UPI (Unified Payments Interface) is a real-time payment system that allows for instant bank transfers. This guide will walk you through the steps to integrate Recurring UPI payments with EBANX, allowing you to set up regular subscription-based payments for your customers.
How it works
To integrate recurring UPI transactions, you will need to follow three main steps:
- Subscription enrollment - Register the subscription to establish the customer's recurring payment setup.
- Pre-debit notification - Notify the customer before initiating the payment, as required by Indian regulations.
- Payment request - Request the actual payment after ensuring the pre-debit notification has been successfully acknowledged.
Requirements
- API credentials - Ensure you have your EBANX integration key. If not, complete the Merchant Signup Form.
- Familiarity with EBANX Direct - This setup follows the same general structure as other payment methods, with a few unique parameters.
Instructions
Follow the steps below.
Select your environment
Select the appropriate environment for your integration. Use the sandbox environment for testing, or the production environment for live transactions. Use the URL for your HTTP requests based on your selection.
https://sandbox.ebanx.com/ws/directSubscription enrollment parameters
To start the recurring payment process, enroll the subscription using the /ws/userenrollment endpoint. This step involves collecting essential customer details and subscription parameters to establish the recurring billing agreement. Once the process is complete, the customer will be enrolled for the recurring payment cycle. You’ll need to specify the following parameters in your enrollment request
Essential parameters
Parameter Description operation
Set to enrollment
integration_key
Your EBANX integration key payment_type_code
Set to upi-collect-autopay
Subscription parameters
Parameter Description enrollment.merchant_enrollment_code
Unique identifier associated with the subscription. enrollment.country
Two-letter country code. Set to in
for India.enrollment.back_urls.success
Callback URL for successful response. enrollment.back_urls.failure
Callback URL for failure response. subscription.subscription_name
Description for the subscription. subscription.expiration_date
Expiration date of the subscription. subscription.frequency
Frequency for charging the subscription.
ondemand
monthly
biweekly
weekly
subscription.recurrence_rule
Must be on
if subscription frequency is:
monthly, biweekly or weeklysubscription.recurrence_value
Mandatory if subscription frequency is monthly, biweekly or weekly.
If weekly, 1 to 7,
If biweekly, 1 to 16,
If monthly 1 to 31.subscription.min_amount
Minimum amount (per payment) during the validity of subscription plan, (In INR currency) subscription.max_amount
Maximum amount (per payment) during the validity of the subscription plan, (In INR currency) upi.vpa
Subscription payer UPI ID.
Standard format is 'payer@vpa'.
Mandatory ifpayment_type_code
isupi-collect-autopay
.Addition information
- To set a fixed subscription amount, use equal values for the following:
subscription.min_amount
andsubscription.max_amount
- The following params will be displayed in the user's UPI app with the subscription authentication request.
subscription_name
expiration_date
frequency
min_amount
max_amount
- The predefined values for
subscription.frequency
set the rules for payment execution, but they don't automate the required actions.- Pre-debit notifications and payment requests must be managed manually.
- Payments outside these rules will be declined.
- If the time window is missed, the subscription status remains unchanged, and payments can proceed in the next window.
- For more flexibility, consider using the
ondemand
frequency.
- To set a fixed subscription amount, use equal values for the following:
Enrollment request
Use the following example to initiate an enrollment request.
curl -X POST \
--location 'https://sandbox.ebanx.com/ws/userenrollment' \
--header 'Content-Type: application/json' \
--data '{
"integration_key": "your EBANX integration key",
"operation": "enrollment",
"payment_type_code": "upi-collect-autopay",
"enrollment": {
"merchant_enrollment_code": "1234567ABCD",
"email": "email@example.com",
"country": "IN",
"back_urls": {
"success": "{{success_url}}",
"failure": "{{failure_url}}"
},
"subscription": {
"subscription_name": "Description of the subscription.",
"expiration_date": "2025-12-30",
"frequency": "ondemand",
"min_amount": "1",
"max_amount": "20000"
},
"upi": {
"vpa": "payer@vpa"
}
}
}Enrollment Response
A successful request will return a JSON response like the one below.{
"status": "SUCCESS",
"enrollment": {
"merchant_enrollment_code": "1234567ABCD",
"email": "email@example.com",
"country": "IN",
"back_urls": {
"success": "{{success_url}}",
"failure": "{{failure_url}}"
},
"subscription": {
"subscription_name": "Descriptor of the subscription.",
"expiration_date": "2025-12-30",
"frequency": "ondemand",
"min_amount": "1",
"max_amount": "20000"
},
"upi": {
"vpa": "payer@vpa"
}
}
}Tips
For subscriptions with payment amounts under 15,000 INR, auto-debit can be enabled for subsequent payments.
- This means that for following transactions under 15,000 INR, PIN authentication for UPI transactions will not be required.
- However, the first payment must be executed within 5 minutes of the initial enrollment.
Even with auto-debit enabled, subsequent payments will still require the mandatory pre-debit notification to the user.
Payments > 15,000 INR will always require user authentication.
- Users have up to 60 minutes to approve the transaction after the subscription payment is requested.
Pre-debit notification
This is a mandatory step that must be sent to the user before initiating a payment. This notification informs the customer about the upcoming transaction, ensuring they are aware of the payment being applied to their account. The pre-debit notification is a regulatory requirement for all recurring payments.
To send a pre-debit notification, use the /ws/customerenrollment-notify endpoint. This will trigger a notification to the customer, allowing them to be informed and prepared for the payment.
Important: The subscription payment can only proceed once the pre-debit notification has been successfully sent and acknowledged by the customer with a
"status": "notified"
response.Parameters
Parameter Description integration_key
Your EBANX integration key. amount
Amount for the upcoming payment. merchant_enrollment_code
Unique enrollment code defined when subscription was registered. payment_execution_date
Date and time for the upcoming payment.
Expected format:yyyy-mm-dd hh:mm:ss
.Sample Request
curl -X POST \
--location 'https://sandbox.ebanx.com/ws/customerenrollment-notify/' \
--header 'Content-Type: application/json' \
--data '{
"integration_key": "Your EBANX integration key",
"amount": "1000",
"merchant_enrollment_code": "1234567ABCD",
"payment_execution_date": "2024-08-01 12:00:00"
}'A successful request will return a JSON response like the one below.
{
"status": "SUCCESS",
"notification": {
"hash": "ac682d9c3b5a2f90150bjcbabe89b933f954e616fbd19e0dff99339f7586881f4e397ca7dd88baba9715d40f39562e8040c1898a551143574aa0f93fc07a4c6e",
"amount": "1000",
"status": "notified",
"payment_execution_date": "2024-08-01 12:00:00"
}
}Mandatory Wait Period
A mandatory wait period exists between the pre-debit notification to the user and the initiation of the subscription payment.
- The payment can only be initiated once a successful response, with
"status": "notified"
is received. - For subscriptions with a frequency of
ondemand
, the wait period must be at least 24 hours. - For subscriptions with a frequency of
monthly
,biweekly
, orweekly
, the wait period must be at least 48 hours. - Subscription payment attempts made without a prior pre-debit notification to the user, or within a wait period shorter than the required duration, will be declined.
- The payment can only be initiated once a successful response, with
Define payment parameters
The subscription payment request follows the same standards as the
ws/direct
payment requests, with the addition of specific parameters related to the subscription. These parameters link the payment to the corresponding subscription, ensuring that the recurring payment is properly processed.Essential parameters
Basic parameters: integration_key
Your EBANX integration key operation
Set to request
Payment parameters
Payment parameters: payment.name
Payer full name payment.email
Customer email payment.country
Two-letter country code. Set to in
for Indiapayment.merchant_payment_code
Unique code for the payment payment.currency_code
Set to INR
payment.amount_total
Payment amount metadata.merchant_enrollment_code
Unique identifier associated with the subscription To learn more about parameters and view examples, please refer to theAPI Reference Guide chevron_rightPayment request
Use the
ws/direct
endpoint to initiate a payment request, ensuring the payment is correctly linked to the corresponding subscription.Sample request:
curl -X POST \
--location 'https://sandbox.ebanx.com/ws/direct' \
--header 'Content-Type: application/json' \
--data '{
"integration_key": "Your EBANX integration key",
"operation": "request",
"payment": {
"name": "John Doe",
"email": "email@example.com",
"country": "in",
"payment_type_code": "upi-collect-autopay",
"merchant_payment_code": "PMT1234567BC",
"currency_code": "INR",
"amount_total": 1000,
"metadata": {
"merchant_enrollment_code": "1234567ABCD"
}
}
}'A successful request returns a response like the example below.
{
"payment": {
"hash": "66a22a492540fe35c3d6479aa88551d844ea66de7c193bd1",
"country": "in",
"merchant_payment_code": "PMT1234567BC",
"status": "PE",
"open_date": "2024-08-02 13:00:00",
"amount_br": "1000.00",
"amount_ext": "1000.00",
"amount_iof": "0.00",
"currency_rate": "1.0000",
"currency_ext": "INR",
"due_date": "2024-07-28",
"instalments": "1",
"payment_type_code": "upi-collect-autopay",
"customer": {
"email": "email@example.com",
"name": "John Doe",
},
},
"status": "SUCCESS"
}At this stage, the payment will appear as pending (PE) in yourEBANX Dashboardchevron_rightMonitor payment for status changes
Notifications
EBANX will send a notification whenever a payment status changes.
Make sure your system is set up to receive notifications from EBANX for any changes in payment status.
Status
After receiving a notification that status has changed, retrieve the payment status.
When a payment is confirmed, the status will change from pending (PE) to confirmed (CO). If the customer does not complete the payment, the status will eventually change to cancelled (CA).
Congratulations!
You have succesfully integrated UPI Recurring.
For more information, refer to theDirect API reference guidechevron_right
Resources
Use the following resources when testing in your sandbox environment.
API Reference
Click here to access detailed API documentation to integrate efficiently.
Mock Customer Data
Click here to view mock customer data for testing and validating user flows.
Error Codes
Click here to review common error codes to troubleshoot and resolve issues quickly.
Still need help?
We hope this article was helpful. If you still have questions, you can explore the following options:
- Merchant support: Contact our support team at sales.engineering@ebanx.com for assistance.
- Not a partner yet? Please complete the Merchant Signup Form, and our commercial team will reach out to you.