POST/v1/collectAPI Key required
Initiate a mobile money collection from a customer. The customer receives an STK push on their phone to approve the payment.
When to use this
Collect is the endpoint most integrations start with: you call it whenever your app needs money from a customer right now, and you already have their phone number on hand. Kawrie pushes a prompt to that number; the customer approves it in their mobile money app, and the funds move into your wallet. Because the push happens on the customer’s device, you never see or store their mobile money PIN.
- Checkout flow where the customer types their phone number and confirms on their phone
- In-app wallet top-ups
- Subscription renewal charges for a number you already have on file
- Point-of-sale style charges initiated by staff on behalf of a walk-in customer
Request headers
| Field | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Required | Bearer your_api_key |
| Content-Type | string | Required | application/json |
| Idempotency-Key | string | Required | Unique key that prevents the same request from being processed twice |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| amount | number | Required | Amount in the smallest currency unit. 10000 equals UGX 10,000 |
| phone | string | Required | Customer phone in E.164 format, e.g. +256712345678 |
| currency | string | Required | One of UGX, KES, GHS, XAF |
| merchant_reference | string | Optional | Your own reference ID, max 50 characters |
| description | string | Optional | Transaction description, max 255 characters |
| customer_name | string | Optional | Customer name, max 100 characters |
| metadata | object | Optional | Additional data to store with the transaction |
Request example
curl -X POST https://api.kawrie.com/v1/collect \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: unique-key-123" \
-H "Content-Type: application/json" \
-d '{
"amount": 25000,
"phone": "+256712345678",
"currency": "UGX",
"merchant_reference": "ORDER-12345"
}'Response200 OK
{
"success": true,
"data": {
"kawrie_reference": "KW-20260628-A1B2C3D4",
"status": "processing",
"amount": 25000,
"fee": 1875,
"net_amount": 23125,
"currency": "UGX",
"customer_name": "John Doe",
"phone": "+256712345678"
},
"meta": { "timestamp": "2026-06-28T10:30:00.000Z" }
}Error responses
| Code | Status | Description |
|---|---|---|
| INVALID_PHONE | 400 | Phone number is not registered for mobile money |
| INSUFFICIENT_BALANCE | 400 | Merchant wallet balance is insufficient |
| BELOW_MINIMUM_AMOUNT | 400 | Amount is below UGX 500 |
| ABOVE_MAXIMUM_AMOUNT | 400 | Amount exceeds your KYC limit |
| DUPLICATE_REFERENCE | 400 | Idempotency key has already been used |
| INVALID_API_KEY | 401 | API key is invalid or missing |
| RATE_LIMIT_EXCEEDED | 429 | Too many requests |
| PROVIDER_ERROR | 502 | The payment provider returned an error |