API Testing Guide
Learn how to test your meCash API integration using various tools and methods.Testing Tools
cURL
Command-line tool for making HTTP requests
Postman
Popular GUI tool for API testing
Code Examples
Language-specific examples in our docs
Basic Authentication Test
Test your API key authentication with the sandbox environment:Testing Common Endpoints
1. Get All Wallets
2. Create a Quote
3. Create a Payout
Simulating Payout States
In the sandbox environment, you can simulate different payout outcomes to test your webhook handling. This is particularly useful for testing error scenarios and ensuring your integration handles failed payouts correctly.Simulating a Failed Payout
To simulate a payout failure and trigger thepayout.failed webhook, simply include “failed” as the remark field in your payout request:
When you include
"remark": "fail" in your payout request, the system will process the payout as a failure and send a payout.failed webhook to your configured webhook URL. This allows you to test your failure handling logic without real transactions.Expected Webhook Response
After submitting a payout with"remark": "fail", you will receive a payout.failed webhook event:
Simulating Virtual Account Funding
Testing your collection flow is critical. In sandbox, you can simulate an incoming bank transfer to any of your virtual accounts.How to Simulate Funding
To credit a virtual account, use the simulation endpoint:Note: The
amount should be in the lowest denomination (e.g., 500000 = 5,000 NGN). This will trigger a virtualaccount.completed webhook.Postman Collection
Import this collection into Postman for easy testing:Error Testing
Test error scenarios to ensure proper handling:Invalid API Key
Missing Required Fields
Rate Limit Testing
Test rate limits by making multiple rapid requests:Webhook Testing
Test webhook endpoints using tools like webhook.site:- Go to webhook.site
- Copy the provided URL
- Add it to your meCash webhook configuration
- Trigger events to see webhook payloads
Environment Variables
Set up environment variables for testing:Testing Checklist
- API key authentication works
- All required endpoints respond correctly
- Error handling works as expected
- Rate limits are respected
- Webhooks are received and processed
- Response formats match documentation
- Required fields validation works
- Optional fields are handled properly
Need Help?
- Check the API Reference for detailed endpoint documentation
- Review Error Codes for troubleshooting
- Contact support at [email protected]

