This endpoint allows you to deactivate a specific payment method token belonging to the buyer. Deactivation makes it impossible to further use the token for future transactions.
<?php
$client = new Client();
$headers = [
'x-date' => '<current date format(Y-m-d H:i:s.u)>',
'x-public-key' => '<your public key uuid>',
'x-buyer-ip' => <external ip>',
'x-token' => '<generated token>',
'x-source'=> 'shop',
'x-id' => '<your-service-id>',
'Content-Type' => 'application/json'
];
$body = '{
"chargeMethodTokenId": 630
}';
$request = new Request('PUT', 'https://pay-sandbox.billerbase.com/api/v3/buyers/9b4afcac-c8e4-4b0e-a98b-6fd6053db120/disable-token', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();curl --location --request PUT 'https://pay-sandbox.billerbase.com/api/v3/buyers/9b4afcac-c8e4-4b0e-a98b-6fd6053db120/disable-token' \
--header 'x-date: <Y-m-d H:i:s.u (current date)>' \
--header 'x-public-key: <your public key uuid>' \
--header 'x-buyer-ip: <external ip>'\
--header 'x-token: <generated token>' \
--header 'x-source: shop' \
--header 'x-id: <your-service-id>' \
--header 'Content-Type: application/json' \
--data '{
"chargeMethodTokenId": 630
}'1{
2 "chargeMethodTokenId": 630
3}var request = require('request');
var options = {
'method': 'PUT',
'url': 'https://pay-sandbox.billerbase.com/api/v3/buyers/9b4afcac-c8e4-4b0e-a98b-6fd6053db120/disable-token',
'headers': {
'x-date': '<current date format(Y-m-d H:i:s.u)>',
'x-public-key': '<your public key uuid>',
'x-buyer-ip': <external ip>',
'x-token': '<generated token>',
'x-source': 'shop',
'x-id': '<your-service-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"chargeMethodTokenId": 630
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});After the request is executed, the token for the buyer payment method is activated and the status 204 is returned without any data indicating the successful completion of the request.
The list of possible errors for this endpoint, along with their types and interpretation, is provided in the general reference: Endpoint response errors.