I’m trying to create multiple orders with fapi/v1/batchOrders endpoint. I was able to create the orders successfully if they are everything is fine. But when the order doesn’t create because the quantity is insufficient I couldn’t get the error result.
However, I tried to give wrong value for “side” parameter (for example ‘XXX’ instead of ‘BUY’ or ‘SELL’) , I can take an error message as expected.
As a result, The endpoint is not giving an error for quantity or price issues.
I need all errors messages when doesn’t create a order.
Please let me know if any solutions you have.
Thank you.
Hi. Understood this endpoint might be tricky for the users. Do note that when there is an error in the order content, the http status code returned is still 200.
For example, if the following request is sent
/fapi/v1/batchOrders?batchOrders=[{}]×tamp={{timestamp}}&signature={{signature}}
the response is:
status code: 200
[
{
"code": -1102,
"msg": "Mandatory parameter 'symbol' was not sent, was empty/null, or malformed."
}
]
Thanks for your quick response. I know and expect response 200. That’s fine I already take 200. But I mentioned that if one of order in the batch has a quantity or price issue the endpoint can’t respond to the error on the error array.
If you can try to create a sample order with 0 quantity probably you can see the my issue.
Thanks.
I hope I can find someone who knows the subject.
Could you share the error messages you saw? We did try to replicate the issue and found something needed to be improved. E.g.
[
{
"code": 400,
"msg": null
}
]
Did you find any other error messages not clear enough?
Hello,
I would like to share two example I had.
I tried with both end points using exactly the same parameters,
when I try to create with create order I get the error message correctly, which is great, but when there is an error from createbatchorder I only get {‘code’: 400, ‘msg’: None}.
you can see my example payloads and response.
Quantity error example:
CreateOrder Endpoint:
Payload: {‘symbol’: ‘BTCUSDT’, ‘side’: ‘BUY’, ‘type’: ‘MARKET’, ‘quantity’: 0.0}
Response: {‘code’: -4003, ‘msg’: ‘Quantity less than zero.’}
CreateBatchOrder Endpoint:
Payload: {‘batchOrders’: [{‘symbol’: ‘BTCUSDT’, ‘side’: ‘BUY’, ‘type’: ‘MARKET’, ‘quantity’: 0}]}
Response: [{‘code’: 400, ‘msg’: None}]
+++++++++++++++++++++++
Margin error example:
CreateOrder Endpoint:
Payload : {‘symbol’: ‘BTCUSDT’, ‘side’: ‘BUY’, ‘type’: ‘MARKET’, ‘quantity’: 1.035}
Reponse : {‘code’: -2019, ‘msg’: ‘Margin is insufficient.’}
CreateBatchOrder Endpoint:
Payload : {‘batchOrders’: [{‘symbol’: ‘BTCUSDT’, ‘side’: ‘BUY’, ‘type’: ‘MARKET’, ‘quantity’: 1.036}]}
Reponse : [{‘code’: 400, ‘msg’: None}]
+++++++++++++++++++++++
Hope I could explain clearly.
Thanks you …
Thanks for giving out more info. The team will try to fix it.
i’m really happy to you will take an action for the issue. Could you please let me know when they fix it.
Thank you