Create Mobile Payment
POST /api/v1/payments with type: mobile
POST /api/v1/payments with type: "mobile".
Idempotency-Key is required — requests without it return 400 IDEMPOTENCY_KEY_REQUIRED. Idempotency.
Returns 201 with status: "pending" and a USSD push to the customer’s phone, or 200 when replaying an existing Idempotency-Key.
Required fields
| Field | Notes |
|---|---|
amount, currency, type, customer, phone | type must be "mobile". Currencies: TZS, USD, KES, UGX |
customer | firstname, lastname, email |
phone | TZS numbers are normalized and validated — see below |
Optional fields
| Field | Notes |
|---|---|
network | Auto-detected from phone; aliases mpesa → vodacom, mixx → tigo |
reference, metadata | Duplicate live reference → 409 DUPLICATE_REFERENCE |
webhook_url, callback_url | Override merchant defaults |
Phone formats (TZS)
These all normalize to255712345678: 0712345678, 712345678, 255712345678, +255712345678. After normalization the number must be a valid Tanzanian mobile (255 + 6/7 + 8 digits) — anything else returns 400 VALIDATION_ERROR.
Minimum amount
500 TZS minimum whencurrency is TZS.
Response
| Field | Value |
|---|---|
status | pending |
payment_url | Omitted |
qr_code | Omitted |
Errors
| HTTP | error_code | When |
|---|---|---|
| 400 | VALIDATION_ERROR | Invalid phone, network, or currency |
| 400 | PAYMENT_FAILED | Amount below the 500 TZS minimum |
| 402 | PAYMENT_DECLINED | Synchronous provider decline — details.transaction_id in response |
Authorizations
API key obtained from the merchant dashboard. When using the 'Try It' feature, enter only the key—the 'Bearer ' prefix is added automatically. For direct API calls, the 'Authorization: Bearer ' format is mandatory.
Headers
Required. A unique value (max 255 characters) per payment attempt, scoped to your merchant account. Requests without it are rejected with 400 IDEMPOTENCY_KEY_REQUIRED. Reuse the same value when retrying — the retry returns 200 with the original payment instead of creating a duplicate. Safe under concurrent retries: the losing request replays the winner's payment.
255"123e4567-e89b-12d3-a456-426614174000"
Body
- Option 1
- Option 2
- Option 3
Amount the customer is charged. Minimum 500 TZS when currency is TZS.
TZS, USD, KES, UGX Mobile money USSD push payment.
"mobile"Customer phone number. For TZS, accepted formats: 0712345678, 712345678, 255712345678, +255712345678 — normalized to 255XXXXXXXXX and must be a valid Tanzanian mobile number (2556/2557 prefix). Invalid numbers return 400 VALIDATION_ERROR.
Optional — the mobile network operator is auto-detected from the phone number. Aliases accepted: mpesa (vodacom), mixx (tigo). Invalid values return 400 VALIDATION_ERROR.
vodacom, tigo, airtel, halotel, ttcl Your internal reference. A reference with an existing live (pending/processing/completed) payment is rejected with 409 DUPLICATE_REFERENCE.
Per-payment webhook URL. Overrides merchant webhook_url when set.
Per-payment callback URL for terminal status. Overrides merchant callback_url when set.
Response
Idempotent replay — a payment already exists for this Idempotency-Key. The existing payment is returned and no new charge is created.
Standard success envelope wrapping all API responses.
success HTTP status code echoed in the body
Payment record returned by GET /payments/{id}, GET /payments, POST /payments/{id}/refresh, and idempotent replays. reference is YOUR merchant reference; the upstream payment identifier is external_id.
Pagination metadata on list endpoints

