Skip to main content
GET
/
card-details
Get card details
using RestSharp;


var options = new RestClientOptions("https://api.sandbox.{id}.gr4vy.app/card-details");
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/card-details"

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/card-details")
.header("Authorization", "Bearer <token>")
.asString();
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.{id}.gr4vy.app/card-details",
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/card-details"

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/card-details', 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/card-details \
--header 'Authorization: Bearer <token>'
{
  "type": "card-detail",
  "id": "123456",
  "card_type": "credit",
  "scheme": "visa",
  "additional_schemes": [
    "eftpos-australia"
  ],
  "additional_schemes_details": [
    {
      "icon_url": "https://cdn.example.gr4vy.app/assets/icons/card-schemes/eftpos-australia.svg",
      "scheme": "eftpos-australia"
    }
  ],
  "scheme_icon_url": "https://cdn.example.gr4vy.app/assets/icons/card-schemes/mastercard.svg",
  "country": "US",
  "required_fields": {
    "address": {
      "postal_code": true
    }
  }
}
{
"type": "error",
"code": "bad_request",
"status": 400,
"message": "Generic error",
"details": []
}
{
"type": "error",
"code": "unauthorized",
"status": 401,
"message": "No valid API authentication found",
"details": []
}
{
"type": "error",
"code": "forbidden",
"status": 403,
"message": "Generic error",
"details": []
}
{
"type": "error",
"code": "not_found",
"status": 404,
"message": "The resource could not be found",
"details": []
}
{
"type": "error",
"code": "method_not_allowed",
"status": 405,
"message": "Method Not Allowed",
"details": []
}
{
"type": "error",
"code": "duplicate_record",
"status": 409,
"message": "Generic error",
"details": [],
"resource_id": "cdc70639-cb9c-4222-a73f-b8ce39f7821b"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}
{
"type": "error",
"code": "too_early",
"status": 425,
"message": "Generic error",
"details": []
}
{
"type": "error",
"code": "too_many_requests",
"status": 429,
"message": "Generic error",
"details": []
}
{
"type": "error",
"code": "server_error",
"status": 500,
"message": "Request could not be processed",
"details": []
}
{
"type": "error",
"code": "bad_gateway",
"status": 502,
"message": "Request could not be processed",
"details": []
}
{
"type": "error",
"code": "gateway_timeout",
"status": 504,
"message": "Request could not be processed",
"details": []
}
Retrieves details about a card using card’s BIN or a stored payment_method_id. This endpoint requires the embed scope.

Authorizations

Authorization
string
header
required

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

Headers

x-gr4vy-merchant-account-id
string

The ID of the merchant account to use for this request.

Example:

"default"

Query Parameters

currency
string
required

The three-letter ISO currency code.

Example:

"USD"

bin
string | null

The bank identification number (BIN) of the card.

Required string length: 6 - 8
Pattern: ^\d+$
Example:

"411111"

payment_method_id
string<uuid> | null

The ID of the payment method to check, instead of the bin.

Example:

"123e4567-e89b-12d3-a456-426614174000"

country
string | null

The two-letter ISO country code.

Pattern: ^[A-Z]{2}$
Example:

"US"

amount
integer | null

The payment amount in the smallest currency unit.

Example:

1299

intent
enum<string> | null
default:authorize

The transaction intent.

Available options:
authorize,
capture
Example:

"authorize"

is_subsequent_payment
boolean | null

Whether this is a subsequent payment.

Example:

false

merchant_initiated
boolean | null

Whether the transaction is merchant-initiated

Example:

false

metadata
string | null

Additional metadata for the transaction in JSON format

Example:

"{\"source\": \"web\"}"

payment_source
enum<string> | null

The source of the transaction payment The way payment method information made it to this transaction.

Available options:
ecommerce,
moto,
recurring,
installment,
card_on_file
Example:

"web"

Response

Successful Response

type
string
default:card-detail

Always card-detail.

Allowed value: "card-detail"
Example:

"card-detail"

id
string | null

The Bank Identification Number (BIN) of the card.

Required string length: 6 - 8
Pattern: ^\d+$
Example:

"123456"

card_type
string | null

The type of the card.

Example:

"credit"

scheme
enum<string> | null

The card scheme/network.

Available options:
accel,
amex,
bancontact,
carte-bancaire,
cirrus,
culiance,
dankort,
diners-club,
discover,
eftpos-australia,
elo,
hipercard,
jcb,
maestro,
mastercard,
mir,
nyce,
other,
pulse,
qcard,
rupay,
star,
uatp,
unionpay,
visa
Example:

"visa"

additional_schemes
enum<string>[] | null

Additional schemes of the card besides the primary scheme.

Available options:
accel,
amex,
bancontact,
carte-bancaire,
cirrus,
culiance,
dankort,
diners-club,
discover,
eftpos-australia,
elo,
hipercard,
jcb,
maestro,
mastercard,
mir,
nyce,
other,
pulse,
qcard,
rupay,
star,
uatp,
unionpay,
visa
Example:
["eftpos-australia"]
additional_schemes_details
AdditionalSchemeDetail · object[] | null

Per-scheme details (name and icon URL) for each additional scheme. Mirrors additional_schemes — null when additional_schemes is null.

Example:
[
{
"icon_url": "https://cdn.example.gr4vy.app/assets/icons/card-schemes/eftpos-australia.svg",
"scheme": "eftpos-australia"
}
]
scheme_icon_url
string | null

URL to the card scheme's icon.

Example:

"https://cdn.example.gr4vy.app/assets/icons/card-schemes/mastercard.svg"

country
string | null

The country code associated with the card.

Pattern: ^[A-Z]{2}$
Example:

"US"

required_fields
RequiredFields · object | null

Fields that are required for this card type.

Example:
{ "address": { "postal_code": true } }