---
page_source: https://juspay.io/in/docs/payment-page-enterprise/react-native/mandates/mandate-execution-api
page_title: Mandate Execution API
---

## API Version: default


# Mandate Execution API



After the successful Mandate registration, Merchant will receive a mandate_id, mandate_token from Juspay that should be stored against a customer at their end. For the subsequent charge transactions, the merchant is supposed to pass a combination of customer_id and mandate_id to do a debit without a 2FA. This API will create an order and perform a transaction with PG based on the mandate_id passed in the request.


| Status code | Reason | Response |
|---|---|---|
| JP_851 | Notification Leg of the transaction failed.  | PDN Failed. <Notification Failure Reason> |
| JP_852 | Mandate is not in active State |  |
| 401 | Invalid Authentication | { "status": "error", "error_code": "access_denied" } |
| 400 | Duplicate order id | { "status_id": 40, "status": "DUPLICATE_ORDER_ID", "error_message": "Order already exists with the given order_id" } |
| 400 | Invalid order amount | {"status":"Invalid Request","error_message":Invalid order amount","error_code":"Invalid"} |
| 400 | Mandate max amount not found | {"status":"Invalid Request","error_message":"Mandate max amount not found.","error_code":"Invalid"} |
| 400 | Amount not found in request. | {"status":"Invalid Request","error_message":"Amount not found in request.","error_code":"Invalid"} |
| 400 | Order amount greater than mandate max amount | {"status":"Invalid Request","error_message":"Order amount greater than mandate max amount (<currency <> max amount>)","error_code":"Invalid"} |
| 400 | Order amount not equal to mandate max amount. | {"status":"Invalid Request","error_message":"Order amount not equal to mandate max amount.","error_code":"Invalid"} |
| 400 | Currency not valid for mandate transaction | {"status":"Invalid Request","error_message":"currency not valid for mandate transaction.","error_code":"Invalid"} |
| 400 | notification_id not found in request. | {"status":"Invalid Request","error_message":"mandate.notification_id is mandatory.","error_code":"Invalid"} |
| 400 | Notification record not found | {"status":"Invalid Request","error_message":"Notification record not found for ","error_code":"Invalid"} |
| 400 | Notification status is not success | {"status":"Invalid Request","error_message":"Notification status is not success.","error_code":"Invalid"} |
| 400 | Mandate not found | {"status":"invalid_request_error","error_message":"Mandate not found","error_code":"Mandate not found"} |
| 400 | Mandate not in active state | {"status":"invalid_request_error","error_message":"Mandate is in non active(REVOKED / FAILURE) state. Recurring cannot be executed","error_code":"Mandate is in non active(REVOKED / FAILURE) state. Recurring cannot be executed"} |
## Endpoints:
- Sandbox: https://sandbox.juspay.in/txns

- Production: https://api.juspay.in/txns

## Request Type: 
POST

## Authorization:

#### Basic Auth:
Consists of two parts.

* Username: API Key obtained from Juspay dashboard
* Password: Empty string

Example:- Basic MUQ2QUxxxxxxxxxxxxU5QTIxQzNFNTQwNkFDMEZCOg==
- Tags: Base64 Encoded Username:Password, Mandatory
## Headers:

#### Content-Type:
application/x-www-form-urlencoded
- Tags: string

#### x-routing-id:
We recommend passing the customer_id as the x-routing-id. If the customer is checking out as a guest, you can pass an alternative ID that helps track the payment session lifecycle. For example, this could be an Order ID or Cart ID.

> **Warning**
> This ID is associated with the customer. It plays a key role in ensuring consistency and maintaining connections across different systems. If you fail to pass the same x-routing-id for the same customer in all related API calls, it could lead to issues with API functionality. Therefore, it’s crucial that you use the same x-routing-id for all requests tied to the same customer.


- Value: customer_1122
- Tags: String, Required
## Sample Code Snippets:
### Sample Request:

#### Request Code Snippet:

```request
curl -X  POST 'https://api.juspay.in/txns' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Authorization: Basic <base64 of key:>'
-H 'x-routing-id: customer_1122'\
-d 'order.order_id=26234761248249834753485721' \
-d 'order.amount=1.00' \
-d 'order.customer_id=cst_lz7zmpemoo5okgav' \
-d 'mandate_id=4rKxSj3bNXs7RQcdtajAkb' \
-d 'mandate.notification_id=2QNPw8KSbpHL122bNP926' \
-d 'mandate.display_invoice_number=JUS1239881' \
-d 'mandate.execution_date=1622369936' \
-d 'merchant_id=merchantid' \
-d 'format=json'

```

### Sample Response:

#### Response:
```json
{
  "txn_uuid": "eulmN9X8JpeC7qK6AJq",
  "txn_id": "merchant_id-order_id-1",
  "status": "PENDING_VBV",
  "payment": {
    "authentication": {
      "url": "https://api.juspay.io/v2/pay/finish/merchant_id/eulmN9X8JpeCxxxxxJq/2621",
      "method": "GET"
    }
  },
  "order_id": "order_id"
}
```

## Body Parameters:
### Parameters:

#### order:
- Value:
  - **First_name**:
    - Description: first_name is mandatory for certain gateway specific flows
    - Tags: String
  - **Last_name**:
    - Description: last_name is mandatory for certain gateway specific flows
    - Tags: String
  - **Order_id**:
    - Description: Unique Identifier for the order.
    - Tags: string, Mandatory
  - **Amount**:
    - Description: This is the amount that a customer will be charged in this transaction.
    - Tags: string, Mandatory
  - **Customer_id**:
    - Description: Customer Identifier against which the mandate was created.
    - Tags: string, Mandatory
  - **Currency**:
    - Description: ISO string of the currency. Use **INR**  for Indian Rupee. Among other accepted values are EUR, USD, GBP. Default value: `INR`
    - Tags: string
  - **Customer_email**:
    - Description: Email address of the customer. This field is **mandatory**  if gateway requires it.
    - Tags: string
  - **Customer_phone**:
    - Description: Mobile number or fixed line number of the customer. This field is **mandatory**  if gateway requires it.
    - Tags: string
  - **Description**:
    - Description: Short description for the order. We send this information to the backend gateways whenever there is a provision for this.
    - Tags: string
  - **Return_url**:
    - Description: A fully qualified URL such as [http://shop.merchant.com/](http://shop.merchant.com/) to which the customer will be redirected after payment completion.This URL shouldn’t contain any **query parameters** .This URL takes higher precedence over the common return URL configured in your account settings.
    - Tags: string
  - **Product_id**:
    - Description: An identifier for the product on the **Lender**  side for which the payment is being done. This field is just echoed back in the response so that **Lender**  can differentiate on their side.
    - Tags: string
  - **Billing_address_first_name**:
    - Description: First name in the billing address
    - Tags: string
  - **Billing_address_last_name**:
    - Description: Last name in the billing address
    - Tags: string
  - **Billing_address_line1**:
    - Description: Line 1 in the billing address
    - Tags: string
  - **Billing_address_line2**:
    - Description: Line 2 in the billing address
    - Tags: string
  - **Billing_address_line3**:
    - Description: Line 3 in the billing address
    - Tags: string
  - **Billing_address_city**:
    - Description: Billing address city
    - Tags: string
  - **Billing_address_state**:
    - Description: Billing address state
    - Tags: string
  - **Billing_address_country**:
    - Description: Billing address country
    - Tags: string
  - **Billing_address_postal_code**:
    - Description: Billing address postal code or zip code
    - Tags: string
  - **Billing_address_phone**:
    - Description: Mobile or phone number in the billing address
    - Tags: string
  - **Billing_address_country_code_iso**:
    - Description: ISO Country code. Default value: **IND**
    - Tags: string
  - **Shipping_address_first_name**:
    - Description: First name in the shipping address
    - Tags: string
  - **Shipping_address_last_name**:
    - Description: Last name in the shipping address
    - Tags: string
  - **Shipping_address_line1**:
    - Description: Line 1 in the shipping address
    - Tags: string
  - **Shipping_address_line2**:
    - Description: Line 2 in the shipping address
    - Tags: string
  - **Shipping_address_line3**:
    - Description: Line 3 in the shipping address
    - Tags: string
  - **Shipping_address_city**:
    - Description: Shipping address city
    - Tags: string
  - **Shipping_address_state**:
    - Description: Shipping address state
    - Tags: string
  - **Shipping_address_country**:
    - Description: Shipping address country
    - Tags: string
  - **Shipping_address_postal_code**:
    - Description: Shipping address postal code or zip code
    - Tags: string
  - **Shipping_address_phone**:
    - Description: Mobile or phone number in the shipping address
    - Tags: string
  - **Shipping_address_country_code_iso**:
    - Description: ISO Country code. Default value: **IND**
    - Tags: string
  - **Udf1**:
    - Tags: string
  - **Udf2**:
    - Tags: string
  - **Udf3**:
    - Tags: string
  - **Udf4**:
    - Tags: string
  - **Udf5**:
    - Tags: string
  - **Udf6**:
    - Tags: string
  - **Udf7**:
    - Tags: string
  - **Udf8**:
    - Tags: string
  - **Udf9**:
    - Tags: string
  - **Udf10**:
    - Tags: string
  - **Gateway_id**:
    - Description: Specify your preferred gateway for this order. Complete mapping for **gateway_id**  can be found here: [Gateway mapping](https://docs.juspay.in/resources/docs/dynamic-routing/dynamic-routing#Enforce-Gateway-Routing)
    - Tags: string
  - **Metadata**:
    - Value:
      - **BILLDESK:AdditionalInfo1**:
        - Tags: String
      - **BILLDESK:AdditionalInfo2**:
        - Tags: String
    - Tags: object
  - **Mutual_fund_details**:
    - Description: Contains the details of Mutual Fund.
    - Value:
      - **MemberId**:
        - Description: Member Id with ICCL or ARN_RIA with RTA.
        - Tags: String, Mandatory
      - **UserId**:
        - Description: Client Id with ICCL or USER_CODE with RTA.
        - Tags: String, Mandatory
      - **MfPartner**:
        - Description: NSE/BSE/KFIN/CAMS.
        - Tags: String, Mandatory
      - **OrderNumber**:
        - Description: Unique order number of each MF. Oder Number in ICCL or APPL_NO in RTA.
        - Tags: String, Mandatory
      - **Amount**:
        - Description: Individual MF amount within the array of MF being purchased.
        - Tags: String, Mandatory
      - **InvestmentType**:
        - Description: LUMPSU/ SIP
        - Tags: String, Mandatory
      - **FolioNumber**:
        - Description: Folio Number of the MF, used for RTA reporting. Mandatory for RTA reporting.
        - Tags: String, Optional
      - **PanNumber**:
        - Description: PAN Number of the user, used for RTA reporting. Mandatory for RTA reporting.
        - Tags: String, Optional
      - **AmcCode**:
        - Description: AMC Code of the MF, used for RTA reporting. Mandatory for RTA reporting.
        - Tags: String, Optional
      - **SchemeCode**:
        - Description: Scheme Code of the MF, used for RTA reporting. Mandatory for RTA reporting.
        - Tags: String, Optional
    - Tags: List, Optional
- Tags: object

#### merchant_id:
- Description: The username you hold at Juspay
- Tags: string, Required

#### mandate_id:
- Description: Mandate ID sent by Juspay after successful mandate registration.
- Tags: string, Required

#### mandate:
- Value:
  - **Notification_id**:
    - Description: [CONDITIONAL] The object_reference_id which was sent in notification API call. Applicable only for merchants calling Notification and Execution APIs separately.
    - Tags: string
  - **Display_invoice_number**:
    - Description: Applicable only for cards SI. If merchant wants to generate invoice display number, but wants Juspay to handle pre-debit notification, this needs to be sent.
    - Tags: string
  - **Execution_date**:
    - Description: Applicable only for merchants enabled for mandate workflow (notification + execution flow).UNIX EPOCH timestamp format. Default execution happens at 25th hour of successful notification. If a merchant wants to execute mandate at custom time anytime after 25th hour, send execution_date.
      
      > **Warning**
      > This parameter doesn't apply to gateways handling notifications (e.g. Razorpay, PhonePe, Cashfree), execution follows the gateway's policy
    - Tags: string
- Tags: object

#### format:
- Description: The format of the response. Should be passed as json.
- Tags: string, Required
## API Responses:
### 200:

#### txn_uuid:
- Description: Transaction UUID for the payment
- Tags: string

#### txn_id:
- Description: Transaction Id for the payment
- Tags: string

#### status:
- Description: Status of the transaction. See Appendix for status mapping.
- Tags: string

#### payment:
- Value:
  - **Authentication**:
    - Value:
      - **Url**:
        - Description: URL to which the user has to be taken to for completing the authentication
        - Tags: String
      - **Method**:
        - Description: HTTP Method for authentication. Can be one of GET or POST
        - Tags: String
      - **Payment.authentication.params**:
        - Description: Present only when the method is POST. Parameter map that has to be sent along with the URL for authentication.
        - Tags: Params Object
    - Tags: object
- Tags: object

#### order_id:
- Description: 26234761248249834753485721
- Tags: string

#### offer_details:
- Value:
  - **Offers**:
    - Tags: array
- Tags: object
### 400:

#### status_id:
- Tags: integer

#### status:
- Description: DUPLICATE_ORDER_ID
- Tags: string

#### error_message:
- Description: Order already exists with the given order_id
- Tags: string
