List gift cards for buyer
using RestSharp;
var options = new RestClientOptions("https://api.sandbox.{id}.gr4vy.app/buyers/gift-cards");
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/gift-cards"
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/gift-cards")
.header("Authorization", "Bearer <token>")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.{id}.gr4vy.app/buyers/gift-cards",
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/gift-cards"
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/gift-cards', 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/gift-cards \
--header 'Authorization: Bearer <token>'{
"items": [
{
"type": "gift-card",
"id": "e6cdf979-87e2-4796-8ff6-9784d5aed893",
"merchant_account_id": "default",
"bin": "412345",
"sub_bin": "554",
"last4": "1234",
"expiration_date": "2013-07-16T19:23:00.000+00:00",
"balance": 1299,
"currency": "USD",
"balance_error_code": "incorrect_currency",
"balance_raw_error_code": "10363",
"balance_raw_error_message": "This currency is not supported by the merchant."
}
]
}{
"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": []
}List buyer gift cards
GET
/
buyers
/
gift-cards
List gift cards for buyer
using RestSharp;
var options = new RestClientOptions("https://api.sandbox.{id}.gr4vy.app/buyers/gift-cards");
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/gift-cards"
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/gift-cards")
.header("Authorization", "Bearer <token>")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.{id}.gr4vy.app/buyers/gift-cards",
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/gift-cards"
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/gift-cards', 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/gift-cards \
--header 'Authorization: Bearer <token>'{
"items": [
{
"type": "gift-card",
"id": "e6cdf979-87e2-4796-8ff6-9784d5aed893",
"merchant_account_id": "default",
"bin": "412345",
"sub_bin": "554",
"last4": "1234",
"expiration_date": "2013-07-16T19:23:00.000+00:00",
"balance": 1299,
"currency": "USD",
"balance_error_code": "incorrect_currency",
"balance_raw_error_code": "10363",
"balance_raw_error_message": "This currency is not supported by the merchant."
}
]
}{
"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
gift-cards.read or embed scope.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Filters the results to only the items for which the buyer has an
id that matches this value.
Example:
"8724fd24-5489-4a5d-90fd-0604df7d3b83"
Filters the results to only the items for which the buyer has an
external_identifier that matches this value.
Example:
"user-12345"
Response
Returns a list of available gift cards for a buyer.
A list of gift cards in a short format including the latest balance.
A list of stored gift cards.
Show child attributes
Show child attributes
Was this page helpful?
⌘I