Error Handling
Error Handling
Requests with application or business logic errors will return with an HTTP code of 200, but with additional fields for error code and message. For example:
{
"code": 171008,
"message": "Internal Server Error"
}
{
"code": 171018,
"message": "expire time exceeds global limit 120s"
}To verify the response status, please check success bool, or if code is present in the response.
Error Codes
The list of most common error codes returned by Swap APIs. For other unknown errors, please reach out to Native team members via existing channel.
101010
quoted amount exceeds maximum available
The quoting amount exceeds the maximum available liquidity/depth represented by levels in the /orderbook endpoint.
Please always refer to the up-to-date /orderbook results while quoting. And quote within the available depth.
171037
orderbook empty for quoted trade
The quoting trade currently has 0 available liquidity/depth, and is removed from the /orderbook endpoint.
Please always refer to the latest /orderbook results for quoting.
Please always refer to the up-to-date /orderbook results while quoting. And only quote existing orderbooks.
171011
requested pair not found
The requested pair is not supported by Native and can’t be found.
Refer to /orderbook results while quoting. And only quote existing orderbooks.
Or contact Native to enable AMM fallback.
171015
quoted token not available
The requested quote/buying token is not available.
Refer to /orderbook results while quoting. And only quote existing orderbooks.
Or contact Native to enable AMM fallback.
101007
quoted pair not available, empty orderbook
The quoting trade currently has 0 available liquidity/depth, and is removed from the /orderbook endpoint.
Please always refer to the latest /orderbook results for quoting.
Please always refer to the up-to-date /orderbook results while quoting. And only quote existing orderbooks.
131003
failed to parse parameters
Issues with input parameters. Usually due to incorrect formats.
Check input format. Avoid passing floats in unsupported params like amount_wei or timeout_millis
131004
invalid parameter
Issues with input parameters. Usually due to input conflicts.
Try avoid using duplicated params together like amount and amount_wei
131011
front key version required
version is required when calling Native’s public UI apiKey. Note that version must be ≥ 3.
Use version=3 or above while quoting.
171018
expire time exceeds global limit 120s
The requested expiry should not exceed 120s.
Remove or pass expiry_time that is smaller than 120, recommend using 60 globally.
171053
fee bps exceeds limit 300
The commission fee should not exceed 300 bps.
Adjust fee to be 300 or lower.
131005
chain parameters invalid
Missing chain input.
Refer to Networksfor supported networks. And use small-caps, standardised chain names.
201001
auth get api key is invalid
Auth error.
Use correct api key.
201005
rate reach limit
Rate limit is hit.
Reduce traffic.
Last updated