Collections Get saved cards
Get saved cards
Lists a customer's saved cards, default card first, then newest. The list includes cards that are not active yet; only a card with `is_active` true can be charged.
Api-Key
Query parameters
NameDescription
customer_idThe customer's ID. Always send it.
client_customer_idWhen set, Gravv matches cards by this value only and does not filter by
customer_id.Response
Returns 200 OK. The saved cards
NameDescription
dataShow 12 child attributesobject[]
idCard ID for
GET /v1/collections/cards/{card_id}card_tokenToken to charge or delete the card
card_last4card_brandcard_exp_monthcard_exp_yearis_defaultis_activeOnly an active card can be charged. A card is inactive until its first payment settles.
cardholder_nameis_expiring_soonTrue when the card expires within 30 days
billing_infoBilling details saved with the card, when there are any
Show 9 child attributesobject
first_namelast_nameemailphoneaddress1citystatezipcountrycreated_aterrorErrors
| Status | Meaning |
|---|---|
| 200 | The saved cards |
| 400 | The request failed. A missing or invalid customer_id returns invalid customer_id format: invalid input. |
Was this page helpful? Yes No
Previous
Next
Request
cURLJavaScriptPythonGoRubyPHPJavaC#cURL
curl --request GET \
--url 'https://api.gravv.xyz/v1/collections/cards?customer_id=f827e428-c497-4b21-8855-99d978909c28&client_customer_id=merchant-user-123' \
--header 'Api-Key: <api-key>'
const response = await fetch('https://api.gravv.xyz/v1/collections/cards?customer_id=f827e428-c497-4b21-8855-99d978909c28&client_customer_id=merchant-user-123', {
method: 'GET',
headers: {
'Api-Key': '<api-key>',
},
});
const data = await response.json();
console.log(response.status, data);
import requests
url = "https://api.gravv.xyz/v1/collections/cards?customer_id=f827e428-c497-4b21-8855-99d978909c28&client_customer_id=merchant-user-123"
headers = {
"Api-Key": "<api-key>",
}
response = requests.get(url, headers=headers)
print(response.status_code)
print(response.json())
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://api.gravv.xyz/v1/collections/cards?customer_id=f827e428-c497-4b21-8855-99d978909c28&client_customer_id=merchant-user-123", nil)
if err != nil {
panic(err)
}
req.Header.Set("Api-Key", "<api-key>")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(res.Status)
fmt.Println(string(body))
}
require "net/http"
require "uri"
uri = URI("https://api.gravv.xyz/v1/collections/cards?customer_id=f827e428-c497-4b21-8855-99d978909c28&client_customer_id=merchant-user-123")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
request = Net::HTTP::Get.new(uri)
request["Api-Key"] = "<api-key>"
response = http.request(request)
puts response.code
puts response.body
<?php
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://api.gravv.xyz/v1/collections/cards?customer_id=f827e428-c497-4b21-8855-99d978909c28&client_customer_id=merchant-user-123',
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Api-Key: <api-key>',
],
]);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
echo $status, PHP_EOL, $response, PHP_EOL;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.gravv.xyz/v1/collections/cards?customer_id=f827e428-c497-4b21-8855-99d978909c28&client_customer_id=merchant-user-123"))
.header("Api-Key", "<api-key>")
.GET()
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
System.out.println(response.body());
}
}
using System.Net.Http;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.gravv.xyz/v1/collections/cards?customer_id=f827e428-c497-4b21-8855-99d978909c28&client_customer_id=merchant-user-123");
request.Headers.TryAddWithoutValidation("Api-Key", "<api-key>");
using var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
Responseapplication/json
200400OK
{
"data": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"card_token": "tokn_80aebb6ea2594a74bc",
"card_last4": "1111",
"card_brand": "visa",
"card_exp_month": "12",
"card_exp_year": "2028",
"is_default": true,
"is_active": true,
"cardholder_name": "JANE DOE",
"is_expiring_soon": false,
"billing_info": {
"first_name": "Jane",
"last_name": "Doe",
"country": "US"
},
"created_at": "2026-10-01T10:00:00Z"
}
],
"error": null
}
{
"data": null,
"error": "invalid customer_id format: invalid input"
}