Build with DeriPay
Accept M-Pesa payments and send merchant payouts through one API.
DeriPay gives your server access to STK push collections, M-Pesa payouts, payment status, and merchant balances. Requests are scoped to your merchant account.
Quickstart
Create a key and make your first API request.
Collect a payment
Request an STK push and track the result.
Send a payout
Disburse from your available payout balance.
Receive webhooks
Verify signed events and process them safely.
How an integration works
- Your server authenticates using a scoped API key.
- It submits a collection or payout with an idempotency key.
- DeriPay returns a payment ID and its current state.
- Your server polls that payment or receives a signed terminal webhook.
Acceptance is not settlement
A successful HTTP response to a payment request does not mean money has moved. Confirm a final payment status before fulfilling an order or marking a payout complete.
Before you begin
You need an approved merchant account, access to the Developers area of the merchant dashboard, and the API base URL for your environment. Merchant processing must be enabled on that deployment.
Documentation is publicly readable. Reading these pages does not activate merchant processing or provision API access.
API conventions
| Convention | Value |
|---|---|
| Protocol | HTTPS in live and hosted sandbox environments |
| Authentication | X-API-Key header |
| Request and response format | JSON |
| Currency | KES |
| Amounts | Integer cents, in whole-shilling increments |
| API version | /api/v1 |
| Timestamps | RFC 3339 timestamps; examples use UTC |
The examples use DERIPAY_API_BASE_URL and DERIPAY_API_KEY as server-side environment variables. Copy the complete base URL, including /api/v1, from your dashboard.
Choose your next step
Start with authentication, or go directly to the quickstart. Read idempotency before creating payments.