Skip to content

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 an error with Heron's servers (these are rare).

Error Response Body

When an error occurs, the API returns a JSON response body containing the specific error details:

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

Error Codes

CodeDescription
invalid_requestThe request was unacceptable, often due to missing a required parameter.
unauthorizedNo valid API key was provided.
forbiddenThe API key doesn't have permissions to perform the request.
not_foundThe requested resource doesn't exist.
conflictThe request conflicts with another item (e.g., duplicate idempotency key).
rate_limit_exceededToo many requests hit the API too quickly. We recommend an exponential backoff of your requests.
transfer_not_foundThe requested transfer resource was not found.
idempotency_conflictA request with this idempotency key has already been processed with different parameters.
internal_server_errorSomething went wrong on Heron's end.

Handling Errors

We recommend building your integration to handle specific error codes. For example, if you receive invalid_request, you might want to inspect the details field for more information.

Released under the Commercial License.