Error Codes

Every failure is machine-readable: {"error": {"code": "...", "message": "..."}} with the correct HTTP status. Handle codes, not messages — messages may be refined; codes are the contract.

HTTPCodeMeaning
401AUTH_FAILEDBad credentials, unknown client_id/secret, revoked credential, or a token from a non-API login
401TOKEN_EXPIREDBearer token older than 24h — exchange a new one
403SCOPE_DENIEDCredential lacks the scope the route requires
403IP_NOT_ALLOWEDCalling IP is not on the credential's allowlist
403MERCHANT_DEACTIVATEDMerchant account disabled
403MERCHANT_NOT_APPROVEDMerchant account not approved for API use
429RATE_LIMITEDRate limit exceeded — back off and retry (token endpoint: 10/min/IP; others 60/min/key)
404CUSTOMER_NOT_FOUNDNo customer with that payroll number
404NOT_FOUNDTransaction serial does not exist or belongs to another merchant
422VALIDATION_FAILEDField-level validation — the Laravel message / errors object describes the fields
422BUYER_DEACTIVATEDThe civil servant's GP account is disabled
422BUYER_NOT_VERIFIEDThe civil servant hasn't completed GP verification
422NEAR_RETIREMENTBuyer is at the retirement boundary (age 59 / 34 years in service)
422NOT_CANCELLABLEOnly pending transactions can be cancelled via the API
422GP_LIMIT_EXCEEDED
SALARY_GATE_BLOCKED
Eligibility declines (GP monthly max / salary-data checks). The message carries the human detail
409DUPLICATE_REFERENCEmerchant_reference reused with a different payload
409CUSTOMER_TAKEN / EMAIL_TAKENRegistration conflicts (see the registrations section)
Unauthenticated requests rejected by the auth layer return Laravel's standard {"message": "Unauthenticated."} with 401 — same handling as AUTH_FAILED. If you forget the Accept: application/json header you will get HTML instead of any of these — always send it.