Error codes
Gateway errors return an errorCode and errorMessage body.
Error body
JSON
{
"errorCode": "400.002.02",
"errorMessage": "Invalid request payload"
}Codes
| HTTP | errorCode | Meaning |
|---|---|---|
| 400 | 400.008.01 | Invalid grant type. Use grant_type=client_credentials. |
| 400 | 400.002.02 | Invalid request payload, invalid CallBackURL, or the destination is not registered and verified for your account. |
| 400 | 400.002.01 | Invalid Amount. |
| 401 | 404.001.03 | Invalid authentication. Check your credentials or bearer token. Also returned for a revoked credential, or a token issued before an immediate secret rotation. |
| 402 | billing_overdue | An invoice is overdue. Live STK Push resumes once it is paid. |
| 403 | 403.001.01 | Account is not verified for live transactions, or the account is suspended. |
| 404 | 404.001.01 | Transaction not found for your account and environment. |
| 409 | 409.001.01 | Transaction has no final result to replay. |
| 429 | 429.001.01 | Too many requests. Slow down and retry. |
| 500/502 | 500.001.1001 | Temporary failure, or the transaction is still being processed. Retry shortly. |
Result codes
Final payment outcomes arrive as ResultCode in the callback and in STK Query. 0 means success. Common non-zero values follow the standard M-Pesa result codes, for example 1032 when the customer cancels and 1 for insufficient funds.