Error Codes
Scope
Instruction mode, order mode, and other ToB trading endpoints share the same error_code set.
Error Handling Flow
- All endpoints follow the same error code format. Errors differ only in the
error_codeandmessagereturned. - Implement error handling in the following order:
- Check if the HTTP
statusCodeequals 200. If not, display an error immediately. - Check if
statusin the response equals 0. If 0, parsedata. If 1, the request failed — proceed to the next step. - Match
error_codeagainst the list below and handle accordingly. Fall back to80000for any unrecognizederror_code.
Error Code List
| Error Code | Description |
|---|---|
| 80000 | Internal error; contact us for troubleshooting or retry. |
| 80001 | Insufficient token balance. |
| 80002 | Transaction amount below minimum. |
| 80003 | Transaction amount above maximum. |
| 80004 | Order expired. |
| 80005 | Insufficient liquidity; transaction cannot be completed at this time. |
| 80006 | Illegal request (invalid format, missing required fields, or value out of range). |
| 80007 | Partner not found or invalid. |
| 80008 | Reverse quote calculation did not converge (PayFi Swap minAmountOut mode only). |
| 80009 | Failed to get token info (token does not exist or service error). |
| 80010 | Failed to get token price or gas price. |
| 80011 | Failed to generate transaction calldata (PayFi Swap only). |
| 80012 | Quote failed (no quote available, all markets failed, etc.). |
| 80013 | Unsupported chain (chain config missing or no available market). |
| 80014 | Order not found (Order mode; for checkOrdersFee, any invalid orderId fails the entire request). |
| 80015 | Order already submitted; do not resubmit (Order mode only). |
| 80016 | Insufficient native coin balance to pay Gas fees. |
| 80017 | NoGas feature is not available for this transaction. |
| 80018 | Invalid fee rate (must be 0 or 0.001–0.02). |
| 80019 | Market not allowed for this partner. |
| 80020 | Quote value deviation exceeds threshold (output value is too low relative to input). |
| 80021 | NoGas minimum threshold not met. |
| 80022 | Risk check failed. |
Error Response Example
{
"status": 1,
"error_code": 80000,
"data": null,
"msg": "system err",
"title": "",
"timestamp": 1769580545990,
"trace": "Root=1-6979a801-6ba8a7696bc0d4256c5b603c"
}Last updated on


