Virtual Accounts Setup Preferred Bank To generate virtual account, can set a default preferred bank you would like your customers to generate. This will be the default bank your customer can generate.
NOTE: You can pass bankcode as a field to the generate account endpoint to generate account number on the go without considering the default set bank. Get the list of available bank and their code from the partnerbank endpoint.
POST
https://api.oneappgo.com/v1/updatebankprefer
Request Body
200: OK
Copy {
"status": true,
"responseCode": "01",
"message": "Preferred bank successfully updated"
}
Take a look at how you might do this:
cURL NodeJs PHP - cURL Dart
Copy curl --location 'https://api.oneappgo.com/v1/updatebankprefer' \
--header 'Authorization: Bearer SECRET_KEY' \
--header 'Content-Type: application/json' \
--data '{
"bankcode": "090267",
"bankname": "Kuda Bank"
}'
Copy var request = require('request');
var options = {
'method': 'POST',
'url': 'https://api.oneappgo.com/v1/updatebankprefer',
'headers': {
'Authorization': 'Bearer SECRET_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"bankcode": "090267",
"bankname": "Kuda Bank"
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
Copy $curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.oneappgo.com/v1/updatebankprefer',
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 =>'{
"bankcode": "090267",
"bankname": "Kuda Bank"
}',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer SECRET_KEY',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Copy var headers = {
'Authorization': 'Bearer SECRET_KEY',
'Content-Type': 'application/json'
};
var request = http.Request('POST', Uri.parse('https://api.oneappgo.com/v1/updatebankprefer'));
request.body = json.encode({
"bankcode": "090267",
"bankname": "Kuda Bank"
});
request.headers.addAll(headers);
http.StreamedResponse response = await request.send();
if (response.statusCode == 200) {
print(await response.stream.bytesToString());
}
else {
print(response.reasonPhrase);
}