Developers · Errors

Errors & status codes

Canonical error envelope from the Amnen Pay API style guide. Codes are language-independent; messages may be localized later.

Full contract: API Style Guide · OpenAPI baseline

Error response shape

{
  "success": false,
  "timestamp": "2026-08-24T12:00:00.000Z",
  "correlationId": "corr_test_01JEXAMPLE000000000000",
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Validation failed",
    "category": "validation",
    "severity": "medium",
    "suggestedResolution": "Correct the request fields and retry.",
    "documentationUrl": "https://docs.example.amnenpay.test/errors/VALIDATION_ERROR"
  }
}

HTTP status codes

CodeMeaning
200OK — the request succeeded.
201Created — a resource was created.
400Bad Request — validation failed or parameters are invalid.
401Unauthorized — missing or invalid API key / token.
403Forbidden — the key lacks permission for this action.
404Not Found — the resource does not exist.
409Conflict — idempotency conflict or duplicate request.
422Unprocessable — the request was well-formed but rejected by rules.
429Too Many Requests — rate limit exceeded.
500Server Error — something went wrong on our side.

Stable error codes

CodeMeaning
VALIDATION_ERROROne or more parameters are missing or malformed.
AUTHENTICATION_ERRORThe API key or token is missing, invalid, or expired.
AUTHORIZATION_ERRORThe key does not have the required permission.
NOT_FOUNDThe resource does not exist for this tenant.
IDEMPOTENCY_CONFLICTAn identical idempotency key was already used with a different body.
RATE_LIMIT_EXCEEDEDToo many requests in the current window.
INTERNAL_ERRORAn unexpected error occurred.