Initiate Payload

📘

Where to call initiate?

  • Android: In the onCreate() method of your application's main activity
  • iOS: In application:didFinishLaunchingWithOptions method of the application's AppDelegate class
  • React
    • Class Component architecture: In componentDidMount() method
    • Function Component architecture: In useEffect() hook

Payload for Initiation

The payload passed to the SDK during Initiate SDK call shall contain below parameters. Please note that the below params will be sufficient for Payment Methods - Cards, Netbanking, Wallets and UPI (Collect, Intent flows).

VariableDescriptionRequiredDefault
actionChanges based on operation to be performed
Type: String
Yes"initiate"
clientIdWill be shared by juspay team

Type: String
Yes
merchantIdThis parameter shall not be passed, if the customer/ order is created through Payments SDK.

It is Mandatory, when the payment session token is obtained from Juspay Servers.

Unique merchant id shared during onboarding

Type: String
Conditional
environmentEnvironment to be used in the session. Accepted values are “sandbox” or “production”
Type: String
Yes"production"
logLevelPass this parameter to receive the user click events
Refer Clickstream Events for list of events
Value : “1”
Type: String
No

Sample Request

{
  "requestId" : "8cbc3fad-8b3f-40c0-ae93-2d7e75a8624a",
  "service" : "in.juspay.hyperpay",
  "payload" : {
    "action" : "initiate",
    "merchantId" : "<Merchant Id>",   
    "clientId" : "<Client Id>",
    "environment" : "sandbox"|"production"
  }
}

Sample Response

{
  "service": "in.juspay.hyperpay",
  "requestId": "8cbc3fad-8b3f-40c0-ae93-2d7e75a8624a",
  "payload": {
    "action": "initiate",
    "status": "success"
  },
  "errorMessage": "",
  "errorCode": "",
  "error": false,
  "event" : "initiate_result"
}

What’s Next