---
page_source: https://docs.juspay.io/upi-inapp/android/headless-process-payloads/get-session-token
page_title: Get Session Token
---


## Get Session Token



It should not be called on an HyperSDK instance which has not been initiated. To verify if an instance is initiated, kindly refer to check SDK initiated in code


###   Process Parameters


> **Note**
> Status Description
> 
> NOPERMISSION - User has not given necessary permissions yet (SMS, Phone). FRESH - Necessary permissions are provided but the user is not registered. BOUND - User registered on device but no accounts are found. LINKED - User registered on device and valid accounts are found.




## 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: upiGetSessionToken
      - Tags: String, Mandatory
    - **MerchantKeyId**:
      - Description: Key ID to identify the public-private key pair used for signature generation.
      - Tags: String, Mandatory
    - **Signature**:
      - Description: Signature generated for the signaturePayload
      - 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
    - **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: upiGetSessionToken
      - 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": "getSessionToken",
    "merchantKeyId": "<Merchant Key Id>",
    "signature": "<Generated signature for signature payload>",
    "signaturePayload": "<Stringified signature payload used for signature generation>"
  }
}

"signaturePayload": {
  "merchant_id": "stock",
  "customer_id": "abcde12345",
  "timestamp": "1668389349848"
}
```

#### Kotlin Code Snippet:

```kotlin
{
  "requestId": "f7443c1d-9acb-4b3d-9ae5-0e3c33dfcf5b",
  "service": "in.juspay.hyperapi",
  "payload": {
    "action": "getSessionToken",
    "merchantKeyId": "<Merchant Key Id>",
    "signature": "<Generated signature for signature payload>",
    "signaturePayload": "<Stringified signature payload used for signature generation>"
  }
}

"signaturePayload": {
  "merchant_id": "stock",
  "customer_id": "abcde12345",
  "timestamp": "1668389349848"
}
```


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

#### Request Code Snippet:

```request
{
  "requestId": "f7443c1d-9acb-4b3d-9ae5-0e3c33dfcf5b",
  "service": "in.juspay.hyperapi",
  "payload": {
    "action": "getSessionToken",
    "merchantKeyId": "<Merchant Key Id>",
    "signature": "<Generated signature for signature payload>",
    "signaturePayload": "<Stringified signature payload used for signature generation>"
  }
}

"signaturePayload": {
  "merchant_id": "stock",
  "customer_id": "abcde12345",
  "timestamp": "1668389349848"
}
```

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

