VIRTUAL CARDS Card Funding This endpoint is used to fund already issued card
POST
{{base_url}}/business/vcard-fund
Request Body
Already issued virtual card ID
Amount to fund the card with
Your secret keys are to be kept secret and only stored on your servers. Do not pass your secret key to the front-end language where it can be exploited.
Take a look at how you might do this:
cURL NodeJs PHP - cURL Dart
Copy curl -- location '{{base_url}}/business/vcard-fund' \
-- header 'Content-Type: application/json' \
-- header 'Authorization: Bearer SECRET_KEY' \
-- data '{
"vcardid": "ao022-22e23o-2238-2829d",
"amount": 5
}'
Copy const axios = require ( 'axios' );
let data = JSON .stringify ({
"vcardid" : "ao022-22e23o-2238-2829d" ,
"amount" : 5
});
let config = {
method : 'post' ,
maxBodyLength : Infinity ,
url : '{{base_url}}/business/vcard-fund'
headers: {
'Content-Type' : 'application/json' ,
'Authorization' : 'Bearer SECRET_KEY'
} ,
data : data
};
axios .request (config)
.then ((response) => {
console .log ( JSON .stringify ( response .data));
})
.catch ((error) => {
console .log (error);
});
Copy $curl = curl_init () ;
curl_setopt_array ( $curl , array(
CURLOPT_URL => '{{base_url}}/business/vcard-fund' ,
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 => '{
"vcardid": "ao022-22e23o-2238-2829d",
"amount": 5
}' ,
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json' ,
'Authorization: Bearer SECRET_KEY'
) ,
) ) ;
$response = curl_exec ( $curl ) ;
curl_close ( $curl ) ;
echo $response;
Copy var headers = {
'Content-Type' : 'application/json' ,
'Authorization' : 'Bearer SECRET_KEY'
};
var request = http. Request ( 'POST' , Uri . parse ( '{{base_url}}/business/vcard-fund' ));
request.body = json. encode ({
"vcardid" : "ao022-22e23o-2238-2829d" ,
"amount" : 5
});
request.headers. addAll (headers);
http. StreamedResponse response = await request. send ();
if (response.statusCode == 200 ) {
print ( await response.stream. bytesToString ());
}
else {
print (response.reasonPhrase);
}
Sample response
Successful Failed
Copy {
"status" : true ,
"responsecode" : "01" ,
"message" : "Virtual Card $5 is Processing" ,
"txref" : "0621121102020" ,
"charged" : 6 ,
"currency" : "USD"
}
Copy {
"status": false
"responsecode": "00",
"message": "Insufficient wallet balance for this transaction",
"txref": "",
"charged": ""
}
When the card funding is successfully processed, we will notify you via webhook notification with the funding details. Event_type as transactions and Paid_through as cardfunding