Creating and Executing Mandates
Businesses can use mandates to securely collect recurring payments via UPI from their customers. By creating a payment session for mandate enrollment, you obtain the customer’s consent for future charges. Executing it allows you to collect recurring payments on a scheduled basis.
Create a Payment Session for Mandate Enrollment
Before collecting recurring payments, create a payment session for mandate enrollment that authorises your business to charge the customer according to their agreed schedule and amount. To create a mandate, you’ll have to:
-
Create a customer using the Create Customer API.
-
Use the
customer_idto create a Mandate Enrollment Payment Session with the required mandate details. -
Create a new payment instance using the
zapikey. -
Call the
requestPaymentMethod()function on the instance with thepayment_session_idto initiate the payment.
Once initiated, the widget will open, allowing the customer to set up the UPI mandate. After the autopay is set up, you can execute the mandates to notify customers and collect recurring payments.
Note: A mandate once created cannot be modified. To make any changes, you need to create a new mandate.
Executing Mandates
After you set up a mandate and your customer authorises it, you can execute it to securely collect funds on a scheduled basis. Follow the steps below to execute your mandate and start receiving payments.
Notes:
- Notifications must be sent at least 24 hours before the mandate is executed.
- For manual notifications, mandate execution should be initiated 24 hours after the notification is sent.
- For auto-execution, a notification is sent when the execute API is triggered, and the mandate is automatically executed 24 hours after the notification.
Send Mandate Notification
Once you obtain the mandate_id, you can manually send mandate notifications to your customers by using the Mandate Notification API.
{
"mandate_id": 300000009876,
"amount": 100,
"execution_date": "23-07-2025",
"description": "Testing Mandate Execution",
"invoice_number": "INV12345"
}
Insight: Use the mandate_notification_id to retrieve details for a specific mandate notification. Refer to our API docs for more details.
Create Payment Session for Mandate Execution
To execute a mandate, create a payment session and use the session_id generated from the Payment Session API in the mandate execution request.
Note:
-
Payment session created for mandate execution is valid for 3 days.
-
A maximum of 3 retry attempts are allowed for each payment session, with a minimum interval of one hour between each attempt.
{
"amount": "100",
"currency": "INR",
"customer_id": "3000000000927",
"type": "mandate_execution",
"description": "Payment session for mandate execution",
"invoice_number": "INV-12345",
"meta_data": [
{
"key": "Key1",
"value": "Value1"
}
]
}
Once you’ve created a payment session, you can proceed to execute the mandate.
Execute the Mandate
You can use the associated mandate_id to execute the mandate and collect recurring payments. If the mandate notification is sent manually, make sure to include the mandate_notification_id when executing the mandate. Refer to our API documentation for implementing mandate execution.
{
"customer_id": 3000000006081,
"mandate_id": 3000000006083,
"payments_session_id": 3000000006082,
"amount": 100,
"invoice_number": "INV12345",
"mandate_notification_id": 3000000009226,
"receipt_email": "xxx@abc.com",
"phone": "+91 0000000000",
"description": "Testing Mandate Execution",
"reference_number": "2123"
}
Once the mandate is executed, recurring payments will be collected from the customer. Payments are processed through UPI, and both the business and the customer receive confirmation of each transaction. Customers can pause or cancel their mandate at any time using their UPI app.
Insight: Use the mandate_id to retrieve details for a specific mandate. Refer to our API Docs for more details.