BluePayAPI
Ask AI
BluePay
API Keys Support Dashboard

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

  1. Open API Keys and copy the API secret, Account ID (BP-XXXX-XXXX), and Channel ID (for example BP23356).
  2. Set an HTTPS callback URL on Account. Localhost may use http://.
  3. POST STK push with those three values, phone (2547…), and amount in KES. Keep checkout_request_id and account_reference from the response.
  4. The customer confirms the M-Pesa prompt. A successful HTTP response only means the prompt was sent.
  5. 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

Endpoints

MethodPathPurpose
GET / POST/api/payment_channels.phpList channels on the account.
POST/api/stk_push.phpStart an STK prompt.
GET / POST/api/payment_status.phpRead whether that payment settled.
POST/api/stk_push_paylink.phpSTK from a pay-link token t.
POST/api/stk_push_paydefault.phpSTK for a default or channel pay link.

Field lists and samples are in API Reference.