Change buyer data

PATCH
/api/v2/buyers/{buyerId}
lts

The endpoint changes the buyer data if necessary. Currently, the endpoint is used only to change the email.

Header parameters
Attribute
Requirement
Description
x-public-key
mandatory
a public key that identifies the merchant account (there can be several for one merchant)
x-buyer-ip
mandatory
is responsible for information about the buyer's IP address
x-date
mandatory
is responsible for the date and time of sending the request
x-token
mandatory
generated on the merchant side
x-source
mandatory
pass the value shop
x-id
mandatory
merchant name
Request parameters
Attribute
Type
Requirement
Description
Standard
buyerId
string
mandatory
Unique identifier of buyer in the system
uuid
email
string
mandatory
Buyer's new email
-
<?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 = '{
  "email": "test@test.com"
}';
$request = new Request('PATCH', 'https://pay-sandbox.billerbase.com/api/v2/buyers/000229c8-e3b7-480e-a482-4408f7b969b8', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
curl --location --request PATCH 'https://pay-sandbox.billerbase.com/api/v2/buyers/000229c8-e3b7-480e-a482-4408f7b969b8' \
--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-raw '{
  "email": "test@test.com"
}'
1{
2  "email": "test@test.com"
3}
var request = require('request');
var options = {
  'method': 'PATCH',
  'url': 'https://pay-sandbox.billerbase.com/api/v2/buyers/000229c8-e3b7-480e-a482-4408f7b969b8',
  '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({
    "email": "test@test.com"
  })

};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
Response parameters

Depending on the success of the request, the following answers may be received:

  1. if HTTP: 204(No content) is returned - the email has been successfully changed.
  2. if HTTP returns: 404(Not Found) is returned - the buyer not found in the Billing database.
  3. if HTTP: 409(Conflict) is returned - this email is ALREADY busy.
  4. if HTTP: 422(Unprocessable Content) is returned - the email has been .
Errors and interpretation

The list of possible errors for this endpoint, along with their types and interpretation, is provided in the general reference: Endpoint response errors.