Skip to main content
GET
/
buyers
/
payment-methods
List payment methods for buyer
using RestSharp;


var options = new RestClientOptions("https://api.sandbox.{id}.gr4vy.app/buyers/payment-methods");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
var response = await client.GetAsync(request);

Console.WriteLine("{0}", response.Content);
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.sandbox.{id}.gr4vy.app/buyers/payment-methods"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.sandbox.{id}.gr4vy.app/buyers/payment-methods")
.header("Authorization", "Bearer <token>")
.asString();
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.{id}.gr4vy.app/buyers/payment-methods",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import requests

url = "https://api.sandbox.{id}.gr4vy.app/buyers/payment-methods"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.sandbox.{id}.gr4vy.app/buyers/payment-methods', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
curl --request GET \
--url https://api.sandbox.{id}.gr4vy.app/buyers/payment-methods \
--header 'Authorization: Bearer <token>'
{
  "items": [
    {
      "type": "payment-method",
      "id": "77a76f7e-d2de-4bbc-ada9-d6a0015e6bd5",
      "merchant_account_id": "default",
      "method": "card",
      "label": "1111",
      "scheme": "visa",
      "additional_schemes": [
        "visa"
      ],
      "expiration_date": "11/25",
      "approval_target": "any",
      "approval_url": "https://api.example.app.gr4vy.com/payment-methods/ffc88ec9-e1ee-45ba-993d-b5902c3b2a8c/approve",
      "currency": "USD",
      "country": "US",
      "last_replaced_at": "2023-07-26T19:23:00.000+00:00",
      "has_replacement": false,
      "last_used_at": "2013-07-16T19:23:00.000+00:00",
      "usage_count": 5,
      "cit_last_used_at": "2013-07-16T19:23:00.000+00:00",
      "cit_usage_count": 2
    }
  ]
}
{
"type": "error",
"code": "unauthorized",
"status": 401,
"message": "No valid API authentication found",
"details": []
}
{
"type": "error",
"code": "not_found",
"status": 404,
"message": "The resource could not be found",
"details": []
}
This endpoint requires the payment-methods.read or embed scope.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

buyer_id
string

Filters the results to only the items for which the buyer has an id that matches this value.

Example:

"8724fd24-5489-4a5d-90fd-0604df7d3b83"

buyer_external_identifier
string

Filters the results to only the items for which the buyer has an external_identifier that matches this value.

Example:

"user-12345"

country
string

Filters the results to only the items which support this country code. A country is formatted as 2-letter ISO country code.

Example:

"US"

currency
string

Filters the results to only the items which support this currency code. A currency is formatted as 3-letter ISO currency code.

Example:

"USD"

sort_by
enum<string>

Used by the payment method filter to sort the results by an specific usage field. Set of fields to order results.

Available options:
last_used_at,
usage_count,
cit_last_used_at,
cit_usage_count
Example:

"last_used_at"

order_by
enum<string>
default:desc

Used to show the results ascending or descending order. Ordering direction for the results.

Available options:
asc,
desc
Example:

"desc"

Response

Returns a list of available payment methods for a buyer, filtered by the given currency and country code.

A list of stored payment methods in summarized format.

items
Payment Method (Summary) · object[]

A list of stored payment methods in summarized format.