Endpoint is responsible for creating a buyer without subscription. Can be used when the buyer is missed not in the system.
<?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 = '{
"merchantCode": "<your-brand-code>",
"email": "test@test.test",
"country": "nl",
"zip": null,
"state": null,
"locale": "en"
}';
$request = new Request('POST', 'https://pay-sandbox.billerbase.com/api/v2/buyers', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();curl --location 'https://pay-sandbox.billerbase.com/api/v2/buyers' \
--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 'Content-Type: application/json' \
--data-raw '{
"merchantCode": "<your-brand-code>",
"email": "test@test.test",
"country": "nl",
"zip": null,
"state": null,
"locale": "en"
}'1{
2 "merchantCode": "<your-brand-code>",
3 "email": "test@test.test",
4 "country": "nl",
5 "zip": null,
6 "state": null,
7 "locale": "en"
8}var request = require('request');
var options = {
'method': 'POST',
'url': 'https://pay-sandbox.billerbase.com/api/v2/buyers',
'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({
"merchantCode": "<your-brand-code>",
"email": "test@test.test",
"country": "nl",
"zip": null,
"state": null,
"locale": "en"
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});{
"data": {
"id": "028afc6c-34d4-4925-8b08-4ea88a94a878"
},
"meta": {
"type": "entity"
}
}The list of possible errors for this endpoint, along with their types and interpretation, is provided in the general reference: Endpoint response errors.