The shape of an error
{
"error": "Route not found.",
"code": "not_found",
"hint": "GET / lists every endpoint."
}error is for people, code is for programs, and hint, when there is one, says what to do next.
Statuses and codes
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_addressinvalid_payerchain_mismatchinvalid_amountinvalid_contractamount_needs_paid_route | The request is wrong. Fix it and send it again. |
| 401 | missing_keyinvalid_keyunknown_keykey_ended | The key is missing, not known or has ended. Send a valid key, or leave the header out and pay per call. |
| 402 | Payment is required. See Paying per call. | |
| 404 | not_foundunknown_plantrusted_tokennear_not_accepted | There is no such route or pass, or the token is one Svalin values others against, so it has no grade. |
| 409 | other_plan | This key is on another plan. Renew it on its own plan. |
| 422 | token_address | This is a token, not a wallet. For a NEAR token, the answer carries its grade. |
| 429 | demo_limit_reachedpro_daily_limitkey_used_uptoo_many_requeststoo_many_refused_keys | A limit was reached. Daily calls come back at 00:00 UTC; Retry-After says when to try a free route again. |
| 500 | internal_error | Something failed on Svalin’s side. |
| 501 | chain_not_supported | This instance does not cover that chain. |
| 502 | upstream_unavailableupstream_error | A data provider did not answer. Try again in a minute. |
| 503 | upstream_rate_limitedpayments_not_configuredfacilitator_unavailablekeys_unavailablecheckout_busy | A service is busy or not available. Try again shortly. |
Failed calls are not charged
Bad input is rejected before any payment, and a call that fails is never settled. A call made with a pass that fails is not counted.