ZenoPay API Technical Reference v1.0
Introduction
This document provides the complete technical reference for ZenoPay's Mobile Money Payments API for Tanzania. It covers all endpoints, request/response formats, and webhook implementations.
https://zenoapi.com
Authentication
All API requests require authentication via an API key sent in the request header:
x-api-key: YOUR_API_KEY
Note: Replace YOUR_API_KEY with the key provided in your ZenoPay dashboard.
Base URL
The base URL for all API endpoints is:
https://zenoapi.com
All endpoint paths are relative to this base URL.
POST 1. Initiate Mobile Money Payment
Initiate a mobile money payment transaction via USSD push.
Endpoint
/api/payments/mobile_money_tanzania
Request Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
order_id |
string | Yes | Unique transaction identifier (UUID recommended) | "3rer407fe-3ee8-4525-456f-ccb95de38250" |
buyer_email |
string | Yes | Payer's valid email address | "customer@example.com" |
buyer_name |
string | Yes | Payer's full name (no special characters) | "John Joh" |
buyer_phone |
string | Yes | Tanzanian mobile number (format: 07XXXXXXXX) | "0744963858" |
amount |
number | Yes | Transaction amount in TZS (no decimals) | 1000 |
webhook_url |
string | No | URL for receiving payment status updates | "https://yourdomain.com/webhook" |
Example Request
{
"order_id": "3rer407fe-3ee8-4525-456f-ccb95de38250",
"buyer_email": "customer@example.com",
"buyer_name": "John Joh",
"buyer_phone": "0744963858",
"amount": 1000,
"webhook_url": "https://yourdomain.com/webhook"
}
Responses
Success Response (200 OK)
{
"status": "success",
"resultcode": "000",
"message": "Request in progress. You will receive a callback shortly",
"order_id": "3rer407fe-3ee8-4525-456f-ccb95de38250"
}
Error Responses
| HTTP Status | Response Body | Description |
|---|---|---|
| 400 Bad Request | {"status":"error","message":"Invalid request payload"} |
Missing or invalid parameters |
| 401 Unauthorized | {"status":"error","message":"Invalid API Key"} |
Invalid or missing API key |
| 500 Server Error | {"status":"error","message":"Internal server error"} |
Server-side processing error |
GET 2. Check Order Status
Check the current status of a payment order.
Endpoint
/api/payments/order-status?order_id={order_id}
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
order_id |
string | Yes | The order_id from the payment initiation response |
Example Request
curl -X GET "https://zenoapi.com/api/payments/order-status?order_id=3rer407fe-3ee8-4525-456f-ccb95de38250" \
-H "x-api-key: YOUR_API_KEY"
Success Response (200 OK)
{
"reference": "0936183435",
"resultcode": "000",
"result": "SUCCESS",
"message": "Order fetch successful",
"data": [
{
"order_id": "3rer407fe-3ee8-4525-456f-ccb95de38250",
"creation_date": "2025-05-19 08:40:33",
"amount": "1000",
"payment_status": "COMPLETED",
"transid": "CEJ3I3SETSN",
"channel": "MPESA-TZ",
"reference": "0936183435",
"msisdn": "255744963858"
}
]
}
Response Fields
| Field | Type | Description |
|---|---|---|
payment_status |
string | Current status (COMPLETED, PENDING, FAILED) |
channel |
string | Payment channel (MPESA-TZ, TIGO-TZ, AIRTEL-TZ) |
transid |
string | Mobile money transaction reference |
msisdn |
string | Customer phone number in international format |
Webhook Notifications
ZenoPay can send automatic notifications to your server when payment status changes to COMPLETED.
Setup Instructions
- Include the
webhook_urlparameter in your payment initiation request - Ensure your endpoint is publicly accessible via HTTPS
- Implement verification of the
x-api-keyheader - Return HTTP 200 OK response to acknowledge receipt
Example Payment Request with Webhook
{
"order_id": "3rer407fe-3ee8-4525-456f-ccb95de38250",
"buyer_email": "customer@example.com",
"buyer_name": "John Joh",
"buyer_phone": "0744963858",
"amount": 1000,
"webhook_url": "https://yourdomain.com/webhook"
}
Webhook Payload
When a payment status changes to COMPLETED, ZenoPay will POST a JSON payload to your webhook URL.
Headers
x-api-key: YOUR_API_KEY
Content-Type: application/json
Payload Example
{
"order_id": "677e43274d7cb",
"payment_status": "COMPLETED",
"reference": "1003020496",
"metadata": {}
}
Payload Fields
| Field | Type | Description |
|---|---|---|
order_id |
string | Original order ID from payment request |
payment_status |
string | Always "COMPLETED" for webhooks |
reference |
string | Mobile money transaction reference |
metadata |
object | Additional transaction data (currently empty) |
Support & Resources
Get help with integration, troubleshooting, and account management through our comprehensive support channels.
Support Channels
| Support Channel | Contact Information | Response Time |
|---|---|---|
| Email Support | support@zenopay.net | 24 hours |
| 0793166166 | Business hours (8AM - 5PM EAT) | |
| Documentation | zenopay-docs.netlify.app | 24/7 |
Common Integration Issues
| Issue | Solution |
|---|---|
| Invalid API Key | Ensure your API key is correctly set in the request headers as x-api-key: YOUR_API_KEY |
| Phone Number Format | Use Tanzanian format (0744001122) without country code or + sign |
| Webhook Not Receiving | Check your webhook URL is publicly accessible and returns 200 OK. Test with webhook.site first. |
| SSL Certificate | Ensure your webhook endpoint uses valid SSL certificate (Let's Encrypt offers free certificates) |
| Timeout Issues | Set request timeout to at least 60 seconds for payment requests |
| Payment Status Not Updating | Mobile money payments can take several minutes to complete. Use webhooks or poll the status endpoint periodically. |
Implementation Guides
- Guzzle Implementation - Recommended for modern PHP applications
- cURL Implementation - For systems without Composer
- Native PHP Implementation - Basic implementation without dependencies
Additional Resources
- ZenoPay Website - Official ZenoPay website
- ZenoPay GitHub Repository - Official GitHub page for various ZenoPay repositories
- Quickstart - Guzzle Documentation - A quick introduction to Guzzle and introductory examples.
- Webhook Best Practices - How to properly implement and secure webhooks