Axerity Docs
API

Errors

Every non-2xx response follows a Stripe-shaped error envelope.

Every non-2xx response carries an error object:

{
  "error": {
    "type": "invalid_request_error",
    "code": "code_in_use",
    "message": "Account code 1010 is already in use.",
    "param": "code"
  }
}

Error types

HTTPtypeWhen
400invalid_request_errorBad input — missing field, wrong type, validation fail.
401authentication_errorMissing, malformed, expired, or revoked API key.
403permission_errorKey lacks the required scope.
404not_found_errorResource doesn't exist or isn't in your organization.
409conflict_errorUniqueness or state conflict (e.g. duplicate code).
429rate_limit_errorToo many requests in a window.
500api_errorServer-side bug. Reported automatically; please retry.

Handling errors

  • Switch on type and code, not message. The message is for humans and may change.
  • param identifies the offending field on 400s (for nested fields: dotted path, e.g. lines.0.debit).
  • Retry policy. 5xx errors are safe to retry with exponential backoff. 429s honor the rate-limit window. 4xx errors mean the request was bad — retrying won't help unless you change something.

Idempotency

Not yet supported. If a POST fails halfway with a 5xx, retrying with the same payload could create a duplicate. Best practice for now: include a unique reference on transactions and check for duplicates on the server side, or use the API's read endpoints to verify state before retrying. Native idempotency keys are on the roadmap.

Pagination

On this page