---
page_source: https://juspay.io/sea/docs/express-checkout-sdk-global/capacitor/base-sdk-integration/1-get-customer-api
page_title: 2.1 Get Customer API
---

## API Version: default


# Get Customer API



This is a Server-to-Server API which retrieves the customer entity for a given identifier, allowing verification of the customer's existence in the Juspay system. This API retrieves all customer-related information, including first name, last name, mobile number, email address (as provided during the Create Customer API call), along with the customer creation date and the last updated date of the customer details.## Endpoints:
- Sandbox: https://sandbox.juspay.in/customers/{customer_id}

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

## Request Type: 
GET

## 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:
Unique identifier for the merchant. This is the Merchant ID provided by Juspay. The value is case sensitive.

> **Note**
> Passing this value will help us route efficiently at network level.


- Value: x-merchantid: testaccount
- Tags: string, Recommended

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

#### Sandbox Code Snippet:

```sandbox
curl -X GET \
   https://sandbox.juspay.in/customers/:customerid \
   -u your_api_key:  \
   -H 'x-merchantid: merchant_id'\
   -H 'Content-Type: application/x-www-form-urlencoded'\
```

#### Production Code Snippet:

```production
curl -X GET \
   https://api.juspay.in/customers/:customerid \
   -u your_api_key:  \
   -H 'x-merchantid: merchant_id'\
   -H 'Content-Type: application/x-www-form-urlencoded'\
```

### Sample Response:

#### 200 - Success:
```json
{
  "object_reference_id": "customer",
  "object": "customer",
  "mobile_number": "99999999",
  "mobile_country_code": "65",
  "last_updated": "2020-03-17T14:29:17Z",
  "last_name": "al",
  "id": "cst_tooedar2k7j1d60b",
  "first_name": "name",
  "email_address": "test@juspay.in",
  "date_created": "2020-03-17T14:29:17Z"
}

```

#### 401 - Unauthorized:
```plaintext
{
    "status": "error",
    "error_code": "access_denied",
    "error_info": {
        "user_message": "Unauthorized.",
        "request_id": "b2e0fd33-7655-4778-83a8-5179ed21b0b7",
        "href": "NA",
        "developer_message": "Invalid API Key. Please pass a valid and active api key.",
        "code": "UNAUTHORIZED",
        "category": "USER_ERROR"
    }
}
```

#### 404 - Not Found:
```plaintext
{
    "error_message": "Cannot find what you are looking for",
    "status": "invalid_request_error",
    "error_code": "object_not_found",
    "error_info": {
        "user_message": "Cannot process your request as customer account not found.",
        "request_id": "bfd8b9e6-45a8-4b41-a554-de6e435ffc36",
        "href": "NA",
        "developer_message": "Customer account not found.",
        "code": "RESOURCE_NOT_FOUND",
        "category": "USER_ERROR"
    }
}
```

## Path Parameters:

#### customer_id:
It is the ID with which merchant refers to a customer object. Merchants can use either `customer_id` or `object_reference_id`. This ID is essential for accessing stored payment methods, enabling EMI transactions, and setting up subscriptions.

* `Object_reference_id`: An ID maintained at merchant’s end for each customer.
* `Customer_id`: An ID(`id`field of Create customer API response) created by Juspay for each `Object_reference_id` during the Create Customer API call.
- Value: <p>Example:- <br> customer-id-007 </p>
- Tags: string, required, Max Length :300 
## API Responses:
### 200:

#### object_reference_id:
- Description: ID maintained at ermchant end fro each customer
- Tags: string

#### mobile_number:
- Description: Customers mobile number
- Tags: string

#### mobile_country_code:
- Description: Cusomter's mobile country code
- Tags: string

#### last_updated:
- Description: Last updated information of the customer details
- 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:
- Description: Customer created date
- Tags: string
### 401:

#### status:
- Description: Status of the get customer api response
- Value: Response: error
- Tags: String

#### error_code:
- Description: error code information
- Value: Sample response: access_denied
- Tags: String

#### error_info:
- Description: Detailed information of the error
- Value:
  - **User_message**:
    - Description: User error message
    - Value: Response: Unauthorized.
    - Tags: String
  - **Developer_message**:
    - Description: Provide accurate details on the error message
    - Value: Sample Response: Invalid API Key. Please pass a valid and active api key.
    - Tags: String
  - **Category**:
    - Description: Denotes the category of the error
    - Value: Sample Response: USER_ERROR
    - Tags: String
- Tags: JSON
### 404:

#### error_message:
- Description: Response Error message
- Value: sample Response: Cannot find what you are looking for
- Tags: String

#### status:
- Description: Status of the api response
- Value: Response: invalid_request_error
- Tags: String

#### error_code:
- Description: error code information
- Value: Response: object_not_found
- Tags: String

#### error_info:
- Description: Detailed information of the error
- Value:
  - **User_message**:
    - Description: User error message
    - Value: Response: Cannot process your request as customer account not found.
    - Tags: String
  - **Developer_message**:
    - Description: Provide accurate details on the error message
    - Value: Response: Customer account not found.
    - Tags: String
  - **Category**:
    - Description: Denotes the category of the error
    - Value: sample response: USER_ERROR
    - Tags: String
- Tags: JSON



## Error Codes




| Scenario | Error Codes | Description | Sample Error Message |
|---|---|---|---|
| Checking for random customer_id value | 404 | Not Found | {"error_message": "Cannot find what you are looking for","status": "invalid_request_error","error_code": "object_not_found","error_info": {"user_message": "Cannot process your request as customer account not found.","developer_message": "Customer account not found.","code": "RESOURCE_NOT_FOUND","category": "USER_ERROR"}} |
| Whitelisting of IP in dashboard  | 403 | IP Verification Failed | {"error":true,"error_message":"Internal Server error.","user_message":"Bad Origin.","error_info":{"code":"BAD_ORIGIN","category":"USER_ERROR","user_message":"Bad Origin.","developer_message":"IP Verification Failed"}} |
| Wrong API Key | 401 | Unauthorized | {"status":"error","error_code":"access_denied","error_info": {"user_message":"Unauthorized.","developer_message":"Invalid API Key. Please pass a valid and active api key.","code":"UNAUTHORIZED","category":"USER_ERROR"}} |
| Wrong API endpoint | 404 | Not Found |  |
