Payment-method icon

Recurring payments with UPI Autopay

Offer recurring payments to your shoppers with our UPI Autopay integration.

Accept UPI Autopay payments using our APIs, and build your own payment form to have full control over the look and feel of your checkout page. Use this page to offer recurring UPI Autopay payments to your shoppers.

You can accept recurring UPI Autopay payments for the following types of payments:

  • Subscriptions: A recurring transaction made at regular intervals for a product or a service. These payments use the Subscription recurring processing model.
  • Automatic top-ups: Contracts that occur on a non-fixed schedule using stored card details. This includes automatic top-ups when the cardholder's balance drops below a certain amount. These payments use the UnscheduledCardOnFile [recurring processing model](/online-payments/tokenization/advanced-flow.

How to pay with UPI Autopay

After shoppers select to pay through UPI on your website for the first time:

  1. Shoppers are prompted to provide the Virtual Payment Address (VPA).
  2. The shoppers then get a notification on their UPI app asking them to complete the payment.
  3. On the UPI app, shoppers provide their UPI pin to confirm the payment.
  4. When shoppers go back to your checkout page, they are redirected to a page showing the payment status.

For subsequent payments, shoppers receive a pre-debit notification in the form of an SMS or an email at least 24 hours before the recurring amount is charged.

Set up a billing plan

To start a billing plan for a shopper, you need to store their payment details and create a mandate in their UPI app. The UPI payment service provider and the issuer uses this mandate to have visibility of your shopper's billing plan. They can then let the shopper cancel (or pause/unpause) the mandate on their side.

Make sure that every billing plan has a unique mandate associated with it.

  1. From your server, make a POST /payments request, specifying:

    Field Required Description
    paymentMethod.type -white_check_mark- upi_collect
    paymentMethod.virtualPaymentAddress -white_check_mark- Virtual Payment Address. A unique identifier used to let UPI connect to the shopper's bank account.
    storePaymentMethod -white_check_mark- Set to true to store shopper's payment details.
    shopperInteraction -white_check_mark- Set to Ecommerce.
    recurringProcessingModel -white_check_mark- Set to Subscription or UnscheduledCardOnFile.
    shopperReference -white_check_mark- The shopper reference associated with the billing plan (minimum length three characters).
    mandate.amount -white_check_mark- The amount the shopper will be charged per recurring debit in minor units. Must be more than or equal to the transaction amount.
    The recurring charge does not need to go through authentication if the amount is less than or equal to INR 15,000.
    mandate.amountRule Possible values: max (default) and exact.
    • max - The shopper can be charged any amount between INR 1 to the amount in the amount field.
    • exact - The shopper can only be charged the amount in the amount field.
    mandate.frequency -white_check_mark- The frequency at which the shopper will be charged. Possible values: monthly and adhoc.
    mandate.startsAt Start date of the billing plan, in YYYY-MM-DD format. The default value is the transaction date.
    mandate.endsAt -white_check_mark- End date of the billing plan, in YYYY-MM-DD format.
    mandate.remarks Limited to 50 characters, no special characters. Shown in the shopper's UPI app, under the Mandate section.
    mandate.billingAttemptsRule Possible values: before, after, and on.
    • before - You can initiate the charge and retries anytime from 1st day of the billing cycle to the mandate.billingDay.
    • after - You can initiate the charge and retries any time from the mandate.billingDay to the end of billing cycle (if the frequency is monthly, till the end of the month).
    • on - You can initiate the charge and retries only on the mandate.billingDay.
    mandate.billingDay The day of the billing cycle when the shopper would be charged. If the mandate.frequency is monthly, and mandate.billingDay is 26th, the shopper should be charged on the 26th of every month. This field does not apply for adhoc frequency. Possible values: 1-31

    The details in the mandate object are used to create the mandate for the shopper's billing plan.

    The /payments response is:

  2. Show a waiting screen to the shopper, telling them you are waiting for them to complete the payment.

  3. Check your webhooks to see the payment result. We send a webhook to you with the final status of the payment.

    eventCode success field Description Action to take
    AUTHORISATION false The transaction failed. Cancel the order and inform the shopper that the payment failed and any amount debited will be refunded in 2-3 days.
    AUTHORISATION true The shopper successfully completed the payment and a mandate was created. Inform the shopper that the payment has been successful and proceed with the order.

    You can receive the mandate details as part of your standard webhooks. To do this:

    1. In your Customer Area, go to Developers > Webhooks.
    2. Next to Standard webhook, select the edit webhook icon .
    3. Under Additional Settings, select Include Mandate Details.
    4. Select Save Configuration.

    Then, the webhook will also contain the details on the shopper's mandate, including:

    • mandate.mandateId: The identifier for the mandate created by the issuer.
    • mandate.providerId: The ID returned by the provider.
    • mandate.status: The status of the mandate.
    • mandate.txVariant: The transaction variant.

    You will need the recurringDetailReference and shopperReference to make subsequent payments in the billing plan.

  4. Once you get the webhook, redirect them to your website, and present the payment result.

Modify the billing plan

If you need to modify the billing plan, then you have to cancel the mandate and create a new one with the modified information.

Make recurring payments

For every subsequent payment in a billing plan, you need to:

  1. (Optional) Check the mandate details.
  2. Send a pre-debit notification.
  3. Make the recurring payment.

Before proceeding with a subsequent payment in a billing plan, you can check the mandate details of the shopper's billing plan to make sure all relevant information is available for the payment to be successful.

(Optional) Check mandate details

For each billing plan, you have to create a unique mandate. To check the mandates created for a shopper's billing plans, make a POST /listRecurringDetails call.

The /listRecurringDetails response contains the details of the mandate created for the shopper with a specific shopperReference.

Send a pre-debit notification

A pre-debit notification is an email or SMS notification sent to a shopper to inform them of their impending recurring charge. You need to inform the issuer when the notification needs to be sent out and subsequently the issuer sends the email or SMS. When they receive the notification, shoppers can choose to cancel the mandate. Shoppers receive the pre-debit notification at least 24 hours before every recurring payment.

To send a pre-debit notification to your shopper, make a POST call to /notifyShopper:

  • storedPaymentMethodId: The token for your shopper's stored payment details.
  • merchantAccount: Your merchant account associated with the shopper's stored payment details.
  • shopperReference: The shopper reference associated with the billing plan.
  • amount: The amount you are going to charge the shopper. If you have configured max for the mandate.amountRule, the shopper can be charged any amount between INR 1 to the amount in the mandate.amount field. If you have configured exact, the shopper can only be charged the amount in the mandate.amount field.
  • billingDate: Optional. The date the shopper will be charged.
  • reference: The notification reference.

The /notifyShopper response contains:

  • message: Information about the status of the pre-debit notification.
  • shopperNotificationReference: Unique reference to the pre-debit notification. Store this value to make the subsequent payment.

If the /notifyShopper request fails, you will receive a response with resultCode set to Refused.

If there was an issue with the /notifyShopper request, you will receive a response containing an errorCode and a message explaining the error. For a list of possible values, refer to Generic error codes.

Make a recurring payment

Once the shopper has received the pre-debit notification, you can carry out a recurring payment.

  1. To do so, make a POST /payments call, including:

    Field Required Description
    paymentMethod.type -white_check_mark- upi_collect
    paymentMethod.storedPaymentMethodId -white_check_mark- The token value for the shopper's stored payment information.
    paymentMethod.shopperNotificationReference -white_check_mark- Unique reference to the pre-debit notification from the /notifyShopper response.
    amount -white_check_mark- Include the currency and value of the shopper's recurring payment.
    merchantAccount -white_check_mark- Your merchant account
    shopperReference -white_check_mark- The shopper reference associated with the billing plan.
    shopperInteraction -white_check_mark- Set to ContAuth.
    recurringProcessingModel -white_check_mark- Set to Subscription or UnscheduledCardOnFile.
    mandate.remarks Limited to 50 characters, no special characters. Shown in the shopper's UPI app, under the Mandate section.
  2. The /payments response contains:

  3. Check your webhooks to see the payment result.

    eventCode success field Description Action to take
    AUTHORISATION false The transaction failed. Cancel the order and inform the shopper that the payment failed.
    AUTHORISATION true The shopper successfully completed the payment. Inform the shopper that the payment has been successful and proceed with the order.

Cancel a billing plan

If your shopper wants to end their billing plan, then you need to cancel the mandate generated for their stored payment details on your side.

To do so, make a DELETE /storedPaymentMethods call, including:

Field Description
merchantAccount Your merchant account associated with the shopper's stored payment details.
shopperReference The shopper reference associated with the mandate you want to remove.
recurringDetailReference The token for the shopper's stored payment details that you want to remove.

Test and go live

Contact Support Team to set up your test environment for UPI Autopay.

Use the following credentials to test UPI Autopay :

Parameter Value
VPA testvpa@icici

If you have access to the UPI simulator, the /payments response contains the upiSimulatorUrl that you can use to test payments. This is returned in the test environment only.

Check the status of UPI Autopay test payments in your Customer Area > Transactions > Payments.

Before you can accept live UPI Autopay payments, you need to submit a request for UPI Autopay in your live Customer Area.

See also