Core API
Invoices
Create, send, and track invoices with M-Pesa payment integration.
Create Invoice
Create an invoice that customers can pay via M-Pesa:
bash
curl -X POST "https://paynexus.co.ke/api/invoices" \
-H "X-API-Key: sk_your_secret_key_here" \
-H "Content-Type: application/json" \
-d '{
"customer_name": "John Doe",
"customer_phone": "0746990866",
"amount": 1500,
"description": "Consulting Services",
"due_date": "2026-01-30"
}'
List Invoices
bash
curl -X GET "https://paynexus.co.ke/api/invoices" \
-H "X-API-Key: pk_your_public_key_here"
Get Invoice
bash
curl -X GET "https://paynexus.co.ke/api/invoices/INV-001" \
-H "X-API-Key: pk_your_public_key_here"
Send Invoice
Send an invoice to the customer via SMS or email:
bash
curl -X POST "https://paynexus.co.ke/api/invoices/INV-001/send" \
-H "X-API-Key: sk_your_secret_key_here" \
-H "Content-Type: application/json" \
-d '{"channel": "sms"}'
Invoice Status
| Status | Description |
|---|---|
draft | Invoice created but not sent |
sent | Invoice sent to customer |
paid | Payment received via M-Pesa |
overdue | Past due date, not paid |
cancelled | Invoice cancelled |