I encountered intermittent order submission failures (about 2 out of 5 attempts) while conducting unit testing to send orders on testnet.binancefuture.com. I captured the HTTP request and response and it seems to be a problem with the testnet.
Here is an example of the request and response that returned an error:
(req)
POST /fapi/v1/order?timestamp=1682408912782&signature=c2444bc1e41d3eee8dd53c1d70aec140f449044db87cfad152cca994e8167260 HTTP/1.1
Host: testnet.binancefuture.com
User-Agent: Go-http-client/1.1
Content-Length: 67
Content-Type: application/x-www-form-urlencoded
X-Mbx-Apikey: dc427ce063bb6fa9b7d650cc37150a555e8cdc318c78a1d3e2ba4d62bb5514e1
Accept-Encoding: gzip
newOrderRespType=&quantity=0.01&side=BUY&symbol=BTCUSDT&type=MARKET
(resp)
HTTP/1.1 400 Bad Request
Content-Type: application/json
Content-Length: 93
Connection: keep-alive
Date: Tue, 25 Apr 2023 07:48:33 GMT
Server: Bengine
x-mbx-used-weight-1m: -1
x-mbx-order-count-10s: 2
x-mbx-order-count-1m: 1
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
X-Cache: Error from cloudfront
Via: 1.1 52f7257d0c699edd83950a4ebf27c3cc.cloudfront.net (CloudFront)
X-Amz-Cf-Pop: HKG54-C1
X-Amz-Cf-Id: KR6e0tZ4v-Xz8HXd2WOSI2EFhjGxI9RpRBTif-gPhfTNb7mvRNAQRQ==
{"code":-1102,"msg":"Mandatory parameter symbol was not sent, was empty/null, or malformed."}
And here is an example of the request and response that returned successfully:
(req)
POST /fapi/v1/order?timestamp=1682408910765&signature=4dbec14249afcb57c3faec83b5076ab1ab5799f52588548f37ab5bba7e9fe64b HTTP/1.1
Host: testnet.binancefuture.com
User-Agent: Go-http-client/1.1
Content-Length: 67
Content-Type: application/x-www-form-urlencoded
X-Mbx-Apikey: dc427ce063bb6fa9b7d650cc37150a555e8cdc318c78a1d3e2ba4d62bb5514e1
Accept-Encoding: gzip
newOrderRespType=&quantity=0.01&side=BUY&symbol=BTCUSDT&type=MARKET
(resp)
HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
Date: Tue, 25 Apr 2023 07:48:31 GMT
Server: Bengine
Vary: Accept-Encoding
X-MBX-USED-WEIGHT-1M: -1
X-MBX-ORDER-COUNT-10S: 0
X-MBX-ORDER-COUNT-1M: 1
x-response-time: 3ms
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Content-Security-Policy: default-src 'self'
cache-control: no-cache, no-store, must-revalidate
expires: 0
pragma: no-cache
strict-transport-security: max-age=31536000; includeSubdomains
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
Content-Encoding: gzip
X-Cache: Miss from cloudfront
Via: 1.1 52f7257d0c699edd83950a4ebf27c3cc.cloudfront.net (CloudFront)
X-Amz-Cf-Pop: HKG54-C1
X-Amz-Cf-Id: 1r30DGlmX0W_BucF5dxAp5JFOv7Hm46HlmxXu0XaeOxblVouxuSS3g==
{"orderId":3330393705,"symbol":"BTCUSDT","status":"NEW","clientOrderId":"tpVqluW9QxCS8OAa0svLW5","price":"0","avgPrice":"0.00000","origQty":"0.010","executedQty":"0","cumQty":"0","cumQuote":"0","timeInForce":"GTC","type":"MARKET","reduceOnly":false,"closePosition":false,"side":"BUY","positionSide":"BOTH","stopPrice":"0","workingType":"CONTRACT_PRICE","priceProtect":false,"origType":"MARKET","updateTime":1682408911098}
Thank you for your attention to this matter.