Quick start
Three steps to your first payment.
Start in the sandbox
Get test credentials and build safely before going live.
Get a token
Swap your client ID and secret for a 1-hour bearer token.
/oauth/tokenMake your first call
Collect from or pay out to a wallet. The result comes to your callback.
/payments/collections/pushEndpoints
Pick one to see a sample. Base URL: https://{BASE_URL}/api/v1
/oauth/tokenGet an access token
Exchange your client ID and secret for a 1-hour bearer token. An invalid client ID or secret returns PGW-1001. Calls from a non-whitelisted IP return PGW-1009.
POST /oauth/token
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials&client_id={clientId}&client_secret={clientSecret}{
"access_token": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ...",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "payments:read payments:write"
}/payments/collections/pushCollect from a customer
Send a payment prompt to the customer’s phone. The acknowledgement only confirms the request was accepted. The final outcome arrives on your callback, or via the status endpoint.
{
"requestId": "3cf73c52-d6b0-4906-8b5d-f9a4f82b5011",
"merchantId": "0882eff7-da0f-4a6c-a581-9899a2a6e779",
"providerCode": "VODACOM",
"amount": 10000.00,
"currency": "TZS",
"msisdn": "255754123456",
"reference": "INV-1001",
"callbackUrl": "https://merchant.example.com/api/payment-result",
"narration": "Invoice INV-1001"
}{
"status": "SUCCESS",
"code": "PGW-0000",
"message": "Collection request accepted",
"data": {
"transactionId": "TXN-20260419-000022",
"providerCode": "VODACOM",
"transactionStatus": "ROUTED",
"currency": "TZS"
}
}/payments/disbursementsPay out to a wallet
Send funds from your provider disbursement wallet to a customer’s mobile wallet. The gateway checks your balance and reserves the amount; on final success the reservation is consumed, on failure it is released.
{
"requestId": "6e3c1d3d-6b96-4e08-8a7d-c4968ea6905a",
"merchantId": "0882eff7-da0f-4a6c-a581-9899a2a6e779",
"providerCode": "YAS",
"amount": 25000.00,
"currency": "TZS",
"msisdn": "255713123456",
"reference": "PAYOUT-1001",
"callbackUrl": "https://merchant.example.com/api/payment-result",
"narration": "Customer refund"
}{
"status": "SUCCESS",
"code": "PGW-0000",
"message": "Disbursement accepted for processing",
"data": {
"transactionId": "TXN-20260419-000021",
"providerCode": "YAS",
"transactionStatus": "FUNDS_RESERVED",
"reservedAmount": 25000.00,
"currency": "TZS"
}
}/payments/{reference}Check a payment
Retrieve the latest normalised status of a payment using your business reference.
{
"status": "SUCCESS",
"code": "PGW-0000",
"message": "Transaction retrieved successfully",
"data": {
"transactionId": "TXN-20260419-000022",
"providerCode": "VODACOM",
"operation": "C2B_USSD_PUSH",
"transactionStatus": "SUCCESS",
"amount": 10000.00,
"currency": "TZS",
"msisdn": "255754123456",
"reference": "INV-1001",
"providerTransactionId": "919994765",
"providerReceiptNo": "5HN31LXJQAX",
"finalizedAt": "2026-04-19T21:38:57+03:00"
}
}/payments/wallets/balance/{clientId}Check your balance
Get the real-time balance of a wallet, useful for checking available funds before starting a payout. Uses the same security headers as the payment APIs, plus Accept and Content-Type: application/json.
/payments/name-checkVerify a name
Verify the registered customer name behind a mobile number before you pay. Pass providerCode and msisdn as query parameters, with the Accept, X-Client-Id and X-Request-Id headers.
curl -sS -X GET \
"https://{BASE_URL}/api/v1/payments/name-check?providerCode=HALOTEL&msisdn=255XXXXXXXXX" \
-H "Accept: application/json" \
-H "X-Client-Id: <client-id>" \
-H "X-Request-Id: <unique-request-id>"{
"status": "SUCCESS",
"code": "PGW-0000",
"message": "Request processed successfully",
"data": {
"providerCode": "HALOTEL",
"msisdn": "255XXXXXXXXX",
"recipientName": "Full Name",
"resultCode": "200",
"resultMessage": "SUCCESS",
"route": "DIRECT"
}
}Callbacks
We POST the final result of each payment to your HTTPS endpoint. Reply with HTTP 200, and handle duplicates safely: we retry on timeouts and non-2xx responses.
{
"status": "SUCCESS",
"code": "PGW-0000",
"timestamp": "2026-04-19T21:15:33+03:00",
"data": {
"transactionId": "TXN-20260419-000022",
"requestId": "3cf73c52-d6b0-4906-8b5d-f9a4f82b5011",
"providerCode": "VODACOM",
"operation": "C2B_USSD_PUSH",
"transactionStatus": "SUCCESS",
"amount": 10000.00,
"currency": "TZS",
"msisdn": "255754123456",
"reference": "INV-1001",
"providerReceiptNo": "5HN31LXJQAX",
"message": "Transaction finalized successfully"
}
}HTTP/1.1 200 OK
Content-Type: application/json
{ "status": "RECEIVED", "message": "Callback accepted" }Callback headers
| Header | Description |
|---|---|
X-Callback-Id | Unique callback delivery identifier. |
X-Callback-Timestamp | Callback creation timestamp. |
X-Callback-Content-SHA256 | Optional. Base64 SHA-256 hash of the raw body. |
X-Callback-Signature | Optional. Base64 HMAC-SHA256 using your callback secret. |
Reference
Open what you need.
How a payment flows
Collect (C2B)
- You send a collection push request
- Gateway validates and routes it
- Acknowledgement is returned
- Customer approves or rejects on their phone
- Provider returns the final result
- Success: collection wallet credited
- Your callback is delivered
Pay out (B2C)
- You send a disbursement request
- Gateway authenticates and validates it
- Funds are reserved in the provider disbursement wallet
- Request is routed and acknowledged
- Provider returns the final result
- Success: ledger posted · Failure: reservation released
- Your callback is delivered
Base URL, API style and response envelope
https://{BASE_URL}/api/v1Your production and UAT hosts are shared during onboarding.
| Standard | Rule |
|---|---|
| Protocol | HTTPS only |
| Payload format | JSON, UTF-8 |
| Authentication | Bearer access token (OAuth2 client credentials). Optional HMAC request signature where enabled. |
| Idempotency | Required for payment creation endpoints |
| Date and time | ISO-8601 with timezone in responses |
| Amounts | Decimal numbers without thousands separators |
Every response uses the same envelope, so you can handle success and errors in one place.
{
"status": "SUCCESS",
"code": "PGW-0000",
"message": "Request processed successfully",
"requestId": "a15c1e07-5e8f-4d45-a533-f1a57ad7c9d9",
"timestamp": "2026-04-19T21:15:33+03:00",
"data": { }
}Required headers
| Header | Description |
|---|---|
Authorization | Bearer access token from the token endpoint. |
X-Client-Id | Client identifier issued during onboarding. |
X-Request-Id | Unique request identifier. |
X-Idempotency-Key | Unique idempotency key for the request. |
X-Timestamp | 10-digit Unix epoch timestamp in seconds, e.g. 1782275551. |
X-Nonce | Unique random value to prevent replay attacks. |
X-Content-SHA256 | SHA-256 hash of the raw request body, Base64-encoded. |
X-Signature | Optional. Base64-encoded HMAC-SHA256 signature. |
Security and idempotency
Each integration uses OAuth2 client credentials, JWT bearer access tokens, IP whitelisting, timestamps, nonces and idempotency keys. HMAC request signing is available and can be enabled for your integration during onboarding.
Payment creation endpoints compare the idempotency key and the request hash. Sending the exact same request again returns the original result, so retries never create duplicate payments. Reusing a key with a different payload is rejected (PGW-1004).
Core fields
| Field | Meaning |
|---|---|
requestId | Merchant-generated unique request reference for traceability. |
merchantId | Merchant identifier issued during onboarding. |
transactionId | Gateway-generated, immutable transaction identifier. |
providerCode | Target network wallet, e.g. YAS or VODACOM. Only codes enabled for your merchant account are accepted. |
reference | Your business reference: invoice, order or payout number. |
amount / currency | Transaction amount; currency is normally TZS. |
msisdn | Customer mobile number in international format (2557XXXXXXXX). |
callbackUrl | Your HTTPS endpoint for the final asynchronous result. |
Transaction states
Every payment moves through a normalised set of states, the same for every network.
RECEIVEDAccepted at the API boundary.
AUTHENTICATEDSecurity and client validation completed.
VALIDATEDBusiness rules and payload validation completed.
FUNDS_RESERVEDB2C only — amount reserved from the disbursement wallet.
ROUTEDProvider accepted the request for processing.
PENDING_FINALFinal provider outcome still pending.
SUCCESSCompleted and ledger posting applied.
FAILEDFailed; any reservation is released.
REVERSEDSuccessful reversal against the original transaction.
Wallet structure
Each merchant is onboarded with a wallet hierarchy: one merchant parent wallet showing your total balance, a provider total wallet per network, and provider leaf wallets for collection and disbursement. Collections increase the provider collection wallet; disbursements decrease the provider disbursement wallet.
Error codes
Failed requests return "status": "FAILED" with one of these codes in the standard envelope.
| Code | Meaning |
|---|---|
PGW-0000 | Request processed successfully |
PGW-1001 | Invalid client credentials |
PGW-1002 | Unsupported or disabled providerCode for the merchant |
PGW-1003 | Invalid MSISDN format |
PGW-1004 | Duplicate requestId or idempotency conflict |
PGW-1005 | Amount exceeds configured merchant limits |
PGW-1006 | Insufficient balance in the provider disbursement wallet |
PGW-1007 | Authentication failed |
PGW-1008 | Signature validation failed |
PGW-1009 | IP address is not whitelisted |
PGW-1010 | Transaction not found |
PGW-1099 | General processing error |
Operational notes
| Topic | Guidance |
|---|---|
| Timeouts | Use sensible client timeouts and rely on the callback or status query for final results. |
| Duplicates | Treat transactionId and requestId as stable identifiers and handle duplicate callbacks safely. |
| References | Use a unique business reference for every payment request. |
| MSISDN format | International format with country code, e.g. 2557XXXXXXXX. |
| Clock sync | Keep your servers synchronised to a reliable time source so X-Timestamp passes validation. |
| Environments | Use separate credentials and callback endpoints for UAT and production. |
Ready to build?
Start in the sandbox. Go live when you’re ready.