STK Push Collections

Initiate an STK push

POST
/api/sandbox/v1/stk/new

Push a payment prompt to a customer's phone. They approve it with their mobile money PIN and the funds land in your Kiotapay wallet.

The response comes back immediately with a requestId; the customer has not paid yet at that point. The outcome arrives on your callbackUrl once they approve, decline, or the prompt times out.

Conditionally required fields

CurrencyAdditionally required
KSH (Kenya)accountReference
TZS (Tanzania)channel
UGX (Uganda)narration, customerName

Watch the length limits: description is capped at 13 characters and accountReference at 12, because both are rendered inside the PIN prompt on the customer's handset.

Authorization

bearerAuth
AuthorizationBearer <token>

The access_token returned by POST /api/v1/get-token.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

Callbacks

curl -X POST "https://example.com/api/sandbox/v1/stk/new" \  -H "Content-Type: application/json" \  -d '{    "phoneNumber": "254745362174",    "amount": 10,    "currencyCode": "KSH",    "description": "Order 4821",    "accountReference": "INV-4821",    "callbackUrl": "https://kiotapay.co.ke",    "referenceId": "1234"  }'
{  "status": 201,  "message": "Stk request has been accepted for request",  "data": {    "requestId": "4dc43b5a-d43f-4b0e-b677-3a6167d2c654",    "phoneNumber": "0745362174",    "requestedAmount": 10  }}