---
page_title: Create with Validate Customer Account
product: API Reference
page_source: https://juspay.io/in/docs/api-reference/docs/express-checkout/create-with-validate-customer-account
openapi: https://juspay.io/in/docs/api/swagger?document=https%3A%2F%2Fjuspay.io%2Fin%2Fdocs%2Fapi-reference%2Fdocs%2Fexpress-checkout%2Fcreate-with-validate-customer-account
llms_txt: https://juspay.io/in/docs/llms.txt
product_llms_txt: https://juspay.io/in/docs/api-reference/llms.txt
---

## API Version: default


# Create and Validate Customer Account



This is a Server-to-Server API that takes bank account details/UPI parameters as an input and validates the provided details. Once the validation is successful, customer account ID is created in the Juspay system against the provided customer ID.

> **Note**
> Merchants can validate and create multiple customer accounts (both Bank Account and UPI) simultaneously. An array of UPI and bank accounts can be provided as input, and individual customer account IDs will be created and validated for each account details.

## Endpoints:
- Sandbox: https://sandbox.juspay.in/customers/{customer_id}/accounts

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

## Request Type: 
POST

## Authorization:

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

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

Example:- Basic MUQ2QUxxxxxxxxxxxxU5QTIxQzNFNTQwNkFDMEZCOg==
- Tags: Base64 Encoded Username:Password, Mandatory
## Headers:

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

#### With Bank Account Code Snippet:

```with bank account
curl --location --request POST 'https://api.juspay.in/customers/cst_zqqmw0v4exbhvv2l/accounts' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic QTA0QT*******ODg1Og==' \
--header 'x-routing-id: customer_1122'\
--data-urlencode 'bank_code=JP_HDFC' \
--data-urlencode 'account_details={"bank_account" : [{"ifsc":"YESB0000262", "account":"026291800001191"}]}' \
--data-urlencode 'customer_id=cst_zqqmw0v4exbhvv2l' \
--data-urlencode 'gateway_id=800' \
--data-urlencode 'gateway_reference_id=testing' \
--data-urlencode 'command=validate'
```

#### With UPI Code Snippet:

```with upi
curl --location --request POST 'https://api.juspay.in/customers/cst_zqqmw0v4exbhvv2l/accounts' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic QTA0QT*******ODg1Og==' \
--data-urlencode 'bank_code=JP_HDFC' \
--data-urlencode 'account_details={"upi":[{"vpa":"8668757911@ffsk"}]}' \
--data-urlencode 'customer_id=cst_zqqmw0v4exbhvv2l' \
--data-urlencode 'gateway_id=800' \
--data-urlencode 'gateway_reference_id=testing' \
--data-urlencode 'command=validate'
```

#### With Multiple accounts Code Snippet:

```with multiple accounts
curl --location --request POST 'https://api.juspay.in/customers/cst_zqqmw0v4exbhvv2l/accounts' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic QTA0QT*******ODg1Og==' \
--data-urlencode 'bank_code=JP_HDFC' \
--data-urlencode 'account_details={"upi":[{"vpa":"9164326296@upi"}], "bank_account" : [{"ifsc":"YESB0000262", "account":"026291800001191"}]}' \
--data-urlencode 'customer_id=cst_zqqmw0v4exbhvv2l' \
--data-urlencode 'gateway_id=800' \
--data-urlencode 'gateway_reference_id=testing' \
--data-urlencode 'command=validate'
```

#### With Preferred gateway Code Snippet:

```with preferred gateway
curl --location --request POST 'https://api.juspay.in/customers/cst_zqqmw0v4exbhvv2l/accounts' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic QTA0QT*******ODg1Og==' \
--data-urlencode 'bank_code=JP_HDFC' \
--data-urlencode 'account_details={"upi":[{"vpa":"8668757911@ffsk"}]}' \
--data-urlencode 'customer_id=cst_zqqmw0v4exbhvv2l' \
--data-urlencode 'gateway_id=800' \
--data-urlencode 'gateway_reference_id=testing' \
--data-urlencode 'command=validate' \
--data-urlencode 'preferred_ifsc_validation_gateway=CFGEN'
```

### Sample Response:

#### 200 - Success(With Bank Account):
```plaintext
[
    {
        "object": "customer_account",
        "customer_account_id": "banh_jhDBzmQanmKTLoZj",
        "customer_id": "cth_mh7UuTPY1V9dMGuT",
        "date_created": "2025-02-24T13:19:43.292530547Z",
        "account_details": {
            "name": "test",
            "ifsc": "AABF0008032",
            "account": "026291800001191"
        },
        "validation_amount": 1,
        "currency": "INR",
        "validation_status": "ACTIVE",
        "last_validated": "2025-02-24T13:19:43.292530547Z",
        "customer_account_type": "SAVINGS"
    }
]
```

#### 200 - Success(With UPI):
```json
[
    {
        "object": "customer_account",
        "customer_account_id": "banh_7BQaxZdn3UnC8CoF",
        "customer_id": "cst_zqqmw0v4exbhvv2l",
        "date_created": "2023-06-06T13:29:49Z",
        "account_details": {
            "vpa": "4225246777@yesg"
        },
        "validation_amount": 1.0,
        "currency": "INR",
        "validation_status": "ACTIVE",
        "last_validated": "2023-06-06T13:29:53Z"
    }
]
```

#### 200 - Success(With Multiple Accounts):
```plaintext
[
    {
        "object": "customer_account",
        "customer_account_id": "banh_ePg3dcMBgGnFzoZj",
        "customer_id": "cth_mh7UuTPY1V9dMGuT",
        "date_created": "2025-02-24T17:49:53.977288433Z",
        "account_details": {
            "vpa": "9164326296@upi"
        },
        "validation_amount": 1,
        "currency": "INR",
        "validation_status": "ACTIVE",
        "last_validated": "2025-02-24T17:49:53.977288433Z",
        "customer_account_type": "UPI"
    },
    {
        "object": "customer_account",
        "customer_account_id": "banh_jhDBzmQanmKTLoZj",
        "customer_id": "cth_mh7UuTPY1V9dMGuT",
        "date_created": "2025-02-24T13:19:43.292530547Z",
        "account_details": {
            "name": "test",
            "ifsc": "AABF0008032",
            "account": "026291800001191"
        },
        "validation_amount": 1,
        "currency": "INR",
        "validation_status": "ACTIVE",
        "last_validated": "2025-02-24T13:19:43.292530547Z",
        "customer_account_type": "SAVINGS"
    }
]
```

#### 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"
    }
}
```

## Path Parameters:

#### customer_id:
Customer Id
- Value: Example:- cst_wexxxxsfdkl
- Tags: String, Mandatory
## Body Parameters:
### Parameters:

#### bank_code:
- Description: Juspay bank code ID defining the bank.
- Tags: string, Mandatory

#### account_details:
- Description: Bank account details
- Value:
  - **Bank_account**:
    - Description: Bank account details
    - Value:
      - **Ifsc**:
        - Description: IFSC code for a bank branch.
        - Value: AABF0008032
        - Tags: String
      - **Account**:
        - Description: Bank account number
        - Value: 026291800001191
        - Tags: String
      - **Name**:
        - Description: Name of the customer in a given bank account.
        - Value: test
        - Tags: String
    - Tags: Array
  - **Upi**:
    - Description: VPA details
    - Value:
      - **Vpa**:
        - Value: 9164326296@upi
        - Tags: String
    - Tags: String
- Tags: text, Mandatory

#### gateway_id:
- Description: Gateway id of the underlying provider to be used for bank account validation.
- Tags: string, Optional

#### gateway_reference_id:
- Description: Reference Id to a specific gateway which is used for validation
- Tags: string, Optional

#### command:
- Description: Value should be “validate”
- Tags: String, Mandatory

#### preferred_ifsc_validation_gateway:
- Description: Preferred gateway to validate the bank account/VPA details
- Tags: String, Optional

#### validation_amount:
- Description: Predefined amount to verify the bank account details.Default amount: 1 INR (Rupee)
- Tags: String, Optional
## API Responses:
### 200:

#### object:
- Value: customer_account
- Tags: String

#### customer_account_id:
- Description: ID created at Juspay’s end for the bank account details
- Value: banh_kGvx5TGUmkRVC2dH
- Tags: String

#### customer_id:
- Description: Customer ID
- Value: cst_zqqmw0v4exbhvv2l
- Tags: String

#### date_created:
- Description: Creation date of the custmer account ID
- Value: 2023-06-06T13:28:20Z
- Tags: String

#### account_details:
- Description: Account details with which customer account ID created
- Value:
  - **Account**:
    - Description: Bank account number
    - Value: 026291800001191
    - Tags: String
  - **Name**:
    - Description: Beneficiary name
    - Value: test
    - Tags: String
  - **Ifsc**:
    - Description: IFSC Code
    - Value: AABF0008032
    - Tags: String
  - **Juspay_bank_code**:
    - Description: Bank code
    - Value: 12
    - Tags: String
  - **Bank_name**:
    - Description: Beneficiary account bank name
    - Value: SBI
    - Tags: String
- Tags: Object

#### validation_amount:
- Description: Penny drop amount for validation
- Value: 1
- Tags: String

#### currency:
- Description: Currency of the Validation amount
- Value: INR
- Tags: String

#### validation_status:
- Description: Status of the validation.**Possible values:** `CREATED` - Customer account has been created, validation has not yet been completed

`ACTIVE` - validation is successful at gateway with provided customer bank details

`PENDING` - Awaiting transaction status on the penny drop transaction

`FAILURE` - Provided account validation is failure
- Value: CREATED
- Tags: String

#### last_validated:
- Description: Recent modified date of the customer account ID
- Value: 2023-06-06T13:28:20Z
- 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


---

## See Also

- [Validate Customer Account](https://juspay.io/in/docs/api-reference/docs/express-checkout/validate-customer-account)
- [List Customer Accounts](https://juspay.io/in/docs/api-reference/docs/express-checkout/list-customer-accounts)
