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": "not found token info"
}
{
"code": 171018,
"message": "expire time exceeds global limit 60s"
}To verify the response status, check whether code is present in the response. Successful quote responses also carry success: true, but not every endpoint returns a success field.
Codes that are not individually mapped are normalised by the gateway: any code starting with 3 or 4 is returned as quote invalid, risk management checks failed, and any other unmapped code is returned as failed to provide quote, mm not available together with the original code.
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 an existing channel.
301016 405030 (any 3xxxxx / 4xxxxx code)
quote invalid, risk management checks failed
The quote provided by the underlying private market maker is rejected by Native's risk managment system to protect swapper/taker.
This is usually caused by sudden, violent market movements and should never be persistent. Simply try again after a few seconds of cooldown.
101010
quoted amount exceeds maximum available, please check /orderbook endpoint for levels
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, please check /orderbook endpoint
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 or non-integer values in integer params. A non-integer amount_wei returns 171009 (token amount is wrong) instead.
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, and must not be empty or 1.
Use version=3 or above while quoting (we recommend always passing version=6; omitting it falls back to version 4, which will be deprecated soon).
171018
expire time exceeds global limit 60s
The requested expiry_time should not exceed 60s.
Remove or pass expiry_time of 60 or lower.
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 or unrecognised chain input (src_chain / dst_chain on quote endpoints, chain / chainId on /orderbook).
Refer to Networksfor supported networks. And use small-caps, standardised chain names.
131002
Internal Server Error
Unexpected gateway error.
Retry. If persistent, contact Native.
131006
request timeout
The quote backend did not respond in time (fixed 3s for quotes).
Retry after a short delay.
131010
invalid api id
The API key is not recognised for this endpoint.
Use the correct API key.
131012
exact out not support
exact_type=ExactOut is only enabled for selected API keys.
Use ExactIn, or contact Native.
171009
token amount is wrong
Invalid or non-integer amount_wei.
Pass an integer string in wei, or use amount.
171055
seller token amount too small, min: %d (wei)
Amount is below minimum_in_base for the pair.
Quote at least the minimum from /orderbook.
171058 / 171073
multiple hop not support multiple pmm / exact out not support multiple hop
Multihop restrictions.
See Multihop.
171079
solana does not support native SOL as token_out
Native SOL cannot be the output token on Solana.
Use wrapped SOL as token_out.
201003
X-Forwarded-For is empty
Requests must carry a non-empty X-Forwarded-For header.
Add the header.
201009
no auth to call
The endpoint (for example /blacklist or /is-black-address) is not enabled for your key.
Contact Native to request permission.
201001
auth get api key is invalid
Auth error.
Use correct api key.
201005
rate reach limit
Per-API-key rate limit is hit (counted per 1-second window).
Reduce traffic.
Last updated