API Reference

New Withdrawal

This API will receive a withdrawal request with necessary information.

Through this API, a new withdrawal request is received by VivaroPay.

📘

Endpoint

https://vivaropay.live/api/v1.0.0-beta/withdrawal/makeNew

Request Header

Include the following request headers:

ParameterValueRequired
AuthorizationToken found from the Get Token APIYES
Content-Typeapplication/jsonYES
Acceptapplication/jsonNO

Request Parameters

ParameterTypeRequiredDescription
withdrawal_idStringYESUnique withdrawal id for each withdrawal request.
methodStringYESWithdrawal method. Must be one of bkash | nagad | rocket | upay
walletStringYESbkash | nagad | rocket | upay - wallet number
amountNumberYESWithdrawal amount
meta_dataJSONNOOptional data. Must be in json format. I.E: {"pid": 17}
webhookUrlStringNOValid URL to which VivaroPay will send the withdrawal information silently in post format.

Response Parameters

ParameterTypeDescription
statusBooleanRequest status (True or False)
statusMessageStringRequest status message
withdrawalIDStringGateway generated withdrawal id
methodStringWithdrawal method. (bkash | nagad | rocket | upay).
walletStringbkash | nagad | rocket | upay - wallet number
amountFloatRequested amount
chargeFloatWithdrawal charge
remainingBalanceFloatRemaining 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",
}