---
page_source: https://juspay.io/in/docs/upi-consumer-stack/docs/customer-onboarding/add-primary-account
page_title: Add Primary Account
---

## API Version: default


# Add **Primary Account** 



This api is used to change primary account of vpas of customer. The account passed in the api will become primary for the vpa in request body. If vpa is not passed, the account will become primary for all the vpa's of customer.

> **Note**
> 1. This is an idempotent api.

## Endpoints:
- Production:  http://{{host}}/api/{{uri}}/merchants/vpaAccounts

## Request Type: 
POST

## Content-Type: 
application/json

## Headers:

#### x-merchant-id:
Will be shared while onboarding.
- Value: {{mid}}
- Tags: string, Required

#### x-merchant-channel-id:
Will be shared while onboarding.
- Value: {{mcid}}
- Tags: string, Required

#### x-timestamp:
This is an epoch unix timestamp string. For example, `1496918882000`. It can be used by us to invalidate older requests.
- Value: {{$timestamp}}
- Tags: string, Required

#### x-merchant-signature:
This is a signature over combination of headers, payload. Refer Signature Calculation section for more details.
- Value: 342AE54CEC15921C232FE2B53E4283179932042EF126A88214E14156BF095BAD19E1EDAD329F430973009B9071DCF24E0D4080778E051AA60AED8EA08912F514B2B5A18880DD303D31337C30AFC0E3195DE42E35852B22211DC02621303E3ADF6B4237669652216D499E7D4A793022A02200F9AA178EF5C383731E80FA5C4B170E181682A449DD7863AC10B2C53ADACDE5FC00E288D1F7F5BABA24A168912A90D9733FC9A7B2DAF0873C307E0FA3E4A851066DD3B0D78A917F66E2CD26FDC508BA7A06E6801F1BEC2A9A8FD65DE9712F09D9F3B161A5B467B525D887296829DCE2349E8C31081C96D5BCC2C422A15C647D29E7BFD1B785F7B1B6D21CADB91093
- Tags: string, Required

#### content-type:
`application/json`
- Tags: String, Required

#### accept:
`application/json`
- Tags: String, Required
## Sample Code Snippets:
### Code Snippets:

#### Shell Code Snippet:

```shell
{"success":false,"message":"No Data found for the given path"}
```

### Sample Request and Response:

#### Request:
```json
{"success":false,"message":"No Data found for the given path"}
```

#### Response:
```json
{"success":false,"message":"No Data found for the given path"}
```

## Body Parameters:
### Parameters:

#### merchantCustomerId:
- Description: Description: Merchant generated unique profile id for customerConstraints: Alphanumeric string with dot(.). Maximum length is 256.
- Value: value
- Tags: String, Mandatory

#### action:
- Description: Description: Action to be performed on vpaAccountsConstraints: `PRIMARY_ACCOUNT`
- Tags: String, Mandatory

#### bankAccountUniqueId:
- Description: Description: Unique id for the bank account to be linkedConstraints: `bankAccountUniqueId` in the response of `Fetch Accounts` api call.
- Tags: String, Mandatory

#### customerVpa:
- Description: Description: Vpa to which the bank account should be linked as primary accountConstraints: something@handle
- Tags: String, Optional

#### udfParameters:
- Description: Description: Stringified JSON for udf parameters
- Tags: JSON String, Optional
## API Responses:
### 200:

#### status:
- Description: PSP status of the API**Values:** SUCCESS, FAILURE
- Tags: String, Mandatory

#### responseCode:
- Description: PSP response code for the API**Values:** Refer error code section
- Tags: String, Mandatory

#### responseMessage:
- Description: PSP response message for the API**Values:** Refer error code section
- Tags: String, Mandatory

#### payload:
- Value:
  - **MerchantId**:
    - Description: Unique id for the merchant as passed in request headers
    - Tags: String, Mandatory
  - **MerchantChannelId**:
    - Description: Unique id for the merchant channel as passed in request headers
    - Tags: String, Mandatory
  - **MerchantCustomerId**:
    - Description: Merchant generated unique profile id for customer as passed in the request
    - Tags: String, Mandatory
  - **CustomerMobileNumber**:
    - Description: Customer mobile number**Values:** 12 digits mobile number string
    - Tags: String, Mandatory
  - **Vpas**:
    - Description: List of vpas added
    - Tags: Array of String, Mandatory
  - **Accounts**:
    - Description: List of accounts
    - Tags: Array of String, Mandatory
  - **DefaultBankAccountUniqueId**:
    - Description: Unique id for the default bank account of the customer
    - Tags: String, Mandatory
- Tags: String, Mandatory

#### udfParameters:
- Description: Udf Parameters as passed in the request
- Tags: JSON String, Optional
