Skip to main content
Every error the API produces has the same shape, and every response, error or not, starts with the environment that answered. This page is the whole error story: the envelope, the codes, what to branch on, and the one deliberate exception.

The envelope

  • code is what you branch on. It is stable.
  • message is for your logs, not your users. Its wording may change.
  • fields appears only when a bank endpoint refused a specific input, and it names the field, never the value.
  • environment says which upstreams answered: sandbox or production. Read it off any response you paste into a ticket.
Every endpoint page in the API reference lists the codes that endpoint can answer, per HTTP status.

The codes

The bank onboarding flow adds a few of its own on the consent calls: consent_session_invalid, consent_declined, consent_link_failed and, on the sandbox identity call, kyc_provider_refused. Each is listed on the endpoint page that answers it.

What to branch on

  • Branch on code and the HTTP status. Never on message: its wording is not part of the contract.
  • Three are worth handling on their own. no_route is temporary: re-quote later. rate_limited means back off, not retry at once. chain_not_allowed means the corridor was never yours, so no retry will fix it.
  • A 4xx on a create call created nothing. There is no order or payout to clean up; fix the request and call again.
  • Do not enumerate the codes for the user. Show your own copy per branch and keep code and message in your logs for the support ticket.

The exception: bank transfers and virtual accounts

On the bank transfer and virtual account endpoints the envelope is the same, but code and fields inside it are the banking partner’s own, passed through unchanged rather than mapped to the table above. The set is theirs and it can grow, so there:
  • branch on the HTTP status first,
  • log code as a string rather than matching it against a fixed set,
  • read fields to know which input to fix; it names the field, not the value.
The flows this applies to are on On-ramp and Virtual accounts.
  • Which products, chains and tokens your key carries, and why a request is refused rather than defaulted: Authentication.
  • Rate limits and what your key’s ceiling means for your own users: Rheon API.