---
page_source: https://docs.juspay.io/upi-inapp/android/headless-process-payloads/set-primary-account
page_title: Set Primary Account
---


## Set Primary Account



The merchant can call this API to set another account as primary.


###   Process Parameters



## Request Payload
- **RequestId**:
  - Description: Unique uuid-v4 string
  - Value: Example: abcd-12345-abcd-12345
  - Tags: String, Mandatory
- **Service**:
  - Description: Value: in.juspay.hyperapi
  - Tags: String, Mandatory
- **Payload**:
  - Description: Parameters required to call Hyper SDK API
  - Value:
    - **Action**:
      - Description: Operation to be performed in the SDK.
      - Value: upiMakePrimary
      - Tags: String, Mandatory
    - **CustomerVpa**:
      - Description: Customer VPA
      - Value: eg: something@handle
      - Tags: String, Mandatory
    - **AccountReferenceId**:
      - Description: Unique id of account to be set as primary.
      - Value: eg: acc2
      - Tags: String, Mandatory
    - **UdfParameters**:
      - Description: Passed by merchant
      - Tags: String, Optional
    - **PrimaryAccountMapping**:
      - Description: Primary Account Mapping. Default: ONE_TO_ALL
      - Value: Possible values: ONE_TO_ONE (account in request will be set primary for vpa passed in request) / ONE_TO_ALL (account in request will be set primary for all vpas of a customer) / NONE (account in request will not be set primary for vpa passed in request and already existing entries won't be modified for other vpaaccounts)
      - Tags: String, Optional
  - Tags: JSON, Mandatory


## Response Payload
- **RequestId**:
  - Description: Unique uuid-v4 string
  - Value: Example: abcd-12345-abcd-12345
  - Tags: String
- **Service**:
  - Description: Value: in.juspay.hyperapi
  - Tags: String
- **Payload**:
  - Description: Response Parameters
  - Value:
    - **Action**:
      - Description: Operation to be performed in the SDK.
      - Value: upiMakePrimary
      - Tags: String, Mandatory
    - **Status**:
      - Description: Status of the API
      - Value: SUCCESS / FAILURE
      - Tags: String, Mandatory
    - **GatewayResponseCode**:
      - Description: Response code returned by NPCI
      - Tags: String, Mandatory
    - **GatewayResponseMessage**:
      - Description: Response message returned by NPCI
      - Tags: String, Mandatory
    - **CustomerMobileNumber**:
      - Description: masked phone number of the customer
      - Value: <Customer mobile number>
      - Tags: String, Mandatory
    - **VpaAccounts**:
      - Description: List of remaining vpa accounts. It's an array of Vpa Accounts
      - Value:
        - **Vpa**:
          - Description: Vpa
          - Tags: String, Mandatory
        - **Accounts**:
          - Description: Account linked to this vpa
          - Value:
            - **BankCode**:
              - Description: IIN Code for the bank
              - Tags: String, Mandatory
            - **BankName**:
              - Description: Name of bank
              - Tags: String, Mandatory
            - **MaskedAccountNumber**:
              - Description: Account Number with last few digits visible
              - Tags: String, Mandatory
            - **MpinLength**:
              - Description: Length of mpin
              - Tags: String, Mandatory
            - **MpinSet**:
              - Description: Is mpin set
              - Value: true / false
              - Tags: String, Mandatory
            - **ReferenceId**:
              - Tags: String, Mandatory
            - **OtpLength**:
              - Description: Length of OTP
              - Tags: String, Mandatory
            - **AtmPinLength**:
              - Description: Length of atm pin
              - Tags: String, Mandatory
            - **AccountNumber**:
              - Tags: String, Optional
            - **Type**:
              - Description: Type of account
              - Tags: String, Optional
            - **BranchName**:
              - Description: Name of branch in which account is registered
              - Tags: String, Optional
            - **BankAccountUniqueId**:
              - Description: Unique Identifier for bank account across banks
              - Tags: String, Optional
            - **Ifsc**:
              - Description: Account IFSC
              - Tags: String, Optional
            - **IsPrimary**:
              - Description: Is this account the primary account
              - Value: true / false
              - Tags: String, Optional
            - **Name**:
              - Description: Name of account holder
              - Tags: String, Optional
          - Tags: Array of JSON, Mandatory
      - Tags: Array of JSON, Mandatory
    - **OtherInfo**:
      - Description: As passed in request
      - Tags: String, Optional
  - Tags: JSON
- **Error**:
  - Description: Possible values :- true/false
  - Tags: Boolean
- **ErrorMessage**:
  - Description: Error Message
  - Tags: String
- **ErrorCode**:
  - Description: Error Code
  - Tags: String
- **Event**:
  - Description: Value: process_result
  - Tags: String





#### Code Snippets: -

#### Java Code Snippet:

```java
{
  "requestId": "f7443c1d-9acb-4b3d-9ae5-0e3c33dfcf5b",
  "service": "in.juspay.hyperapi",
  "payload": {
    "action": "upiMakePrimary",
    "customerVpa": "something@handle",
    "accountReferenceId": "acc2"
  }
}
```

#### Kotlin Code Snippet:

```kotlin
{
  "requestId": "f7443c1d-9acb-4b3d-9ae5-0e3c33dfcf5b",
  "service": "in.juspay.hyperapi",
  "payload": {
    "action": "upiMakePrimary",
    "customerVpa": "something@handle",
    "accountReferenceId": "acc2"
  }
}
```


## Sample Code Snippets:
### Request snippets:

#### Request Code Snippet:

```request
{
  "requestId": "f7443c1d-9acb-4b3d-9ae5-0e3c33dfcf5b",
  "service": "in.juspay.hyperapi",
  "payload": {
    "action": "upiMakePrimary",
    "customerVpa": "something@handle",
    "accountReferenceId": "acc2"
  }
}
```

### Response snippets:

#### Response:
```plaintext
{
  "requestId": "<request id passed>",
  "service": "in.juspay.hyperapi",
  "payload": {
    "action": "upiMakePrimary",
    "status": "SUCCESS",
    "customerMobileNumber": "XXXX7890",
    "vpaAccounts": [{
      "account": {
        "bankCode": "11111",
        "bankName": "ABCD",
        "maskedAccountNumber": "XXXX203891",
        "mpinLength": "6",
        "mpinSet": "true",
        "referenceId": "A0760cb548bb4dda9d32e3030863dd5",
        "isPrimary": "true",
        "otpLength": "6",
        "atmPinLength": "6"
      },
      "vpa": "something@handle",
      "isDefault": "true"
    }],
    "gatewayResponseCode": "00",
    "gatewayResponseMessage": "SUCCESS",
    "otherInfo": "{}",
  },
  "event": "process_result",
  "errorMessage": "",
  "errorCode": "",
  "error": false
}
```

