Skip to content

Standard Error Codes

Purpose

Provide a consistent error response contract and baseline HTTP status interpretation across backend modules.

Standard Error Payload

{
  "status_code": 400,
  "error_code": "MODULE_SPECIFIC_ERROR",
  "message": "Human-readable summary",
  "details": {}
}

Baseline HTTP Mapping

  • 400 business rule or request-state violation.
  • 401 authentication failure.
  • 403 authorization/permission failure.
  • 404 target resource not found.
  • 409 conflicting state transition or duplicate operation.
  • 422 schema/payload validation failure.
  • 429 throttling/rate limiting.
  • 500 internal server error.
  • 502 upstream integration failure.
  • 503 upstream service unavailable.

Module-Specific Error Code Prefix Guidance

  • Authentication: AUTH_*
  • Customer: CUSTOMER_*
  • Wallet: WALLET_*
  • Transaction: TRANSACTION_*
  • AML: AML_*
  • Reconciliation: RECONCILIATION_*
  • Campaign/Inventory: CAMPAIGN_* or INVENTORY_*
  • Support: SUPPORT_*
  • Core: CORE_*
  • Integration: INTEGRATION_*

Implementation Notes

  • Keep error_code stable for clients; evolve message and details as needed.
  • Use details for machine-readable fields (for example required, available, field_errors, reference_id).
  • Never expose secrets in message or details.