This endpoint returns a list of all tokens associated with the buyer. Includes detailed information about each token and payment method.
<?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'
];
$request = new Request('GET', 'https://pay-sandbox.billerbase.com/api/v3/buyers/9d51eace-eba6-455d-9037-bb2f76c2c85b/tokens', $headers);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();curl --location 'https://pay-sandbox.billerbase.com/api/v3/buyers/9d51eace-eba6-455d-9037-bb2f76c2c85b/tokens' \
--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'var request = require('request');
var options = {
'method': 'GET',
'url': 'https://pay-sandbox.billerbase.com/api/v3/buyers/9d51eace-eba6-455d-9037-bb2f76c2c85b/tokens',
'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'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});{
"data": [
{
"id": "6a6d2f1a-cc44-4779-a937-147494fb9e69",
"value": "5032",
"paymentMethodType": "card",
"paymentMethodIdentifier": "461fb87dfb1336593ae416e9ca6b8a1652c4262d6ea8b694acfe1c873013ddb1124e23cbb02ef1c7af5717b1b649476ff633c1fa63f2190aec215ae0c0818849",
"tokens": [
{
"id": 1163866,
"provider": "safecharge",
"mid": "default",
"bin": "400002",
"email": "qa.auto+st+olkgqsehap@test.com",
"isEnabled": true,
"chargeId": "1ead2740-e000-4805-bdcb-13d0dedda2e2",
"createdAt": "2024-10-24 06:32:54",
"updatedAt": "2024-10-24 08:23:21",
"successfullyUsedAt": "2024-10-24 06:32:54"
}
]
}
],
"meta": {
"type": "collection",
"total": 1,
"offset": 0
}
}The list of possible errors for this endpoint, along with their types and interpretation, is provided in the general reference: Endpoint response errors.