Errors & Status Codes
Structured Error Catalog
AkiliPay returns predictable, machine-readable JSON envelopes with RFC-compliant HTTP status codes.
Standard Error Envelope
Every failed request returns a JSON response containing a unique code, human-readable message, and an audit requestId to facilitate debugging.
Client Handling Rule:
Check the error.code rather than parsing HTTP message strings, as codes remain stable across API versions.
Error Response Structure
json
{
"status": "error",
"error": {
"code": "INVALID_REQUEST",
"message": "The amountMinor must be a positive integer in pesewas.",
"details": [
{
"field": "amountMinor",
"issue": "Expected integer >= 1"
}
]
},
"meta": {
"requestId": "req_01928a81f3",
"timestamp": "2026-11-19T10:00:00.000Z"
}
}Uniform across all endpoints.
Standard Error Code Reference
| Error Code | HTTP Status | Meaning / Cause | Suggested Remediation |
|---|---|---|---|
| INVALID_REQUEST | 400 | Validation failed or missing required fields. | Inspect error.details array and fix parameters. |
| UNAUTHORIZED | 401 | Missing or invalid Bearer secret API key. | Verify Authorization header and environment key. |
| FORBIDDEN | 403 | API key is missing the required permission scope. | Update key permissions in API Keys dashboard. |
| RESOURCE_NOT_FOUND | 404 | The requested entity ID was not found. | Check transaction or payment ID spelling. |
| IDEMPOTENCY_CONFLICT | 409 | Re-used Idempotency-Key with different payload parameters. | Generate a unique key per distinct operation. |
| INSUFFICIENT_FUNDS | 422 | Customer wallet balance too low to complete charge. | Prompt customer to fund wallet or use another method. |
| PROVIDER_UNAVAILABLE | 502 | Upstream payment rail (telco/bank) is temporarily down. | Retry safely with exponential backoff. |
| RATE_LIMITED | 429 | Exceeded API request threshold. | Throttle client requests and implement backoff. |
Continue learning