Core API
Transactions
Track and manage M-Pesa payment transactions. Response fields, status tracking, and reconciliation.
Get Payment by Reference
Retrieve payment details using the unique payment reference:
bash
curl -X GET "https://paynexus.co.ke/api/payments/PNXABC123DEF" \
-H "X-API-Key: pk_your_public_key_here"
Get Payment by Checkout Request ID
Look up a payment using the M-Pesa checkout request ID:
bash
curl -X POST "https://paynexus.co.ke/api/payments/status-by-checkout-id" \
-H "X-API-Key: pk_your_public_key_here" \
-H "Content-Type: application/json" \
-d '{"checkout_request_id": "ws_CO_27012026101718139746990866"}'
Response Fields
| Field | Type | Description |
|---|---|---|
reference | string | Unique PayNexus payment reference |
checkout_request_id | string | M-Pesa checkout request ID |
amount | string | Payment amount in KES |
phone | string | Normalized phone number (254...) |
status | string | Current payment status |
transaction_id | string | PayNexus transaction ID |
provider_transaction_id | string | M-Pesa transaction ID |
created_at | string | ISO 8601 timestamp |
Status Values
| Status | Description |
|---|---|
initiated | STK Push sent to customer |
processing | Payment being processed |
completed | Payment successful |
failed | Payment failed |
cancelled | Customer cancelled |
expired | STK Push expired |