---
page_title: Update Card
product: API Reference
page_source: https://juspay.io/in/docs/api-reference/docs/express-checkout/update-card
openapi: https://juspay.io/in/docs/api/swagger?document=https%3A%2F%2Fjuspay.io%2Fin%2Fdocs%2Fapi-reference%2Fdocs%2Fexpress-checkout%2Fupdate-card
llms_txt: https://juspay.io/in/docs/llms.txt
product_llms_txt: https://juspay.io/in/docs/api-reference/llms.txt
---

## API Version: default


# Update Card



Update nickname and name_on_card for the stored card## Endpoints:
- Sandbox: https://sandbox.juspay.in/card/update

- Production: https://api.juspay.in/card/update

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

#### Content-Type:
application/x-www-form-urlencoded
- 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:
### Sample Request:

#### Request Code Snippet:

```request
curl -X POST https://api.juspay.in/card/update \
-u your_api_key: \
-H 'x-routing-id: customer_1122'\
-d card_token=c75a9fca-1121-xxxx-xxxx-47d5c4971456
-d customer_id=cst_123456789
-d nickname=suresh

```

### Sample Response:

#### Response:
```json
{
  "card_token": "c75a9fca-1121-418e-973c-47d5c4971456",
  "user_message": "Card details updated",
  "status": "SUCCESS"
}
```

## Body Parameters:
### Parameters:

#### card_token:
- Description: Card token obtained from /card/list API
- Tags: string, Required

#### customer_id:
- Description: Customer ID against which the card is stored. This is same as the object_reference_id using which was customer was created
- Tags: string, Required

#### name_on_card:
- Description: Pass a new value, if name on card needs to be updated, alphabet and spaces allowed with length limit of 64 chars.
- Tags: string

#### nickname:
- Description: Pass a new value, if nickname needs to be updated, alphabet and spaces allowed with length limit of 64 chars.
- Tags: string
## API Responses:
### 200:

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

#### user_message:
- Description: Card details updated
- Tags: string

#### status:
- Description: SUCCESS
- Tags: string
### 400:

#### Invalid Customer Id:
- Value:
  - **Error**:
    - Description: true
    - Tags: String
  - **Error_message**:
    - Description: BAD_REQUEST
    - Tags: String
  - **User_message**:
    - Description: Invalid customer id
    - Tags: String, Mandatory
- Tags: JSON

#### Nothing to Update:
- Value:
  - **Error**:
    - Description: true
    - Tags: String
  - **Error_message**:
    - Description: BAD_REQUEST
    - Tags: String
  - **User_message**:
    - Description: Nothing to update
    - Tags: String
- Tags: JSON

#### Invalid Card Token:
- Value:
  - **Error**:
    - Description: true
    - Tags: String
  - **Error_message**:
    - Description: BAD_REQUEST
    - Tags: String
  - ** user_message**:
    - Description: Invalid card token
    - Tags: String
- Tags: JSON


---

## See Also

- [Delete Card](https://juspay.io/in/docs/api-reference/docs/express-checkout/delete-card)
- [Card Info](https://juspay.io/in/docs/api-reference/docs/express-checkout/card-info)
