Axiym
Fundamentals

Error handling and retries

View Markdown

The Axiym API platform returns structured JSON errors for API-level failures. Use the HTTP status for the primary handling path and the body for validation or domain detail.

Error shape

{
  "code": 422,
  "message": "Invalid Parameters",
  "errors": {
    "legalAddress": {
      "country": [
        {
          "code": "invalid_country",
          "message": null,
          "params": { "value": "INVALID" }
        }
      ]
    }
  }
}
FieldMeaning
codeHTTP status code as a number.
messageHuman-readable summary; its wording can change.
errorsValidation or request-level details, or null when none is available.

Validation details follow the field structure: leaf fields contain arrays of errors, nested fields contain objects, and array items use objects keyed by index, such as "0". Do not assume field paths are flattened into dotted keys.

Request-level failures can instead contain details such as "errors": { "message": "Failed to parse the request body as JSON" }. Business rejections can have errors: null, with the reason in message.

Status handling

StatusMeaningRetry?
400Malformed or invalid request-level input.No. Fix the request.
401Missing, expired, or invalid token.Obtain a token and retry once.
403Caller or source IP is not permitted.No. Resolve access first.
404Resource is unknown or not visible in this scope.No. Check identifier and scope.
409Request conflicts with an existing resource or operation.No unchanged retry. Resolve the conflict or retrieve the existing resource.
422Validation or business precondition failed.No unchanged retry. Fix data or state.
429Rate limit exceeded.Yes, after Retry-After.
500Unexpected server error.Yes, with backoff and the same idempotency key.

Business failures

Do not retry unchanged when validation, permissions, balances, resource state, or another documented business precondition has failed. Correct the data or state before starting another attempt.

For Client Trade onboarding, a new request using an existing partnerClientId returns 409 Conflict. Retrieve the existing onboarding case instead. Retrying the original request with its original Idempotency-Key returns the original result.

Retry an ambiguous state-changing request with the identical path, body, and Idempotency-Key. Generate a new key only when starting a new operation.

Safe diagnostics

Log X-Request-Id, the endpoint template, method, HTTP status, timestamp, and environment for support investigation. Allowlist safe field paths and machine-readable error codes when more detail is needed.

Do not log raw request or response bodies. Validation errors can echo submitted values in params.value, and messages may contain sensitive data. Redact party details, account numbers, document content, secrets, and access tokens before sending diagnostics to logs or support systems.