BluePayAPI
Ask AI
BluePay
API Keys Support Dashboard

Go live

Check secrets, invoice ids, webhooks, and a real paid payment before you switch on customers.

Go live

Run one real payment on your server, including a failure, before you point customers at it.

Checklist

CheckDone when
Secret stays on the serverNo page, app, or log that a customer can read contains api_secret.
Invoice id is yoursEach order sends its own account_reference. You stored checkout_request_id from the STK response.
Paid means settledYou fulfill on paid: true or mpesa.payment.received, after the amount and reference match the order.
Webhook and statusThe callback URL is HTTPS, the signature check uses the raw body and the API secret, you return 2xx, and a status poll covers a missed webhook.
DuplicatesYou store Idempotency-Key and the M-Pesa receipt so a second delivery does not fulfill again.
Prepaid balanceThe service-token wallet can cover the fee, or the account is postpaid. A 402 is handled in your UI.
ChannelThe Channel ID is active on that Account ID. A 422 is logged with the id you sent.

If a test fails

What you seeLook at
401All three auth fields, from the same API Keys card. Authentication.
422Channel inactive or on another account. Payment channels.
402 INSUFFICIENT_PREPAIDTop up service tokens. The body includes required_kes and balance_kes.
STK stays pendingThe customer may not have confirmed. Poll payment status with the stored checkout_request_id.
Your webhook returns 401HMAC is over the raw body, with the API secret. A parsed JSON string will not match.