Introduction
#Welcome to the Malipo 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.tzAuthentication
#The Malipo API uses API keys to authenticate requests. You can view and manage your API keys in the Dashboard.
Exchange your api_key and secret_key for a time-limited Bearer token via POST /accounts/request/token. Keep your credentials secure and never expose them in client-side code or public repositories.
X-Environment header (sandbox or live).AI Integration (MCP)
#Malipo by Tunzaa supports the Model Context Protocol (MCP). Add this single config to any MCP-compatible editor (Claude Desktop, Cursor, Windsurf, etc.) and your AI assistant gets full context about the Malipo API.
Why use MCP?
By configuring the MCP server, you give your AI context about the Malipo API, enabling it to write integration code, debug errors, and answer questions specifically for your codebase.
- Claude Desktop: Settings > Developer > Edit Config, then paste the JSON into the
mcpServerssection. - Cursor: Settings > Features > MCP, then add a new server and paste the JSON config (or open
mcp.json). - Windsurf: Open the Cascade panel, click the MCPs icon, choose
View Raw Config, and paste the JSON into themcpServerssection.
Authentication
#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. In sandbox mode you can simulate outcomes via the X-Sandbox-Scenario header (success, failure).
X-Sandbox-Scenario header (e.g., success or failure) to simulate transaction outcomes without real money moving.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: GET
Retrieve a paginated list of installment plans.
| Parameter | Type | Description |
|---|---|---|
| page | number | Page number (default: 1) |
| page_size | number | Items per page (default: 20, max: 1000) |
Get Plan Details
#Method: GET
Retrieve full details for a specific installment plan including the customer, plan summary, and generated installments. Append ?include_payments=true to also receive completed payment history and progress totals.
| Parameter | Type | Description |
|---|---|---|
| plan_idRequired | number | The unique 6-digit plan identifier |
| include_payments | boolean | When true, adds payment_history and progress (paid/remaining/percentage) to the response |
Update Plan
#Method: PUT
Partially update a plan and/or its customer. Changing any critical plan field (start_date, end_date, total_amount, payment_frequency, or custom_interval) will regenerate the installment schedule. Other fields update in place without affecting installments.
| Parameter | Type | Description |
|---|---|---|
| plan_idRequired | number | The unique 6-digit plan identifier |
Cancel Plan
#Method: DELETE
Terminate an installment plan.
| Parameter | Type | Description |
|---|---|---|
| plan_idRequired | number | - |
Invoices
#Create, send, and manage customer-facing invoices. Invoices support a public payment page and mobile money C2B push.
Create Invoice
#Method: POST
Create a new invoice for the authenticated merchant. Set `save_as_draft` to true to keep it as a draft; otherwise it is marked as sent immediately.
List Invoices
#Method: GET
List invoices for the authenticated merchant. Admins can filter by merchant and status.
| Parameter | Type | Description |
|---|---|---|
| status | string | Filter by status: draft, sent, paid, cancelled, expired |
| merchant | string | Admin only: filter by merchant_id |
Get Invoice
#Method: GET
Retrieve full details of a specific invoice.
| Parameter | Type | Description |
|---|---|---|
| invoice_idRequired | string | The invoice ID (e.g. INV-XXXXXXX) |
Update Invoice
#Method: PATCH
Partially update an invoice. Only draft invoices can be updated.
| Parameter | Type | Description |
|---|---|---|
| invoice_idRequired | string | The invoice ID |
Cancel Invoice
#Method: DELETE
Cancel/void an invoice. Paid invoices cannot be cancelled.
| Parameter | Type | Description |
|---|---|---|
| invoice_idRequired | string | The invoice ID |
Send Invoice Email
#Method: POST
Send (or re-send) the invoice payment link to the recipient's email.
| Parameter | Type | Description |
|---|---|---|
| invoice_idRequired | string | The invoice ID |
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
- Malipo 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 is not 200 OK
Callbacks
#Transaction status notifications sent from Malipo to your system.
Transaction Status Callback
#Method: POST
Malipo sends POST requests to your configured sandbox or live callback URL when a transaction completes, fails, or is linked to an invoice. The X-Signature header is an HMAC-SHA256 hex digest of the JSON payload (with alphabetically sorted keys) computed using the API secret key for the transaction's environment.
| Parameter | Type | Description |
|---|---|---|
| transaction_id | string | Unique identifier for the transaction on Malipo |
| reference_id | string | Reference for the transaction on the merchant's system |
| invoice_id | string | Invoice ID if the transaction was linked to an invoice, otherwise null |
| status | string | Current status of the transaction (COMPLETED, FAILED) |
| amount | string | Transaction amount |
| payment_date | string | Payment date (Format: YYYY-MM-DD HH:mm:ss) |
| timestamp | string | When the callback was sent (Format: YYYY-MM-DD HH:mm:ss) |
| remark | string | Human-readable note about the transaction status |
This is what you'll receive from Malipo
