TeePayDocs
API ReferenceCollections

Create a mobile money payment

POST
/v1/collections

Sends a USSD payment prompt to the customer's phone. The customer approves it with their mobile money PIN. A 202 response means the request was accepted, not that the customer paid: read the collection or wait for the payment.completed webhook. customer.country and money.currency must be a pair your key can use (see Get capabilities); otherwise the error is unsupported_market. Requires collection:create and mobile money push enabled for your account.

Authorization

BearerAuth
headerAuthorizationBearer <token>

Secret API key: tp_test_. or tp_live_.. Server-side only.

Header Parameters

Idempotency-Key*string
Match^[A-Za-z0-9_-]+$
Length8 <= length <= 128

Request Body

application/json
  1. body
money*
customer*
description?string
Lengthlength <= 240

Response Body

Persisted payment state, provider-neutral money and public reference; no provider credentials or diagnostics

application/json
  1. response
id*string
public_reference?string

Use this reference to read the payment.

operation*unknown
status*unknown
Value in"created""pending""processing""succeeded""failed""reversed""refunded"
status_detail?unknown

Present only for failed payments the customer cancelled or that expired.

Value in"cancelled""expired"
money*
created_at*string
Formatdate-time
updated_at*string
Formatdate-time
Example Request
curl -X POST 'https://api.teepay.me/v1/collections' \  -H 'Idempotency-Key: order-1001' \  -H 'Content-Type: application/json' \  -d '{  "money": {    "amount_minor": "500000",    "currency": "TZS"  },  "customer": {    "country": "TZ",    "phone": "+255712345678",    "name": "Asha Juma",    "email": "asha@example.com"  },  "description": "Order 1001"}'
Example Response
{  "id": "string",  "public_reference": "string",  "operation": "charge",  "status": "created",  "status_detail": "cancelled",  "money": {    "amount_minor": 0,    "currency": "string"  },  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}