---
page_source: https://juspay.io/in/docs/ec-headless/cordova/mandates/mandate-registration-1
page_title: Mandate Registration
---


## Mandate Registration



To register mandate, pass mandate related parameters in the Create Order API to create a mandate registration order. Post transaction completion, use Order Status API and Webhooks to capture mandate registration details.

> **Note**
> CVV Less flow is not applicable for Mandate registration using saved cards & CVV is mandatory in these cases.




### Step 1.1. Create Order with Mandate Details


Pass mandate related parameters in [Create Order API](/ec-headless/android/mandates/mandates-create-order-api). Make sure all the required fields for mandates are passed correctly.




### Step 1.2. Render Checkout Screen with Mandate supported payment methods


Call the [Payment Methods API](/ec-headless/cordova/mandates/payment-methods-api) keeping value for `options.add_emandate_payment_methods` as true to fetch payment methods that support mandates. Supported Payment Methods include UPI, Card, Wallet, eNACH with Card/NB/Aadhaar authentication and eMandate (Direct Bank NB Mandate).




### Step 1.3. Initiate Transaction


Follow [Step 5.2: Transaction Initiation](/ec-headless/cordova/base-sdk-integration/making-a-payment#transaction-initiation) of the base integration process. Make sure to pass `shouldCreateMandate` as true in the process payload for the selected payment method in order to create a mandate registration. Additionally,

* For mandates on cards - Call [Card Info API](/ec-headless/cordova/mandates/card-info-api) to validate if the customer's card is eligible for mandates.
* For mandates on UPI collect - Call [Verify VPA API](/ec-headless/cordova/mandates/verify-vpa-api) to verify if the customer's VPA handle supports mandates.




### Step 1.4. Handle Payment Response with Mandate Details


Post the transaction is completed, follow [Step 6](/ec-headless/cordova/base-sdk-integration/handling-payment-response) of the Base Integration to handle the trasaction response. Mandate status will be sent in the Order Status API and Webhook.

In order to retrieve the mandate details in the [Order Status API](https://juspay.io/in/docs/ec-headless/cordova/mandates/mandate-order-status-api) and [Webhooks](/ec-headless/cordova/base-sdk-integration/webhooks), you should consume the mandate block that comes in the response. Some important parameters to look out for include `mandate_id`, `mandate_status`, and `mandate_token`. Along with Order and Transaction related webhooks, you will also receive mandate-specific webhooks which are: `Mandate Created`, `Mandate Active` and `Mandate Failed` webhooks. These webhooks will provide you with additional information about the mandate. It's important to handle these webhooks to ensure that the mandate is properly managed.



## Sample Code Snippets:
### Requests:

#### Step 1: Call Create Mandate Order API Code Snippet:

```step 1: call create mandate order api
curl POST 'https://api.juspay.in/orders' \
-H 'x-merchantid: merchant' \
-H ‘'Content-Type: application/x-www-form-urlencoded'\
-d 'order_id=234823498237423894273498' \
-d 'amount=1.00' \
-d 'currency=INR' \
-d 'customer_id=cst_lz7emoo5okgav' \
-d 'customer_email=test@gmail.com' \
-d 'customer_phone=9818638469' \
-d 'options.create_mandate=REQUIRED' \
-d 'mandate.amount_rule=VARIABLE' \
-d 'mandate.max_amount=1000.00' \
-d 'mandate.revokable_by_customer=true' \
-d 'mandate.block_funds=false' \
-d 'mandate.start_date=1598965200' \
-d 'mandate.end_date=1914141600' \
-d 'mandate.frequency=MONTHLY' \
-d 'mandate.rule_value=1' \
-d 'mandate.rule_type=ON' \
-d 'gateway_id=19' \
-d 'metadata.PAYTM_V2:gateway_reference_id=upimandate'

```

#### Step 2: Call Payment Methods API Code Snippet:

```step 2: call payment methods api
curl -X GET https://api.juspay.in/merchants/guest/paymentmethods?options.add_emandate_payment_methods=true
```

#### Step 3a: Call Card Info API Code Snippet:

```step 3a: call card info api
curl --location --request GET 'https://api.juspay.in/cardbins/424242?merchant_id=merchantId&options.check_mandate_support=true'
```

#### Step 3b: Call Verify VPA API Code Snippet:

```step 3b: call verify vpa api
curl --location --request POST 'https://api.juspay.in/v2/upi/verify-vpa' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic RDRGQkRDQkVC****BQjc0QThCOg==' \
--data-urlencode 'vpa=9999999999@upi' \
--data-urlencode 'merchant_id=merchantId'
```

#### Step 4: Get Mandate Order status Code Snippet:

```step 4: get mandate order status
curl GET 'https://api.juspay.in/orders/{{order_id}}' \
--header 'x-merchantid: merchant_id' \
--header 'Authorization: Basic <base64 of key:>'
--header 'version: 2020-12-31'
```

### Responses:

#### Step 1: Call Create Mandate Order API:
```plaintext
{
  "udf9": "",
  "udf8": "",
  "udf7": "",
  "udf6": "",
  "udf5": "",
  "udf4": "",
  "udf3": "",
  "udf2": "",
  "udf10": "",
  "udf1": "",
  "status_id": 10,
  "status": "NEW",
  "return_url": "",
  "refunded": false,
  "product_id": "",
  "payment_links": {
    "web": "https://api.juspay.in/merchant/pay/ordeu_8bddad1e3b9c85eab3db4528575c01b",
    "mobile": "https://api.juspay.in/merchant/pay/ordeu_8bddad1e3b9c85eab3db4528575c01b?mobile=true",
    "iframe": "https://api.juspay.in/merchant/ipay/ordeu_8bddad1e3b9c485eab3db4528575c01b"
  },
  "order_id": "14183944763",
  "merchant_id": "merchantId",
  "juspay": {
    "client_auth_token_expiry": "2020-06-16T10:43:35Z",
    "client_auth_token": "tkn_753275c49a44a1a313eb2567f2fd6b"
  },
  "id": "ordeu_8bddad1e3b9c85eab3db4528575c01b",
  "date_created": "2020-06-16T10:28:35Z",
  "customer_phone": "9999999999",
  "customer_id": "1235677",
  "customer_email": "test@gmail.com",
  "options.createMandate": "REQUIRED",
  "amount": "2.0",
  "mandate.maxAmount": "10.00",
  "mandate.endDate": "1646234827",
  "mandate.startDate": "1644420442"
}
```

#### Step 2: Call Payment Methods API:
```plaintext
{
  "payment_methods": [
    {
      "description": "Pay with UPI",
      "payment_method": "UPI",
      "payment_method_type": "UPI"
    },
    {
      "description": "Visa",
      "payment_method": "VISA",
      "payment_method_type": "CARD"
    },
    {
      "description": "Mastercard",
      "payment_method": "MASTER",
      "payment_method_type": "CARD"
    },
    {
      "description": "Rupay",
      "payment_method": "RUPAY",
      "payment_method_type": "CARD"
    },
    {
      "description": "HDFC Bank",
      "payment_method": "NB_HDFC",
      "payment_method_type": "NB"
    },
    {
      "description": "ICICI Netbanking",
      "payment_method": "NB_ICICI",
      "payment_method_type": "NB"
    },
    {
      "description": "Axis Bank",
      "payment_method": "NB_AXIS",
      "payment_method_type": "NB"
    }
  ],
  "emandate_payment_methods": [
    {
      "description": "UPI Collect",
      "payment_method": "COLLECT",
      "payment_method_type": "UPI"
    },
    {
      "description": "UPI Intent Pay",
      "payment_method": "PAY",
      "payment_method_type": "UPI"
    },
    {
      "payment_method_type": "CARD",
      "payment_method": "JP_HDFC",
      "description": "HDFC Bank"
    },
    {
      "payment_method_type": "NB",
      "payment_method": "JP_HDFC",
      "description": "HDFC Bank"
    },
    {
      "payment_method_type": "CARD",
      "payment_method": "JP_AXIS",
      "description": "Axis Bank"
    },
    {
      "payment_method_type": "NB",
      "payment_method": "JP_AXIS",
      "description": "Axis Bank"
    }
  ]
}
```

#### Step 3a: Call Card Info API:
```plaintext
{
  "id": "541919",
  "card_sub_type": "PLATINUM",
  "mandate_support": true,
  "brand": "MASTERCARD",
  "bank": "HDFC Bank",
  "object": "cardbin",
  "type": "DEBIT",
  "juspay_bank_code": "JP_HDFC",
  "country": "INDIA"
}
```

#### Step 3b: Call Verify VPA API:
```plaintext
{
  "vpa": "9999999999@upi",
  "status": "VALID",
  "mandate_details": {
    "is_handle_supported": true
  },
  "customer_name": "Verified"
}
```

#### Step 4: Get Mandate Order status:
```plaintext
{
  "udf9": "",
  "udf8": "",
  "udf7": "",
  "udf6": "",
  "udf5": "",
  "udf4": "",
  "udf3": "",
  "udf2": "",
  "udf10": "",
  "udf1": "",
  "txn_uuid": "eulmyxQn6bQso6y1Syy",
  "txn_id": "juspay-234823498237423894273498-1",
  "txn_detail": {
    "txn_uuid": "eulmyxQn6bQso6y1Syy",
    "txn_object_type": "EMANDATE_REGISTER",
    "txn_id": "juspay-234823498237423894273498-1",
    "txn_amount": 1,
    "tax_amount": null,
    "surcharge_amount": null,
    "status": "CHARGED",
    "source_object_id": "91887",
    "source_object": "MANDATE",
    "redirect": true,
    "order_id": "234823498237423894273498",
    "net_amount": 1,
    "gateway_id": 19,
    "gateway": "PAYTM_V2",
    "express_checkout": false,
    "error_message": "",
    "error_code": "",
    "currency": "INR",
    "created": "2020-08-30T09:53:17Z"
  },
  "status_id": 21,
  "status": "CHARGED",
  "return_url": "https://api.juspay.in",
  "refunded": false,
  "product_id": "",
  "payment_method_type": "UPI",
  "payment_method": "UPI",
  "payment_links": {
    "web": "https://api.juspay.in/merchant/pay/ordeu_9a0929803da644df8036133cf14d0206"
  },
  "payment_gateway_response": {
    "txn_id": "juspay-234823498237423894273498-1",
    "rrn": "4299662",
    "resp_message": "Txn Success",
    "resp_code": "01",
    "epg_txn_id": "202008301131312168187301880189",
    "created": "2020-08-30T09:54:10Z",
    "auth_id_code": ""
  },
  "payer_vpa": "9999999999@paytm",
  "order_id": "234823498237423894273498",
  "metadata": {
    "PAYTM_V2:gateway_reference_id": "upimandate"
  },
  "merchant_id": "juspay",
  "mandate": {
    "start_date": "1598745600",
    "rule_value": 30,
    "rule_type": "AFTER",
    "revokable_by_customer": true,
    "max_amount": 1000,
    "mandate_type": "EMANDATE",
    "mandate_token": "ad1d28b13f460fb5d348487be790f3",
    "mandate_status": "ACTIVE",
    "mandate_id": "3XMEcS1z2212Gq7fbfVYbzj",
    "frequency": "MONTHLY",
    "end_date": "1606521610",
    "block_fund": false,
    "amount_rule": "VARIABLE"
  },
  "id": "ordeu_9a0929803da644df8036133cf14d0206",
  "gateway_reference_id": "upimandate",
  "gateway_id": 19,
  "date_created": "2020-08-30T09:47:46Z",
  "customer_phone": "9999999999",
  "customer_id": "cst_lz7zmpemoo5okv",
  "customer_email": "customer@gmail.com",
  "currency": "INR",
  "bank_error_message": "",
  "bank_error_code": "",
  "auth_type": "",
  "amount_refunded": 0,
  "amount": 1
}

```

