Skip to main content

Overview

Pepay returns JSON error responses. For debugging, always log:
  • HTTP status code
  • an error code / error_code when present
  • an error message (message or error.message)
  • request id headers when present (x-request-id, request-id)
If you’re using the SDK, errors are normalized into typed exceptions and include safe retry behavior for retryable cases.

Authentication

Some errors happen before authentication succeeds (for example, missing/invalid headers). Others are authorization errors (403) after the request is authenticated but lacks permissions or scope.

Request

When reporting an issue, include:
  • the endpoint + method
  • the request id header (if present)
  • a sanitized excerpt of the response body (do not include API keys or session tokens)
Example request (invalid API key):

Response

Error envelopes may vary slightly by endpoint. Common shapes include: success=false envelope:
Legacy {error, code} envelope:

Errors

Examples

Example (SDK error handling):
Next: Merchant APIs