Create a collection
Starts a USSD push to the customer's phone. The response is 202 with
status: created; the customer then approves the PIN prompt. Listen for
the collection.succeeded / collection.failed / collection.expired
webhooks, or poll GET /v1/collections/{id}.
The fee is fixed at creation and deducted from the amount you receive.
Authorization
apiKey Authorization: Bearer np_test_sk_…. The key's prefix selects test or live mode.
In: header
Header Parameters
Unique per operation (1–255 printable ASCII characters), e.g. a UUID.
Retrying with the same key and body returns the original response with
Idempotent-Replayed: true; the same key with a different body returns
409 idempotency_key_reused. Keys are kept for 24 hours.
1 <= length <= 255Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/collections" \ -H "Idempotency-Key: string" \ -H "Content-Type: application/json" \ -d '{ "amount": 15000, "phone": "0754123456", "reference": "ORDER-1029", "description": "Order 1029", "metadata": { "cart_id": "abc" } }'{ "id": "string", "object": "collection", "status": "created", "amount": 0, "fee": 0, "currency": "TZS", "channel": "MPESA_TZ", "phone": "string", "reference": "string", "description": "string", "metadata": {}, "failure_code": "insufficient_funds", "failure_message": "string", "mode": "live", "created_at": "2019-08-24T14:15:22Z", "completed_at": "2019-08-24T14:15:22Z"}