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
referencestringUnique PayNexus payment reference
checkout_request_idstringM-Pesa checkout request ID
amountstringPayment amount in KES
phonestringNormalized phone number (254...)
statusstringCurrent payment status
transaction_idstringPayNexus transaction ID
provider_transaction_idstringM-Pesa transaction ID
created_atstringISO 8601 timestamp

Status Values

StatusDescription
initiatedSTK Push sent to customer
processingPayment being processed
completedPayment successful
failedPayment failed
cancelledCustomer cancelled
expiredSTK Push expired