Core API

Invoices

Create, send, and track invoices with M-Pesa payment integration.

Create an Invoice from the Merchant Panel

You don't need code to create or send invoices. Log in to your PayNexus merchant panel and manage everything from the dashboard:

1

Sign in to your merchant account

Go to /login and sign in to your PayNexus merchant panel.

2

Create an invoice

In the merchant panel, open Invoices and click Create Invoice.

3

Add customer and line items

Enter the customer name, email, phone number, currency, line items, and due date. You can also set a fixed amount or let the customer pay any amount.

4

Send the invoice

Use the Send Invoice action to email the invoice directly to your customer with a Pay Now button. The customer pays via M-Pesa without needing a website or API integration.

5

Track payment status

Monitor statuses from the panel: Draft, Sent, Paid, Overdue, and Partial.

No-Code First

The merchant panel is the easiest way to create, send, and manage invoices. Use the API only if you need to integrate invoicing into your own system.

Create Invoice (API)

Use the REST API only if you want to create invoices programmatically from your own application:

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
draftInvoice created but not sent
sentInvoice sent to customer
paidPayment received via M-Pesa
overduePast due date, not paid
cancelledInvoice cancelled