/v1/checkout/sessions
Creates checkout session and returns checkout_url and checkout_id.
Authentication via Api-Key. Base URL: https://api.payzeno.io
From order to confirmed webhook.
Send amount, currency, customer and return URLs.
Redirect to checkout_url or use direct payment via API.
Receive HTTP notification when status changes.
All routes require the Api-Key header with a key created at app.payzeno.io → Integration → API Keys.
pk_live_… (production) or pk_test_… (sandbox, when available)
curl https://api.payzeno.io/v1/checkout/sessions/abc123/status \
-H "Api-Key: pk_live_xxx"
On all POST requests, send Idempotency-Key with a unique value per operation (e.g. your store order ID).
409 error
-checkout
curl -X POST https://api.payzeno.io/v1/checkout/sessions \
-H "Api-Key: pk_live_xxx" \
-H "Idempotency-Key: order-123-unique" \
-H "Content-Type: application/json" \
-d '{ ... }'
Essential routes for hosted checkout and direct payments.
/v1/checkout/sessions
Creates checkout session and returns checkout_url and checkout_id.
/v1/checkout/sessions/:id/status
Query session status (pending, paid, expired, etc.).
/v1/payment/mpesa
Direct M-Pesa payment with checkout_id and phone (+258…).
/v1/payment/emola
Direct e-Mola payment with checkout_id and phone.
amount in minor units (cents): 2500 = 25.00 MZN.
Required fields: amount, currency, customer (name, phone E.164; email optional), success_url.
Optional: reference, description, cancel_url, payment_methods (mpesa, emola, …).
curl -X POST https://api.payzeno.io/v1/checkout/sessions \
-H "Api-Key: pk_live_xxx" \
-H "Idempotency-Key: order-123-unique" \
-H "Content-Type: application/json" \
-d '{
"amount": 2500,
"currency": "MZN",
"reference": "order-123",
"description": "Order #123",
"payment_methods": ["mpesa", "emola"],
"customer": {
"name": "Maria Silva",
"email": "maria@example.com",
"phone": "+258840000000"
},
"success_url": "https://store.com/success",
"cancel_url": "https://store.com/cancelled"
}'
{
"success": true,
"checkout_id": "674a1b2c3d4e5f678901234",
"checkout_url": "https://checkout.payzeno.io/payment/674a1b2c...",
"status": "pending",
"amount": 2500,
"currency": "MZN",
"expires_at": "2026-06-16T14:30:00+02:00"
}
Triggers STK/USSD on the customer phone without opening the browser. Use after creating the session.
Phone: Mozambique format +25884… or 84… (normalised automatically).
curl -X POST https://api.payzeno.io/v1/payment/mpesa \
-H "Api-Key: pk_live_xxx" \
-H "Idempotency-Key: order-123-mpesa" \
-H "Content-Type: application/json" \
-d '{
"checkout_id": "674a1b2c3d4e5f678901234",
"phone": "+258840000000"
}'
{
"success": true,
"checkout_id": "674a1b2c3d4e5f678901234",
"status": "pending",
"message": "Payment initiated. Await webhook or poll status."
}
Confirm payment via payment.succeeded webhook or polling GET …/status.
POST JSON to the URL configured on the API key. Respond 2xx quickly; retries on failure.
event
payment.succeededPayment confirmed. Status succeeded.
event
payment.refundedRefund processed.
event
payment.chargebackChargeback / dispute recorded.
{
"event": "payment.succeeded",
"payment_id": "674a1b2c3d4e5f678901234",
"checkout_id": "674a1b2c3d4e5f678901234",
"reference": "order-123",
"amount": 2500,
"currency": "MZN",
"status": "succeeded",
"paid_at": "2026-06-15T12:34:56+02:00",
"payment_method": "mpesa",
"customer": {
"name": "Maria Silva",
"email": "maria@example.com"
}
}
amount is always in minor units. reference is the value you sent in reference when creating the session.
JSON body: { "success": false, "message": "…" }
| HTTP | Situation |
|---|---|
| 400 | Invalid body, amount ≤ 0, invalid phone, expired session |
| 401 | Missing or invalid Api-Key |
| 404 | checkout_id not found or belongs to another merchant |
| 409 | Idempotency conflict (same key, different body) |
| 422 | Gateway declined payment (balance, timeout, etc.) |
pending — awaiting payment
paid — paid successfully
expired — session expired
cancelled — cancelled by customer
refunded — refunded
Payment links (/l/pl_xxx) in the dashboard do not require the API — ideal for quick tests.
curl https://api.payzeno.io/v1/checkout/sessions/674a1b2c/status \
-H "Api-Key: pk_live_xxx"
Explore all endpoints, schemas and test calls in the OpenAPI documentation.