Error Model

All API errors follow a normalized structure so your client can implement consistent retries, alerting, and user messaging regardless of upstream provider.

Standard Error Response
{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "currency is required",
    "details": {
      "field": "currency"
    }
  }
}

Common Error Codes

CodeMeaning
AUTH_INVALID_CREDENTIALSInvalid app keys or token
AUTH_TOKEN_EXPIREDAccess token expired; refresh or re-authenticate
VALIDATION_ERRORInvalid request payload or missing required fields
PAYMENT_NOT_FOUNDUnknown payment reference
PAYMENT_NOT_REFUNDABLEPayment cannot be refunded in current state
RATE_LIMIT_EXCEEDEDRequest rate exceeded, retry later
IDEMPOTENCY_PAYLOAD_MISMATCHIdempotency key reused with different payload
PROVIDER_UPSTREAM_ERRORConnected payment provider failed upstream

Handling Guidance

  • Retry only retryable classes (timeouts, 429, upstream transient errors).
  • Do not retry validation or authorization failures without correction.
  • Log error.code and request correlation IDs for support escalation.