Mobile Money — Overview
The Moko Mobile Money API lets you collect funds from a customer's mobile wallet (Collection / Deposit) and pay out to a customer's mobile wallet (Withdrawal / Payout).
A single URL and a single content-type header, with operations distinguished by the action field in the body.
Single endpoint
POST https://api.gofreshpay.com/api/v1/gateway
Content-Type: application/jsonThe action field determines the operation:
action | Direction | Docs |
|---|---|---|
debit | Collection — customer → merchant (STK Push) | Collection |
credit | Withdrawal — merchant → customer (payout) | Withdrawal |
verify | Look up a transaction's status | Verify |
Supported operators
The method field in the body:
method | Operator |
|---|---|
mpesa | M-Pesa (Vodacom) |
orange | Orange Money |
airtel | Airtel Money |
afrimoney | Afrimoney (Africell) |
Currencies
CDF— Congolese francUSD— US dollar
Customer phone number format
International format without + or spaces: 243XXXXXXXXX (12 digits for the DRC).
Example: 243970000000.
Auth
The MM API uses body-based authentication — there is no HMAC header. You include your credentials directly in the body:
merchant_id(merchant identifier)merchant_secrete(note the spelling, with aneat the end — notmerchant_secret)
WARNING
The merchant_secrete spelling is intentional on the MM API — it is the legacy field name. Don't confuse it with merchant_secret from the Card API.
Get your credentials from henock.barakael@mokoafrika.com (sandbox), then on request for production.
Asynchronous flow
All MM operations are asynchronous:
- You send
POST /api/v1/gateway - You immediately receive a
200 OKresponse withStatus: "Success"= transaction created, NOT paid - The customer completes the operation on their phone (STK Push, enters their PIN)
- The operator processes the transaction
- Moko POSTs a webhook to your
callback_urlwithTrans_Status = Successful | Failed | Pending
The Status field in the initial response only indicates that the request was accepted. The actual result arrives in the webhook via Trans_Status. See Webhooks.
Page structure
- Collection (Deposit) — collect funds from a customer
- Withdrawal (Payout) — pay out to a customer
- Verify — check status by reference
- Webhooks — callback format + retry policy + signature
