---
page_source: https://docs.juspay.io/paytm-gateway-configuration/docs/express-checkout/add-card
page_title: Add Card
---

## API Version: default


# Add Card



Add a credit card or debit card of a customer to JusPay Locker. `customer_id`parameter identifies the customer to whom this card belongs. ## Endpoints:
- Production: https://api.juspay.in/card/add

## Request Type: 
POST

## Authorization:

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

* Username: API Key obtained from Juspay dashboard
* Password: Empty string
- Value:    <p>Example:- <br> Basic MUQ2QUxxxxxxxxxxxxU5QTIxQzNFNTQwNkFDMEZCOg==</p>
- Tags: Base64 Encoded Username:Password, Mandatory
## Sample Code Snippets:
### Sample Request:

#### Request Code Snippet:

```request
curl https://api.juspay.in/card/add \
    -u api_key: \
    -d "merchant_id=guest" \
    -d "customer_id=user_101" \
    -d "customer_email=customer@mail.com" \
    -d "card_number=4111111111111111" \
    -d "card_exp_year=2025" \
    -d "card_exp_month=07" \
    -d "name_on_card=name" \
    -d "nickname=Visa card"
```

#### Request - With Token Code Snippet:

```request - with token
curl --location --request POST 'https://api.juspay.in/cards' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic QTVFNTNBM*****kQ5M0EzOg==' \
--data-urlencode 'merchant_id=guest' \
--data-urlencode 'customer_id=testcustomer' \
--data-urlencode 'customer_email=test@gmail.com' \
--data-urlencode 'card_token=ctkn_2vnerrtkzyku8jnutiz1'
```

### Sample Response:

#### Response:
```json
{
  "card_token": "c75a9fca-1121-418e-973c-47d5c4971456",
  "card_reference": "df2c47951a71e4486827039fad7b039a",
  "card_fingerprint": "c7uapov1smt3a0rd5f9b1l21i"
}
```

## Body Parameters:
### Parameters:

#### token:
- Description: The token obtained during tokenize card API. If `token` is used within 15 minutes, then `card_number`, `card_exp_year`, and `card_exp_month` are not required. `merchant_id`and `customer_id`are required in either case.
- Tags: string

#### merchant_id:
- Description: Merchant ID which represents the merchant storing the card
- Tags: string, Required

#### customer_id:
- Description: Customer ID which represents the user uniquely
- Tags: string, Required

#### customer_email:
- Description: Email address of the customer
- Tags: string

#### card_number:
- Description: A valid card number. Required only if `token` is not used in the request.
- Tags: string

#### card_exp_year:
- Description: Expiry year of the card (Format: yyyy) Example: 2020Required only if `token` is not used in the request.
- Tags: string

#### card_exp_month:
- Description: Expiry month of the card (Format: mm) Example: 06Required only if `token` is not used in the request.
- Tags: string

#### name_on_card:
- Description: Cardholder name
- Tags: string

#### nickname:
- Description: A tag or a label for the card so that the user can easily identify the card
- Tags: string
## API Responses:
### 200:

#### card_token:
- Description: c75a9fca-1121-418e-973c-47d5c4971456
- Tags: string

#### card_reference:
- Description: df2c47951a71e4486827039fad7b039a
- Tags: string

#### card_fingerprint:
- Description: c7uapov1smt3a0rd5f9b1l21i
- Tags: string
