Documentation
PayNexus Developer Docs
Everything you need to integrate M-Pesa payments into your application. REST APIs, SDKs, plugins, and step-by-step guides for developers.
API Keys
Generate public and secret keys, understand scopes, and keep your integrations secure.
Read moreQuick Start
Get up and running in 5 minutes. From registration to your first STK Push payment.
Read moreSTK Push API
Trigger M-Pesa payments directly to your customer's phone. Full API reference with examples.
Read morePopular Topics
| Topic | Description | Link |
|---|---|---|
| API Keys | Generate and manage your public and secret API keys | View |
| Authentication | Bearer tokens, scopes, and secure auth patterns | View |
| STK Push | Initiate and track M-Pesa payments via API | View |
| Webhooks | Receive real-time payment confirmations | View |
| Payment Links | Create shareable checkout links without code | View |
| Security Best Practices | Keep your integration safe and compliant | View |
Quick Example
Here's a minimal example of initiating an STK Push payment using cURL:
bash
curl -X POST "https://paynexus.co.ke/api/mpesa/payment/initiate" \
-H "X-API-Key: sk_your_secret_key_here" \
-H "Content-Type: application/json" \
-d '{
"amount": 10,
"phone": "0746990866",
"description": "Order #12345"
}'
Sandbox Testing
Use sb_... keys for testing. Live payments require a verified business account and sk_... keys.