Skip to content
Login

Error Handling

The Heron API uses standard HTTP response codes to indicate the success or failure of an API request. In general:

  • Codes in the 2xx range indicate success.
  • Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a charge failed, etc.).
  • Codes in the 5xx range indicate a server-side or upstream failure.

Error Response Body

When an error occurs, the API returns the error payload directly:

json
{
  "code": "invalid_request",
  "message": "The provided parameter 'amount' must be a positive number.",
  "details": {
    "field": "amount"
  }
}

details is optional. When present, it contains endpoint-specific context that can help you correct the request or understand why the operation could not be completed.

Error Codes

Heron uses resource-specific error codes rather than a tiny generic set. The route-level API reference is the source of truth for which codes each endpoint can return. Common public API codes include:

CodeTypical meaning
missing_credentialsNo API credentials were provided.
unauthorizedThe provided API key or bearer token was not accepted.
auth_failureHeron's authentication infrastructure is temporarily unavailable.
invalid_requestThe request shape or values were invalid. Check details when present.
insufficient_roleThe credential is valid but does not carry the required role for the operation.
rate_limit_exceededToo many requests were sent in a short period. Use retry/backoff logic.
service_unavailableA required upstream dependency is temporarily unavailable. Retry later.
transfer_not_foundThe requested transfer does not exist in your organization or environment.
report_not_foundThe requested report does not exist in your organization or environment.
quote_request_not_foundThe referenced quote request does not exist.
quote_option_not_foundThe referenced quote option does not exist.
quote_option_expiredThe quote option is no longer valid and must be refreshed.
idempotency_conflictThe same idempotency key was reused with different request parameters.
entity_conflictThe request conflicts with an existing entity or a concurrent change.
customer_webhook_endpoint_limit_exceededYour organization has reached the maximum number of configured customer webhook endpoints.
customer_webhook_delivery_replay_unavailableThe delivery cannot be replayed in its current state or the replay window has expired.
crypto_wallet_screening_rejectedA crypto wallet address was blocked by required sanctions screening.
crypto_wallet_screening_unavailableHeron could not complete required crypto wallet screening. Retry later or contact support.
internal_server_errorAn unexpected server-side failure occurred.

Request IDs

Every Heron API response includes an X-Request-Id header. If you contact Heron support about a failed or unexpected request, include this header value along with the endpoint, timestamp, and response error code so support can correlate your report with Heron logs.

Handling Errors

We recommend handling errors by code, not just by HTTP status. For example, if you receive invalid_request, inspect details for field-level information when it is present; if you receive service_unavailable or rate_limit_exceeded, retry with exponential backoff.

Released under the Commercial License.