Skip to main content

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

  1. 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.
  2. 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.
  3. Refer to the error code table below to determine how to handle the error.
  4. 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

  1. 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.
  2. Refer to the error code table below to determine how to handle the error.
  3. 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 CodeAdvised Method
3008Service busy, please try again later.
3109Insufficient balance, please adjust the order quantity or make another deposit.
3127The order quantity is below the minimum requirement. Please adjust the order quantity.
3606The price difference between the order price and the latest price is too large. Please adjust the order amount accordingly.
3610Order cancellation prohibited during the Call Auction period.
3612The est. ask price is lower than the current bottom ask price. Please reduce the amount.
3613The est. bid price is higher than the current top bid price. Please reduce the amount.
3614The deviation between your est. filled price and the index price. Please reduce the amount.
3615The deviation between your order price and the index price is too high. Please adjust your order price and try again.
3616The order price exceeds the current top bid price. Please adjust the order price and try again.
3617The order price exceeds the current bottom ask price. Please adjust the order price and try again.
3618The deviation between your order price and the index price is too high. Please adjust your order price and try again.
3619The deviation between your order price and the trigger price is too high. Please adjust your order price and try again.
3620Market order submission is temporarily unavailable due to insufficient depth in the current market
3621This order can't be completely executed and has been canceled.
3622This order can't be set as Maker Only and has been canceled.
3627The current market depth is low, please reduce your order amount and try again.
3628The current market depth is low, please reduce your order amount and try again.
3629The current market depth is low, please reduce your order amount and try again.
3632The order price exceeds the current top bid price. Please adjust the order price and try again.
3633The order price exceeds the current bottom ask price. Please adjust the order price and try again.
3634The deviation between your est. filled price and the index price is too high. Please reduce the amount and try again.
3635The deviation between your est. filled price and the index price is too high. Please reduce the amount and try again.
4001Service unavailable, please try again later.
4002Service request timed out, please try again later.
4003Internal error, please contact customer service for help.
4004Parameter error, please check whether the request parameters are abnormal.
4005Abnormal access_id, please check whether the value passed by X-COINEX-KEY is normal.
4006Signature verification failed, please check the signature according to the documentation instructions.
4007IP address prohibited, please check whether the whitelist or export IP is normal.
4008Abnormal X-COIN-SIGN value, please check.
4009Abnormal request method, please check.
4010Expired request, please try again later.
4011User prohibited from accessing, please contact customer service for help.
4017Signature expired, please try again later.
4115User prohibited from trading, please contact customer service for help.
4117Trading prohibited in this market, please try again later.
4123Rate limit triggered. Please adjust your strategy and reduce the request rate.
4130Futures trading prohibited, please try again later.
4158Trading prohibited, please try again later.
4213The request is too frequent, please try again later.
4512Insufficient sub-account permissions, please check.

WS Error Code

Spot WS Error CodeAdvised Method
20001Request parameter error, please check.
20002No corresponding method found
21001This method requires authentication, please authenticate first.
21002Authentication failed
23001Request service timeout
23002Requests submitted too frequently
24001Internal Error
24002Service unavailable temporarily
Futures WS Error CodeAdvised Method
30001Request parameter error, please check.
30002No corresponding method found
31001This method requires authentication, please authenticate first.
31002Authentication failed
33001Request service timeout
33002Requests submitted too frequently
34001Internal Error
34002Service unavailable temporarily