Sign In

PayWay Developer API Portal

Build modern, automated payment experiences. Access RESTful API endpoints for M-Pesa STK Push Express payments, C2B Paybill reconciliation, B2C automated disbursements, and real-time webhooks.

API Quick Reference

API Authentication

All HTTP requests to PayWay REST endpoints require HTTP Basic Authentication headers using your API Key Token generated in your PayWay Merchant Account Settings.

HTTP BASIC AUTH HEADER
Authorization: Basic <your_api_key> Content-Type: application/json Accept: application/json
POST https://payway.co.ke/api/v2/payments

Initiate M-Pesa STK Push Prompt

Triggers an instant Safaricom M-Pesa SIM popup prompt on the customer's phone requesting PIN entry to complete the payment transaction.

cURL EXAMPLE REQUEST
curl --location 'https://payway.co.ke/api/v2/payments' \ --header 'Content-Type: application/json' \ --header 'Authorization: Basic <your_api_key>' \ --data '{ "amount": "100", "phone": "+254700000000", "reference": "ORDER-9942", "description": "Payment for Online Purchase" }'
POST https://payway.co.ke/api/v2/withdraw

Automated B2C M-Pesa Payout

Disburse funds directly from your PayWay wallet to any registered M-Pesa recipient phone number in Kenya within seconds.

cURL DISBURSEMENT REQUEST
curl --location 'https://payway.co.ke/api/v2/withdraw' \ --header 'Content-Type: application/json' \ --header 'Authorization: Basic <your_api_key>' \ --data '{ "amount": "500", "phone": "+254700000000", "channel": "MPESA_B2C", "remarks": "Salary Payout #1042" }'
JSON WEBHOOK CALLBACK PAYLOAD

Real-Time Webhook Callback

When an M-Pesa transaction is completed by the customer, PayWay immediately sends an HTTP POST JSON payload to your configured Callback URL.

SAMPLE WEBHOOK JSON RESPONSE
{ "status": "SUCCESS", "transaction_id": "PW-9821-4402", "receipt_code": "RKS8910245", "amount": 100.00, "phone": "254700000000", "reference": "ORDER-9942", "gateway": "M-PESA EXPRESS", "timestamp": "2026-08-25T11:45:00Z" }