---
page_title: AmazonPay UPI SDK
product: EC Headless
platform: Android
page_source: https://juspay.io/in/docs/ec-headless/android/additional-features/amazonpay-upi-sdk
llms_txt: https://juspay.io/in/docs/llms.txt
product_llms_txt: https://juspay.io/in/docs/ec-headless/llms.txt
---


# Amazon Pay UPI SDK Flow




### Step 1.1. Flow


The objective of this new integration is to improve user experience and success rates by reducing unnecessary redirections for the end user.

**Prerequisites** 

Amazon Pay SDKs are included in a new SDK HyperAPayUPI. Merchant needs to add its dependency in addition to the existing HyperSDK dependency in the app’s build.gradle.


#### Groovy Code Snippet:

```groovy
hyperSdkPlugin {
    clientId = "<CLIENT_ID>"
    sdkVersion = "2.1.13"
}
```


> **Note**
> _Please make sure you have mavenCentral() added in root build.gradle’s allProject repository section to fetch transitive dependencies of HyperAPayUPI SDK_ .






### Step 1.1. Integration


The SDK integration has been done in a way to minimise the changes needed to be done for live merchants. In the  proposed implementation, merchants call Juspay SDK with `upiTxn`action and `"getAvailableApps": true`and`"version": “v2`parameters which internally calls Amazon Pay SDK’s prefetch function and returns the call with the corresponding package based on the response from Amazon Pay SDK. Sample Request and Response are available on the right side of this screen.The extra parameter (“version” : “v2”) is being added to maintain backward compatibility. This extra parameter needs to be passed in the UPITxn getAvailableApps and the subsequent transaction call as well. For more details, please refer to this [document](https://assets.juspay.in/juspay/docs/AmazonPay+UPI+SDK+Integration_v2.pdf).



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

#### Amazon Pay UPI SDK Flow Code Snippet:

```amazon pay upi sdk flow
{
    "requestId": "7bd92330-2c0f-4dbc-91d0-8f2484910b40",
    "service": "in.juspay.hyperapi",
    "payload": {
        "action": "upiTxn",
        "orderId": "hyperorder95862",
        "getAvailableApps": true,
        "version": “v2”,
        "clientAuthToken": "tkn_af0a8502674c4d6abe94d33483ad86e3"
    }
}
```

### Sample Response:

#### Amazon Pay UPI SDK Flow:
```json
{
    "service": "in.juspay.hyperapi",
    "requestId": "c5db944e-ebd6-4056-9e80-a6f2424f47a6",
    "payload": {
        "action": "upiTxn",
        "availableApps": [
            {
            "packageName": "AMAZON_PAY_UPI_SDK",
            "appName": "Amazon Pay UPI"
            }
        ]
    },
    "errorMessage": "",
    "errorCode": "",
    "error": false,
    "event": "process_result"
}
```



---

## See Also

- [AmazonPay - Non Tokenized Flow](https://juspay.io/in/docs/ec-headless/android/additional-features/amazonpay--non-tokenized-flow)
- [User Payment Profile Management](https://juspay.io/in/docs/ec-headless/android/additional-features/user payment-profile-management)
