Error Handling For Order Operations
In this document, you will find detailed information on how to troubleshoot and resolve errors that may occur during order submission and order cancellation processes.
The tables in this guide provide specific information on the types of errors that may be encountered, their associated status codes, and recommended actions for addressing each error.
We hope that this guide will be a helpful resource for you as you work with our cloud-based system and manage orders in your organization.
Troubleshooting Order Errors
This table lists the status codes that may occur during order submission and cancellation processes, along with their recommended actions for addressing each error.
Status Code | Description |
---|---|
400 | Bad Request Your request is invalid. Please check the tables below for recommended actions. https://docs.btcturk.com/error-handling-for-order-operations#order-submit-errors https://docs.btcturk.com/error-handling-for-order-operations#order-cancel-errors |
401 | Unauthorized You might be sending wrong Api Key or Signature. Also the nonce should be of the correct length and meet the requirements specified in the API documentation and make sure that you have correctly implemented the API accessibility and IP permissions as described in the documentation. For more information please check the api documentation. https://docs.btcturk.com/authentication/authentication-v1 |
404 | Not Found Make sure that you have specified the correct URL or endpoint for requested resource. Also keep this in mind if you request an invalid or non-existent order, you will encounter a HTTP error code 400 instead of 404. |
405 | Wrong Method You are using wrong http method for the API. Only POST and DELETE methods are allowed for order operations. Also you should use GET method if you want to access order data. Please check the documentation for more information. https://docs.btcturk.com/ |
429 | Too Many Requests You exceeded request limit for specified period for that endpoint. You should wait and retry that request. Please check the rate limits and retry strategy guideline documents for more information. https://docs.btcturk.com/rate-limits https://docs.btcturk.com/error-handling-for-order-operations/retry-strategy-guideline#rate-limits https://docs.btcturk.com/error-handling-for-order-operations/retry-strategy-guideline |
5xx | Internal Server Error An unexpected error occurred while processing your request. Since POST endpoints are not idempotent, you should check if your order is inserted or not from api/v1/allOrders endpoint before retrying your request. You can use "orderClientId" parameter to find out your order exists or not. For more information about orders, please check the documentation. https://docs.btcturk.com/private-endpoints/all-orders DELETE is idempotent, so you can implement retry mechanism for DELETE operations safely. Please check the retry strategy guideline documentation before implementing retry strategy. https://docs.btcturk.com/error-handling-for-order-operations/retry-strategy-guideline |
503 | Service Unavailable We're temporarily offline for maintenance. Please try again later. Since POST endpoints are not idempotent, you should check if your order is inserted or not from api/v1/allOrders endpoint before retrying your request. You can use "orderClientId" parameter to find out your order exists or not. For more information about orders, please check the documentation. https://docs.btcturk.com/private-endpoints/all-orders DELETE is idempotent, so you can implement retry mechanism for DELETE operations safely. Please check the retry strategy guideline documentation before implementing retry strategy. https://docs.btcturk.com/error-handling-for-order-operations/retry-strategy-guideline |
Bad Request Errors For Order Operations
Here is an example of a typical response content to a bad request error for order submit and cancel operations:
The tables below provide explanations for why an error occurred and offers guidance on how to troubleshoot the error with the error code, message and description:
Order Submit Errors
Message | Code | Description |
---|---|---|
BALANCE_NOT_ENOUGH | 1055 | The balance amount is not enough for this operation. Check your balance amount using the /api/v1/users/balances endpoint. |
FAILED_MARKET_ORDER | 1118 | You might be sending wrong quantity or pairSymbol parameter. Quantity fields must be greater than zero, also pairSymbol field should be valid. You can check valid pairs from /api/v2/server/exchangeinfo endpoint. |
FAILED_LIMIT_ORDER | 1120 | You might be sending wrong price, quantity or pairSymbol parameter. Price and quantity fields must be greater than zero, also pairSymbol field should be valid. You can check valid pairs from /api/v2/server/exchangeinfo endpoint. |
FAILED_ORDER_WITH_OPEN_ORDERS | 1122 | Order submission failed due to open orders. Your free balance is not enough for this transaction. You can view your available balance with the free field from the /api/v1/users/balance endpoint. You may have an open order or a request to withdraw. For more details on open orders, please check documentation. Get Open Orders |
FAILED_MIN_TOTAL_AMOUNT | 1123 | The order quantity is less than the minimum required. You can view the minimum order amount from the /api/v2/server/exchangeinfo endpoint. minExchangeValue value of a pair represents the correct minimum amount for order submitting. |
FAILED_STOP_PRICE_GREATER_THAN_BEST_ASK | 1124 | Stop buy price must be above best ask price. You can check the best ask price information from the /api/v2/ticker endpoint with the askfield. |
FAILED_STOP_PRICE_LESS_THAN_BEST_BID | 1125 | Stop sell price must be below best bid price. You can check the best bid price information from the /api/v2/ticker endpoint with the bidobject. |
FAILED_INVALID_PRICE_SCALE | 1126 | This error indicates that scale of the price you send is not valid for that pair. You can check denominatorScale field from /api/v2/server/exchangeinfo endpoint. |
FAILED_INVALID_QUANTITY_SCALE | 1127 | This error indicates that scale of the quantity you send is not valid for that pair. You can check numeratorScale field from /api/v2/server/exchangeinfo endpoint. |
FAILED_INVALID_STOP_PRICE_SCALE | 1128 | This error indicates that scale of the stopPrice you send is not valid for that pair. You can check denominatorScale field from /api/v2/server/exchangeinfo endpoint. |
ORDER_METHOD_NOT_SUPPORTED | 1134 | You might be sending invalid orderMethod parameter. valid orderMethod parameters should be one of this: limit, market, stopLimit, stopMarket Sometimes even though you send valid orderMethod parameter, that order method might not be allowed for a temporary time period for that pair. You can check orderMethods field from /api/v2/server/exchangeinfo endpoint. |
ORDER_TYPE_NOT_SUPPORTED | 1193 | You might be sending invalid orderTypeparameter. valid orderType parameters should be one of this: buy, sell. |
PRICE_MUST_BE_LESS_THAN_MAXPRICE | 1226 | Buy price must be less than maximum price for Limit and Stop-Limit order methods, for relevant pair. You can view the maximum price information from the /api/v2/server/exchangeinfo endpoint with the maxPrice field. Please ensure that you’re checking correct pair. |
PRICE_MUST_BE_LESS_THAN_MINPRICE | 1227 | Sell price must be greater than min price for Limit and Stop-Limit order methods, for relevant pair. You can view the minimum price information from the /api/v2/server/exchangeinfo endpoint with the minPrice field. Note: There is an conflict between error message and explanation. Please take description into consideration. |
ORDER_MAX_PRICE_EXCEEDED | 8003 | Limit or StopLimit order price is greater than maximumLimitOrderPrice . You can check the maximumLimitOrderPrice value from the /api/v2/server/exchangeinfo endpoint. |
ORDER_MIN_PRICE_EXCEEDED | 8004 | Limit or StopLimit order price is less than minimumLimitOrderPrice . You can check the minimumLimitOrderPrice value from the /api/v2/server/exchangeinfo endpoint. |
ORDER_INSERT_BLOCKED | 8005 | Maintenance work is in progress for the trading pair. You can implement one of the retry strategies or you can stop order insertions and follow our status page before starting to send order submit requests. BtcTurk Status Also please check the retry strategy guideline documentation before implementing retry strategy. https://docs.btcturk.com/error-handling-for-order-operations/retry-strategy-guideline |
Order Cancel Errors
Message | Code | Description |
---|---|---|
ORDER_COULD_NOT_BE_CANCELED | 1051 | This error may be received in the following scenarios during the order cancellation process.
|
NO_ORDER_MATCHES_YOUR_REQUEST | 1052 | The requested order was not found. Make sure that you are using the correct orderId and that the order exists. Also you can check your open orders as specified in documentation. https://docs.btcturk.com/private-endpoints/open-orders |
ORDER_CANCEL_BLOCKED | 8006 | Maintenance work is in progress for the trading pair. Visit our status page for more detailed information. https://status.btcturk.com/ Please check the retry strategy guideline documentation before implementing retry strategy. https://docs.btcturk.com/error-handling-for-order-operations/retry-strategy-guideline |
Last updated