Skip to main content
POST

Authorizations

X-Auth-Client
string
header
required

Your workspace client id.

X-Auth-Secret
string
header
required

Your sandbox client secret. The playground accepts sandbox keys only, sends the secret straight from your browser to the API, and needs your IP on the key's whitelist. In your own integration, sign requests with HMAC instead of sending the secret.

Body

application/json
amount
integer<int64>
required

Amount to collect, in base units (cents; 100 is 1 KES or 1 UGX). KES 2000 to 14500000; UGX 50000 to 400000000. GET /api/collections/supported-currencies gives the limits.

Required range: x >= 1
Example:

150000

currency
string
required

KES or UGX, case-insensitive. GET /api/collections/supported-currencies lists what is enabled.

Example:

"KES"

network
string
required

Mobile money network. MPESA for KES; MTN or AIRTEL for UGX. Any case, and the network's display name is accepted (M-Pesa).

Maximum string length: 32
Example:

"MPESA"

phone_number
string
required

The payer's phone number. Local or international form; it is stored as digits with the country code, which must match phone_pattern from GET /api/collections/supported-currencies.

Maximum string length: 20
Example:

"254700000000"

reference
string
required

Your unique reference for the payment, and the idempotency key.

Maximum string length: 100
country
string

ISO 3166-1 alpha-2 country, case-insensitive. Must be KE for KES and UG for UGX; omit to use the currency's country.

Required string length: 2
Example:

"KE"

customer_id
string<uuid>

Links the payer's customer record. Optional; no customer or KYC is needed to collect.

description
string

A note for the collection, returned as description.

Maximum string length: 255
payer_name
string

The payer's name.

Maximum string length: 100
rail
enum<string>
default:mobile_money

Optional and case-insensitive; mobile_money is the only rail.

Available options:
mobile_money

Response

Created, or the open collection already created under this reference.

Successful responses are wrapped in this envelope, and so are errors a handler answers itself (request body and field validation, some not-found and conflict cases, ORG_NOT_ACTIVE): success is false and error carries a code and message. Errors raised by authentication and by the services behind a handler are a Problem instead.

success
boolean
required

true on success

timestamp
string<date-time>
required

When the response was written.

data
object

The payload; its shape is given per operation. Omitted when there is none.

error
object
message
string

Human-readable summary; omitted when empty.

request_id
string

Set on error envelopes: the request's correlation id (req_ followed by a UUID), the same value as the X-Correlation-ID response header. Quote it to support.