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": "42424242",
  "card_type": "credit",
  "scheme": "visa",
  "scheme_icon_url": "https://api.sandbox.example.gr4vy.app/assets/card-scheme-definitions/visa.svg",
  "country": "US",
  "required_fields": {
    "first_name": true,
    "last_name": true,
    "email_address": true,
    "phone_number": true,
    "address": {
      "city": true,
      "country": true,
      "postal_code": true,
      "state": true,
      "house_number_or_name": true,
      "line1": true
    },
    "tax_id": true
  }
}
{
"type": "error",
"code": "bad_request",
"status": 400,
"message": "Missing '****' field",
"details": [
{
"location": "body",
"type": "value_error.missing",
"pointer": "/payment_method/number",
"message": "field required"
}
]
}
{
"type": "error",
"code": "unauthorized",
"status": 401,
"message": "No valid API authentication found",
"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.

Query Parameters

currency
string
required

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

Example:

"USD"

amount
integer

Used by the Flow engine to filter the results based on the transaction amount.

Example:

500

bin
string

The first 8 digits (the BIN) of the card.

Required string length: 8
Example:

"42424242"

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"

intent
enum<string>

The intent of the transaction.

Available options:
authorize,
capture
Example:

"capture"

is_subsequent_payment
boolean

Used by the Flow engine to filter available options based on the value of the is_subsequent_payment flag.

Example:

true

merchant_initiated
boolean

Used by the Flow engine to filter available options based on the value of the merchant_initiated flag.

Example:

true

metadata
string

Used by the Flow engine to filter available options based on various client-defined parameters. If present, this must be a string representing a valid JSON dictionary.

Example:

"{\"restricted_items\": \"True\"}"

payment_method_id
string<uuid>

Filters for transactions that have a payment method with an ID that matches exactly with the provided value.

Example:

"46973e9d-88a7-44a6-abfe-be4ff0134ff4"

payment_source
enum<string>

Used by the Flow engine to filter available options based on the payment source.

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

"recurring"

Response

Returns information about a card.

Details about a card.

type
enum<string>

card-detail.

Available options:
card-detail
Example:

"card-detail"

id
string<bin>

The 8 digit BIN of the card. When looking up card details using a payment_method_id this value will be null.

Required string length: 8
Example:

"42424242"

card_type
enum<string>

The type of card.

Available options:
credit,
debit
Example:

"credit"

scheme
enum<string> | null

The scheme/brand of the card.

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

"visa"

scheme_icon_url
string

An icon to display for the card scheme.

Example:

"https://api.sandbox.example.gr4vy.app/assets/card-scheme-definitions/visa.svg"

country
string

The 2-letter ISO code of the issuing country of the card.

Example:

"US"

required_fields
Required Fields · object

The fields that are required to process a transaction for this payment option.