This API will receive a withdrawal request with necessary information.
Through this API, a new withdrawal request is received by VivaroPay.
Endpoint
Request Header
Include the following request headers:
Parameter | Value | Required |
---|---|---|
Authorization | Token found from the Get Token API | YES |
Content-Type | application/json | YES |
Accept | application/json | NO |
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
withdrawal_id | String | YES | Unique withdrawal id for each withdrawal request. |
method | String | YES | Withdrawal method. Must be one of bkash | nagad | rocket | upay |
wallet | String | YES | bkash | nagad | rocket | upay - wallet number |
amount | Number | YES | Withdrawal amount |
meta_data | JSON | NO | Optional data. Must be in json format. I.E: {"pid": 17} |
webhookUrl | String | NO | Valid URL to which VivaroPay will send the withdrawal information silently in post format. |
Response Parameters
Parameter | Type | Description |
---|---|---|
status | Boolean | Request status (True or False) |
statusMessage | String | Request status message |
withdrawalID | String | Gateway generated withdrawal id |
method | String | Withdrawal method. (bkash | nagad | rocket | upay). |
wallet | String | bkash | nagad | rocket | upay - wallet number |
amount | Float | Requested amount |
charge | Float | Withdrawal charge |
remainingBalance | Float | Remaining account balance |
Example Code
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://vivaropay.live/api/v1.0.0-beta/withdrawal/makeNew',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"withdrawal_id": "W874589241",
"method": "bkash",
"wallet": "018********",
"amount": "500"
}',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer Your Token',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
curl --location 'httpd://vivaropay.pro/api/v1.0.0-beta/withdrawal/makeNew' \
--header 'Authorization: Bearer Your Token' \
--header 'Content-Type: application/json' \
--data '{
"methodID": "13",
"amount": "500"
}'
Success response
{
"status": true,
"statusMessage": "Withdrawal request is successful",
"withdrawalID": "WD-6749",
"method": "bkash",
"wallet": "018********",
"amount": 500,
"charge": 10,
"remainingBalance": 6490
}
Error Response
{
"status": false,
"statusMessage": "Not enough balance",
}