POST/v1/payment/token/:token/pay
Charge a customer against an active payment token by collecting from their mobile money account.
When to use this
This is what runs when a customer opens a payment token link and enters their phone number, whether on the hosted pay.kawrie.com page or your own custom UI. It requires no API key because the token itself, generated server-side by you with Generate Payment Token, is the authorization; anyone with the link can pay it exactly once for exactly the amount you set.
- The "pay now" button on a hosted or custom payment-token page
- Letting a customer complete a previously shared invoice without logging in
Path parameters
| Field | Type | Required | Description |
|---|---|---|---|
| token | string | Required | The active payment token to pay |
Request headers
| Field | Type | Required | Description |
|---|---|---|---|
| Content-Type | string | Required | application/json |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| phone | string | Required | Payer phone in E.164 format |
| customer_name | string | Optional | Payer name, max 100 characters |
Request example
curl -X POST https://api.kawrie.com/v1/payment/token/pt_9f2h1k3a8b7c/pay \
-H "Content-Type: application/json" \
-d '{ "phone": "+256712345678", "customer_name": "John Doe" }'Response200 OK
{
"success": true,
"data": {
"kawrie_reference": "KW-20260628-T5R8N2Q1",
"status": "processing",
"amount": 15000,
"currency": "UGX",
"phone": "+256712345678"
}
}Error responses
| Code | Status | Description |
|---|---|---|
| TOKEN_NOT_FOUND | 404 | No payment token exists with that identifier |
| TOKEN_EXPIRED | 400 | This payment token has expired |
| TOKEN_ALREADY_PAID | 400 | This payment token has already been paid |
| INVALID_PHONE | 400 | Phone number is not registered for mobile money |