Skip to main content

Mobile Money

The Mobile Money API allows merchants to initiate customer payments using Tanzania’s leading mobile money providers through a single integration. Supported networks include:
  • M-Pesa
  • Airtel Money
  • Mixx by Yas
  • HaloPesa
  • EzyPesa
  • TTCL Pesa
SplashPay automatically routes the payment request to the appropriate provider based on the customer’s mobile number.

Endpoint

POST /payments/mobile-money

Base URLs

https://sandbox-api.splashpay.co.tz/api/v1
Use this environment for development and testing.

Request Body

FieldTypeRequiredDescription
amountnumberYesPayment amount
currencystringYesCurrency code. Must be TZS.
referencestringYesUnique merchant reference
phonestringYesCustomer phone number in international format
customer_namestringYesCustomer full name
customer_emailstringYesCustomer email address
metadataobjectNoAdditional merchant data

Example Request

curl --request POST \
  --url https://api.splashpay.co.tz/api/v1/payments/mobile-money \
  --header "Content-Type: application/json" \
  --header "X-API-KEY: pk_live_xxxxxxxxxxxxx" \
  --header "X-API-SECRET: sk_live_xxxxxxxxxxxxx" \
  --header "Idempotency-Key: UniqueKey123" \
  --data '{
    "amount": 1000,
    "currency": "TZS",
    "reference": "INV-1234`",
    "phone": "255712345678",
    "customer_name": "John Doe",
    "customer_email": "john.doe@example.com"
  }'

Successful Response

If the request is accepted successfully, SplashPay returns a 200 OK response with the payment details.
{
  "status": "success",
  "code": "PAYMENT_INITIATED",
  "message": "Payment initiated",
  "data": {
    "merchant_id": 2,
    "customer_name": "John Doe",
    "customer_email": "john.doe@example.com",
    "customer_phone": "255712345678",
    "reference": "INV-1234",
    "amount": "1000.00",
    "fee": 15.00,
    "net_amount": 985.00,
    "currency": "TZS",
    "source": "api",
    "payment_method": "mobile_money",
    "provider": "selcom",
    "provider_reference": "S20618089300",
    "status": "pending",
    "metadata": null,
    "created_at": "2026-07-03T10:28:57Z",
    "processing_at": "2026-07-03T13:28:57Z"
  },
  "meta": [],
  "request_id": "85323840-963b-4464-897f-12613975b8e3"
}

Response Fields

FieldTypeDescription
statusstringIndicates whether the API request was successful.
codestringMachine-readable response code.
messagestringHuman-readable response message.
data.merchant_idintegerUnique merchant identifier.
data.customer_namestringCustomer’s full name.
data.customer_emailstringCustomer’s email address.
data.customer_phonestringCustomer’s phone number in international format.
data.referencestringMerchant’s unique payment reference.
data.amountdecimalPayment amount requested.
data.feedecimalSplashPay processing fee.
data.net_amountdecimalAmount after deducting the processing fee.
data.currencystringTransaction currency (TZS).
data.sourcestringSource of the transaction (e.g. api).
data.payment_methodstringPayment method used to initiate the transaction.
data.providerstringPayment service provider handling the transaction.
data.provider_referencestringProvider’s unique transaction reference.
data.statusstringCurrent transaction status.
data.metadataobject | nullAdditional merchant-defined metadata.
data.created_atstringTimestamp when the transaction was created (ISO-8601).
data.processing_atstring | nullTimestamp when processing began.
metaarrayAdditional response metadata. Reserved for future use.
request_idstringUnique request identifier for troubleshooting and support.
A successful initiation does not mean the customer has completed payment. The initial transaction status is typically pending. You should wait for a webhook notification or query the Payment Status endpoint to determine the final payment outcome.

Payment Status

StatusDescription
pendingWaiting for customer confirmation
processingPayment is being processed
successPayment completed successfully
failedPayment failed
cancelledCustomer cancelled payment
expiredPayment expired

Sample Webhook Payload

When a payment reaches a final state, SplashPay sends an HTTP POST request to your configured webhook endpoint.
{
  "event": "payment.success",
  "created_at": "2026-06-24T09:59:24.430757Z",
  "data": {
    "reference": "INV-1234",
    "amount": "1000.00",
    "currency": "TZS",
    "status": "success",
    "customer_name": "John Doe",
    "customer_email": "john.doe@example.com",
    "customer_phone": "255712345678",
    "channel": "TIGOPESATZ",
    "provider_reference": "1769142083",
    "metadata": null
  }
}

Webhook Fields

FieldTypeDescription
eventstringEvent type sent by SplashPay.
created_atstringISO-8601 timestamp when the webhook was generated.
data.referencestringMerchant payment reference.
data.amountdecimalPayment amount.
data.currencystringTransaction currency (TZS).
data.statusstringFinal payment status.
data.customer_namestringCustomer’s full name.
data.customer_emailstringCustomer’s email address.
data.customer_phonestringCustomer’s phone number.
data.channelstringProvider channel or network used to process the payment.
data.provider_referencestringProvider transaction reference.
data.metadataobject | nullAdditional merchant-defined metadata.

Supported Events

SplashPay currently sends the following payment events:
EventDescription
payment.successPayment completed successfully.
payment.failedPayment failed.
payment.cancelledPayment was cancelled by the customer or provider.
payment.expiredPayment request expired before completion.
Webhook notifications may be delivered more than once. Your webhook endpoint should be idempotent by checking the payment reference before processing the event.
Always verify the webhook signature before processing the payload and return an HTTP 200 OK response after successful processing to prevent unnecessary retries.

Error Responses

Invalid Request

{
    "success": false,
    "code": "INVALID_REQUEST",
    "message": "The request payload is invalid."
}

Invalid API Credentials

{
    "success": false,
    "code": "UNAUTHORIZED",
    "message": "Invalid API credentials."
}

Duplicate Request

{
    "success": false,
    "code": "DUPLICATE_REQUEST",
    "message": "A request with this Idempotency-Key has already been processed."
}

Best Practices

1

Generate a unique reference

Every payment should have a unique merchant reference.
2

Use an Idempotency Key

Reuse the same Idempotency-Key only when retrying the same request.
3

Handle Webhooks

Always update your payment status using webhook notifications instead of relying only on the synchronous API response.
4

Store the SplashPay Reference

Persist the payment reference returned by SplashPay for reconciliation and support.

Next Steps

  • Learn how to check a payment status.
  • Configure Webhooks.