---
page_source: https://juspay.io/in/docs/hyper-checkout/android/resources/sample-payloads
page_title: Sample Payloads
---


## Sample Payloads



Refer to the below sample payloads based on your use-case


### Open the Hypercheckout Screen




#### Shell Code Snippet:

```shell
curl --location --request POST 'https://api.juspay.in/session' \
--header 'x-merchantid: yourMerchantId' \
--header 'Authorization: Basic base64encodedkey==' \
--header 'Content-Type: application/json' \
--data-raw '{
"amount":"10.00",
"order_id":"yourUniqueOrderId",
"customer_id":"dummyCustId",
"customer_phone":"9876543210",
"customer_email":"dummyemail@gmail.com",
"payment_page_client_id":"<YOUR_CLIENT_ID>",
"action":"paymentPage"
}'

```



### Open Quickpay - Applicable only for App




#### Shell Code Snippet:

```shell
curl --location --request POST 'https://api.juspay.in/session' \
--header 'x-merchantid: yourMerchantId' \
--header 'Authorization: Basic base64encodedkey==' \
--header 'Content-Type: application/json' \
--data-raw '{
"amount":"10.00",
"order_id":"yourUniqueOrderId",
"customer_id":"dummyCustId",
"customer_phone":"9876543210",
"customer_email":"dummyemail@gmail.com",
"payment_page_client_id":"<YOUR_CLIENT_ID>",
"action":"quickPay"
}'

```



### Open Payment Management - Screen allowing users to delete stored payment methods




#### Shell Code Snippet:

```shell
curl --location --request POST 'https://api.juspay.in/session' \
--header 'x-merchantid: yourMerchantId' \
--header 'Authorization: Basic base64encodedkey==' \
--header 'Content-Type: application/json' \
--data-raw '{
"customer_id":"dummyCustId",
"customer_phone":"9876543210",
"customer_email":"dummyemail@gmail.com",
"payment_page_client_id":"<YOUR_CLIENT_ID>",
"action":"paymentManagement"
}'

```



### Open the Hypercheckout Screen with REQUIRED Mandate Flow



User can proceed with mandate enabled options only


#### Shell Code Snippet:

```shell
curl --location --request POST 'https://api.juspay.in/session' \
--header 'x-merchantid: yourMerchantId' \
--header 'Authorization: Basic base64encodedkey==' \
--header 'Content-Type: application/json' \
--data-raw '{
"amount":"10.00",
"order_id":"yourUniqueOrderId",
"customer_id":"yourUniqueCustId",
"customer_phone":"9876543210",
"customer_email":"dummyemail@gmail.com",
"payment_page_client_id":"<YOUR_CLIENT_ID>",
"action":"paymentPage",
"options.create_mandate":"REQUIRED",
"mandate.max_amount":"1000.00",
"mandate.start_date":"1644420442",
"mandate.end_date":"1646234827"
}'

```



### isInitialised



Checks if current HyperSDK has been initialised. It should be used to check the HyperSDK instance state before calling process API.


#### Java Code Snippet:

```java
/**
Checks if current sdk instance has been initialised.
*/
public boolean isInitialised;


//Example usage
if (hyperServices.isInitialised()) {
    hyperServices.process(processPayload);
} else {
  //Intialise hyperInstance
}
```

#### Swift Code Snippet:

```swift
/**
Checks if current sdk instance has been initialised.
*/

//Example usage
if hyperInstance.isInitialised() {
    hyperInstance.process(processPayload)
}else {
  //Intialize hyperInstance
}

```

#### Objective - C Code Snippet:

```objective - c
/**
Checks if current sdk instance has been initialised..
*/
- (Boolean)isInitialised;

//Example usage
if ([hyperInstance isInitialised]) {
    [hyperInstance process:processPayload];
} else {
  //Intialize hyperInstance
}
```



### **UUID** 



Sample snippets to generate uuid-v4 string. Used in HyperSDK as [requestId]


#### Java Code Snippet:

```java
UUID.randomUUID().toString()

```

#### Swift Code Snippet:

```swift
NSUUID().uuidString
```

#### Objective - C Code Snippet:

```objective - c
NSUUID.UUID.UUIDString;
```



### **Backpress control** 



Since HyperSDK is a fragment, we will need the back-press event from the current activity to trigger events required for hardware back press.**hyperServices.onBackPressed()**  should be called during activity’s **onBackPressed()** . If the result is true, HyperSDK will consume the hardware back press.


#### Java Code Snippet:

```java
@Override
public void onBackPressed() {
    boolean backPressHandled = hyperServices.onBackPressed();
    if(!backPressHandled) {
        super.onBackPressed();
    }
}
```


In case the merchant wants to control backpress, they can call hyperServices.onBackPressed only when the UI is shown and Juspay can handle backpress. They can ignore the boolean response.

> **Warning**
> If the passed activity is terminated in back press (super.onBackPressed or activity.finish), in this case hyper.onBackPressed returns true, which will cause HyperSDK ui to be removed.




### Open the Hypercheckout Screen with OPTIONAL Mandate Flow



User can proceed with one-time or mandate transaction


#### Shell Code Snippet:

```shell
curl --location --request POST 'https://api.juspay.in/session' \
--header 'x-merchantid: yourMerchantId' \
--header 'Authorization: Basic base64encodedkey==' \
--header 'Content-Type: application/json' \
--data-raw '{
"amount":"10.00",
"order_id":"yourUniqueOrderId",
"customer_id":"yourUniqueCustId",
"customer_phone":"9876543210",
"customer_email":"dummyemail@gmail.com",
"payment_page_client_id":"<YOUR_CLIENT_ID>",
"action":"paymentPage",
"options.create_mandate":"OPTIONAL",
"mandate.max_amount":"1000.00",
"mandate.start_date":"1644420442",
"mandate.end_date":"1646234827"
}'

```
