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.
1{
2 "uuid": "6642ea47-568c-4f12-bc85-dc750f5a140e",
3 "code": 3000,
4 "message": "Malformed request syntax.",
5 "traceId": "082d86c339533af07c14252afcecc7bd"
6}1{
2 "code": 0,
3 "message": "Malformed request syntax.",
4 "traceId": "082d86c339533af07c14252afcecc7bd",
5 "errors": [
6 {
7 "field": "coupon",
8 "title": "Coupon not found."
9 }
10 ]
11}The list of possible errors for this endpoint, along with their types and interpretation, is provided in the general reference: Endpoint response errors.