---
page_title: UPI
product: ec-headless
platform: capacitor
page_source: https://docs.juspay.io/ec-headless/capacitor/payloads/upi
llms_txt: https://docs.juspay.io/llms.txt
product_llms_txt: https://docs.juspay.io/ec-headless/llms.txt
---


# UPI




### UPI Txn - Collect Substep


UPI Collect transactions happen through the webcollect flow, wherein the user enters his VPA and receives a collect request notification from the corresponding UPI PSP app.




### UPI Txn - Intent Substep


Intent flow (user selects one of the UPI enabled Apps present in his phone) and pays via the respective app.Juspay supports webcollect and intent flow along with the required UI to enable seamless UPI payments (refer Note below). However, merchants can also call Juspay directly with the VPA (webcollect) or Android/iOS App package name (intent).

> **Note**
> Hyper SDK also provides a User Interface for UPI Collect and UPI Intent Transactions. The User Interface will display:
> 
> * UPI Apps (available on users’ phone)
> * Field to enter UPI ID will be provided






### Step 1.1. How to trigger the UPI User Interface:


**The User Interface comes with configuration capabilities for managing:** 

* Blacklisting/Whitelisting UPI apps (to optimize success rates)
* Ordering of UPI apps (last used UPI app shall be always shown first)
* Enable/ Disable UPI collect request

If upiTxn is initiated, with request upiSdkPresent = true excluding the params ”payWithApp” and ”custVpa” , the UPI interface will be automatically triggered.

> **Note**
> Default value for 'showLoader' param, when not passed, is set to true.






### UPI Txn - Collect Mandate Substep


UPI Collect mandate transactions happen through the webcollect flow, wherein the user enters his VPA and receives a collect mandate register request notification from the corresponding UPI PSP app. On approving the request, mandate will be registered and auto debit occurs every cycle.




### Step 1.1. Prerequisites


UPI Intent and Autopay feature shall be enabled by acquirer / PG

![Image](https://dth95m2xtyv8v.cloudfront.net/tesseract/assets/ec-headless/collect_mandate_user_journey.png)
*User Experience for UPI Collect Autopay*








### Step 1.1. Key integration changes for integrating UPI Autopay via Hyper SDK


**Step 1 - Customer context creation** 

Create or Get Customer on the Juspay Server. It is recommended to make this API call before opening the payment page.

**Step 2 - Order creation** 

Create Order on the Juspay Server.

**Step 3 - Check available apps supporting UPI Autopay** 

Use 'List available mandate UPI apps' call to fetch all UPI PSP apps available on the users device that supports mandate. Pls proceed with mandate registration transaction only is the UPI app supports mandates.

**Step 4 - Initiate upi transaction** 

Use upiTxn operation to process UPI Collect Mandate or UPI Intent mandate registration. Please ensure that two additional parameters are passed for mandate registration (in comparison with UPI Intent/ Collect one-time transactions)

* shouldCreateMandate :: true

**Step 5 - Check mandate registration status** 

Use Juspay order status API to check the status of mandate.

**Step 6 - Recurring payments** 

Once the mandate registration status is successful, use Juspay APIs to directly debit the user account for renewals.

* Fetch active mandates for the customer using list mandates API
* Debit the user account using execute mandate API
* Revoke user mandates using revoke mandate API
* Send mandate notification using notification API and check notification status using notification status API. It is mandatory to send pre-debit notification to the user 24 hours before the execution of the mandate.

API Reference - [https://docs.juspay.in/api-reference](https://docs.juspay.in/api-reference)




### UPI Txn - Intent Mandate Substep


UPI Intent Mandate flow (user selects one of the UPI enabled Apps present in his phone), registers for the mandate and approves autodebit via the respective app.




### Step 1.1. Prerequisites


UPI Intent and Autopay feature shall be enabled by acquirer / PG

![Image](https://dth95m2xtyv8v.cloudfront.net/tesseract/assets/ec-headless/intent_mandate_user_journey.png)
*User Experience for UPI Intent Autopay*






### Step 1.1. Key integration changes for integrating UPI Autopay via Hyper SDK


**Step 1 - Customer context creation** 

Create or Get Customer on the Juspay Server. It is recommended to make this API call before opening the payment page.

**Step 2 - Order creation** 

Create Order on the Juspay Server.

**Step 3 - Check available apps supporting UPI Autopay** 

Use 'List available mandate UPI apps' call to fetch all UPI PSP apps available on the users device that supports mandate. Pls proceed with mandate registration transaction only is the UPI app supports mandates.

**Step 4 - Initiate upi transaction** 

Use upiTxn operation to process UPI Collect Mandate or UPI Intent mandate registration. Please ensure that two additional parameters are passed for mandate registration (in comparison with UPI Intent/ Collect one-time transactions)

* shouldCreateMandate :: true

**Step 5 - Check mandate registration status** 

Use Juspay order status API to check the status of mandate.

**Step 6 - Recurring payments** 

Once the mandate registration status is successful, use Juspay APIs to directly debit the user account for renewals.

* Fetch active mandates for the customer using list mandates API
* Debit the user account using execute mandate API
* Revoke user mandates using revoke mandate API
* Send mandate notification using notification API and check notification status using notification status API. It is mandatory to send pre-debit notification to the user 24 hours before the execution of the mandate.

API Reference - [https://docs.juspay.in/api-reference](https://docs.juspay.in/api-reference)

> **Note**
> Default value for 'showLoader' param, when not passed, is set to true.





## Sample Code Snippets:

### Sample Request:

#### UPI Txn - Collect Code Snippet:

```upi txn - collect
{
    "requestId": "eee6f65e-23dc-42e1-ad7c-ec3cddd64ac9",
    "service": "in.juspay.hyperapi",
    "payload": {
        "action": "upiTxn",
        "orderId": "hyperorder45314",
        "custVpa": "90005643210@ybl",
        "upiSdkPresent": false,
        "displayNote": "UPI Collect",
        "clientAuthToken": "tkn_0e37edc631d647fdb606ab48ccfc4213"
    }
}
```

#### UPI Txn - Intent Code Snippet:

```upi txn - intent
{
    "requestId": "eee6f65e-23dc-42e1-ad7c-ec3cddd64ac9",
    "service": "in.juspay.hyperapi",
    "payload": {
        "action": "upiTxn",
        "orderId": "hyperorder45314",
        "upiSdkPresent": true,
        "payWithApp": "com.phonepe.app",
        "displayNote": "UPI Intent",
        "clientAuthToken": "tkn_0e37edc631d647fdb606ab48ccfc4213",
        "showLoader": true
    }
}
```

#### UPI Txn - Collect Mandate Code Snippet:

```upi txn - collect mandate
{
    "requestId": "eee6f65e-23dc-42e1-ad7c-ec3cddd64ac9",
    "service": "in.juspay.hyperapi",
    "payload": {
        "action": "upiTxn",
        "orderId": "hyperorder45314",
        "custVpa": "90005643210@ybl",
        "upiSdkPresent": false,
        "displayNote": "UPI Collect Mandate",
        "clientAuthToken": "tkn_0e37edc631d647fdb606ab48ccfc4213",
        "shouldCreateMandate": true
    }
}
```

#### UPI Txn - Intent Mandate Code Snippet:

```upi txn - intent mandate
{
    "requestId": "eee6f65e-23dc-42e1-ad7c-ec3cddd64ac9",
    "service": "in.juspay.hyperapi",
    "payload": {
        "action": "upiTxn",
        "orderId": "hyperorder45314",
        "upiSdkPresent": true,
        "payWithApp": "com.phonepe.app",
        "displayNote": "UPI Intent Mandate",
        "clientAuthToken": "tkn_0e37edc631d647fdb606ab48ccfc4213",
        "shouldCreateMandate": true,
        "showLoader": true
    }
}
```

### Sample Response:

#### UPI Txn - Collect:
```plaintext
{
    "requestId": "eee6f65e-23dc-42e1-ad7c-ec3cddd64ac9",
    "service": "in.juspay.hyperapi",
    "payload": {
        "action": "upiTxn",
        "status": "CHARGED",
        "orderId": "hyperorder45314"
    },
    "error": false,
    "errorCode": "",
    "errorMessage": ""
}
```

#### UPI Txn - Intent:
```plaintext
{
    "service": "in.juspay.hyperapi",
    "requestId": "eee6f65e-23dc-42e1-ad7c-ec3cddd64ac9",
    "payload": {
        "action": "upiTxn",
        "status": "CHARGED",
        "orderId": "hyperorder45314"
    },
    "errorMessage": "",
    "errorCode": "",
    "error": false
}
```

#### UPI Txn - Collect Mandate:
```plaintext
{
    "requestId": "eee6f65e-23dc-42e1-ad7c-ec3cddd64ac9",
    "service": "in.juspay.hyperapi",
    "payload": {
        "action": "upiTxn",
        "status": "CHARGED",
        "orderId": "hyperorder45314"
    },
    "error": false,
    "errorCode": "",
    "errorMessage": ""
}
```

#### UPI Txn - Intent Mandate:
```plaintext
{
    "requestId": "eee6f65e-23dc-42e1-ad7c-ec3cddd64ac9",
    "service": "in.juspay.hyperapi",
    "payload": {
        "action": "upiTxn",
        "status": "CHARGED",
        "orderId": "hyperorder45314"
    },
    "error": false,
    "errorCode": "",
    "errorMessage": ""
}
```

