---
page_title: Mandate Registration API
product: upi-autopay
page_source: https://docs.juspay.io/upi-autopay/docs/how-to-integrate/mandate-registration-api
llms_txt: https://docs.juspay.io/llms.txt
product_llms_txt: https://docs.juspay.io/upi-autopay/llms.txt
---


# Mandate Registration API



For initiating UPI Autopay registration transaction, additional mandate parameters is required to be added in the existing UPI payment call.


### Step 1.1. Parameters



### Payload
- **Order_id**:
  - Description: Unique Identifier for the order.
  - Tags: string, Mandatory
- **Merchant_id**:
  - Description: ID of the **merchant_account**  that you hold with us.
  - Tags: string, Mandatory
- **Payment_method_type**:
  - Description: Payment method type of transaction. **Value:**  UPI
  - Tags: string, Mandatory
- **Payment_method**:
  - Description: Payment method of transaction.**COLLECT**  - For UPI Collect transaction.**PAY**  - For UPI Intent / UPI QR transaction.
  - Tags: string, Mandatory
- **Upi_vpa**:
  - Description: **VPA**  to which the collect request must be sent.
  - Tags: string
- **Redirect_after_payment**:
  - Description: We recommend that you set this to **true**  and use the redirection flow.If set to **true** , then the user is redirected to the return_url configured for the order.If set to **false** , then the user will be stopped at the response page from the gateway.Your client should be able to read the page/title to infer that the user has completed the transaction.
  - Tags: boolean, Mandatory
- **Format**:
  - Description: If it is set to **json** , then the response will be **HTTP 200**  with a JSON formatted text. Otherwise, the response is **HTTP 302**  with the Location attribute having the destination URL.
  - Tags: string, Mandatory
- **Mandate_type**:
  - Description: **EMANDATE**  in case of UPI.
  - Tags: string, Mandatory
- **Should_create_mandate**:
  - Description: This is a customer’s consent flag. This should be always **TRUE**  in case of a mandate transaction.
  - Tags: boolean, Mandatory
- **Txn_type**:
  - Description: Should be passed as `UPI_PAY` for UPI Intent / `UPI_QR` for QR / `UPI_COLLECT` for UPI Collect transactions
  - Tags: String, Required
- **Sdk_params**:
  - Description: Should be passed as true to receive the paramters for URI construction. Must be passed as `true` for UPI Intent/ QR transacitons
  - Tags: Boolean





## Mandate UPI Intent /QR -  URI construction: 



From the response parameters of the UPI Intent transaction API call , the `uri_params` parameters must be consumed to construct a URI that needs to be embedded in the browser. 

For UPI QR payment method, the QR code should be generated with the URI constructed in the below step. 

**Format:** 

upi://mandate?tr=...(enter the tr).......&tid=...(enter the tid).......&pa=.....(enter pa)...&mc=....(enter the mc)...&pn=....(enterthe pn)...&am=.....(enter the am).....&cu=INR&tn=....(description for the transaction)&amrule=(enter the amrule)&……

**Sample Autopay URI:** 

upi://mandate?validitystart=20062022&validityend=24082037&tr=202101345671229366&tn=Pay%20for%20merchant&tid=121313202101345671229366&recur=ASPRESENTED&purpose=14&pn=test&pa=juspay@axisbank&orgid=000000&mode=00&mn=Subscription%20for%20testaccount&mc=1234&amrule=MAX&am=1.00&cu=INR

> **Warning**
> In the URI spaces are replaced by "%20". The URI is encoded. Kindly generate the intent URI dynamically ie, based on the params received in the `sdk_params` response. Do not hardcode any keys or values as it can differ with different PG’s.



## Sample Code Snippets:
### Request :

#### Request- UPI Collect Code Snippet:

```request- upi collect
curl -X POST 'https://api.juspay.in/txns' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'x-routing-id: customer_1122'\
-d 'order_id=234823498237423894273498' \
-d 'merchant_id=merchant' \
-d 'payment_method_type=UPI' \
-d 'payment_method=COLLECT' \
-d 'upi_vpa=9483407288@paytm' \
-d 'redirect_after_payment=true' \
-d 'format=json' \
-d 'should_create_mandate=true' \
-d 'mandate_type=EMANDATE'

```

#### Request- UPI Intent Code Snippet:

```request- upi intent
curl --location --request POST 'https://api.juspay.in/txns' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'x-routing-id: customer_1122'\
--data-urlencode 'order_id=DW-1dvn6nL9AD' \
--data-urlencode 'merchant_id=merchantId' \
--data-urlencode 'should_create_mandate=true' \
--data-urlencode 'payment_method_type=UPI' \
--data-urlencode 'payment_method=PAY' \
--data-urlencode 'txn_type=UPI_PAY' \
--data-urlencode 'sdk_params=true' \
--data-urlencode 'mandate_type=EMANDATE'\
--data-urlencode 'redirect_after_payment=true' \
--data-urlencode 'format=json' 

```

### Response :

#### Response- UPI Collect:
```json
{
  "txn_uuid": "eulmyxQn6bQso6y1Syy",
  "txn_id": "merchant-234823498237423894273498-1",
  "status": "PENDING_VBV",
  "payment": {
    "authentication": {
      "url": "https://api.juspay.in/v2/pay/start/paypal/euxxxxQn6bQso6y1Syy",
      "method": "GET"
    }
  },
  "order_id": "234823498237423894273498"
}
```

#### Response- UPI Intent:
```plaintext
{
  "txn_uuid": "eulcEPzPd244hfrGShFpH",
  "txn_id": "merchantId-DW-1dvn6nL9AD-1",
  "status": "PENDING_VBV",
  "payment": {
    "sdk_params": {
      "uri_params": {
        "validitystart": "20062022",
        "validityend": "24082037",
        "tr": "PAYTMSUBS202206203480824046791145",
        "tn": "Amount%20to%20be%20paid%20now%20is%20Rs%201.00",
        "tid": "PYTM20220620937257791803424",
        "recur": "ASPRESENTED",
        "purpose": "14",
        "pn": "test",
        "pa": "test@paytm",
        "orgid": "000000",
        "mode": "00",
        "mn": "Subscription%20for%20testaccount",
        "mc": "5811",
        "cu": "INR",
        "amrule": "MAX",
        "am": "1000.00"
      },
      "scheme": "mandate"
    },
    "authentication": {
      "url": "https://api.juspay.in/v2/pay/start/merchantid/exxcEPzPd2xxxfrGShFpH",
      "method": "GET"
    }
  },
  "order_id": "DW-1dvn6nL9AD",
  "offer_details": {
    "offers": []
  }
}
```

