---
page_source: https://docs.juspay.io/upi-inapp/android/headless-process-payloads/bind-and-activate-device
page_title: Bind and Activate Device
---


## Bind and Activate Device



This api is used to bind the device to the customer. If device binding is not completed before the expiry of sms token, the sms token will be marked as expired.


###   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: Should be upiBindActivateDevice for this call.
      - Value: upiBindActivateDevice
      - Tags: String, Mandatory
    - **SimId**:
      - Description: ID for sim
      - Value: 0/1/2, etc
      - Tags: String, Mandatory
    - **IsBindAndActivateRequest**:
      - Description: Possible values: true/false
      - Value: Value: true
      - Tags: Boolean, Mandatory
    - **MerchantKeyId**:
      - Description: Key ID to identify the public-private key pair used for signature generation.
      - Value: Example: 1234
      - Tags: String, Mandatory
    - **Signature**:
      - Description: Signature generated for the signaturePayload
      - Value: <signature>
      - Tags: String, Mandatory
    - **SignaturePayload**:
      - Description: Signature payload is a stringified JSON of the details mentioned in the below table.
      - Value:
        - **Merchant_id**:
          - Description: Unique identifier associated with an account created by juspay.Ex: stock
          - Tags: String, Mandatory
        - **Customer_id**:
          - Description: Any unique reference associated with your customer.
          - Tags: String, Mandatory
        - **Timestamp**:
          - Description: Time when request is created in milliseconds.
          - Tags: String, Mandatory
      - Tags: String, Mandatory
    - **CustomerMobileNumber**:
      - Description: The customerMobileNumber passed here should be same as the sim used for binding, any other number will result in failure
      - Value: <Customer mobile number>
      - Tags: String, Optional
    - **UdfParameters**:
      - Description: Stringified json for udf parameters
      - 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 performed in the SDK.
      - Value: upiBindActivateDevice
      - Tags: String, Mandatory
    - **Status**:
      - Description: Status of the Operation. Possible values : NOPERMISSION / FRESH / BOUND / LINKED Accounts will be available only in case status is LINKED.
      - Tags: String, Mandatory
    - **IsDeviceBound**:
      - Description: If the current device is in bound state or not.
      - Value: Possible values: true/false
      - Tags: String, Mandatory
    - **IsDeviceActivated**:
      - Description: If the device is in active state or not
      - Value: Possible values: true/false
      - Tags: String, Mandatory
    - **Prefix**:
      - Description: Prefix to append before requestID
      - Value: Example: ABC
      - Tags: String, Mandatory
    - **VpaAccounts**:
      - Description: It's an array of Vpa Accounts. We will get this only after successful linking of accounts.
      - Value:
        - **Vpa**:
          - Description: Vpa
          - Tags: String, Mandatory
        - **Accounts**:
          - Description: Accounts 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: Possible values: true/false
              - Tags: String, Mandatory
            - **ReferenceId**:
              - Description: Account Reference Id
              - Tags: String, Mandatory
            - **OtpLength**:
              - Description: Length of OTP
              - Value: Example: 6
              - Tags: String, Mandatory
            - **AtmPinLength**:
              - Description: Length of atm pin
              - Value: Example: 6
              - Tags: String, Mandatory
            - **Type**:
              - Description: Type of account
              - Value: Example: Savings
              - 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: Possible values: true/false
              - Tags: String, Optional
            - **Name**:
              - Description: Name of account holder
              - Value: Example: ABC
              - Tags: String, Optional
          - Tags: Array of JSON, Mandatory
      - Tags: Array of JSON, Optional
    - **CustomerMobileNumber**:
      - Description: Masked phone number of the customer
      - Value: <Customer mobile number>
      - Tags: String, Optional
    - **DeviceFingerPrint**:
      - Description: Unique fingerprint of the device
      - Tags: String, Optional
    - **ExpiryTimestamp**:
      - Description: Expiry time of token
      - Tags: String, Optional
    - **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": "upiBindActivateDevice",
    "simId": "<simid>",
    "customerMobileNumber": "9876543210",
    "isBindAndActivateRequest": "true",
    "merchantKeyId": "<mkid>",
    "signature": "<Generated signature for signature payload>",
    "signaturePayload": "<Stringified signature payload used for signature generation>"
  }
}

"signaturePayload": {
  "merchant_id" = "stock",
  "customer_id" = "1234567",
  "timestamp" = "234562345",
  "customer_phone" = "9876543210"
}
```

#### Kotlin Code Snippet:

```kotlin
{
  "requestId": "f7443c1d-9acb-4b3d-9ae5-0e3c33dfcf5b",
  "service": "in.juspay.hyperapi",
  "payload": {
    "action": "upiBindActivateDevice",
    "simId": "<simid>",
    "customerMobileNumber": "9876543210",
    "isBindAndActivateRequest": "true",
    "merchantKeyId": "<mkid>",
    "signature": "<Generated signature for signature payload>",
    "signaturePayload": "<Stringified signature payload used for signature generation>"
  }
}

"signaturePayload": {
  "merchant_id" = "stock",
  "customer_id" = "1234567",
  "timestamp" = "234562345",
  "customer_phone" = "9876543210"
}
```


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

#### Request Code Snippet:

```request
{
  "requestId": "f7443c1d-9acb-4b3d-9ae5-0e3c33dfcf5b",
  "service": "in.juspay.hyperapi",
  "payload": {
    "action": "upiBindActivateDevice",
    "simId": "<simid>",
    "customerMobileNumber": "9876543210",
    "isBindAndActivateRequest": "true",
    "merchantKeyId": "<mkid>",
    "signature": "<Generated signature for signature payload>",
    "signaturePayload": "<Stringified signature payload used for signature generation>"
  }
}

"signaturePayload": {
  "merchant_id" = "stock",
  "customer_id" = "1234567",
  "timestamp" = "234562345",
  "customer_phone" = "9876543210"
}
```

### Response snippets:

#### Response:
```plaintext
{
  "requestId": "f7443c1d-9acb-4b3d-9ae5-0e3c33dfcf5b",
  "service": "in.juspay.hyperapi",
  "payload": {
    "action": "getSessionToken",
    "status": "LINKED",
    "isDeviceBound": "true",
    "isDeviceActivated": "true",
    "vpaAccounts": [{
      "account": {
        "bankCode": "11111",
        "bankName": "ABCD",
        "maskedAccountNumber": "XXXX203891",
        "mpinLength": "6",
        "mpinSet": "true",
        "referenceId": "A0760cb548bb4dda9d32e3030863dd5",
        "isPrimary": "true",
        "otpLength": "6",
        "atmPinLength": "6"
      },
      "vpa": "abc@xyz",
      "isDefault": "true"
    }],
    "prefix": "XYZ"
  },
  "error": false,
  "errorMessage": "",
  "errorCode": "",
  "event": "process_result"
}
```

