---
page_source: https://juspay.io/in/docs/upi-plugin-sdk/cordova/interaction-with-sdk/initiating-the-sdk
page_title: Initiating the SDK
---


## Initiating the SDK



To initialise the SDK, client needs to call the `initiate` SDK API. The initiate api call boots up the SDK and makes it ready for all other operations

Follow the below steps to make an initiate SDK call:


### Step 1 Create an instance of HyperServices


The SDK exposes the `HyperServices` class. Create an object of this class for all upcoming operations



#### Code Snippets: -

#### JavaScript Code Snippet:

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



### Step 2 Create Initiate payload


Initiate API takes two parameters as input. One of the parameter is a JSON object referred as `InitiatePayload`. This payload contains certain key value pairs used by the SDK to perform a successful initiate

Refer to the following table for information about the description and sample payload.



#### Code Snippets: -

#### JavaScript Code Snippet:

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



###   Initiate Parameters - Signature Support



## Request Payload
- **RequestId**:
  - Description: Unique uuid-v4 string
  - Value: $requestId
  - 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. Should be initiate for this call.
      - Value: Value: initiate
      - Tags: String, Mandatory
    - **ClientId**:
      - Description: Client Id assigned by juspay. Usual convention is merchant_id
      - Value: Example: stock
      - Tags: String, Mandatory
    - **Environment**:
      - Description: Environment to be used for the session, while in testing it is sandbox and production when we are moving to releasing this app. Accepted values are 'sandbox' or 'production'
      - Value: Example: sandbox
      - Tags: String, Mandatory
    - **IssuingPsp**:
      - Description: Bank on which the merchant has been onboarded.
      - Value: Example: YES_BIZ/AXIS_BIZ
      - Tags: String, Mandatory
    - **MerchantKeyId**:
      - Description: Key ID to identify the public-private key pair used for signature generation.
      - Value: Example: 1234
      - Tags: String, Mandatory
    - **Signature**:
      - Description: Generated signature for signature payload. See signature generation process in pre-requisites section.
      - 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.
          - Value: Example: stock
          - Tags: String, Mandatory
        - **Customer_id**:
          - Description: Any unique reference associated with your customer.
          - Value: Example: abcde12345
          - Tags: String, Mandatory
        - **Timestamp**:
          - Description: Time when request is created in milliseconds.
          - Value: Example: 1665996901100
          - Tags: String, Mandatory
      - Tags: String, Mandatory
    - **ShouldCreateCustomer**:
      - Description: Value: true
      - Value: Value: true
      - Tags: Boolean, Mandatory
    - **MerchantLoader**:
      - Description: This key can be passed to so that merchant can show their own loaders and as well get the loader related events from the SDK, by default it’s value is false
      - Value: Value: false
      - Tags: Boolean, Optional
  - Tags: JSON, Mandatory


## Response Payload
- **RequestId**:
  - Description: Unique uuid-v4 string
  - Value: $requestId
  - 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 performed in the SDK.
      - Value: Value: initiate
      - Tags: String
    - **Status**:
      - Description: Status of the Operation.
      - Value: Possible values : SUCCESS / FAILURE
      - Tags: String
  - Tags: JSON, Mandatory



> **Note**
> [Click here](../miscellaneous/additional-parameters) for additional initiate parameters





#### Code Snippets: -

#### JavaScript Code Snippet:

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



###   Initiate Parameters - ClientAuthToken Support



## Request Payload
- **RequestId**:
  - Description: Unique uuid-v4 string
  - Value: $requestId
  - 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. Should be initiate for this call.
      - Value: Value: initiate
      - Tags: String, Mandatory
    - **ClientId**:
      - Description: Client Id assigned by juspay. Usual convention is merchant_id
      - Value: Example: stock
      - Tags: String, Mandatory
    - **Environment**:
      - Description: Environment to be used for the session, while in testing it is sandbox and production when we are moving to releasing this app. Accepted values are 'sandbox' or 'production'
      - Value: Example: sandbox
      - Tags: String, Mandatory
    - **MerchantId **:
      - Description: Key ID to identify the public-private key pair used for signature generation.
      - Value: Example: 1234
      - Tags: String, Mandatory
    - **CustomerId**:
      - Description: Any unique reference associated with your customer.
      - Value: Example: 12345
      - Tags: String, Mandatory
    - **IssuingPsp**:
      - Description: Bank on which the merchant has been onboarded.
      - Value: Example: YES_BIZ/AXIS_BIZ
      - Tags: String, Mandatory
    - **ClientAuthToken**:
      - Description: clientAuthToken as returned from clientAuthToken generation
      - Value: Example: tkn_2p2k1b6d26eg4740b9ef01294d3a43b4
      - Tags: String, Optional
    - **AuthExpiry**:
      - Description: Default 15min (functionality to be extended if configuration to change signature expiry is added)
      - Value: Example: 2021-07-19T07:20:53.318Z
      - Tags: String, Optional
    - **ShouldCreateCustomer**:
      - Description: true if customer is not registered, false if customer is already created via Get Customer.
      - Value: Example: true
      - Tags: Boolean, Mandatory
    - **MerchantLoader**:
      - Description: This key can be passed to so that merchant can show their own loaders and as well get the loader related events from the SDK, by default it’s value is false
      - Value: Value: false
      - Tags: Boolean, Optional
  - Tags: JSON, Mandatory


## Response Payload
- **RequestId**:
  - Description: Unique uuid-v4 string
  - Value: $requestId
  - 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 performed in the SDK.
      - Value: Value: initiate
      - Tags: String
    - **Status**:
      - Description: Status of the Operation.
      - Value: Possible values : SUCCESS / FAILURE
      - Tags: String
  - Tags: JSON, Mandatory



> **Note**
> [Click here](../miscellaneous/additional-parameters) for additional initiate parameters





#### Code Snippets: -

#### JavaScript Code Snippet:

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



### Step 3 Create CallbackHandler


During its lifecycle, SDK emits multiple events to communicate about the transaction status. All of these events are received by an instance of `HyperPaymentsCallbackAdapter`.

This callback handler is passed as the second argument to the initiate API call.



#### Code Snippets: -

#### JavaScript Code Snippet:

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



### Step 4 Call initiate


The final step is to call the `Initiate SDK API`.

The initiate method takes two parameters: `InitiatePayload` and `HyperPaymentsCallbackAdapter`. Use the functions created in the above steps to create the parameters

> **Warning**
> Initiate is a fire-and-forget call. For every HyperService instance you should **call initiate only once.** 





#### Code Snippets: -

#### JavaScript Code Snippet:

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