# Authentication Source: https://docs.splashpay.co.tz/authentication Securely authenticate requests to SplashPay APIs. # Authentication All SplashPay API requests require authentication using API credentials. *** ## API Credentials Generate API credentials from: **Merchant Portal → Developers → API Keys** Used in Sandbox environment. ```http theme={null} X-API-KEY: pk_test_xxxxxxxxxxxxx X-API-SECRET: sk_test_xxxxxxxxxxxxx ``` Used in Production environment. ```http theme={null} X-API-KEY: pk_live_xxxxxxxxxxxxx X-API-SECRET: sk_live_xxxxxxxxxxxxx ``` *** ## Required Headers ```http theme={null} X-API-KEY: pk_live_xxxxxxxxxxxxx X-API-SECRET: sk_live_xxxxxxxxxxxxx Idempotency-Key: Unique-Request-ID Content-Type: application/json Accept: application/json ``` *** ## Example Request ```bash theme={null} curl --request GET \ --url https://api.splashpay.co.tz/api/v1/payments/mobile-money \ --header "X-API-KEY: pk_live_xxxxxxxxx" \ --header "X-API-SECRET: sk_live_xxxxxxxxx" \ --header "Idempotency-Key: Unique-Request-ID" ``` ```php theme={null} $response = Http::withHeaders([ 'X-API-KEY' => env('SPLASHPAY_KEY'), 'X-API-SECRET' => env('SPLASHPAY_SECRET'), 'Idempotency-Key' => 'Unique-Request-ID', ])->get( 'https://api.splashpay.co.tz/api/v1/payments/mobile-money' ); ``` ```javascript theme={null} const response = await fetch( 'https://api.splashpay.co.tz/api/v1/payments/mobile-money', { headers: { 'X-API-KEY': process.env.SPLASHPAY_KEY, 'X-API-SECRET': process.env.SPLASHPAY_SECRET, 'Idempotency-Key': 'Unique-Request-ID', }, } ); ``` ```python theme={null} import requests response = requests.get( 'https://api.splashpay.co.tz/api/v1/payments/mobile-money', headers={ 'X-API-KEY': os.getenv('SPLASHPAY_KEY'), 'X-API-SECRET': os.getenv('SPLASHPAY_SECRET'), 'Idempotency-Key': 'Unique-Request-ID', } ) ``` ```dart Dart theme={null} import 'dart:convert'; import 'package:http/http.dart' as http; import 'package:uuid/uuid.dart'; Future initiateMobileMoneyPayment() async { final response = await http.post( Uri.parse( 'https://api.splashpay.co.tz/api/v1/payments/mobile-money', ), headers: { 'Content-Type': 'application/json', 'X-API-KEY': const String.fromEnvironment('SPLASHPAY_KEY'), 'X-API-SECRET': const String.fromEnvironment('SPLASHPAY_SECRET'), 'Idempotency-Key': const Uuid().v4(), }, ); } ``` *** ## Authentication Errors | Status | Description | | ------ | ----------------------- | | 401 | Invalid API credentials | | 403 | Access denied | | 429 | Too many requests | *** Never expose your API Secret in frontend applications, mobile apps, or public repositories. *** ## Best Practices Store API credentials in environment variables. Rotate API secrets regularly. Use Sandbox credentials during development. Keep API secrets private. *** ## Next Steps Create payment requests and collect payments. Receive transaction updates automatically. # Available Balance Source: https://docs.splashpay.co.tz/collections/available-balance Retrieve your current merchant wallet balance, including available and locked funds. # Available Balance The Available Balance API allows you to retrieve the current wallet balance for your authenticated merchant account. It returns the total balance, available balance, locked balance, and wallet currency. This endpoint is useful before initiating disbursements, payouts, or reconciliation. > **Tip** > Always check your available balance before initiating a disbursement or payout to avoid insufficient balance errors. *** ## Endpoint ```http theme={null} GET /merchant-balance ``` *** ## Authentication Every request must include your API credentials. | Header | Required | Description | | ------------ | :------: | ------------------- | | X-API-KEY | ✅ | Merchant API Key | | X-API-SECRET | ✅ | Merchant API Secret | *** ## Example Request ```bash theme={null} curl --request GET \ --url https://api.splashpay.co.tz/api/v1/merchant-balance \ --header "X-API-KEY: pk_live_xxxxxxxxx" \ --header "X-API-SECRET: sk_live_xxxxxxxxx" ``` ```javascript theme={null} const response = await fetch( "https://api.splashpay.co.tz/api/v1/merchant-balance", { method: "GET", headers: { "X-API-KEY": process.env.SPLASHPAY_KEY, "X-API-SECRET": process.env.SPLASHPAY_SECRET, }, } ); const data = await response.json(); ``` ```python theme={null} import requests response = requests.get( "https://api.splashpay.co.tz/api/v1/merchant-balance", headers={ "X-API-KEY": "pk_live_xxxxxxxxx", "X-API-SECRET": "sk_live_xxxxxxxxx", }, ) print(response.json()) ``` ```php theme={null} $client = new \GuzzleHttp\Client(); $response = $client->get( 'https://api.splashpay.co.tz/api/v1/merchant-balance', [ 'headers' => [ 'X-API-KEY' => 'pk_live_xxxxxxxxx', 'X-API-SECRET' => 'sk_live_xxxxxxxxx', ], ] ); echo $response->getBody(); ``` *** ## Example Response ```json theme={null} { "status": "success", "code": "SUCCESS", "message": "Success", "data": { "balance": 28394, "available_balance": 28394, "locked_balance": 0, "currency": "TZS" }, "meta": [], "request_id": "a17ec7ed-2ab3-406c-a811-4a6c730ebd09" } ``` *** ## Response Fields | Field | Type | Description | | ------------------ | ------ | -------------------------------------------------- | | balance | number | Total wallet balance. | | available\_balance | number | Funds currently available for transactions. | | locked\_balance | number | Funds temporarily reserved or unavailable for use. | | currency | string | Wallet currency. Currently `TZS`. | *** ## Error Response ```json theme={null} { "status": "error", "code": "UNAUTHORIZED", "message": "Unauthenticated." } ``` ```json theme={null} { "status": "error", "code": "INSUFFICIENT_PERMISSIONS", "message": "Access denied." } ``` *** ## # Cancel Payment Source: https://docs.splashpay.co.tz/collections/cancel Cancel a pending payment before the customer completes the payment. # Cancel Payment The Cancel Payment API allows you to cancel a payment that is still awaiting customer action. A payment can only be cancelled while it is in a **pending** state. Once a payment has been completed, failed, expired, or previously cancelled, it can no longer be cancelled. > **Note** > Cancellation only prevents the customer from completing the payment. If the payment has already been processed successfully, use refunds or reversals where applicable. *** ## Endpoint ```http theme={null} POST /payments/cancel ``` *** ## Authentication Every request must include your API credentials. | Header | Required | Description | | ------------ | :------: | ------------------- | | X-API-KEY | ✅ | Merchant API Key | | X-API-SECRET | ✅ | Merchant API Secret | | Content-Type | ✅ | application/json | *** ## Example Request ```bash theme={null} curl --request POST \ --url https://api.splashpay.co.tz/api/v1/payments/cancel \ --header "Content-Type: application/json" \ --header "X-API-KEY: pk_live_xxxxxxxxx" \ --header "X-API-SECRET: sk_live_xxxxxxxxx" \ --data '{ "reference": "CIR-6723dg" }' ``` ```javascript theme={null} const response = await fetch( "https://api.splashpay.co.tz/api/v1/payments/cancel", { method: "POST", headers: { "Content-Type": "application/json", "X-API-KEY": process.env.SPLASHPAY_KEY, "X-API-SECRET": process.env.SPLASHPAY_SECRET, }, body: JSON.stringify({ reference: "CIR-6723dg", }), } ); const data = await response.json(); ``` ```python theme={null} import requests response = requests.post( "https://api.splashpay.co.tz/api/v1/payments/cancel", headers={ "Content-Type": "application/json", "X-API-KEY": "pk_live_xxxxxxxxx", "X-API-SECRET": "sk_live_xxxxxxxxx", }, json={ "reference": "CIR-6723dg" } ) print(response.json()) ``` ```php theme={null} $client = new \GuzzleHttp\Client(); $response = $client->post( 'https://api.splashpay.co.tz/api/v1/payments/cancel', [ 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => 'pk_live_xxxxxxxxx', 'X-API-SECRET' => 'sk_live_xxxxxxxxx', ], 'json' => [ 'reference' => 'CIR-6723dg', ], ] ); echo $response->getBody(); ``` *** ## Request Body | Field | Type | Required | Description | | --------- | ------ | :------: | ------------------------------------------------------------------------ | | reference | string | ✅ | Unique merchant payment reference returned when the payment was created. | *** ## Example Response ```json theme={null} { "status": "success", "code": "PAYMENT_CANCELLED", "message": "Payment cancelled successfully", "data": { "reference": "CIR-6723e8hs6", "provider_reference": "S20629971309", "status": "cancelled", "cancelled_at": "2026-07-12 11:01:56" }, "meta": [], "request_id": "05ae240d-f77f-4cff-a8c5-b4bc09e92b32" } ``` *** ## Error Responses ### Payment Already Completed ```json theme={null} { "status": "error", "code": "PAYMENT_NOT_CANCELLABLE", "message": "Payment cannot be cancelled because it has already been completed." } ``` ### Payment Expired ```json theme={null} { "status": "error", "code": "PAYMENT_NOT_CANCELLABLE", "message": "Payment cannot be cancelled because it has expired." } ``` ### Payment Not Found ```json theme={null} { "status": "error", "code": "PAYMENT_NOT_FOUND", "message": "Payment not found." } ``` *** ## Cancellable Statuses | Payment Status | Can Cancel | | -------------- | :----------------------------------------: | | `pending` | ✅ | | `processing` | ✅ *(if supported by the payment provider)* | | `success` | ❌ | | `failed` | ❌ | | `expired` | ❌ | | `cancelled` | ❌ | *** ## Webhook Notification If your merchant account has a webhook endpoint configured, SplashPay sends a **`payment.cancelled`** event after the payment has been successfully cancelled. The webhook is dispatched only after the cancellation has been confirmed and the transaction has been updated in SplashPay. ### Event ```text theme={null} payment.cancelled ``` ### Sample Webhook ```json theme={null} { "event": "payment.cancelled", "created_at": "2026-07-12T11:01:56Z", "data": { "reference": "CIR-6723e8hs6", "provider_reference": "S20629971309", "amount": "1000.00", "currency": "TZS", "status": "cancelled", "payment_method": "tanqr", "provider": "selcom", "channel": "tanqr", "network": "SELCOMTANQR", "cancelled_at": "2026-07-12T11:01:56Z" } } ``` ## Best Practices Call the Cancel Payment endpoint before the customer completes the payment. Once payment is successful, it cannot be cancelled. Always store the merchant reference returned when creating the payment. It is required to cancel or check the payment status. After cancelling a payment, you can use the **Check Payment Status** endpoint to confirm that the payment status is `cancelled`. If your application receives webhook events, update your local payment record whenever a `payment.cancelled` event is received. *** ## Related Guides Retrieve the latest status of a payment. Receive real-time payment events. Accept Mobile Money payments. Accept payments using Dynamic TanQR. # Card Payments Source: https://docs.splashpay.co.tz/collections/card Accept Visa and Mastercard payments securely using the SplashPay Card Payments API. # Card Payments The Card Payments API enables merchants to securely accept payments from customers using **Visa**, **Mastercard**, and other supported bank cards. SplashPay provides a hosted payment page that securely captures card details and processes payments through a PCI DSS compliant payment gateway. Customers are redirected to a secure payment page hosted by SplashPay's payment provider. Card details are never transmitted through your servers. *** ## Endpoint ```http theme={null} POST /payments/card ``` *** ## Base URL ```text theme={null} https://api.splashpay.co.tz/api/v1 ``` *** # Request Body | Field | Type | Required | Description | | ------------------ | ------ | :------: | --------------------------------------------------------- | | reference | string | Yes | Unique merchant payment reference | | buyer\_name | string | Yes | Customer full name | | buyer\_email | string | Yes | Customer email address | | buyer\_phone | string | Yes | Customer phone number | | amount | number | Yes | Payment amount | | currency | string | Yes | Currency (`TZS`) | | redirect\_url | string | Yes | URL where customer is redirected after successful payment | | cancel\_url | string | Yes | URL where customer is redirected if payment is cancelled | | billing\_firstname | string | Yes | Billing first name | | billing\_lastname | string | Yes | Billing last name | | billing\_address | string | Yes | Billing address | | billing\_city | string | Yes | Billing city | | billing\_state | string | Yes | Billing state | | billing\_postcode | string | Yes | Billing postcode | | billing\_country | string | Yes | ISO 3166-1 Alpha-2 country code | | billing\_phone | string | Yes | Billing phone number | *** ## Example Request ```bash cURL theme={null} curl --request POST \ --url https://api.splashpay.co.tz/api/v1/payments/card \ --header "Content-Type: application/json" \ --header "X-API-KEY: pk_live_xxxxxxxxxxxxx" \ --header "X-API-SECRET: sk_live_xxxxxxxxxxxxx" \ --header "Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000" \ --data '{ "reference":"CIR-6723sg", "buyer_email":"john.doe@example.com", "buyer_name":"John Doe", "buyer_phone":"255744123456", "amount":1000, "currency":"TZS", "redirect_url":"https://example.com", "cancel_url":"https://example.com", "billing_firstname":"John", "billing_lastname":"Doe", "billing_address":"123 Main St", "billing_city":"Dar es Salaam", "billing_state":"Tanzania", "billing_postcode":"67116", "billing_country":"TZ", "billing_phone":"255744123456" }' ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://api.splashpay.co.tz/api/v1/payments/card', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-KEY': process.env.SPLASHPAY_KEY, 'X-API-SECRET': process.env.SPLASHPAY_SECRET, 'Idempotency-Key': crypto.randomUUID(), }, body: JSON.stringify({ reference: 'CIR-6723sg', buyer_email: 'john.doe@example.com', buyer_name: 'John Doe', buyer_phone: '255744123456', amount: 1000, currency: 'TZS', redirect_url: 'https://example.com', cancel_url: 'https://example.com', billing_firstname: 'John', billing_lastname: 'Doe', billing_address: '123 Main St', billing_city: 'Dar es Salaam', billing_state: 'Tanzania', billing_postcode: '67116', billing_country: 'TZ', billing_phone: '255744123456' }), } ); const payment = await response.json(); ``` ```python Python theme={null} import uuid import requests response = requests.post( "https://api.splashpay.co.tz/api/v1/payments/card", headers={ "Content-Type": "application/json", "X-API-KEY": "YOUR_API_KEY", "X-API-SECRET": "YOUR_API_SECRET", "Idempotency-Key": str(uuid.uuid4()) }, json={ "reference":"CIR-6723sg", "buyer_email":"john.doe@example.com", "buyer_name":"John Doe", "buyer_phone":"255744123456", "amount":1000, "currency":"TZS", "redirect_url":"https://example.com", "cancel_url":"https://example.com", "billing_firstname":"John", "billing_lastname":"Doe", "billing_address":"123 Main St", "billing_city":"Dar es Salaam", "billing_state":"Tanzania", "billing_postcode":"67116", "billing_country":"TZ", "billing_phone":"255744123456" } ) print(response.json()) ``` *** # Successful Response ```json theme={null} { "status": "success", "code": "PAYMENT_INITIATED", "message": "Payment initiated", "data": { "customer_name": "John Doe", "customer_email": "john.doe@example.com", "customer_phone": "255744123456", "reference": "CIR-6723sg", "amount": "1000.00", "fee": 29, "net_amount": 971, "currency": "TZS", "payment_method": "card", "provider": "selcom", "provider_reference": "S20618123473", "redirect_url": "https://example.com", "cancel_url": "https://example.com", "payment_gateway_url": "https://...", "status": "pending", "metadata": null, "created_at": "2026-07-03T11:03:09Z", "processing_at": "2026-07-03T14:03:09Z" }, "meta": [], "request_id": "ee0cc9bf-9298-448e-a757-8c399e8c2f11" } ``` *** # Redirect Customer After receiving the response, redirect your customer to the URL provided in the `payment_gateway_url` field. > **Note** > > The `payment_gateway_url` may be Base64 encoded. Decode it before redirecting the customer if required by your integration. Example ```javascript theme={null} window.location.href = payment.data.payment_gateway_url; ``` *** # Payment Status | Status | Description | | ---------- | --------------------------------------------- | | pending | Waiting for customer to complete card payment | | processing | Payment is being processed | | success | Payment completed successfully | | failed | Payment failed | | cancelled | Customer cancelled the payment | | expired | Payment session expired | *** # Webhook Payload ```json theme={null} { "event": "payment.success", "created_at": "2026-07-03T14:10:12Z", "data": { "reference": "CIR-6723sg", "amount": "1000.00", "currency": "TZS", "status": "success", "customer_name": "John Doe", "customer_email": "john.doe@example.com", "customer_phone": "255744123456", "channel": "CARD", "provider_reference": "S20618123473", "metadata": null } } ``` *** # Error Responses ## Invalid Request ```json theme={null} { "status": "error", "code": "INVALID_REQUEST", "message": "The request payload is invalid." } ``` ## Authentication Failed ```json theme={null} { "status": "error", "code": "UNAUTHORIZED", "message": "Invalid API credentials." } ``` ## Duplicate Request ```json theme={null} { "status": "error", "code": "DUPLICATE_REQUEST", "message": "A request with this Idempotency-Key has already been processed." } ``` *** # Best Practices Always provide secure HTTPS URLs for `redirect_url` and `cancel_url`. Every payment request should use a unique merchant reference. Reuse the same `Idempotency-Key` only when retrying the same request. Do not rely solely on the customer's browser redirect. Update payment status using webhook notifications. Store both the merchant reference and the provider reference for reconciliation and customer support. # Mobile Money Source: https://docs.splashpay.co.tz/collections/mobile-money Accept Mobile Money payments from all major Tanzanian mobile networks using the SplashPay Collections API. # 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 ```http theme={null} POST /payments/mobile-money ``` *** ## Base URLs ```text theme={null} https://api.splashpay.co.tz/api/v1 ``` *** # Request Body | Field | Type | Required | Description | | --------------- | ------ | :------: | --------------------------------------------- | | amount | number | Yes | Payment amount | | currency | string | Yes | Currency code. Must be `TZS`. | | reference | string | Yes | Unique merchant reference | | phone | string | Yes | Customer phone number in international format | | customer\_name | string | Yes | Customer full name | | customer\_email | string | Yes | Customer email address | | metadata | object | No | Additional merchant data | *** ## Example Request ```bash cURL theme={null} 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" }' ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://api.splashpay.co.tz/api/v1/payments/mobile-money', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-KEY': process.env.SPLASHPAY_KEY, 'X-API-SECRET': process.env.SPLASHPAY_SECRET, 'Idempotency-Key': crypto.randomUUID(), }, body: JSON.stringify({ amount: 1000, currency: 'TZS', reference: 'INV-1234', phone: '255712345678', customer_name: 'John Doe', customer_email: 'john.doe@example.com', }), } ); const payment = await response.json(); console.log(payment); ``` ```python Python theme={null} import uuid import requests response = requests.post( "https://api.splashpay.co.tz/api/v1/payments/mobile-money", headers={ "Content-Type": "application/json", "X-API-KEY": "YOUR_API_KEY", "X-API-SECRET": "YOUR_API_SECRET", "Idempotency-Key": str(uuid.uuid4()) }, json={ "amount": 1000, "currency": "TZS", "reference": "INV-1234", "phone": "255712345678", "customer_name": "John Doe", "customer_email": "john.doe@example.com" } ) print(response.status_code) print(response.json()) ``` ```php PHP theme={null} use Illuminate\Support\Facades\Http; use Illuminate\Support\Str; $response = Http::withHeaders([ 'X-API-KEY' => env('SPLASHPAY_KEY'), 'X-API-SECRET' => env('SPLASHPAY_SECRET'), 'Idempotency-Key' => (string) Str::uuid(), ])->post( 'https://api.splashpay.co.tz/api/v1/payments/mobile-money', [ 'amount' => 1000, 'currency' => 'TZS', 'reference' => 'INV-1234', 'phone' => '255712345678', 'customer_name' => 'John Doe', 'customer_email' => 'john.doe@example.com', ] ); return $response->json(); ``` ```dart Dart theme={null} import 'dart:convert'; import 'package:http/http.dart' as http; import 'package:uuid/uuid.dart'; Future initiatePayment() async { final response = await http.post( Uri.parse( 'https://api.splashpay.co.tz/api/v1/payments/mobile-money', ), headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY', 'X-API-SECRET': 'YOUR_API_SECRET', 'Idempotency-Key': const Uuid().v4(), }, body: jsonEncode({ 'amount': 1000, 'currency': 'TZS', 'reference': 'INV-1234', 'phone': '255712345678', 'customer_name': 'John Doe', 'customer_email': 'john.doe@example.com', }), ); print(response.body); } ``` *** ## Successful Response If the request is accepted successfully, SplashPay returns a `200 OK` response with the payment details. ```json theme={null} { "status": "success", "code": "PAYMENT_INITIATED", "message": "Payment initiated", "data": { "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", "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 | Field | Type | Description | | ------------------------- | -------------- | ---------------------------------------------------------- | | `status` | string | Indicates whether the API request was successful. | | `code` | string | Machine-readable response code. | | `message` | string | Human-readable response message. | | `data.customer_name` | string | Customer's full name. | | `data.customer_email` | string | Customer's email address. | | `data.customer_phone` | string | Customer's phone number in international format. | | `data.reference` | string | Merchant's unique payment reference. | | `data.amount` | decimal | Payment amount requested. | | `data.fee` | decimal | SplashPay processing fee. | | `data.net_amount` | decimal | Amount after deducting the processing fee. | | `data.currency` | string | Transaction currency (`TZS`). | | `data.payment_method` | string | Payment method used to initiate the transaction. | | `data.provider` | string | Payment service provider handling the transaction. | | `data.provider_reference` | string | Provider's unique transaction reference. | | `data.status` | string | Current transaction status. | | `data.metadata` | object \| null | Additional merchant-defined metadata. | | `data.created_at` | string | Timestamp when the transaction was created (ISO-8601). | | `data.processing_at` | string \| null | Timestamp when processing began. | | `meta` | array | Additional response metadata. Reserved for future use. | | `request_id` | string | Unique 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 | Status | Description | | ---------- | --------------------------------- | | pending | Waiting for customer confirmation | | processing | Payment is being processed | | success | Payment completed successfully | | failed | Payment failed | | cancelled | Customer cancelled payment | | expired | Payment expired | *** ## Sample Webhook Payload When a payment reaches a final state, SplashPay sends an HTTP `POST` request to your configured webhook endpoint. ```json theme={null} { "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 | Field | Type | Description | | ------------------------- | -------------- | -------------------------------------------------------- | | `event` | string | Event type sent by SplashPay. | | `created_at` | string | ISO-8601 timestamp when the webhook was generated. | | `data.reference` | string | Merchant payment reference. | | `data.amount` | decimal | Payment amount. | | `data.currency` | string | Transaction currency (`TZS`). | | `data.status` | string | Final payment status. | | `data.customer_name` | string | Customer's full name. | | `data.customer_email` | string | Customer's email address. | | `data.customer_phone` | string | Customer's phone number. | | `data.channel` | string | Provider channel or network used to process the payment. | | `data.provider_reference` | string | Provider transaction reference. | | `data.metadata` | object \| null | Additional merchant-defined metadata. | *** ## Supported Events SplashPay currently sends the following payment events: | Event | Description | | ------------------- | -------------------------------------------------- | | `payment.success` | Payment completed successfully. | | `payment.failed` | Payment failed. | | `payment.cancelled` | Payment was cancelled by the customer or provider. | | `payment.expired` | Payment 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 ```json theme={null} { "success": false, "code": "INVALID_REQUEST", "message": "The request payload is invalid." } ``` ## Invalid API Credentials ```json theme={null} { "success": false, "code": "UNAUTHORIZED", "message": "Invalid API credentials." } ``` ## Duplicate Request ```json theme={null} { "success": false, "code": "DUPLICATE_REQUEST", "message": "A request with this Idempotency-Key has already been processed." } ``` *** # Best Practices Every payment should have a unique merchant reference. Reuse the same Idempotency-Key only when retrying the same request. Always update your payment status using webhook notifications instead of relying only on the synchronous API response. Persist the payment reference returned by SplashPay for reconciliation and support. *** # Selcom Pesa Source: https://docs.splashpay.co.tz/collections/selcompesa Collect payments using Selcom Pesa Push. # Selcom Pesa Use this endpoint to initiate an **in-app Selcom Pesa** payment. A push notification is sent to the customer's device where the **Selcom Mobile App** is installed. The customer opens the notification, reviews the payment request, and authorizes the transaction within the app. ## Endpoint ```http theme={null} POST /payments/selcompesa ``` ## Authentication Include your API key in the request headers. ```http theme={null} Authorization: Bearer YOUR_API_KEY Content-Type: application/json Accept: application/json ``` ## Request Body | Field | Type | Required | Description | | --------------- | ------ | -------- | ------------------------------------------------------------------- | | amount | number | Yes | Amount to collect. | | currency | string | Yes | Currency code. Currently `TZS`. | | reference | string | Yes | Unique merchant transaction reference. | | phone | string | Yes | Selcom Pesa Mobile Number (e.g. `255787123123`). | | customer\_name | string | Yes | Customer full name. | | customer\_email | string | Yes | Customer email address. | | metadata | object | No | Additional transaction metadata (e.g., order details, customer ID). | ## Example Request ```bash cURL theme={null} curl --request POST \ --url https://api.splashpay.co.tz/api/v1/payments/selcompesa \ --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": 200, "currency": "TZS", "reference": "INV-3809993j", "phone": "255787123123", "customer_name": "John Doe", "customer_email": "johndoe@gmail.com" }' ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://api.splashpay.co.tz/api/v1/payments/selcompesa', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-KEY': process.env.SPLASHPAY_KEY, 'X-API-SECRET': process.env.SPLASHPAY_SECRET, 'Idempotency-Key': crypto.randomUUID(), }, body: JSON.stringify({ amount: 200, currency: 'TZS', reference: 'INV-3809993j', phone: '255787123123', customer_name: 'John Doe', customer_email: 'johndoe@gmail.com', }), } ); const payment = await response.json(); console.log(payment); ``` ```python Python theme={null} import uuid import requests response = requests.post( "https://api.splashpay.co.tz/api/v1/payments/selcompesa", headers={ "Content-Type": "application/json", "X-API-KEY": "YOUR_API_KEY", "X-API-SECRET": "YOUR_API_SECRET", "Idempotency-Key": str(uuid.uuid4()) }, json={ "amount": 200, "currency": "TZS", "reference": "INV-3809993j", "phone": "255787123123", "customer_name": "John Doe", "customer_email": "johndoe@gmail.com" } ) print(response.status_code) print(response.json()) ``` ```php PHP theme={null} use Illuminate\Support\Facades\Http; use Illuminate\Support\Str; $response = Http::withHeaders([ 'X-API-KEY' => env('SPLASHPAY_KEY'), 'X-API-SECRET' => env('SPLASHPAY_SECRET'), 'Idempotency-Key' => (string) Str::uuid(), ])->post( 'https://api.splashpay.co.tz/api/v1/payments/selcompesa', [ 'amount' => 200, 'currency' => 'TZS', 'reference' => 'INV-3809993j', 'phone' => '255787123123', 'customer_name' => 'John Doe', 'customer_email' => 'johndoe@gmail.com', ] ); return $response->json(); ``` ```dart Dart theme={null} import 'dart:convert'; import 'package:http/http.dart' as http; import 'package:uuid/uuid.dart'; Future initiatePayment() async { final response = await http.post( Uri.parse( 'https://api.splashpay.co.tz/api/v1/payments/selcompesa', ), headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY', 'X-API-SECRET': 'YOUR_API_SECRET', 'Idempotency-Key': const Uuid().v4(), }, body: jsonEncode({ 'amount': 200, 'currency': 'TZS', 'reference': 'INV-3809993j', 'phone': '255787123123', 'customer_name': 'John Doe', 'customer_email': 'johndoe@gmail.com', }), ); print(response.body); } ``` ## Successful Response ```json theme={null} { "status": "success", "code": "PAYMENT_INITIATED", "message": "Payment initiated", "data": { "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", "payment_method": "selcompesa", "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" } ``` ## Transaction Status | Status | Description | | ---------- | ---------------------------------------------- | | pending | Payment request has been sent to the customer. | | processing | Payment is being processed. | | success | Payment completed successfully. | | failed | Payment failed. | | cancelled | Customer cancelled the payment request. | | expired | Payment request expired before authorization. | ## Error Response ```json theme={null} { "success": false, "message": "The phone number is invalid.", "errors": { "phone": [ "The phone number must be in international format." ] } } ``` ## Validation Rules | Field | Rules | | --------------- | ----------------------------------------------- | | amount | Required, numeric, greater than 0 | | currency | Required, supported currency (`TZS`) | | reference | Required, unique merchant reference | | phone | Required, international format (`255XXXXXXXXX`) | | customer\_name | Required | | customer\_email | Nullable, valid email address | ## Notes * The `reference` must be unique for every payment request. * Phone numbers must use the international format without the `+` sign. * A payment prompt is sent immediately to the customer's mobile device. * Monitor the transaction status using webhooks or the transaction status endpoint. * Keep your API key secure and never expose it in client-side applications. # Payment Status Source: https://docs.splashpay.co.tz/collections/status Check the latest status of a payment initiated through the SplashPay Collections API. # Payment Status The Payment Status API allows you to retrieve the current status of a payment using the merchant reference. SplashPay first checks the local transaction record. If the payment is still pending, it automatically queries the payment provider to retrieve the latest status and updates the transaction before returning the response. > **Tip** > For real-time payment updates, configure **Webhooks**. The Status API is ideal for reconciliation, manual verification, and fallback scenarios. *** ## Endpoint ```http theme={null} POST /payments/check-status ``` *** ## Authentication Every request must include your API credentials. | Header | Required | Description | | ------------ | :------: | ------------------- | | X-API-KEY | ✅ | Merchant API Key | | X-API-SECRET | ✅ | Merchant API Secret | | Content-Type | ✅ | application/json | *** ## Example Request ```bash theme={null} curl --request POST \ --url https://api.splashpay.co.tz/api/v1/payments/check-status \ --header "Content-Type: application/json" \ --header "X-API-KEY: pk_live_xxxxxxxxx" \ --header "X-API-SECRET: sk_live_xxxxxxxxx" \ --data '{ "reference": "CIR-6723e6ss6" }' ``` ```javascript theme={null} const response = await fetch( "https://api.splashpay.co.tz/api/v1/payments/check-status", { method: "POST", headers: { "Content-Type": "application/json", "X-API-KEY": process.env.SPLASHPAY_KEY, "X-API-SECRET": process.env.SPLASHPAY_SECRET, }, body: JSON.stringify({ reference: "CIR-6723e6ss6", }), } ); const data = await response.json(); ``` ```python theme={null} import requests response = requests.post( "https://api.splashpay.co.tz/api/v1/payments/check-status", headers={ "X-API-KEY": "pk_live_xxxxxxxxx", "X-API-SECRET": "sk_live_xxxxxxxxx", "Content-Type": "application/json", }, json={ "reference": "CIR-6723e6ss6" } ) print(response.json()) ``` ```php theme={null} $client = new \GuzzleHttp\Client(); $response = $client->post( 'https://api.splashpay.co.tz/api/v1/payments/check-status', [ 'headers' => [ 'X-API-KEY' => 'pk_live_xxxxxxxxx', 'X-API-SECRET' => 'sk_live_xxxxxxxxx', 'Content-Type' => 'application/json', ], 'json' => [ 'reference' => 'CIR-6723e6ss6', ], ] ); echo $response->getBody(); ``` *** ## Request Body | Field | Type | Required | Description | | --------- | ------ | :------: | --------------------------------- | | reference | string | ✅ | Unique merchant payment reference | *** ## Example Response ```json theme={null} { "status": "success", "code": "PAYMENT_STATUS_CHECKED", "message": "Payment status checked", "data": { "reference": "CIR-6723e6ss6", "provider_reference": "1782388280", "amount": "1000.00", "currency": "TZS", "status": "success", "provider": "selcom", "channel": "tanqr", "network": "SELCOMTANQR", "created_at": "2026-07-03T14:42:13.000000Z", "processing_at": "2026-07-03T14:42:13Z", "completed_at": null }, "meta": [], "request_id": "f0ee4a32-bc56-49f7-92a5-82f965e8c555" } ``` *** ## Payment Statuses | Status | Description | | ------------ | --------------------------------------------------------- | | `pending` | Payment has been created and is awaiting customer action. | | `processing` | Payment is being processed by the payment provider. | | `success` | Payment completed successfully. | | `failed` | Payment failed. | | `cancelled` | Payment was cancelled. | | `expired` | Payment request expired before completion. | *** ## Error Response ```json theme={null} { "status": "error", "code": "PAYMENT_NOT_FOUND", "message": "Payment not found." } ``` *** ## Best Practices Generate a unique reference for every payment. This reference is used throughout the payment lifecycle. Use webhooks to receive payment updates automatically. The Status API should primarily be used for reconciliation and manual verification. If a payment is still `pending` or `processing`, wait a few seconds before checking again. Save the `provider_reference` returned by SplashPay for reconciliation with the payment provider. *** ## Related Guides Collect payments from Mobile Money wallets. Accept Visa and Mastercard payments. Accept payments using Dynamic TanQR. Receive real-time payment notifications. # Dynamic TANQR Source: https://docs.splashpay.co.tz/collections/tanqr Generate Bank of Tanzania compliant Dynamic TANQR codes for accepting instant payments. # Dynamic TANQR The Dynamic TANQR API enables merchants to generate a unique QR code for every payment transaction. Customers can scan the QR code using any participating banking or mobile banking application that supports the Tanzania National QR (TANQR) standard. Unlike Static QR codes, Dynamic QR codes are generated per transaction and include the payment amount and transaction reference. Generate a unique QR code for every payment and receive real-time payment notifications through webhooks. *** ## Endpoint ```http theme={null} POST /payments/dynamic-qr ``` *** ## Base URL ```text theme={null} https://api.splashpay.co.tz/api/v1 ``` *** # Request Body | Field | Type | Required | Description | | ------------------ | ------ | :------: | ------------------------- | | reference | string | Yes | Unique merchant reference | | buyer\_name | string | Yes | Customer full name | | buyer\_email | string | Yes | Customer email address | | buyer\_phone | string | Yes | Customer phone number | | amount | number | Yes | Payment amount | | currency | string | Yes | Currency (`TZS`) | | billing\_firstname | string | Yes | Billing first name | | billing\_lastname | string | Yes | Billing last name | | billing\_address | string | Yes | Billing address | | billing\_city | string | Yes | Billing city | | billing\_state | string | Yes | Billing state | | billing\_postcode | string | Yes | Billing postcode | | billing\_country | string | Yes | ISO Country Code | | billing\_phone | string | Yes | Billing phone number | *** ## Example Request ```bash cURL theme={null} curl --request POST \ --url https://api.splashpay.co.tz/api/v1/payments/dynamic-qr \ --header "Content-Type: application/json" \ --header "X-API-KEY: pk_live_xxxxxxxxxxxxx" \ --header "X-API-SECRET: sk_live_xxxxxxxxxxxxx" \ --header "Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000" \ --data '{ "reference":"CIR-6723e8ss6", "buyer_email":"john.doe@example.com", "buyer_name":"John Doe", "buyer_phone":"255744123456", "amount":1000, "currency":"TZS", "billing_firstname":"John", "billing_lastname":"Doe", "billing_address":"Bwawani, Mkonze", "billing_city":"Dodoma", "billing_state":"Tanzania", "billing_postcode":"67116", "billing_country":"TZ", "billing_phone":"255744123456" }' ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://api.splashpay.co.tz/api/v1/payments/dynamic-qr', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-KEY': process.env.SPLASHPAY_KEY, 'X-API-SECRET': process.env.SPLASHPAY_SECRET, 'Idempotency-Key': crypto.randomUUID(), }, body: JSON.stringify({ reference: 'CIR-6723e8ss6', buyer_email: 'john.doe@example.com', buyer_name: 'John Doe', buyer_phone: '255744123456', amount: 1000, currency: 'TZS', billing_firstname: 'John', billing_lastname: 'Doe', billing_address: 'Bwawani, Mkonze', billing_city: 'Dodoma', billing_state: 'Tanzania', billing_postcode: '67116', billing_country: 'TZ', billing_phone: '255744123456' }), } ); const payment = await response.json(); ``` ```python Python theme={null} import uuid import requests response = requests.post( "https://api.splashpay.co.tz/api/v1/payments/dynamic-qr", headers={ "Content-Type": "application/json", "X-API-KEY": "YOUR_API_KEY", "X-API-SECRET": "YOUR_API_SECRET", "Idempotency-Key": str(uuid.uuid4()) }, json={ "reference":"CIR-6723e8ss6", "buyer_email":"john.doe@example.com", "buyer_name":"John Doe", "buyer_phone":"255744123456", "amount":1000, "currency":"TZS", "billing_firstname":"John", "billing_lastname":"Doe", "billing_address":"Bwawani, Mkonze", "billing_city":"Dodoma", "billing_state":"Tanzania", "billing_postcode":"67116", "billing_country":"TZ", "billing_phone":"255744123456" } ) print(response.json()) ``` *** # Successful Response ```json theme={null} { "status": "success", "code": "PAYMENT_INITIATED", "message": "Payment initiated", "data": { "customer_name": "John Doe", "customer_email": "john.doe@example.com", "customer_phone": "255744123456", "reference": "CIR-6723e8ss6", "amount": "1000.00", "fee": 10, "net_amount": 990, "currency": "TZS", "payment_method": "tanqr", "provider": "selcom", "provider_reference": null, "qr": "iVBORw0KGgoAAAANSUhEUgAA...", "status": "pending", "metadata": null, "created_at": "2026-07-03T12:02:23Z", "processing_at": "2026-07-03T15:02:23Z" }, "meta": [], "request_id": "a92e05fe-2156-4891-b659-5a9fcee3ee87" } ``` *** # QR Code The `qr` field contains the generated QR code as a **Base64-encoded PNG image**. To display the QR code in a web browser, prepend the following prefix: ```text theme={null} data:image/png;base64, ``` Example ```html theme={null} SplashPay TANQR ``` # Payment Status | Status | Description | | ---------- | ------------------------------------ | | pending | Waiting for customer to scan and pay | | processing | Payment is being processed | | success | Payment completed successfully | | failed | Payment failed | | cancelled | Payment cancelled | | expired | QR code expired before payment | *** # Webhook Payload ```json theme={null} { "event": "payment.success", "created_at": "2026-07-03T15:04:30Z", "data": { "reference": "CIR-6723e8ss6", "amount": "1000.00", "currency": "TZS", "status": "success", "customer_name": "John Doe", "customer_email": "john.doe@example.com", "customer_phone": "255744123456", "channel": "TANQR", "provider_reference": "1769142083", "metadata": null } } ``` *** # Error Responses ## Invalid Request ```json theme={null} { "status": "error", "code": "INVALID_REQUEST", "message": "The request payload is invalid." } ``` ## Authentication Failed ```json theme={null} { "status": "error", "code": "UNAUTHORIZED", "message": "Invalid API credentials." } ``` ## Duplicate Request ```json theme={null} { "status": "error", "code": "DUPLICATE_REQUEST", "message": "A request with this Idempotency-Key has already been processed." } ``` *** # Best Practices Every QR payment should use a unique merchant reference. Render the Base64 image returned in the `qr` field to allow the customer to scan and pay. Update transaction status using webhook notifications instead of polling. If a webhook is delayed, retrieve the latest transaction status using the Payment Status endpoint. Always include a unique `Idempotency-Key` when generating a Dynamic TANQR. # Webhooks Source: https://docs.splashpay.co.tz/collections/webhooks Receive real-time notifications whenever the status of a payment changes. # Webhooks SplashPay uses webhooks to notify your application whenever a payment reaches a final state. Instead of continuously polling the Payment Status endpoint, configure a webhook endpoint to receive instant updates. SplashPay automatically sends an HTTP **POST** request to your webhook URL whenever a payment status changes. *** ## Configure Your Webhook URL You can configure your webhook URL from the SplashPay Merchant Dashboard or via the Merchant API. Example: ```text theme={null} https://merchant.example.com/webhooks/splashpay ``` Your endpoint must: * Support HTTPS * Accept HTTP POST requests * Return **HTTP 200 OK** after successful processing * Be publicly accessible *** ## Webhook Events SplashPay currently sends the following events. | Event | Description | | ------------------------ | -------------------------------------------------- | | `payment.success` | Payment completed successfully. | | `payment.failed` | Payment failed. | | `payment.cancelled` | Payment was cancelled by the customer or provider. | | `payment.expired` | Payment expired before completion. | | `payment.user_cancelled` | Payment was cancelled by the user. | | `payment.in_progress` | Payment is in progress. | | `payment.pending` | Payment is pending. | | `payment.rejected` | Payment was rejected. | *** # Sample Webhook SplashPay sends webhook notifications using the following JSON structure. ```json theme={null} { "event": "payment.success", "created_at": "2026-06-24T09:59:24.430757Z", "data": { "reference": "INV-xcxoddfudjhg", "amount": "1000.00", "fee": "15.00", "net_amount": "985.00", "currency": "TZS", "status": "success", "customer_name": "John Doe", "customer_email": "john.doe@example.com", "customer_phone": "255744123456", "payment_method": "mobile_money", "provider": "selcom", "channel": "TIGOPESATZ", "provider_reference": "1769142083", "metadata": null } } ``` *** # Webhook Payload | Field | Type | Description | | ------------------------- | ----------- | ------------------------------- | | `event` | string | Event name. | | `created_at` | datetime | Time the webhook was generated. | | `data.reference` | string | Merchant payment reference. | | `data.amount` | decimal | Payment amount. | | `data.fee` | decimal | Processing fee charged. | | `data.net_amount` | decimal | Amount settled after fees. | | `data.currency` | string | Transaction currency. | | `data.status` | string | Payment status. | | `data.customer_name` | string | Customer full name. | | `data.customer_email` | string | Customer email. | | `data.customer_phone` | string | Customer phone number. | | `data.payment_method` | string | Payment method used. | | `data.provider` | string | Payment provider. | | `data.channel` | string | Provider channel or network. | | `data.provider_reference` | string | Provider transaction reference. | | `data.metadata` | object/null | Merchant-defined metadata. | *** # Verify Webhook Signature Every webhook request includes a signature that allows you to verify the payload originated from SplashPay. | Header | Description | | ----------------------- | --------------------------------------------- | | `X-SPLASHPAY-SIGNATURE` | HMAC SHA-256 signature of the payload | | `X-SPLASHPAY-TIMESTAMP` | Unix timestamp used to generate the signature | Compute the HMAC using your **Webhook Secret**. ```text theme={null} HMAC_SHA256( timestamp + "." + request_body, WEBHOOK_SECRET ) ``` If the computed signature matches the `X-SPLASHPAY-SIGNATURE` header, the request is authentic. *** # Example Verification (PHP) ```php theme={null} $timestamp = $_SERVER['HTTP_X_SPLASHPAY_TIMESTAMP']; $signature = $_SERVER['HTTP_X_SPLASHPAY_SIGNATURE']; $payload = file_get_contents('php://input'); $expected = hash_hmac( 'sha256', $timestamp.'.'.$payload, env('SPLASHPAY_WEBHOOK_SECRET') ); if (!hash_equals($expected, $signature)) { abort(401, 'Invalid Signature'); } ``` *** # Example Verification (Node.js) ```javascript theme={null} import crypto from "crypto"; const payload = JSON.stringify(req.body); const expected = crypto .createHmac( "sha256", process.env.SPLASHPAY_WEBHOOK_SECRET ) .update( `${req.headers["x-splashpay-timestamp"]}.${payload}` ) .digest("hex"); if ( expected !== req.headers["x-splashpay-signature"] ) { return res.status(401).send("Invalid signature"); } ``` *** # Return HTTP 200 After successfully processing the webhook, return: ```http theme={null} HTTP/1.1 200 OK ``` Example ```json theme={null} { "success": true } ``` *** # Retry Policy If SplashPay does not receive a successful response (`HTTP 200`), the webhook will be retried automatically. | Attempt | Delay | | ------- | ----------- | | 1 | Immediately | | 2 | 1 minute | | 3 | 5 minutes | | 4 | 15 minutes | | 5 | 30 minutes | | 6 | 1 hour | | 7 | 6 hours | | 8 | 24 hours | After the final retry, the webhook is marked as failed. *** # Best Practices Reject webhook requests with invalid signatures. Respond with HTTP 200 immediately, then process the webhook in the background. The same webhook may be delivered more than once. Use the payment `reference` to avoid duplicate processing. Persist both the merchant reference and provider reference for reconciliation. Always rely on webhooks to determine the final payment status. *** # Event Lifecycle ```text theme={null} Payment Created │ ▼ Customer Pays │ ▼ SplashPay │ ▼ Webhook Sent │ ▼ Merchant Server │ ▼ HTTP 200 OK ``` *** # Testing Webhooks During development you can expose your local server using tools such as: * ngrok * Cloudflare Tunnel * LocalTunnel Example: ```text theme={null} https://abc123.ngrok.io/webhooks/splashpay ``` *** # Supported Payment Methods Webhooks are sent for all SplashPay collection methods: * Mobile Money * Card Payments * Dynamic TANQR *** # Next Steps Retrieve the latest status of any payment. Learn more about SplashPay Collections. # Bank Disbursement Source: https://docs.splashpay.co.tz/disbursements/bank Send funds securely from your SplashPay wallet to supported bank accounts. # Bank Disbursement The Bank Disbursement API enables merchants to transfer funds directly from their SplashPay wallet to supported bank accounts in Tanzania. Each request is processed securely and can be tracked using the transaction reference or provider reference. *** ## Endpoint ```http theme={null} POST /disbursements/bank ``` *** ## Authentication Every request must include your API credentials. | Header | Required | Description | | --------------- | :------: | ------------------------- | | X-API-KEY | ✅ | Merchant API Key | | X-API-SECRET | ✅ | Merchant API Secret | | Idempotency-Key | ✅ | Unique request identifier | | Content-Type | ✅ | application/json | *** ## Example Request ```bash theme={null} curl --request POST \ --url https://api.splashpay.co.tz/api/v1/disbursements/bank \ --header "Content-Type: application/json" \ --header "X-API-KEY: pk_live_xxxxxxxxx" \ --header "X-API-SECRET: sk_live_xxxxxxxxx" \ --header "Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000" \ --data '{ "reference":"BANK-100001", "bank_code":"NMIBTZTZ", "account_number":"1234567890", "account_name":"John Doe", "amount":100000, "currency":"TZS", "remarks":"Supplier Payment", "metadata":{ "invoice":"INV-10001" } }' ``` ```javascript theme={null} const response = await fetch( "https://api.splashpay.co.tz/api/v1/disbursements/bank", { method: "POST", headers: { "Content-Type": "application/json", "X-API-KEY": process.env.SPLASHPAY_KEY, "X-API-SECRET": process.env.SPLASHPAY_SECRET, "Idempotency-Key": crypto.randomUUID(), }, body: JSON.stringify({ reference: "BANK-100001", bank_code: "NMIBTZTZ", account_number: "1234567890", account_name: "John Doe", amount: 100000, currency: "TZS", remarks: "Supplier Payment" }), } ); const data = await response.json(); ``` ```python theme={null} import uuid import requests response = requests.post( "https://api.splashpay.co.tz/api/v1/disbursements/bank", headers={ "X-API-KEY": "pk_live_xxxxxxxxx", "X-API-SECRET": "sk_live_xxxxxxxxx", "Idempotency-Key": str(uuid.uuid4()), "Content-Type": "application/json", }, json={ "reference": "BANK-100001", "bank_code": "NMIBTZTZ", "account_number": "1234567890", "account_name": "John Doe", "amount": 100000, "currency": "TZS", "remarks": "Supplier Payment", }, ) print(response.json()) ``` ```php theme={null} $client = new \GuzzleHttp\Client(); $response = $client->post( 'https://api.splashpay.co.tz/api/v1/disbursements/bank', [ 'headers' => [ 'X-API-KEY' => 'pk_live_xxxxxxxxx', 'X-API-SECRET' => 'sk_live_xxxxxxxxx', 'Idempotency-Key' => uniqid(), ], 'json' => [ 'reference' => 'BANK-100001', 'bank_code' => 'NMIBTZTZ', 'account_number' => '1234567890', 'account_name' => 'John Doe', 'amount' => 100000, 'currency' => 'TZS', 'remarks' => 'Supplier Payment', ], ] ); echo $response->getBody(); ``` *** ## Request Body | Field | Type | Required | Description | | --------------- | ------- | :------: | -------------------------------------------------------------- | | reference | string | ✅ | Unique merchant payout reference | | bank\_code | string | ✅ | Destination bank code (use the shortcode from the table below) | | account\_number | string | ✅ | Recipient bank account number | | account\_name | string | ✅ | Recipient account name | | amount | decimal | ✅ | Amount to transfer | | currency | string | ✅ | Transaction currency | | remarks | string | ✅ | Payment description | | metadata | object | No | Additional merchant metadata | ## Supported Banks SplashPay supports payouts to the following financial institutions. | Bank | Shortcode | Name Lookup | | -------------------------------------- | -------------- | :---------: | | ABSA Bank | `ABSA` | ✅ | | Selcom Microfinance Bank (Selcom Pesa) | `SPSCASHIN` | ✅ | | Akiba Commercial Bank | `AKIBA` | ✅ | | Amana Bank | `AMANABANK` | ✅ | | Azania Bank | `AZANIA` | ✅ | | Access Bank Tanzania | `BANCABC` | ✅ | | Bank of Africa Tanzania | `BOA` | ✅ | | Bank of Baroda Tanzania | `BANKOFBARODA` | ✅ | | Bank of India Tanzania | `BANKOFINDIA` | ✅ | | China Dasheng Bank | `CHINADASHENG` | ✅ | | Citibank Tanzania | `CITIBANK` | ✅ | | CRDB Bank | `CRDBBANK` | ✅ | | DCB Commercial Bank | `DCBBANK` | ✅ | | Diamond Trust Bank | `DTB` | ✅ | | Ecobank Tanzania | `ECOBANK` | ✅ | | Equity Bank Tanzania | `EQUITYBANK` | ✅ | | Exim Bank | `EXIMBANK` | ✅ | | FINCA Microfinance Bank | `FINCA` | ✅ | | Guaranty Trust Bank Tanzania | `GTBANK` | ✅ | | Habib African Bank | `HABIBBANK` | ✅ | | I\&M Bank Tanzania | `IMBANK` | ✅ | | International Commercial Bank | `ICB` | ✅ | | KCB Bank Tanzania | `KCB` | ✅ | | Coop Bank Tanzania | `KILIMANJARO` | ✅ | | Letshego Bank Tanzania | `LETSHEGO` | ✅ | | Maendeleo Bank | `MAENDELEO` | ✅ | | Mkombozi Commercial Bank | `MKOMBOZI` | ✅ | | Mwalimu Commercial Bank | `MWALIMU` | ✅ | | Mwanga Hakika Microfinance Bank | `MWANGA` | ✅ | | National Microfinance Bank (NMB) | `NMB` | ✅ | | NBC Bank | `NBC` | ✅ | | NCBA Bank Tanzania | `NCBA` | ✅ | | People's Bank of Zanzibar | `PBZ` | ✅ | | Stanbic Bank Tanzania | `STANBIC` | ✅ | | Tanzania Commercial Bank | `TCB` | ✅ | | Uchumi Commercial Bank | `UCHUMI` | ✅ | | United Bank for Africa | `UBA` | ✅ | Use the **Shortcode** value when specifying the `bank_code` field in your request. You can also verify the recipient's account details using the **Name Lookup API** before initiating a bank disbursement. ## Example Response ```json theme={null} { "status": "success", "code": "DISBURSEMENT_INITIATED", "message": "Disbursement initiated successfully.", "data": { "reference": "BANK-100001", "amount": "100000.00", "fee": "500.00", "total_amount": "100500.00", "currency": "TZS", "bank_code": "NMIBTZTZ", "bank_name": "National Microfinance Bank", "account_number": "1234567890", "account_name": "John Doe", "provider": "selcom", "status": "processing", "remarks": "Supplier Payment", "metadata": {} }, "request_id": "6d878d91-fdfa-4763-b74c-8321c11c9b6b" } ``` *** ## Transaction Status | Status | Description | | ---------- | ------------------------------- | | pending | Request received | | processing | Submitted to the bank | | paid | Transfer completed successfully | | failed | Transfer failed | | cancelled | Transfer cancelled | *** ## Name Lookup Before initiating a bank transfer, you can verify the account details. ```http theme={null} POST /disbursements/name-lookup ``` Example request: ```json theme={null} { "type": "BANK", "bank_code": "NMIBTZTZ", "account_number": "1234567890" } ``` *** ## Error Codes | Code | Description | | ----------------------- | --------------------------------------- | | INVALID\_BANK | Unsupported bank | | INVALID\_ACCOUNT | Invalid account number | | ACCOUNT\_NAME\_MISMATCH | Account verification failed | | INSUFFICIENT\_BALANCE | Merchant wallet balance is insufficient | | DUPLICATE\_REFERENCE | Reference already exists | | DUPLICATE\_REQUEST | Duplicate Idempotency-Key | | PROVIDER\_ERROR | Provider returned an error | *** ## Best Practices Use the Name Lookup API before initiating a bank transfer. Each disbursement should have a unique merchant reference. Prevent duplicate transfers when retrying requests. Listen for webhook events instead of continuously polling the Status API. # Bank Short Names Source: https://docs.splashpay.co.tz/disbursements/bank-shortnames Retrieve the list of supported banks and their short codes for bank transfers. # Bank Short Names Retrieve the list of supported banks and their corresponding short codes. The returned `code` should be used when initiating bank transfer or bank payout requests. ## Endpoint ```http theme={null} GET /bank-shortnames ``` ## Authentication Include your API credentials in the request headers. | Header | Required | Description | | ------------ | -------- | ------------------------- | | X-API-KEY | Yes | Your SplashPay API Key | | X-API-SECRET | Yes | Your SplashPay API Secret | ## Example Request ```bash cURL theme={null} curl --request GET \ --url https://api.splashpay.co.tz/api/v1/bank-shortnames \ --header "Accept: application/json" \ --header "X-API-KEY: pk_live_xxxxxxxxxxxxx" \ --header "X-API-SECRET: sk_live_xxxxxxxxxxxxx" ``` ```javascript JavaScript theme={null} const response = await fetch( 'https://api.splashpay.co.tz/api/v1/bank-shortnames', { method: 'GET', headers: { Accept: 'application/json', 'X-API-KEY': process.env.SPLASHPAY_KEY, 'X-API-SECRET': process.env.SPLASHPAY_SECRET, }, } ); const banks = await response.json(); console.log(banks); ``` ```python Python theme={null} import requests response = requests.get( "https://api.splashpay.co.tz/api/v1/bank-shortnames", headers={ "Accept": "application/json", "X-API-KEY": "YOUR_API_KEY", "X-API-SECRET": "YOUR_API_SECRET", }, ) print(response.status_code) print(response.json()) ``` ```php PHP theme={null} use Illuminate\Support\Facades\Http; $response = Http::withHeaders([ 'Accept' => 'application/json', 'X-API-KEY' => env('SPLASHPAY_KEY'), 'X-API-SECRET' => env('SPLASHPAY_SECRET'), ])->get( 'https://api.splashpay.co.tz/api/v1/bank-shortnames' ); return $response->json(); ``` ```dart Dart theme={null} import 'dart:convert'; import 'package:http/http.dart' as http; Future getBanks() async { final response = await http.get( Uri.parse( 'https://api.splashpay.co.tz/api/v1/bank-shortnames', ), headers: { 'Accept': 'application/json', 'X-API-KEY': 'YOUR_API_KEY', 'X-API-SECRET': 'YOUR_API_SECRET', }, ); print(jsonDecode(response.body)); } ``` ## Successful Response ```json theme={null} { "status": "success", "code": "SUCCESS", "message": "Bank shortnames retrieved successfully.", "data": [ { "id": 1, "name": "ABSA Bank", "code": "ABSA" }, { "id": 2, "name": "CRDB Bank", "code": "CRDB" }, { "id": 3, "name": "NMB Bank", "code": "NMB" } ] } ``` ## Response Fields | Field | Type | Description | | ----- | ------- | --------------------------------------------------------------- | | id | integer | Unique bank identifier. | | name | string | Full bank name. | | code | string | Bank short code used when initiating bank transfers or payouts. | ## Notes * Use the `code` value when making bank transfer or payout requests. * The list may change over time as banks are added, removed, or temporarily disabled. ``` ``` # Mobile Money Source: https://docs.splashpay.co.tz/disbursements/mobile-money Send funds instantly to supported Mobile Money wallets in Tanzania. # Mobile Money The Mobile Money Disbursement API enables you to send money from your SplashPay wallet to supported Mobile Money networks through a single API. Supported networks include: * Vodacom M-Pesa * Airtel Money * Mixx by Yas * HaloPesa * EzyPesa * TTCL Pesa *** ## Endpoint ```http theme={null} POST /disbursements/mobile-money ``` *** ## Authentication Every request must include your API credentials. | Header | Required | Description | | --------------- | :------: | ------------------------- | | X-API-KEY | ✅ | Merchant API Key | | X-API-SECRET | ✅ | Merchant API Secret | | Idempotency-Key | ✅ | Unique request identifier | | Content-Type | ✅ | application/json | *** ## Example Request ```bash theme={null} curl --request POST \ --url https://api.splashpay.co.tz/api/v1/disbursements/mobile-money \ --header "Content-Type: application/json" \ --header "X-API-KEY: pk_live_xxxxxxxxx" \ --header "X-API-SECRET: sk_live_xxxxxxxxx" \ --header "Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000" \ --data '{ "reference":"PAYOUT-100001", "recipient_phone":"255747123456", "recipient_name":"John Doe", "amount":1000, "currency":"TZS", "network":"MPESA", "remarks":"Salary Payment", "metadata":{ "employee_id":"EMP-1001" } }' ``` ```javascript theme={null} const response = await fetch( "https://api.splashpay.co.tz/api/v1/disbursements/mobile-money", { method: "POST", headers: { "Content-Type": "application/json", "X-API-KEY": process.env.SPLASHPAY_KEY, "X-API-SECRET": process.env.SPLASHPAY_SECRET, "Idempotency-Key": crypto.randomUUID(), }, body: JSON.stringify({ reference: "PAYOUT-100001", recipient_phone: "255747123456", recipient_name: "John Doe", amount: 1000, currency: "TZS", network: "MPESA", remarks: "Salary Payment", metadata: { employee_id: "EMP-1001" } }), } ); const data = await response.json(); ``` ```python theme={null} import uuid import requests response = requests.post( "https://api.splashpay.co.tz/api/v1/disbursements/mobile-money", headers={ "X-API-KEY": "pk_live_xxxxxxxxx", "X-API-SECRET": "sk_live_xxxxxxxxx", "Idempotency-Key": str(uuid.uuid4()), "Content-Type": "application/json", }, json={ "reference": "PAYOUT-100001", "recipient_phone": "255747123456", "recipient_name": "John Doe", "amount": 1000, "currency": "TZS", "network": "MPESA", "remarks": "Salary Payment", "metadata": { "employee_id": "EMP-1001" } }, ) print(response.json()) ``` ```php theme={null} $client = new \GuzzleHttp\Client(); $response = $client->post( 'https://api.splashpay.co.tz/api/v1/disbursements/mobile-money', [ 'headers' => [ 'X-API-KEY' => 'pk_live_xxxxxxxxx', 'X-API-SECRET' => 'sk_live_xxxxxxxxx', 'Idempotency-Key' => uniqid(), ], 'json' => [ 'reference' => 'PAYOUT-100001', 'recipient_phone' => '255747123456', 'recipient_name' => 'John Doe', 'amount' => 1000, 'currency' => 'TZS', 'network' => 'MPESA', 'remarks' => 'Salary Payment', 'metadata' => [ 'employee_id' => 'EMP-1001' ] ], ] ); echo $response->getBody(); ``` *** ## Request Body | Field | Type | Required | Description | | ---------------- | ------- | :------: | --------------------------------------------------------------------------------------- | | reference | string | ✅ | Unique merchant payout reference | | recipient\_phone | string | ✅ | Recipient phone number (255XXXXXXXXX) | | recipient\_name | string | ✅ | Recipient full name | | amount | decimal | ✅ | Amount to send | | currency | string | ✅ | Currency (TZS) | | network | string | ✅ | Mobile money network (MPESA, MIXX\_BY\_YAS, AIRTEL\_MONEY, HALOPESA, EZYPESA, TTCLPESA) | | remarks | string | ✅ | Payment description | | metadata | object | No | Additional merchant data | *** ## Example Response ```json theme={null} { "status": "success", "code": "DISBURSEMENT_INITIATED", "message": "Disbursement initiated successfully.", "data": { "reference": "PAYOUT-100001", "amount": "1000.00", "fee": "150.00", "total_amount": "1150.00", "currency": "TZS", "recipient_name": "John Doe", "recipient_phone": "255747123456", "channel": "MOBILE_MONEY", "network": "MPESA", "status": "processing", "provider": "selcom", "remarks": "Salary Payment", "created_at": "2026-07-05T10:20:00Z" }, "request_id": "2c4b4959-45e8-4cf5-93b3-c74fd4c8d57f" } ``` *** ## Transaction Status | Status | Description | | ---------- | ------------------------------ | | pending | Request accepted | | processing | Submitted to provider | | paid | Funds delivered successfully | | failed | Provider rejected the transfer | | cancelled | Transaction cancelled | *** ## Verify Recipient To reduce failed transactions, verify the recipient before initiating a payout. ```http theme={null} POST /disbursements/name-lookup ``` *** ## Error Codes | Code | Description | | --------------------- | --------------------------------------- | | INVALID\_NETWORK | Unsupported Mobile Money network | | INVALID\_PHONE | Invalid recipient phone number | | INSUFFICIENT\_BALANCE | Merchant wallet balance is insufficient | | DUPLICATE\_REFERENCE | Reference already exists | | DUPLICATE\_REQUEST | Duplicate Idempotency-Key | | PROVIDER\_ERROR | Provider returned an error | *** ## Best Practices Generate a unique payout reference for every disbursement. Prevent duplicate payouts when retrying requests. Use the Name Lookup API before initiating payouts whenever possible. Use webhook notifications to receive the final transaction status instead of polling. # Name Lookup Source: https://docs.splashpay.co.tz/disbursements/name-lookup Verify the recipient account name before initiating a disbursement. # Name Lookup The Name Lookup API allows you to verify the recipient's account name before creating a disbursement. SplashPay supports name lookup for the following disbursement channels: * **Mobile Money** * **Bank Transfer** * **Selcom Pesa** Using this endpoint helps reduce failed transfers caused by incorrect account numbers or bank codes. > **Tip** > Always perform a name lookup before initiating a disbursement to allow the recipient to confirm the account details. *** ## Endpoint ```http theme={null} POST /disbursements/name-lookup ``` *** ## Authentication Every request must include your API credentials. | Header | Required | Description | | ------------ | :------: | ------------------- | | X-API-KEY | ✅ | Merchant API Key | | X-API-SECRET | ✅ | Merchant API Secret | | Content-Type | ✅ | application/json | *** ## Supported Channels | Channel | Description | Requires Bank Code | | -------------- | ------------------------------------- | :----------------: | | `MOBILE_MONEY` | Lookup a Mobile Money subscriber name | ❌ | | `BANK` | Lookup a bank account holder | ✅ | | `SELCOMPESA` | Lookup a Selcom Pesa account | ❌ | *** ## Request Parameters | Field | Type | Required | Description | | --------------- | ------ | :---------: | ------------------------------------------------------------------------- | | channel | string | ✅ | `MOBILE_MONEY`, `BANK`, or `SELCOMPESA` | | account\_number | string | ✅ | Mobile number, bank account number, or Selcom Pesa account number | | bank\_code | string | Conditional | Required only when `channel` is `BANK`. Use the supported bank shortcode. | *** ## Example Requests ```json theme={null} { "channel": "MOBILE_MONEY", "account_number": "255717879919" } ``` ```json theme={null} { "channel": "BANK", "account_number": "015123456789", "bank_code": "NMB" } ``` ```json theme={null} { "channel": "SELCOMPESA", "account_number": "255717879919" } ``` *** ## Example Response ```json theme={null} { "status": "success", "code": "ACCOUNT_VERIFIED", "message": "Account verified successfully.", "data": { "channel": "BANK", "account_number": "015123456789", "account_name": "MEDSON NAFTALI", "bank_code": "NMB", "bank_name": "National Microfinance Bank" }, "meta": [], "request_id": "4d1e3b6d-5b1b-4b9e-9d44-53f3d876e5a8" } ``` *** ## Mobile Money Response ```json theme={null} { "status": "success", "code": "ACCOUNT_VERIFIED", "message": "Account verified successfully.", "data": { "channel": "MOBILE_MONEY", "account_number": "255717879919", "account_name": "MEDSON NAFTALI", "network": "MPESA" }, "meta": [], "request_id": "4d1e3b6d-5b1b-4b9e-9d44-53f3d876e5a8" } ``` *** ## Selcom Pesa Response ```json theme={null} { "status": "success", "code": "ACCOUNT_VERIFIED", "message": "Account verified successfully.", "data": { "channel": "SELCOMPESA", "account_number": "255717879919", "account_name": "MEDSON NAFTALI" }, "meta": [], "request_id": "4d1e3b6d-5b1b-4b9e-9d44-53f3d876e5a8" } ``` *** ## Error Responses ### Invalid Bank Code ```json theme={null} { "status": "error", "code": "INVALID_BANK_CODE", "message": "The supplied bank code is not supported." } ``` ### Account Not Found ```json theme={null} { "status": "error", "code": "ACCOUNT_NOT_FOUND", "message": "Recipient account could not be verified." } ``` ### Invalid Channel ```json theme={null} { "status": "error", "code": "INVALID_CHANNEL", "message": "Unsupported disbursement channel." } ``` *** ## Supported Bank Codes For **BANK** lookups, use the bank shortcode. | Bank | Code | | ------------------------ | --------------------------------------------------------------------------------- | | NMB Bank | `NMB` | | CRDB Bank | `CRDBBANK` | | NBC Bank | `NBC` | | Stanbic Bank | `STANBIC` | | NCBA Bank | `NCBA` | | Absa Bank | `ABSA` | | Exim Bank | `EXIMBANK` | | Equity Bank | `EQUITYBANK` | | KCB Bank | `KCB` | | Tanzania Commercial Bank | `TCB` | | ... | Refer to the complete **Supported Banks** section in the Bank Disbursement guide. | *** ## Best Practices Perform a name lookup immediately before initiating a disbursement to reduce failed transfers. Show the verified account name to the customer and request confirmation before submitting the transfer. When using the **BANK** channel, ensure the correct bank shortcode is supplied. Recipient names may change over time. Avoid caching lookup results for extended periods and perform a fresh lookup for each new transfer. *** ## Related Guides Send funds to Mobile Money wallets. Transfer funds directly to bank accounts. Transfer funds to Selcom Pesa accounts. # Overview Source: https://docs.splashpay.co.tz/disbursements/overview Send money to Mobile Money wallets, bank accounts, and Selcom Pesa wallets through a single API. # Disbursements SplashPay Disbursements enables businesses to send money securely and reliably to customers, suppliers, employees, and partners. Using a single API integration, you can initiate payouts to: * Mobile Money wallets * Bank accounts * Selcom Pesa wallets Every disbursement is tracked using a unique reference and supports real-time status updates through webhooks. *** ## Features * Single API for all payout channels * Mobile Money and bank disbursements * Selcom Pesa wallet transfers * Account and wallet name lookup * Idempotent requests * Wallet balance validation * Real-time webhook notifications * Transaction status tracking * Secure API authentication *** ## Base URL ```text theme={null} https://api.splashpay.co.tz/api/v1 ``` *** ## Authentication Every request must include your API credentials. | Header | Required | Description | | --------------- | :------: | -------------------------- | | X-API-KEY | ✅ | Merchant API Key | | X-API-SECRET | ✅ | Merchant API Secret | | Idempotency-Key | ✅ | Prevent duplicate requests | | Content-Type | ✅ | application/json | Example ```http theme={null} X-API-KEY: pk_live_xxxxxxxxxxxxx X-API-SECRET: sk_live_xxxxxxxxxxxxx Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000 Content-Type: application/json ``` *** ## Supported Disbursement Channels | Channel | Description | | ------------ | -------------------------------------- | | Mobile Money | Send funds to supported mobile wallets | | Bank | Transfer funds to bank accounts | | Selcom Pesa | Transfer funds to Selcom Pesa wallets | *** ## Typical Workflow Optionally verify the recipient using the Name Lookup API before initiating the disbursement. Submit a payout request using the appropriate endpoint for the destination channel. SplashPay validates your request and submits it to the payment provider. Monitor the payout using the Status API or receive automatic webhook notifications. *** ## Transaction Status | Status | Description | | ---------- | ---------------------------------------- | | pending | Request received and awaiting processing | | processing | Submitted to the payment provider | | paid | Funds successfully delivered | | failed | Provider rejected or failed the transfer | | cancelled | Transaction cancelled | *** ## Idempotency All disbursement requests must include an **Idempotency-Key**. Using the same key ensures that retrying a request due to network issues does not create duplicate payouts. Example ```http theme={null} Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000 ``` *** ## Security SplashPay protects your payouts using: * API Key authentication * API Secret authentication * HTTPS encryption * Idempotent requests * Request validation * Transaction auditing * Webhook signature verification # Selcom Pesa Disbursement Source: https://docs.splashpay.co.tz/disbursements/selcompesa Send funds instantly to Selcom Pesa wallets using the SplashPay Disbursement API. # Selcom Pesa Disbursement The Selcom Pesa Disbursement API allows you to transfer funds from your SplashPay wallet directly to a **Selcom Pesa wallet**. Selcom Pesa transfers are processed instantly and are ideal for wallet-to-wallet transfers within the Selcom ecosystem. *** ## Endpoint ```http theme={null} POST /disbursements/selcompesa ``` *** ## Authentication Every request must include your API credentials. | Header | Required | Description | | --------------- | :------: | ------------------------- | | X-API-KEY | ✅ | Merchant API Key | | X-API-SECRET | ✅ | Merchant API Secret | | Idempotency-Key | ✅ | Unique request identifier | | Content-Type | ✅ | application/json | *** ## Example Request ```bash theme={null} curl --request POST \ --url https://api.splashpay.co.tz/api/v1/disbursements/selcompesa \ --header "Content-Type: application/json" \ --header "X-API-KEY: pk_live_xxxxxxxxx" \ --header "X-API-SECRET: sk_live_xxxxxxxxx" \ --header "Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000" \ --data '{ "reference":"SP-100001", "wallet_number":"255747123456", "wallet_name":"John Doe", "amount":50000, "currency":"TZS", "remarks":"Wallet Transfer", "metadata":{ "customer_id":"CUS-1001" } }' ``` ```javascript theme={null} const response = await fetch( "https://api.splashpay.co.tz/api/v1/disbursements/selcompesa", { method: "POST", headers: { "Content-Type": "application/json", "X-API-KEY": process.env.SPLASHPAY_KEY, "X-API-SECRET": process.env.SPLASHPAY_SECRET, "Idempotency-Key": crypto.randomUUID(), }, body: JSON.stringify({ reference: "SP-100001", wallet_number: "255747123456", wallet_name: "John Doe", amount: 50000, currency: "TZS", remarks: "Wallet Transfer" }), } ); const data = await response.json(); ``` ```python theme={null} import uuid import requests response = requests.post( "https://api.splashpay.co.tz/api/v1/disbursements/selcompesa", headers={ "X-API-KEY": "pk_live_xxxxxxxxx", "X-API-SECRET": "sk_live_xxxxxxxxx", "Idempotency-Key": str(uuid.uuid4()), "Content-Type": "application/json", }, json={ "reference": "SP-100001", "wallet_number": "255747123456", "wallet_name": "John Doe", "amount": 50000, "currency": "TZS", "remarks": "Wallet Transfer", }, ) print(response.json()) ``` ```php theme={null} $client = new \GuzzleHttp\Client(); $response = $client->post( 'https://api.splashpay.co.tz/api/v1/disbursements/selcompesa', [ 'headers' => [ 'X-API-KEY' => 'pk_live_xxxxxxxxx', 'X-API-SECRET' => 'sk_live_xxxxxxxxx', 'Idempotency-Key' => uniqid(), ], 'json' => [ 'reference' => 'SP-100001', 'wallet_number' => '255747123456', 'wallet_name' => 'John Doe', 'amount' => 50000, 'currency' => 'TZS', 'remarks' => 'Wallet Transfer', ], ] ); echo $response->getBody(); ``` *** ## Request Body | Field | Type | Required | Description | | -------------- | ------- | :------: | -------------------------------- | | reference | string | ✅ | Unique merchant payout reference | | wallet\_number | string | ✅ | Selcom Pesa wallet number | | wallet\_name | string | ✅ | Wallet owner's full name | | amount | decimal | ✅ | Amount to transfer | | currency | string | ✅ | Transaction currency (TZS) | | remarks | string | ✅ | Payment description | | metadata | object | No | Additional merchant data | *** ## Example Response ```json theme={null} { "status": "success", "code": "DISBURSEMENT_INITIATED", "message": "Disbursement initiated successfully.", "data": { "reference": "SP-100001", "amount": "50000.00", "fee": "0.00", "total_amount": "50000.00", "currency": "TZS", "wallet_number": "255747123456", "wallet_name": "John Doe", "provider": "selcom", "status": "processing", "remarks": "Wallet Transfer", "metadata": {} }, "request_id": "cb71e86c-8055-4e61-b59d-8dd82d92b624" } ``` *** ## Transaction Status | Status | Description | | ---------- | ------------------------------- | | pending | Request received | | processing | Submitted to Selcom | | paid | Transfer completed successfully | | failed | Transfer failed | | cancelled | Transfer cancelled | *** ## Wallet Name Lookup To minimize failed transactions, verify the wallet before initiating the transfer. ```http theme={null} POST /disbursements/name-lookup ``` Example request: ```json theme={null} { "type": "SELCOMPESA", "wallet_number": "255747123456" } ``` Example response: ```json theme={null} { "status": "success", "data": { "wallet_name": "John Doe" } } ``` *** ## Error Codes | Code | Description | | --------------------- | --------------------------------------- | | INVALID\_WALLET | Invalid Selcom Pesa wallet | | WALLET\_NOT\_FOUND | Wallet does not exist | | INSUFFICIENT\_BALANCE | Merchant wallet balance is insufficient | | DUPLICATE\_REFERENCE | Reference already exists | | DUPLICATE\_REQUEST | Duplicate Idempotency-Key | | PROVIDER\_ERROR | Provider returned an error | *** ## Best Practices Use the Name Lookup API before sending funds. Every disbursement should have a unique merchant reference. Always send an `Idempotency-Key` to prevent duplicate payouts. Use webhook events to receive the final transaction status instead of polling. # Status Source: https://docs.splashpay.co.tz/disbursements/status Retrieve the current status and details of a disbursement. # Disbursement Status The Disbursement Status API allows you to retrieve the latest status of a disbursement using its unique merchant reference. Use this endpoint to: * Check whether a payout has been processed * Retrieve the provider reference * View processing and completion timestamps * Obtain the latest transaction status > **Tip** > For real-time updates, use the **Webhooks API**. The Status API is useful for manual checks, reconciliation, and retry logic. *** ## Endpoint ```http theme={null} GET /disbursements/{reference} ``` Example: ```http theme={null} GET /disbursements/PAYOUT-100001 ``` *** ## Authentication Every request must include your API credentials. | Header | Required | Description | | ------------ | :------: | ------------------- | | X-API-KEY | ✅ | Merchant API Key | | X-API-SECRET | ✅ | Merchant API Secret | *** ## Example Request ```bash theme={null} curl --request GET \ --url https://api.splashpay.co.tz/api/v1/disbursements/PAYOUT-100001 \ --header "X-API-KEY: pk_live_xxxxxxxxx" \ --header "X-API-SECRET: sk_live_xxxxxxxxx" ``` ```javascript theme={null} const response = await fetch( "https://api.splashpay.co.tz/api/v1/disbursements/PAYOUT-100001", { method: "GET", headers: { "X-API-KEY": process.env.SPLASHPAY_KEY, "X-API-SECRET": process.env.SPLASHPAY_SECRET, }, }, ); const data = await response.json(); ``` ```python theme={null} import requests response = requests.get( "https://api.splashpay.co.tz/api/v1/disbursements/PAYOUT-100001", headers={ "X-API-KEY": "pk_live_xxxxxxxxx", "X-API-SECRET": "sk_live_xxxxxxxxx", }, ) print(response.json()) ``` ```php theme={null} $client = new \GuzzleHttp\Client(); $response = $client->get( 'https://api.splashpay.co.tz/api/v1/disbursements/PAYOUT-100001', [ 'headers' => [ 'X-API-KEY' => 'pk_live_xxxxxxxxx', 'X-API-SECRET' => 'sk_live_xxxxxxxxx', ] ] ); echo $response->getBody(); ``` *** ## Path Parameters | Parameter | Type | Description | | --------- | ------ | ------------------------------- | | reference | string | Merchant disbursement reference | *** ## Example Response ```json theme={null} { "status": "success", "code": "DISBURSEMENT_FOUND", "message": "Disbursement retrieved successfully.", "data": { "reference": "PAYOUT-100001", "provider_reference": "S20618298751", "amount": "50000.00", "fee": "0.00", "total_amount": "50000.00", "currency": "TZS", "channel": "mobile_money", "provider": "selcom", "recipient_name": "Medson Naftali", "recipient_account": "255717879919", "status": "paid", "remarks": "Salary Payment", "metadata": { "employee_id": "EMP-1001" }, "created_at": "2026-07-05T14:20:00Z", "processing_at": "2026-07-05T14:20:03Z", "completed_at": "2026-07-05T14:20:07Z" }, "request_id": "cb71e86c-8055-4e61-b59d-8dd82d92b624" } ``` *** ## Transaction Status | Status | Description | | ------------ | -------------------------------------------------------------- | | `pending` | Disbursement has been received and is waiting to be processed. | | `processing` | The payout has been submitted to the payment provider. | | `paid` | Funds have been successfully delivered to the recipient. | | `failed` | The payout could not be completed. | | `cancelled` | The payout was cancelled before completion. | *** ## Error Response ```json theme={null} { "status": "error", "code": "DISBURSEMENT_NOT_FOUND", "message": "The specified disbursement could not be found." } ``` *** ## Best Practices Generate a unique reference for every disbursement. This reference is used to retrieve the transaction later. Use the Status API for reconciliation or manual checks. For production integrations, rely on webhook notifications to receive transaction updates automatically. If the status is `processing`, wait a few seconds before making another request instead of polling continuously. Save the `provider_reference` returned by SplashPay for reconciliation with payment providers. # Webhooks Source: https://docs.splashpay.co.tz/disbursements/webhooks Receive real-time notifications for disbursement events from SplashPay. # Webhooks SplashPay sends webhook notifications whenever the status of a disbursement changes. Instead of continuously polling the Status API, configure a webhook endpoint to receive real-time updates for successful, failed, or cancelled disbursements. *** ## Configure a Webhook You can configure your webhook URL from the SplashPay Merchant Dashboard or when creating your application. Your endpoint must: * Be publicly accessible over HTTPS * Accept `POST` requests * Return an HTTP `2xx` response within **30 seconds** Example webhook URL: ```text theme={null} https://merchant.example.com/api/webhooks/splashpay ``` *** ## Headers Every webhook request includes the following headers. | Header | Description | | --------------------- | ---------------------- | | X-Webhook-Event | Event type | | X-SplashPay-Signature | HMAC SHA-256 signature | | X-SplashPay-Timestamp | Event timestamp | Example ```http theme={null} POST /api/webhooks/splashpay HTTP/1.1 Content-Type: application/json X-Webhook-Event: disbursement.success X-SplashPay-Timestamp: 2026-07-05T14:25:40Z X-SplashPay-Signature: 8b0f8eb9a6c5a7c6... ``` *** ## Events SplashPay currently sends the following disbursement events. | Event | Description | | ------------------------ | ---------------------------- | | `disbursement.success` | Funds successfully delivered | | `disbursement.failed` | Disbursement failed | | `disbursement.cancelled` | Disbursement cancelled | *** ## Example Payload ```json theme={null} { "event": "disbursement.success", "created_at": "2026-07-05T14:25:40Z", "data": { "reference": "PAYOUT-100001", "provider_reference": "S20618298751", "amount": "50000.00", "currency": "TZS", "status": "success", "provider": "selcom", "channel": "MOBILE_MONEY", "network": "MPESA", "phone": "255747123456", "metadata": { "employee_id": "EMP-1001" } } } ``` *** ## Verify Webhook Signature Always verify the webhook signature before processing the payload. The signature is generated using your **Webhook Secret**. Algorithm: ```text theme={null} HMAC SHA-256 ``` Pseudo code ```text theme={null} signature = HMAC_SHA256( webhook_secret, raw_request_body ) ``` Compare the generated signature with the value in the `X-SplashPay-Signature` header. *** ## Laravel Example ```php theme={null} public function handle(Request $request) { // Raw request body $payload = file_get_contents('php://input'); // Headers $signature = $request->header('X-SplashPay-Signature'); $timestamp = $request->header('X-SplashPay-Timestamp'); $event = $request->header('X-Webhook-Event'); // Verify signature if (!$this->verifySignature($payload, $signature)) { return response()->json([ 'message' => 'Invalid signature' ], 400); } $data = json_decode($payload, true); switch ($event) { case 'disbursement.success': // Mark payout as completed break; case 'disbursement.failed': // Mark payout as failed break; case 'disbursement.cancelled': // Mark payout as cancelled break; } return response()->json([ 'status' => 'ok' ]); } ``` *** ## Signature Verification Example ```php theme={null} protected function verifySignature( string $payload, string $signature ): bool { $expected = hash_hmac( 'sha256', $payload, config('services.splashpay.webhook_secret') ); return hash_equals( $expected, $signature ); } ``` *** ## Response Your endpoint should return an HTTP **200 OK** response after successfully processing the webhook. Example ```json theme={null} { "status": "ok" } ``` *** ## Retry Policy If SplashPay does not receive a successful **2xx** response, the webhook will be retried using an exponential backoff strategy. Typical retry schedule: | Attempt | Delay | | ------- | ----------- | | 1 | Immediately | | 2 | 1 minute | | 3 | 5 minutes | | 4 | 15 minutes | | 5 | 30 minutes | | 6 | 1 hour | *** ## Best Practices Never trust incoming webhook requests without verifying the signature. Return an HTTP 200 response as soon as possible. Perform heavy processing asynchronously. Webhook deliveries may be retried. Process events idempotently using the transaction reference. Log incoming payloads and headers for troubleshooting and auditing. # Introduction Source: https://docs.splashpay.co.tz/introduction Build modern payment experiences with SplashPay. # Build payments with SplashPay Accept payments, send disbursements, and receive real-time transaction updates through a single API. Accept payments from Mobile Money and bank channels. Send money to customers, agents, and merchants. Receive real-time notifications for transaction events. *** ## Why SplashPay? Go live within minutes using our REST API. API authentication, webhook signing, and secure infrastructure. High availability architecture built for mission-critical payments. Simple APIs, clear documentation, and testing tools. *** ## Base URLs ```text theme={null} https://api.splashpay.co.tz/api/v1 ``` *** ## Quick Start Register your SplashPay merchant account. Submit your business information and required KYC documents. Navigate to Merchant Portal → Developers → API Keys. Authenticate using your API credentials. *** ## Example Request ```bash theme={null} 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: Unique-Request-ID" \ --data '{ "amount": 1000, "currency": "TZS", "reference": "INV-323", "phone": "255754000000", "customer_name": "John Doe", "customer_email": "john.doe@example.com", "metadata": { "order_id": "12345", "product": "Test Product" } }' ``` All requests must include valid API credentials. *** ## Support For integration assistance, contact our support team at **[support@splashpay.co.tz](mailto:support@splashpay.co.tz)**