Overview
Pepay returns JSON error responses. For debugging, always log:- HTTP status code
- an error
code/error_codewhen present - an error message (
messageorerror.message) - request id headers when present (
x-request-id,request-id)
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)
Response
Error envelopes may vary slightly by endpoint. Common shapes include:success=false envelope:
{error, code} envelope:

