Payments API

One API for all your payments

Collect from anywhere. Pay anyone. One integration for payments at home and across borders.

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.

POST/oauth/token

Make your first call

Collect from or pay out to a wallet. The result comes to your callback.

POST/payments/collections/push

Endpoints

Pick one to see a sample. Base URL: https://{BASE_URL}/api/v1

POST/oauth/token

Get 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.

HTTP
POST /oauth/token
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials&client_id={clientId}&client_secret={clientSecret}

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.

Callback payload
JSON
{
  "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"
  }
}
Your acknowledgement
HTTP
HTTP/1.1 200 OK
Content-Type: application/json

{ "status": "RECEIVED", "message": "Callback accepted" }
Callback headers
HeaderDescription
X-Callback-IdUnique callback delivery identifier.
X-Callback-TimestampCallback creation timestamp.
X-Callback-Content-SHA256Optional. Base64 SHA-256 hash of the raw body.
X-Callback-SignatureOptional. Base64 HMAC-SHA256 using your callback secret.
If your endpoint does not return HTTP 200 in time, or returns a non-2xx response, retries are scheduled. Failed deliveries are visible in the callback logs.

Reference

Open what you need.

How a payment flows

Collect (C2B)

  1. You send a collection push request
  2. Gateway validates and routes it
  3. Acknowledgement is returned
  4. Customer approves or rejects on their phone
  5. Provider returns the final result
  6. Success: collection wallet credited
  7. Your callback is delivered

Pay out (B2C)

  1. You send a disbursement request
  2. Gateway authenticates and validates it
  3. Funds are reserved in the provider disbursement wallet
  4. Request is routed and acknowledged
  5. Provider returns the final result
  6. Success: ledger posted · Failure: reservation released
  7. Your callback is delivered
Base URL, API style and response envelope
Production & UAT
https://{BASE_URL}/api/v1

Your production and UAT hosts are shared during onboarding.

StandardRule
ProtocolHTTPS only
Payload formatJSON, UTF-8
AuthenticationBearer access token (OAuth2 client credentials). Optional HMAC request signature where enabled.
IdempotencyRequired for payment creation endpoints
Date and timeISO-8601 with timezone in responses
AmountsDecimal numbers without thousands separators

Every response uses the same envelope, so you can handle success and errors in one place.

Response envelope
{
  "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
HeaderDescription
AuthorizationBearer access token from the token endpoint.
X-Client-IdClient identifier issued during onboarding.
X-Request-IdUnique request identifier.
X-Idempotency-KeyUnique idempotency key for the request.
X-Timestamp10-digit Unix epoch timestamp in seconds, e.g. 1782275551.
X-NonceUnique random value to prevent replay attacks.
X-Content-SHA256SHA-256 hash of the raw request body, Base64-encoded.
X-SignatureOptional. 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
FieldMeaning
requestIdMerchant-generated unique request reference for traceability.
merchantIdMerchant identifier issued during onboarding.
transactionIdGateway-generated, immutable transaction identifier.
providerCodeTarget network wallet, e.g. YAS or VODACOM. Only codes enabled for your merchant account are accepted.
referenceYour business reference: invoice, order or payout number.
amount / currencyTransaction amount; currency is normally TZS.
msisdnCustomer mobile number in international format (2557XXXXXXXX).
callbackUrlYour HTTPS endpoint for the final asynchronous result.
Transaction states

Every payment moves through a normalised set of states, the same for every network.

RECEIVED

Accepted at the API boundary.

AUTHENTICATED

Security and client validation completed.

VALIDATED

Business rules and payload validation completed.

FUNDS_RESERVED

B2C only — amount reserved from the disbursement wallet.

ROUTED

Provider accepted the request for processing.

PENDING_FINAL

Final provider outcome still pending.

SUCCESS

Completed and ledger posting applied.

FAILED

Failed; any reservation is released.

REVERSED

Successful 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.

For asynchronous providers, an acknowledgement does not by itself mean final success. Funds are posted only after a final success outcome is recorded.
Error codes

Failed requests return "status": "FAILED" with one of these codes in the standard envelope.

CodeMeaning
PGW-0000Request processed successfully
PGW-1001Invalid client credentials
PGW-1002Unsupported or disabled providerCode for the merchant
PGW-1003Invalid MSISDN format
PGW-1004Duplicate requestId or idempotency conflict
PGW-1005Amount exceeds configured merchant limits
PGW-1006Insufficient balance in the provider disbursement wallet
PGW-1007Authentication failed
PGW-1008Signature validation failed
PGW-1009IP address is not whitelisted
PGW-1010Transaction not found
PGW-1099General processing error
Operational notes
TopicGuidance
TimeoutsUse sensible client timeouts and rely on the callback or status query for final results.
DuplicatesTreat transactionId and requestId as stable identifiers and handle duplicate callbacks safely.
ReferencesUse a unique business reference for every payment request.
MSISDN formatInternational format with country code, e.g. 2557XXXXXXXX.
Clock syncKeep your servers synchronised to a reliable time source so X-Timestamp passes validation.
EnvironmentsUse separate credentials and callback endpoints for UAT and production.

Ready to build?

Start in the sandbox. Go live when you’re ready.

Get sandbox access
Sandbox

Get sandbox access

Tell us about you and what you’re building. We’ll set you up with test credentials to start building.

What do you want to build?
Which networks?