Error codes

Gateway errors return an errorCode and errorMessage body.

Error body

JSON
{
  "errorCode": "400.002.02",
  "errorMessage": "Invalid request payload"
}

Codes

HTTPerrorCodeMeaning
400400.008.01Invalid grant type. Use grant_type=client_credentials.
400400.002.02Invalid request payload, invalid CallBackURL, or the destination is not registered and verified for your account.
400400.002.01Invalid Amount.
401404.001.03Invalid authentication. Check your credentials or bearer token. Also returned for a revoked credential, or a token issued before an immediate secret rotation.
402billing_overdueAn invoice is overdue. Live STK Push resumes once it is paid.
403403.001.01Account is not verified for live transactions, or the account is suspended.
404404.001.01Transaction not found for your account and environment.
409409.001.01Transaction has no final result to replay.
429429.001.01Too many requests. Slow down and retry.
500/502500.001.1001Temporary 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.