Error handling
Errors use a consistent envelope with a machine-readable code and a human-readable message.
{
"ok": false,
"error": {
"code": "merchant_required",
"message": "This application has no authorised merchant account."
}
}
Error codes
| HTTP | Code | Meaning |
|---|---|---|
| 401 | unauthorized | Missing or invalid secret key. |
| 404 | not_found | Unknown resource. |
| 422 | invalid_amount | Amount missing or not positive. |
| 422 | invalid_phone | Customer phone number is not a valid Kenyan MSISDN. |
| 422 | merchant_required | No merchant account linked to the application. |
| 422 | merchant_not_authorized | Live payment attempted before merchant verification. |
| 422 | stk_failed | Daraja rejected the STK push. |
| 429 | rate_limited | Too many requests for this application. |
NixPay documentation · A Supreonix product
Back to introduction