Quick start
Create keys, send one STK from your server, then confirm the payment before you fulfill the order.
Quick start
Calls come from your server. The API secret never goes in a browser, a mobile app, or a public page.
First payment
- Open API Keys and copy the API secret, Account ID (
BP-XXXX-XXXX), and Channel ID (for exampleBP23356). - Set an HTTPS callback URL on Account. Localhost may use
http://. - POST STK push with those three values,
phone(2547…), andamountin KES. Keepcheckout_request_idandaccount_referencefrom the response. - The customer confirms the M-Pesa prompt. A successful HTTP response only means the prompt was sent.
- Fulfill the order when payment status returns
paid: true, or when the webhook says the payment was received.
Base URL —
https://bluepay.co.ke. Send Content-Type: application/json.Read next
- Authentication — the three fields, and what a 401 or 422 means.
- Collect a payment — what to store from the STK response.
- Confirm a payment — status and webhooks together.
- Go live — the checklist before customers use it.
Endpoints
| Method | Path | Purpose |
|---|---|---|
GET / POST | /api/payment_channels.php | List channels on the account. |
POST | /api/stk_push.php | Start an STK prompt. |
GET / POST | /api/payment_status.php | Read whether that payment settled. |
POST | /api/stk_push_paylink.php | STK from a pay-link token t. |
POST | /api/stk_push_paydefault.php | STK for a default or channel pay link. |
Field lists and samples are in API Reference.