DiscHub
Processing your request, please wait...
Processing your request, please wait...
Welcome to the official Dischub API documentation. This API allows users to interact with the Dischub payment gateway, enabling users to create orders and manage transactions efficiently on their platforms.
Dischub provides an easy-to-use payment gateway API for sending and receiving payments between users. This API documentation focuses on how to:
If you have no programming skills, you can find a developer
You are going to use demo accounts to test our API on your plaform(s). Follow below steps on how to activate demo accounts.
You need to create a payment order to dischub by sending a POST request with the three (3) required aurguments to initiate a transaction. These aurguments include:
post endpoint url
request headers
request data
Please find them below in more detail :
https://dischub.co.zw/api/orders/create/
The API supports application/json
headers = { "Content-Type": "application/json" }
Replace the following data in the request body with your own credentials and payment details:
request = { "api_key" : "WKjY8yYwlTiZ3MxbDgFqVCJmx_E1RV9mLGTf_fppmqIELjy7791NWVJ1WGSCS27s", "notify_url" : "https://softwarez.co.zw/payments/success", "order_id" : "344245663564", "recipient" : "softwarez@gmail.com", "amount" : 14.58, "currency" : "USD" }
The request body should include the following fields. Please take note of instructions highlighted in red color
After making a post request, you will receive a response in form of json, indicating the status of the post request. Below are the possible responses you may encounter.
If your post request code is well integrated, you will receive the following response:
{ "status": "success", "message": "payment initiated", "response_code": 200 }
If you miss one or more keys in the request data, you will get the following response:
{ "status": "error", "message": "missing or invalid required keys", "response_code": 400 }
If you post a currency type other than 'USD' and 'ZWG' in the currency key in the request data, you will get the following response:
{ "status": "error", "message": "Invalid or unsupported currency", "response_code": 400 }
If you post an invalid notify_url, you will get the following response:
{ "status": "error", "message": "invalid notify_url format", "response_code": 400 }
If you post an order_id which is non-numeric, you will get the following response:
{ "status": "error", "message": "order_id must be numeric only", "response_code": 400 }
If you use an invalid api key or use an invalid Dischub business account email on the api_key
or recipient
keys respectively, you will get the following response:
{ "status": "error", "message": "authorization failed", "response_code": 401 }
This step comes after you have received a 'success' response from step 2 otherwise do not continue and revise your integration first
Upon 'success', the user is redirected to:
https://dischub.co.zw/api/make/payment/to/{recipient}/{orderid}{recipient} → Your email used to register your Dischub business account.
https://dischub.co.zw/api/make/payment/to/softwarez@gmail.com/344245663564
4a) User then has to click "Dischub" and login into their individual account by entering email, password and reference
**All fields are mandatory**
**Dischub is the only payment method for testing environment**
Once a payment is processed, Dischub will send a status update to the callback URL (notify_url) you provided during the order creation. This allows you to track the success or failure of transactions in real-time.
{ 'transaction_id': 277602, 'order_id' : '344245663564', 'reference': 'Brian Shumba', 'status': 'success', 'currency': 'USD', 'amount': '14.58', 'timestamp': '2025-01-09 04:20:08.702591+00:00' }
The status
field can have values such as "success" or "failed". Use this information to handle the transaction appropriately in your system.
If your callback URL is unreachable or returns an error, Dischub will retry the notification several times over a period of time. Ensure your endpoint is reliable and logs any issues for debugging purposes.
We recommend you to add more funds of all currencies in your individual demo accounts and test our api as many times as you can. When you get satisfied you can turn off all demo accounts and start receiving real funds.
If you face challenges, get help from other developers in our forum telegram group chat