Get buyer's charge methods

get
/api/v2/buyers/{buyerId}/charge-methods
lts

This the endpoint is necessary to receive all payment methods for the selected buyer.

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
identifier of the type of service that is the initiator of the request
x-id
mandatory
service identifier from which the current request is made
Request parameters
Attribute
Type
Requirement
Description
Standard
buyerId
string
mandatory
Unique identifier of buyer in the system
uuid
<?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/v2/buyers/9b9de689-a64f-4231-bec8-d3f20edd04e4/charge-methods', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
curl --location --request GET 'https://pay-sandbox.billerbase.com/api/v2/buyers/9b9de689-a64f-4231-bec8-d3f20edd04e4/charge-methods' \
--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/9b9de689-a64f-4231-bec8-d3f20edd04e4/charge-methods',
  '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);
});
Response parameters
Attribute
Type
Description
data
array of objects
An array of objects that contains information related to each of the payment methods of a particular bayer
meta
object
Provides metadata about the response
{
    "data": [
        {
            "paymentMethodType": "card",
            "paymentMethodIdentifier": "**** **** **** 4444",
            "chargeMethodId": "d23ed15a-4c1e-409e-b26e-7966a2f66168"
        }
    ],
    "meta": {
        "type": "collection",
        "total": 1,
        "offset": 0
    }
}
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.