Mobile Money Integration Guide
Integrate mobile money payments with PayOS
Overview
Mobile money integration with PayOS enables you to accept payments through various mobile money providers in Zambia. This guide details the complete integration process using PayOS’s API.
Prerequisites
Before integrating mobile money payments, ensure you have:
- A PayOS account with mobile money enabled
- OAuth2 client credentials (Client ID and Secret)
- Webhook endpoint configured to receive transaction status updates
Integration Steps
1. Authentication (OAuth2 Client Credentials Flow)
First, obtain an access token using your OAuth2 credentials:
The response will include your access token:
2. Session Creation
Create a payment session using the obtained access token:
The response will include:
In case of failure:
Important:
- The
merchantReference
must be unique for each transaction and contain only alphanumeric characters- You’ll handle the payment flow in your application using the
sessionId
3. Transaction Initiation
Initiate the mobile money transaction using the session ID:
Transaction Response
A successful initiation will return a response like this:
Transaction States
After initiation, the transaction will move through different states:
-
PENDING: Transaction has been accepted and is being processed
- At this point, you should display a loading page to the user
- The customer will receive a prompt on their mobile phone to approve the payment
-
SUCCESS: Transaction has been successfully completed
- You will receive a webhook notification
- The customer’s payment has been processed
-
FAILED: Transaction has failed
- You will receive a webhook notification with the failure reason
- The customer should be prompted to try again
Transaction Response Examples
Successful Response
Pending Response
Failed Response
Common Failure Scenarios
Here’s an example of a failure response:
The following table lists all possible failure codes and their descriptions:
Supported Providers
PayOS supports the following mobile money providers in Zambia:
PayOS supports the following mobile money providers in Ghana:
Best Practices
Security
- Store OAuth credentials securely
- Use HTTPS for all API calls
- Implement proper error handling
- Validate all input data
Transaction Management
- Implement proper logging
- Monitor webhook notifications
- Set up alerts for failed transactions
- Handle timeout scenarios appropriately
Testing
- Use test credentials in sandbox environment
- Test with various amount ranges
- Verify error scenarios
- Test webhook integration thoroughly
Sandbox Testing Numbers
When testing in the sandbox environment, use the following phone numbers to simulate different transaction scenarios:
Any other valid phone number format will result in a successful transaction in the sandbox environment.
Note: These test numbers are for sandbox testing only and will not work in the production environment.
Rate Limiting
- Standard rate limit: 100 requests per minute
- Burst rate limit: 200 requests per minute for 5 minutes
- Implement exponential backoff for retries
Support
For integration support:
- Technical documentation: docs.payos.money
- Email support: support@payos.money
- Integration support hours: 24/7