---
page_source: https://docs.juspay.io/resources-barclays/docs/card-network-tokenization/fetch-token-and-cryptogram-api
page_title: Fetch Token and Cryptogram API
---

## API Version: default


# Fetch Token and Cryptogram



This API is used to fetch cryptogram and token for processing token repeat transactions.## Endpoints:
- Sandbox: https://sandbox.juspay.in/v4/card/get

- Production: https://api.juspay.in/v4/card/get

## Request Type: 
POST

## Content-Type: 
application/json

## Authorization:

#### Basic Auth:
Consists of two parts.

* Username: API Key obtained from Juspay dashboard
* Password: Empty string
- Value:  Example:- Basic MUQ2QUxxxxxxxxxxxxU5QTIxQzNFNTQwNkFDMEZCOg==
- Tags: required, Base64 Encoded Username:Password
## Headers:

#### x-merchantid:
Please pass merchant-id given for your merchant
- Tags: String, Mandatory

#### Content-type:
- Value:  application/json
- Tags: String, Mandatory

#### version:
Pass the date in YYYY-MM-DD format


- Value: Example:- 2023-01-01
- Tags: String, Mandatory

#### x-routing-id:
We recommend passing the customer_id as the x-routing-id. If the customer is checking out as a guest, you can pass an alternative ID that helps track the payment session lifecycle. For example, this could be an Order ID or Cart ID.

> **Warning**
> This ID is associated with the customer. It plays a key role in ensuring consistency and maintaining connections across different systems. If you fail to pass the same x-routing-id for the same customer in all related API calls, it could lead to issues with API functionality. Therefore, it’s crucial that you use the same x-routing-id for all requests tied to the same customer.


- Value: customer_1122
- Tags: String, Required
## Sample Code Snippets:
### Code Snippets:

#### Shell Code Snippet:

```shell
curl -L 'https://api.juspay.in/v4/card/get' \
-H 'Content-Type: application/json' \
-H 'x-routing-id: customer_1122'\
-H 'Authorization: Basic XXXXXXk0QjJEQTlBQjc0QThCOg==' \
-d '{
    "card_reference": "token_a0c16957f9bf46b0966a91a35b555353",
    "customer_id" : "juspaytest_cust",
    "submerchantId" : "airline1"
}'

```

### Sample Request and Response:

#### Request:
```json
{
  "card_reference": "token_a0c16957f9bf46b0966a91a35b555353",
  "customer_id": "juspaytest_cust",
  "submerchantId": "airline1"
}
```

#### Response:
```json
{
  "eci": "07",
  "name_on_card": "Rohit Singh",
  "token_requestor_id": "40000000079",
  "fingerprint": "65soeo5vf909rfe4vrvmreu88f",
  "card_type": "DEBIT",
  "reference": "token_a0c16957f9bf46b0966a91a35b555353",
  "customer_id": "juspaytest_cust",
  "sub_type": null,
  "network": "VISA",
  "token_details": {
    "status": "ACTIVE",
    "first_six": "478808",
    "last_four": "8243",
    "exp_month": "11",
    "exp_year": "2029",
    "provider": "VISA",
    "provider_category": "NETWORK"
  },
  "issuer_country_code": null,
  "authentication_details": {
    "cryptogram": "XXXXXXXXXXXXXXXX",
    "token": "4788080252078243"
  },
  "nickname": null,
  "issuer": "Paytm",
  "card_details": {
    "last_four": "9426",
    "par": "V0010014622122423467188903638",
    "exp_month": "11",
    "exp_year": "2029"
  }
}

```

## Body Parameters:
### Request Params:

#### card_reference:
- Description: It is a unique reference number associated with each card_number.
- Value: value
- Tags: String, Mandatory

#### customer_id:
- Description: It is the ID with which merchant refers to a customer object.
- Tags: String, Mandatory

#### submerchantId:
- Description: Conditional - Required only for reseller based workflows
- Tags: String, Optional
## API Responses:
### 200:

#### eci:
- Tags: String

#### name_on_card:
- Tags: String

#### token_requestor_id:
- Tags: String

#### fingerprint:
- Tags: String

#### card_type:
- Tags: String

#### reference:
- Tags: String

#### customer_id:
- Tags: String

#### sub_type:
- Tags: String

#### network:
- Tags: String

#### token_details: status:
- Tags: String

#### token_details: first_six:
- Tags: String

#### token_details: last_four:
- Tags: String

#### token_details: exp_month:
- Tags: String

#### token_details: exp_year:
- Tags: String

#### token_details: provider:
- Tags: String

#### token_details: provider_category:
- Tags: String

#### issuer_country_code:
- Tags: String, Mandatory

#### authentication_details: cryptogram:
- Tags: String, Mandatory

#### authentication_details: token:
- Tags: String, Mandatory

#### nickname:
- Tags: String, Mandatory

#### issuer:
- Tags: String, Mandatory

#### card_details: last_four:
- Tags: String, Mandatory

#### card_details: par:
- Tags: String, Mandatory

#### card_details: exp_month:
- Tags: String, Mandatory

#### card_details: exp_year:
- Tags: String, Mandatory
### 400:

#### error:
- Value:  true
- Tags: String

#### user_message:
- Value:  Stored Card Entry Not Found
- Tags: String

#### error_message:
- Value:  Not Found
- Tags: String
### 401:

#### status:
- Value:  error
- Tags: String, Mandatory

#### error_code:
- Value:  access_denied
- Tags: String, Mandatory
