Error Handling
Error Handling Process
This section includes the process of error handling to assist developers in taking appropriate actions when encountering errors. It explains how to parse error responses, handle different types of errors, and provide appropriate user feedback, etc.
HTTP Error Handling Process
- Please check if the HTTP response status code is 200. If the status code is not 200, it indicates that the responses may be originating from CoinEx's server gateway service, which was previously functioning. In this case, it's not appropriate to parse the response according to the
JSON
format outlined in our documentation. Instead, it is recommended to directly capture and record the returned response body. - Parse the response body according to the specified error response format (see the next section
Error Response Format
) to determine whether an error has occurred. If the request is successful, the corresponding error code will return the number '0'. If it's not '0', proceed with the next step. - Refer to the error code table below to determine how to handle the error.
- If there is no handling method for this error code in the documentation, please save the request parameters and error response, and contact us for help.
WS Error Handling Process
- Parse the response body according to the specified error response format (see the next section
Error Response Format
) to determine whether an error has occurred. If the request is successful, the corresponding error code will return the number '0'. If it's not '0', proceed with the next step. - Refer to the error code table below to determine how to handle the error.
- If there is no handling method for this error code in the documentation, please save the request parameters and error response, and contact us for help.
Error Response Format
When the request fails, the server will return an error response following a specific format. This error response includes an error code and an error message.
The agreed error response formats are as follows:
HTTP Error Response
{
"code": 3008,
"data": {},
"message": "service too busy"
}
WS Error Response
{
"id": 4,
"message": "invalid parameters",
"code": 20001
}
HTTP Error Code
Error Code | Advised Method |
---|---|
3008 | Service busy, please try again later. |
3109 | Insufficient balance, please adjust the order quantity or make another deposit. |
3127 | The order quantity is below the minimum requirement. Please adjust the order quantity. |
3606 | The price difference between the order price and the latest price is too large. Please adjust the order amount accordingly. |
3610 | Order cancellation prohibited during the Call Auction period. |
3612 | The est. ask price is lower than the current bottom ask price. Please reduce the amount. |
3613 | The est. bid price is higher than the current top bid price. Please reduce the amount. |
3614 | The deviation between your est. filled price and the index price. Please reduce the amount. |
3615 | The deviation between your order price and the index price is too high. Please adjust your order price and try again. |
3616 | The order price exceeds the current top bid price. Please adjust the order price and try again. |
3617 | The order price exceeds the current bottom ask price. Please adjust the order price and try again. |
3618 | The deviation between your order price and the index price is too high. Please adjust your order price and try again. |
3619 | The deviation between your order price and the trigger price is too high. Please adjust your order price and try again. |
3620 | Market order submission is temporarily unavailable due to insufficient depth in the current market |
3621 | This order can't be completely executed and has been canceled. |
3622 | This order can't be set as Maker Only and has been canceled. |
3627 | The current market depth is low, please reduce your order amount and try again. |
3628 | The current market depth is low, please reduce your order amount and try again. |
3629 | The current market depth is low, please reduce your order amount and try again. |
3632 | The order price exceeds the current top bid price. Please adjust the order price and try again. |
3633 | The order price exceeds the current bottom ask price. Please adjust the order price and try again. |
3634 | The deviation between your est. filled price and the index price is too high. Please reduce the amount and try again. |
3635 | The deviation between your est. filled price and the index price is too high. Please reduce the amount and try again. |
3638 | Currently in protection period, only Maker Only Limit Orders placement and order cancellations are supported. |
3639 | Request parameters incorrect. Please check whether the request complies with the document description. |
4001 | Service unavailable, please try again later. |
4002 | Service request timed out, please try again later. |
4003 | Internal error, please contact customer service for help. |
4004 | Parameter error, please check whether the request parameters are abnormal. |
4005 | Abnormal access_id, please check whether the value passed by X-COINEX-KEY is normal. |
4006 | Signature verification failed, please check the signature according to the documentation instructions. |
4007 | IP address prohibited, please check whether the whitelist or export IP is normal. |
4008 | Abnormal X-COIN-SIGN value, please check. |
4009 | Abnormal request method, please check. |
4010 | Expired request, please try again later. |
4011 | User prohibited from accessing, please contact customer service for help. |
4017 | Signature expired, please try again later. |
4018 | The endpoint has been deprecated. Please use the new version of this endpoint. |
4115 | User prohibited from trading, please contact customer service for help. |
4117 | Trading prohibited in this market, please try again later. |
4123 | Rate limit triggered. Please adjust your strategy and reduce the request rate. |
4130 | Futures trading prohibited, please try again later. |
4158 | Trading prohibited, please try again later. |
4213 | The request is too frequent, please try again later. |
4512 | Insufficient sub-account permissions, please check. |
WS Error Code
Spot WS Error Code | Advised Method |
---|---|
20001 | Request parameter error, please check. |
20002 | No corresponding method found |
21001 | This method requires authentication, please authenticate first. |
21002 | Authentication failed |
23001 | Request service timeout |
23002 | Requests submitted too frequently |
24001 | Internal Error |
24002 | Service unavailable temporarily |
Futures WS Error Code | Advised Method |
---|---|
30001 | Request parameter error, please check. |
30002 | No corresponding method found |
31001 | This method requires authentication, please authenticate first. |
31002 | Authentication failed |
33001 | Request service timeout |
33002 | Requests submitted too frequently |
34001 | Internal Error |
34002 | Service unavailable temporarily |