Endpoint is used to search for a buyer by email and merchant code, and returns buyerId in response.
<?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 = '';
$request = new Request('GET', 'https://pay-sandbox.billerbase.com/api/v2/buyers/email/test@test.test', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();curl --location 'https://pay-sandbox.billerbase.com/api/v2/buyers/email/test@test.test' \
--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/v2/buyers/email/test@test.test',
'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);
});HTTP returns: 404(Not Found) - no buyer found and EMAIL FREE.{
"data": {
"buyerId": "9a13bcc8-6c93-4eec-a4de-dadc0a2a656c"
},
"meta": []
}The list of possible errors for this endpoint, along with their types and interpretation, is provided in the general reference: Endpoint response errors.