Your Reliable Partner
Welcome to the official Dischub API documentation. Please read the documentation carefully before integrating.
Dischub provides an easy to use integration for receiving payments between Dischub and Merchant's online platforms. This integration focuses on how to:
If you have no programming skills, you can find a developer
You are going to config your account. Follow below steps on how to config account.
You need to create a payment order to Dischub by sending a POST request with three (3) required arguments to initiate a transaction. These arguments include: POST Endpoint URL, Request Headers and Request Data.
https://dischub.co.zw/api/orders/create/
The API supports application/json. Your API key must be passed in the request headers, not in the request body.
headers = {
"Content-Type": "application/json",
"X-Api-Key": "6945f57cdbf14b00812cb15df1933f2a"
}
Replace the following data in the request body with your own payment details:
request = {
"order_id" : "344245663",
"sender" : "+263780070488",
"recipient" : "softwarez@gmail.com",
"amount" : 14.58,
"currency" : "USD",
"callback_url" : "https://softwarez.co.zw/payment/status/",
"redirect_url" : "https://softwarez.co.zw/take/me/back/"
}
The request body should include the following fields. Please take note of instructions highlighted in red color
+263780070488 or 0780070488.After making a POST request, you will receive a JSON response indicating the status of the request. Below are all possible responses you may encounter.
If your request is well integrated, you will receive the following response:
{
"status": "success",
"message": "order created successfully",
"response_code": 201
}
If the X-Api-Key header is missing entirely, you will get the following response:
{
"status": "error",
"message": "missing api key in request headers",
"response_code": 401
}
If one or more required fields are missing or empty in the request body, you will get the following response:
{
"status": "error",
"message": "missing or invalid required keys in request data",
"response_code": 422
}
If the order_id is not sent as a string (e.g. sent as an integer), you will get the following response:
{
"status": "error",
"message": "order_id must be posted as a string",
"response_code": 400
}
If you use the same order_id that was already used in a previous request, you will get the following response:
{
"status": "error",
"message": "duplicate order_id detected, please create a new unique order_id",
"response_code": 409
}
If the order_id is longer than 30 characters, you will get the following response:
{
"status": "error",
"message": "order_id must be 30 characters or less",
"response_code": 422
}
If the amount is not a valid number, or is zero, negative, or 481 and above, you will get the following response:
{
"status": "error",
"message": "amount must be greater than 0 and less than 481",
"response_code": 422
}
If the sender's phone number does not match an accepted format, you will get the following response:
{
"status": "error",
"message": "invalid sender phone number format",
"response_code": 422
}
If the currency value is anything other than USD or ZWG, you will get the following response:
{
"status": "error",
"message": "invalid or unsupported currency. Accepted values: USD, ZWG",
"response_code": 400
}
If the X-Api-Key header and recipient do not match any merchant account, you will get the following response:
{
"status": "error",
"message": "authorization failed: wrong api key or recipient identifier",
"response_code": 401
}
If your merchant account has no business name configured, you will get the following response:
{
"status": "error",
"message": "merchant account has no business name configured",
"response_code": 403
}
If the payment gateway charges are not configured on the server, you will get the following response:
{
"status": "error",
"message": "payment gateway charges are not configured, please contact support",
"response_code": 503
}
If an unexpected server error occurs during order creation, you will get the following response:
{
"status": "error",
"message": "order could not be created due to an internal error",
"response_code": 500
}
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/{orderid}
{orderid} → The unique order ID generated by your system for the transaction.
https://dischub.co.zw/api/make/payment/to/344245663
Once successfully redirected to Dischub platform, client has to select payment method of choice and complete all further processes until they get either a "Payment successful" or "Payment failed"
This applies when the callback_url fails to receive payment status from Dischub, or when no callback_url was set, as it is optional.
Once a payment is processed, you will need to make a POST request to the Dischub payment status 3 step URL. This allows you to track the success or failure of transactions in real time.
https://dischub.co.zw/api/payment/status/3/step/
The API supports application/json. Your API key must be passed in the request headers, not in the request body.
headers = {
"Content-Type": "application/json",
"X-Api-Key": "6945f57cdbf14b00812cb15df1933f2a"
}
Replace the following data in the request body with your own credentials and the order you want to check:
request = {
"order_id" : "344245663",
"recipient" : "softwarez@gmail.com"
}
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 JSON response indicating the status of the request. Below are all possible responses you may encounter.
If your request is well integrated, you will receive the following response:
{
"order_id" : "344245663",
"recipient" : "My Business Name",
"sender" : "+263780070488",
"status" : "success",
"currency" : "USD",
"amount" : "14.58",
"timestamp" : "2025-01-09 04:20:08.702591+00:00"
}
If the X-Api-Key header is missing entirely, you will get the following response:
{
"status": "error",
"message": "missing api key in request headers",
"response_code": 401
}
If one or more required fields are missing or empty in the request body, you will get the following response:
{
"status": "error",
"message": "missing or invalid required keys in request data",
"response_code": 422
}
If the X-Api-Key header and recipient do not match any merchant account, you will get the following response:
{
"status": "error",
"message": "authorization failed: wrong api key or recipient identifier",
"response_code": 401
}
If no order is found matching the provided order_id and recipient, you will get the following response:
{
"status": "error",
"message": "no order found matching the provided order_id and recipient",
"response_code": 404
}
If an unexpected server error occurs while retrieving the order, you will get the following response:
{
"status": "error",
"message": "an unexpected error occurred while retrieving the order",
"response_code": 500
}
The status field in the success response can have the following values: "success" (payment completed), "pending" (payment not yet confirmed) or "failed" (payment failed or timed out). Use this to update your system accordingly.
If you face challenges, get help from our developers on Whatsapp
Dischub provides an easy to use, customizable WordPress plugin for receiving payments on your WordPress website. This integration focuses on how to:
No programming skills are required to integrate this plugin into a WordPress website.
You are going to config your account. Follow below steps on how to config account.
You will download the Dischub Payments plugin from the Dischub website to your computer, then upload and activate it on your WordPress website. Optionally, you can customize the payment form and CSS styling before uploading.
Click the link below to download the plugin ZIP file to your computer:
Download Dischub Payments Plugin
Before uploading, you can optionally customize the plugin to match your website's look and feel:
dischub-payments.php file./assets/css/dischub-style.css file to match your website's colors and typography.After downloading (and optionally customizing) the plugin, upload and activate it on your WordPress website using one of the following two methods:
dischub-payments.zip file you downloaded.dischub-payments.zip file on your computer.dischub-payments folder to your server at /wp-content/plugins/.Once the plugin is activated, you must link it to your Dischub merchant account before it can process payments:
Please take note of instructions highlighted in red color
Once the plugin is installed, activated, and configured with your credentials, you can start accepting payments on any page or post of your WordPress website.
[dischub_payment]
After your customers complete payments through the plugin, you can monitor all transactions and their statuses directly from your Dischub merchant dashboard. No additional setup is required — all payments are recorded automatically.
Only payments that were fully completed on the Dischub platform will appear as "success" in your dashboard. Payments that were initiated but not completed will appear as "pending".
If you face challenges, get help from our developers on WhatsApp.
"Highly recommend dischub. The onboarding process is seamless and the tech support is phenomenal."
"I totally recommend the API, it's easy to intergrate and their charges are good only 2% "
"very happy, n it gets the job done at no cost. highly recommend it. can be improved though on the UI"
"dischub is very simple to understand, it is not complicated like other payment gateways"
"👍🏻👍🏻"