Payment Tokens
Payment tokens let you request a fixed amount from a customer without them needing an account or a session on your platform. Useful for invoices, quotes, and one-off charges shared over chat or email.
The flow
- Call Generate Payment Token with an amount and currency
- Share the returned
pay_urlwith your customer, or build your own UI around thetoken - The customer (or your UI) calls Pay With Token with their phone number
- Kawrie sends an STK push, then notifies you via webhook when the payment resolves
curl -X POST https://api.kawrie.com/v1/payment/token \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "amount": 15000, "currency": "UGX", "merchant_reference": "INVOICE-77" }'
Expiry
Tokens expire after expires_in seconds (default one hour). An expired token cannot be paid; you'll
need to generate a new one. Check a token's current state anytime with
Get Payment Token.
When to use tokens vs. Collect Payment
Use Collect Payment directly when you already know the customer's phone number and want to charge them immediately from your backend. Use payment tokens when you want to hand off the "enter your phone number and pay" step to the customer themselves, such as in an invoice link.