Skip to main content

Error code format

Each error code is a 6-digit number composed of two parts: The final error code is formed by concatenating both parts and converting them to a number. Example If a requested token pair is not supported:
  • Error domain: 002
  • Specific error code: 001
  • Final error code: 2001
Errors are always tied to a specific stage of the API flow, such as:
  • quote calculation
  • swap execution
  • smart contract interaction

Error domains

Params errors (001)

Errors related to invalid or missing request parameters.

Calculation errors (002)

Errors occurring during route discovery or quote calculation.

Swap execution errors (003)

Errors occurring during swap execution.

Rubic contract errors (004)

Errors related to Rubic smart contract configuration.

Error response formats

The API may return errors in different formats depending on the error domain.

Validation errors (PARAMS_ERRORS)

Validation errors may contain multiple issues in a single response. Example:
  • Invalid sender address
  • Invalid receiver address

Standard error response

All errors except validation errors follow a unified response structure. The id field can be used to track the swap or retrieve its status if execution was partially completed.

Common error examples

No routes available

Approval required

Returned when the user does not have enough allowance for a required spender.

Insufficient native balance (EVM)

Insufficient native balance (TON)

Notes

  • Not all errors include the data field
  • Error lists may expand as the API evolves
  • Refund handling depends on the selected provider
  • Some providers (for example, Celer) require manual refund actions via a dedicated endpoint or support