Create Disbursement
The Create Disbursement API allows merchants to initiate a disbursement request. This process involves generating a disbursement ID that can be used to query the disbursement. Upon validation of request body information, the create disbursement request will be confirmed.
Endpoint
Request URL: https://apihit.net/api/disbursement/create
Request Headers
| Header Name | Value |
|---|---|
| Content-Type | application/json |
| Accept | application/json |
| X-Signature | The HMAC signature used for verification. |
Request Parameters
| Property | Presence | Type | Description |
|---|---|---|---|
| mid | Mandatory | String | Provided by creedo during onboarding. |
| disbursement_method | Mandatory | String | This parameter indicates the method of disbursement. For NAGAD_P2C, the value of this parameter should be "NAGAD_P2C". |
| merchant_disbursement_id | Mandatory | String | Unique invoice number used on the merchant side for this specific disbursement. Max length is 25 characters. Special characters "<", ">" and "&" are not allowed. |
| disbursement_amount | Mandatory | Integer | Amount of the disbursement to be made. |
| disbursement_currency | Mandatory | String | Currency of the mentioned amount. For NAGAD_P2C, the value of this parameter should be "BDT". |
| customer_account_number | Mandatory | String | The customer account number where Creedo will send the disbursement amount. |
| ipn_url | Mandatory | String | URL where creedo sends Instant Disbursement Notification. It must accept POST request from creedo. |
| customer_id | Optional | String | Unique user ID on the merchant's side. |
| customer_name | Optional | String | Full name of the user on the merchant's side. |
| customer_phone_number | Optional | String | Registered phone number of the user on the merchant's side. |
| customer_email | Optional | String | Registered email address of the user on the merchant's side. |
| customer_type | Optional | String | Type of the user. Possible values: Trusted, FTD, MTD, YTD, Others. |
| customer_ip | Optional | String | Current IP address of the user. |
| btag | Optional | String | Btag identifier of the customer. |
| additional_info_1 | Optional | String | Additional information. |
| additional_info_2 | Optional | String | Additional information. |
Success Response Parameters
| Property | Type | Description |
|---|---|---|
| gateway_status | String | "accepted" |
| creedo_disbursement_id | String | Creedo-generated disbursement ID for this disbursement creation request. This disbursement ID can be used later to track the disbursement and in other disbursement-related APIs. |
Error Response Parameters
| Property | Type | Description |
|---|---|---|
| gateway_status | String | "rejected" |
| message | String | Error message here. |
Signature Generation
The signature (X-Signature) is generated using HMAC with SHA-256. It uses the secret_key and a secret_string as inputs. All inputs should be in string format:
secret_string = mid:merchant_disbursement_id:disbursement_method:disbursement_currency:disbursement_amount
Request Body
POST /api/disbursement/create HTTP/1.1
Host: https://apihit.net
Content-Type: application/json
Accept: application/json
{
"mid": "CREEDO12345",
"disbursement_method": "NAGAD_P2C",
"merchant_disbursement_id": "INV123456789",
"disbursement_amount": 5000,
"disbursement_currency": "BDT",
"customer_account_number": "01712345678",
"ipn_url": "https://example.com/ipn-handler",
"customer_id": "USER12345", // Optional
"customer_name": "John Doe", // Optional
"customer_phone_number": "+88017XXXXXXXX", // Optional
"customer_email": "johndoe@example.com", // Optional
"customer_type": "Trusted", // Optional
"customer_ip": "192.168.1.1", // Optional
"btag": "BTAG001", // Optional
"additional_info_1": "Loyal customer", // Optional
"additional_info_2": "" // Optional
}
Success Response
A successful response will return a JSON object containing:
{
"gateway_status": "accepted",
"creedo_disbursement_id": "3C8HL0MHX9"
}
Error Response
In case of an error, the API will return a JSON object with error details:
{
"gateway_status": "rejected",
"message": "Unknown error occurred."
}
Notes
- The
merchant_disbursement_idmust be unique for each transaction to prevent duplication.