---
page_title: Fetch Alt ID and Cryptogram API
product: API Reference
page_source: https://juspay.io/in/docs/api-reference/docs/tokenization-apis/fetch-alt-id-and-cryptogram-api
openapi: https://juspay.io/in/docs/api/swagger?document=https%3A%2F%2Fjuspay.io%2Fin%2Fdocs%2Fapi-reference%2Fdocs%2Ftokenization-apis%2Ffetch-alt-id-and-cryptogram-api
llms_txt: https://juspay.io/in/docs/llms.txt
product_llms_txt: https://juspay.io/in/docs/api-reference/llms.txt
---

## API Version: default


# Fetch Alt ID and Cryptogram API



This API is used to Fetch Network Alt ID and Cryptogram (TAVV) for Guest Checkout transactions, using the original card number collected from user## Endpoints:
- Sandbox: https://sandbox.juspay.in/get/altId

- Production: https://api.juspay.in/get/altId

## Request Type: 
POST

## Content-Type: 
application/json

## Authorization:

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

* Username: API Key obtained from Juspay dashboard
* Password: Empty string

Example:-Basic MUQ2QUxxxxxxxxxxxxU5QTIxQzNFNTQwNkFDMEZCOg==
- Value: MUQ2QUZEQzhFQTY0OUU5QTIxQzNFNTQwNkFDMEZCOg==
- Tags: required, Base 64 encoding
## Headers:

#### x-merchantId:
Merchant ID provided by Juspay

Example:-merchant-id
- Tags: String, Mandatory

#### content-type:
application/x-www-form-urlencoded
- Tags: String

#### 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:

#### Request without Raw Card Code Snippet:

```request without raw card
curl --location 'https://sandbox.juspay.in/get/altId' \
--header 'Content-Type: application/json' \
--header 'Authorization: <api key>' \
--header 'x-routing-id: customer_1122'\
--data '
{
    "cardData" : "eyJhbGciOiJSU0EtT0FFUC0yNTYiLCJlbmMiOiJBMTI4R0NNIiwia2lkIjoiMjIxODE2OGMtZWU2Yi00OWQ3LWE4NTEtOGI5NGU3ZDAwNjhkIn0.JlM0JtxFmZoR6vbqN634vDyFU6XNBC2WPgpdPJdPwezlWpuWa25JEQf8_-ywaugGy-1InssaFJRrN5iBe8e7rhkuL7vSwvAndznvQc7PFuFXgBbPgvlj9gDMPQzUucu9Fgexx_qa5J_C0_Hf5r-jyAu12du_D-N5L333l7AbzRuZSgRqlT3A063UFrLwUt4RvI-rudVhvhWLurHjK5szy02KFMLuvu2YWP-7qpoz3urrwOuu6PD51jh65WZgtHgsfcW62jvwuod08pn-5ALS-Wo8K95gR2jT9h9dRagZHNywE8jdHVdGeyFlM-auZkMmiCb7Rp_ItR1rR1KgefHywg.F_JU5ezjsYDvE9ac.XbxlIzy-ZfearL9U2ZGXe8pezUmnpGnK5Za9-w9MJn52xPosFl-4sB4_VYnTqvKVncG1nO22iGLOERVp8G_R7lTG9afRMR9eOKFGsMD2eyx214pFce8i7iGz_D4NII-RlE176vwGC7zrSVuz189-8vQ.QWE66PdoyQ_NSn773xtqPA",
    "orderData": {
        "amount": 46599.0,
        "currency": "INR"
    },
    "correlationId":null,
"cardBrand":null,
"keyId":"key_bf1d49f7a9b044cc9693290122f3e0b8",
"submerchantId":"testAI",
"shouldSendRawCard":"false"
}'
```

#### Request with Raw Card Code Snippet:

```request with raw card
curl --location 'https://sandbox.juspay.in/get/altId' \
--header 'Content-Type: application/json' \
--header 'x-routing-id: customer_1122'\
--header 'Authorization: <api key>' \
--data '{
    "cardData" : "eyJhbGciOiJSU0EtT0FFUC0yNTYiLCJlbmMiOiJBMTI4R0NNIiwia2lkIjoiMjIxODE2OGMtZWU2Yi00OWQ3LWE4NTEtOGI5NGU3ZDAwNjhkIn0.JlM0JtxFmZoR6vbqN634vDyFU6XNBC2WPgpdPJdPwezlWpuWa25JEQf8_-ywaugGy-1InssaFJRrN5iBe8e7rhkuL7vSwvAndznvQc7PFuFXgBbPgvlj9gDMPQzUucu9Fgexx_qa5J_C0_Hf5r-jyAu12du_D-N5L333l7AbzRuZSgRqlT3A063UFrLwUt4RvI-rudVhvhWLurHjK5szy02KFMLuvu2YWP-7qpoz3urrwOuu6PD51jh65WZgtHgsfcW62jvwuod08pn-5ALS-Wo8K95gR2jT9h9dRagZHNywE8jdHVdGeyFlM-auZkMmiCb7Rp_ItR1rR1KgefHywg.F_JU5ezjsYDvE9ac.XbxlIzy-ZfearL9U2ZGXe8pezUmnpGnK5Za9-w9MJn52xPosFl-4sB4_VYnTqvKVncG1nO22iGLOERVp8G_R7lTG9afRMR9eOKFGsMD2eyx214pFce8i7iGz_D4NII-RlE176vwGC7zrSVuz189-8vQ.QWE66PdoyQ_NSn773xtqPA",
    "orderData": {
        "amount": 1.0,
        "currency": "INR"
    },
    "correlationId":null,
"cardBrand":null,
"keyId":"key_bf1d49f7a9b044cc9693290122f3e0b8",
"shouldSendRawCard":"true"
}'
```

### Sample Request and Response:

#### Decrypted Card Details:
```plaintext
{
  "altId": "53326380934186",
  "expMonth": "11",
  "par": "500166PIYTTY1DA31FLYZLFZSR1PL",
  "expYear": "2026",
  "tavv": "APCcTvj9sufJAAdQxElMAAADFA=="
}

```

#### 200 Response:
```json
{
  "status": "SUCCESS",
  "payload": {
    "cardBrand": "MASTERCARD",
    "cardIssuerCountry": "INDIA",
    "correlationId": "9cff63adf7ae41068765dcdf5c1103a0",
    "altIdDetails": "eyJhbGciOiJSU0EtT0FFUC0yNTYiLCJlbmMiOiJBMTI4R0NNIn0.1ty4w8A3PEzQgsD-RzUb7Isnt9ZGVoB5aw-HNqZOsdYRPxRRm5BvOZ93D2XvIrK2Lv6IUmV94SP5HMyJ419V_G5tZEEo-vKKwwfwiTpWPQVg3rRpg80FVEyMI0JJfkWJ6lg3jOMcGwFa2ZJOI9HUtCyULntaZMbeSj_-h_ipGJ061PlTWS1y50UgaPUsOLhPfexM8_k9aspjLxfPf604W8v5HJp3rNH620smSzhMWQtk3NoBJ3PKpUOM2UwY_y1XBVYELM5FcpU4joRTgEvAvvbQdwjUW83Dxz3s6pGGK0nNCO_RVxGiMOl8jFh5wBQ2kVnsTS79-Kghu_x651lUHQ.h-FGvt7nEuUfH2yZ.zbba3zN4Pt280CwRmBaKRT7hcfV3hhaRcbh-NU9qVZ2nZdDk9Vlt_oD-8LDMvN3ym7eFcLZm0VMIjaLyPGpMkRFxdwWlAyS-vPgIfbvn4TV-cEFZsUqKoXPg3qHXQX1_AmiREFg_yzSQuke_yukS8h7Sfv7eWPJigZMC5wE5iqrpJiITTzepPWo.li194-hkDOA4wwNmlSfnVA",
    "providerCategory": "NETWORK",
    "provider": "MASTERCARD",
    "cardIssuerBank": "ICICI Bank"
  },
  "errorCode": null,
  "errorMessage": null
}

```

#### 200 Response - Raw Card:
```plaintext
{
    "errorCode": null,
    "errorMessage": null,
    "payload": {
        "altIdDetails": "eyJhbGciOiJSU0EtT0FFUC0yNTYiLCJlbmMiOiJBMTI4R0NNIn0.B2g3CJinjam4V7a4Hzp3tUDUTEysLpKBdaFOQ6y81kg3P_V-fEWr9ftIF4g_0oZzPjdOMwNo8jO9FdyO_ynOB2c7DX1sxgetj5HDJ1T0lhC4E5sngctXtz6oieH6V7CY8AM4E8u_beW9SZ-Ntm5rjAcwwRqL18wcJS9zQrZjNX5goqvUNVBmlAsh9QUNKbxSmoiaMa4wj4wLakexdUkZuQyYUmUIZLtKsExihVFX8a7wNbihsH1tFEXQjppoRSHM9CfyC6Z2VcusYw7N39xzodQFUx9D7fF0z7k1R-uUPwiGItfBTQrUmwxrcM-dPrbToU4SNmbam23sVS_-N6cPFO1Bw.C3Po9U2GyN5vAh1J.IpHZM9Wh52RvyUvBH1ajsc9lH-EHEbq3oWGBRB2oemvSVnqoLpNKqoMXcKQxz8OwYF2x0g0Zwp-XkK_pYbSjdypOnDAsOTXU7ezsTr0OZVeG6A.0aj97mv9kfUbiBIxIB568Q",
        "cardBrand": "VISA",
        "cardIssuerBank": "WELLS FARGO BANK, NATIONAL ASSOCIATION",
        "cardIssuerCountry": "UNITEDSTATES",
        "correlationId": "QZ7HISUbcqefdCJFMA",
        "isRawCard": true,
        "provider": "VISA",
        "providerCategory": "NETWORK"
    },
    "status": "SUCCESS"
}

```

#### 400 Response - Invalid Card:
```plaintext
{
    "error": true,
    "error_message": "BAD_REQUEST",
    "user_message": "Invalid CardNumber",
    "error_info": {
        "code": "INVALID_INPUT",
        "category": "USER_ERROR",
        "href": "NA",
        "request_id": "c58fc8ca-405a-4978-a0bd-c3b29e6f896f",
        "user_message": "Invalid card number.",
        "developer_message": "Invalid card number.",
        "fields": [
            {
                "field_name": "card_number",
                "reason": "Luhn Check Failed."
            }
        ]
    }
}

```

#### 400 Response - Pending ALT ID Onboarding:
```plaintext
{
  "error": true,
  "error_message": "BAD_REQUEST",
  "user_message": "Contact juspay to register for ALT_ID",
  "error_info": {
    "code": "INVALID_INPUT",
    "category": "USER_ERROR",
    "request_id": "f5a7b176-0db5-426b-bc4c-7d862e395c41",
    "user_message": "Invalid request params. Please verify your input.",
    "developer_message": "Invalid request params."
  }
}

```

#### 400 Response - Network Error:
```json
{
  "error": true,
  "error_message": "BAD_REQUEST",
  "user_message": "The network token provision request contained data that could not be verified",
  "error_info": {
    "code": "INVALID_INPUT",
    "category": "USER_ERROR",
    "request_id": "ccccac2d-c451-42cc-a7e6-b7355dec8bdc",
    "user_message": "Invalid request params. Please verify your input.",
    "developer_message": "Invalid request params."
  }
}

```

## Body Parameters:
### Basic Parameters:

#### cardData:
- Description: Provide actual card details in an encrypted (**Algorithm** : RSA-OAEP-256**ENC** : A128GCM) payload generated using RSA Keys. 

Refer to the following doc to understand what encryption is required - [https://docs.juspay.in/resources/docs/card-network-tokenization/card-details-encryption](https://docs.juspay.in/resources/docs/card-network-tokenization/card-details-encryption)

Acceptable Card Brands: VISA, MASTERCARD, AMEX, DINERS, RUPAY
- Value:
  - **CardNumber**:
    - Description: Pass the 16-19 digit card number
    - Tags: String, Mandatory
  - **ExpYear**:
    - Description: Pass it in YYYY format
    - Tags: String, Mandatory
  - **ExpMonth**:
    - Description: Pass it in MM format
    - Tags: String, Mandatory
  - **CardSecurityCode**:
    - Tags: String, Conditional
- Tags: String, mandatory

#### orderData:
- Description: Provide the following order-related parameters.
- Value:
  - **Amount**:
    - Description: Pass the order amount
    - Tags: Double, mandatory
  - **Currency**:
    - Description: Pass the currency in which transaction is supposed to happen.
    - Tags: String, Mandatory
  - **AuthRefNumber**:
    - Description: For Rupay, the AltID is generated post successful Authentication hence this field is required only for Rupay cards processing.
    - Tags: String, Conditional
- Tags: JSON, Mandatory

#### submerchantId:
- Description: Value needed incase you have master merchant - submerchant model implementation. Pass the identifier that denotes a submerchant. Note: Travel Networks can use it to pass airline codes.
- Tags: String, Conditional

#### correlationId:
- Description: Unique reference Id that can be passed by merchant; else it is generated by Juspay
- Tags: String, Optional

#### keyId:
- Description: key uuid returned from the Dashboard when the public key is uploaded. Pass the key uuid incase you have multiple Public-Private key pairs published on dashboard.
- Tags: String, Optional

#### shouldSendRawCard:
- Description: Pass true if you want us to return the card data shared in request body. Applicable incase of International cards where ALT_ID is not relevant.
- Value:  true, false
- Tags: String, Conditional
## API Responses:
### 200:

#### 200 : Response:
- Value:
  - **Status**:
    - Tags: String
  - **Payload**:
    - Value:
      - **CardIssuerCountry**:
        - Tags: String
      - **CorrelationId**:
        - Tags: String
      - **CardIssuerBank**:
        - Tags: String
      - **AltIdDetails**:
        - Tags: String, Mandatory
      - **CardBrand**:
        - Tags: String, Mandatory
      - **Provider**:
        - Tags: String, Mandatory
      - **ProviderCategory**:
        - Tags: String, Mandatory
    - Tags: Object
  - **ErrorCode**:
    - Tags: String
  - **ErrorMessage**:
    - Tags: String
- Tags: Object

#### Decrypted Card Details:
- Value:
  - **AltId**:
    - Tags: String
  - **ExpMonth**:
    - Tags: String
  - **ExpYear**:
    - Tags: String
  - **Tavv**:
    - Tags: String
  - **Par**:
    - Tags: String
- Tags: Object


---

## See Also

- [Fetch Token and Cryptogram API](https://juspay.io/in/docs/api-reference/docs/tokenization-apis/fetch-token-and-cryptogram-api)
- [COFT | Alt ID Onboarding API](https://juspay.io/in/docs/api-reference/docs/tokenization-apis/coft--alt-id-onboarding-api)
