---
page_source: https://docs.juspay.io/paytm-gateway-configuration/docs/express-checkout/updatecustomer
page_title: Update Customer
---

## API Version: default


# Update Customer API



The API can be used to update the customer details like phone number, email, first name etc.

> **Note**
> Please keep a note of the following constraints while updating customer’s email address, First Name and Last Name- 
> 
> * email address - You are allowed to use alphanumeric characters and the following special characters:`!#$%&'*+-/=?^_.{|}~`@``_`and `.` cannot appear at the beginning or end of the local part of the email address (before and after the `@`symbol).
> * First Name/Last Name - You are allowed to use alphanumeric characters and the following special characters: `().-_`

## Endpoints:
- Production: https://api.juspay.in/customers/{customer_id}

## 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: <p>Example:- <br> Basic MUQ2QUxxxxxxxxxxxxU5QTIxQzNFNTQwNkFDMEZCOg==</p>
- Tags: Base64 Encoded username:password, required
## Headers:

#### x-merchantid:
Merchant ID provided by Juspay
- Value: <p>Example:- <br>merchant-id</p>
- Tags: string, required

#### Content-Type:
application/x-www-form-urlencoded
- Tags: String
## Sample Code Snippets:
### Sample Request:

#### Request Code Snippet:

```request
curl -X POST https://api.juspay.in/customers/cst_om2l6ctlptxwxuzj \
-u your_api_key: \
-H 'Content-Type: application/x-www-form-urlencoded'\
-d "mobile_number=99887766" \    
-d "email_address=customer@gmail.com" \
-d "first_name=Jon" \
-d "last_name=Snow" \
-d "mobile_country_code=65"
```

### Sample Response:

#### Response:
```json
{
  "id": "cst_om2l6ctlptxwxuzj",
  "object": "customer",
  "object_reference_id": "customer@gmail.com",
  "mobile_number": "99887766",
  "date_created": "2016-08-02T08:07:52+0000",
  "last_updated": "2016-08-02T08:07:52+0000",
  "email_address": "customer@gmail.com",
  "first_name": "Jon",
  "last_name": "Snow",
  "mobile_country_code": "65"
}
```

## API Responses:
### 200:

#### object:
- Value:
  - **Id**:
    - Tags: string
  - **Object_reference_id
**:
    - Description: Unique ID that you use to represent the customer in your database. The typical value for this field would be email address or mobile number or auto increment ID that you have in your DB..
    - Tags: string
  - **Object**:
    - Tags: string
  - **Mobile_number**:
    - Description: Customers mobile number
    - Tags: string
  - **Mobile_country_code**:
    - Description: Cusomter's mobile country code
    - Tags: string
  - **Last_updated**:
    - Tags: string
  - **Last_name**:
    - Description: Customer's last name
    - Tags: string
  - **First_name**:
    - Description: Customer's first name
    - Tags: string
  - **Email_address**:
    - Description: Customer's e-mail address
    - Tags: string
  - **Date_created**:
    - Tags: string
- Tags: JSON
### 404:

#### status:
- Description: invalid_request_error
- Tags: string

#### error_code:
- Description: object_not_found
- Tags: string

#### error_message:
- Description: Cannot find what you are looking for
- Tags: string
