Introduction
#Welcome to the Tunzaa Pay API documentation. We provide a simple yet powerful REST API to accept payments, manage subscriptions, and handle payouts across Africa.
Our API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
Base URL
https://pay.tunzaa.co.tz/api/v1Authentication
#The Tunzaa API uses API keys to authenticate requests. You can view and manage your API keys in the Dashboard.
Your API keys accept key-value pairs of api_key and secret_key. Ensure you keep your keys secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.
AI Integration (MCP)
#Tunzaa Pay supports the Model Context Protocol (MCP), allowing you to integrate directly with AI assistants like Claude Desktop, Cursor, and Windsurf.
Why use MCP?
By configuring the MCP server, you give your AI context about the Tunzaa API, enabling it to write integration code, debug errors, and answer questions specifically for your codebase.
claude_desktop_config.jsonAuthentication
#Authenticate your requests using your API Key and Secret.
Get Access Token
#Method: POST
Exchange your API credentials for a time-limited Bearer token.
Payments
#Initiate and track mobile money transactions.
Initiate Payment
#Method: POST
Trigger a USSD push to the customer's mobile device.
Check Payment Status
#Method: GET
Verify the final status of a transaction.
| Parameter | Type | Description |
|---|---|---|
| transactionIDRequired | string | The ID returned from initiation |
Installment Plans
#Manage Buy Now Pay Later (BNPL) plans.
Create Plan
#Method: POST
Create a new installment plan for a customer.
List Plans
#Method: POST
Retrieve a paginated list of installment plans.
Get Plan Details
#Method: GET
Get detailed information about a specific plan.
| Parameter | Type | Description |
|---|---|---|
| plan_idRequired | number | - |
Update Plan
#Method: PUT
Modify an existing plan's details.
| Parameter | Type | Description |
|---|---|---|
| plan_idRequired | number | - |
Cancel Plan
#Method: DELETE
Terminate an installment plan.
| Parameter | Type | Description |
|---|---|---|
| plan_idRequired | number | - |
How Callbacks Work
#Configure your callback URL in merchant settings to receive automatic transaction status updates.
Callback Process
- Transaction Status Changes: When a payment completes or fails
- Tunzaa Pay Sends POST: To your configured callback URL
- Your System Processes: Handle the update and respond with 200 OK
- Retry on Failure: Up to 5 attempts if response isn't 200 OK
Callbacks
#Transaction status notifications sent from Tunzaa Pay to your system.
Transaction Status Callback
#Method: POST
Tunzaa Pay sends POST requests to your callback URL when transaction status changes occur.
| Parameter | Type | Description |
|---|---|---|
| transaction_idRequired | string | Unique identifier for the transaction on Tunzaa Pay |
| reference_idRequired | string | Reference for the transaction on the merchant's system |
| statusRequired | string | Current status of the transaction (COMPLETED, FAILED) |
| amountRequired | string | Transaction amount |
| payment_date | string | Payment date (Format: YYYY-MM-DD HH:mm:ss) |
| timestampRequired | string | When the callback was sent (Format: YYYY-MM-DD HH:mm:ss) |
This is what you'll receive from Tunzaa Pay