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

FieldTypeRequiredDescription
AuthorizationstringRequiredBearer your_api_key
Content-TypestringRequiredapplication/json
Idempotency-KeystringRequiredUnique key that prevents the same request from being processed twice

Request body

FieldTypeRequiredDescription
amountnumberRequiredAmount in the smallest currency unit. 10000 equals UGX 10,000
phonestringRequiredCustomer phone in E.164 format, e.g. +256712345678
currencystringRequiredOne of UGX, KES, GHS, XAF
merchant_referencestringOptionalYour own reference ID, max 50 characters
descriptionstringOptionalTransaction description, max 255 characters
customer_namestringOptionalCustomer name, max 100 characters
metadataobjectOptionalAdditional 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

response.json
{
  "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

CodeStatusDescription
INVALID_PHONE400Phone number is not registered for mobile money
INSUFFICIENT_BALANCE400Merchant wallet balance is insufficient
BELOW_MINIMUM_AMOUNT400Amount is below UGX 500
ABOVE_MAXIMUM_AMOUNT400Amount exceeds your KYC limit
DUPLICATE_REFERENCE400Idempotency key has already been used
INVALID_API_KEY401API key is invalid or missing
RATE_LIMIT_EXCEEDED429Too many requests
PROVIDER_ERROR502The payment provider returned an error