UPI and card subscriptions let you collect recurring payments from customers using subscription mandates.
This guide walks through how to create and manage subscriptions using EximPe Merchant APIs.This version features automatic recurring payments. Once a mandate is active, the payment gateway automatically processes recurring debits and sends webhook notifications with the subscription ID for each payment.
Create Subscription
Create a subscription order with subscription mandate
Check Mandate Status
Verify that the UPI mandate is active before proceeding
Modify or Cancel Mandate
Update mandate amount/end date or cancel the subscription
Prerequisites
Before you begin, ensure you have:- Credentials: Your Client ID and Client Secret
- Domain Whitelist: Whitelisted your website domain for integration
- Webhook URL: A secure endpoint to receive payment status updates
- UPI Subscription enablement: UPI recurring subscription enabled and approved by EximPe.
- Server environment: Ability to make HTTPS
POSTandGETrequests from your backend. - JSON & HTTP Client: Familiarity with JSON request bodies and HTTP client libraries.
Integration Steps
The integration consists of three steps:- Create Subscription
- Check Mandate Status
- Modify or Cancel Mandate
Step 1: Create Subscription
Use the Create UPI Subscription API to create a subscription order and standing instruction. You can use either Intent Flow (QR code/intent) or Card Flow (requires card details).Intent Flow
Use the Intent Flow to create subscriptions without requiring the customer’s VPA upfront. The Intent flow allows customers to approve the mandate by scanning a QR code or using a UPI payment intent.Sample Request (Intent Flow)
Response (Intent Flow)
Key differences between Card and Intent flow:
- Card Flow: Requires customer’s card details upfront. Payment mandate is created using card information.
- Intent Flow: No VPA required. Customer approves mandate by scanning QR code or using payment intent. Returns QR code in base64 format for display.
Display QR Code
The response includes a base64-encoded QR code that can be displayed directly:intent_uri to generate a QR code client-side or use the provided qr_code.url for UPI app deep linking.
For full request and response schema, see the Create UPI Subscription (Intent Flow) endpoint in API Reference.
Card Flow
Alternatively, you can use the Card Flow which requires the customer’s card details upfront. The subscription mandate is created using the card information. To start with, the request is raised from the Merchant to EximPe with the required transaction mandatory/optional parameters. This needs to be a server-to-server curl call request.Sample Request (Card Flow)
Response (Card Flow)
3D Secure Authentication: Card-based subscriptions may require 3D Secure authentication. If the response includes an
acstemplate, render it on the client side to complete the authentication process before the subscription mandate becomes active.Step 2: Check Mandate Status
After the customer approves the UPI mandate, use the Get Subscription Mandate Status API to verify that it is active.Sample Request
Response
mandate_is_active is true.
Subscription Status Values
A subscription can have the following statuses:| Status | Description |
|---|---|
PENDING | Subscription created but mandate not yet approved by customer |
ACTIVE | Subscription mandate is active and recurring payments will be processed automatically |
PAUSED | Subscription temporarily paused, no recurring payments will be processed |
CANCELLED | Subscription mandate cancelled, no further payments will be processed |
EXPIRED | Subscription reached its end date |
FAILED | Subscription mandate creation or activation failed |
Active Subscriptions: Only subscriptions with
ACTIVE status will have automatic recurring payments processed. Monitor the subscription status via webhooks to track lifecycle changes.Automatic Recurring Payments
The recurring payments are processed automatically by the payment gateway based on the billing cycle defined in the standing instruction. You don’t need to manually trigger recurring payments via API.
standing_instruction block.
How Automatic Payments Work
- Mandate Activation: After the customer approves the mandate, it becomes active
- Scheduled Debit: On each billing date, the payment gateway automatically debits the specified amount
- Webhook Notification: Upon successful payment, you’ll receive a webhook notification with the payment details
Monitoring Recurring Payments
You can monitor recurring payments through:- Webhooks: Real-time notifications for each successful/failed payment
- Payment API: Use the Get Payment endpoint to fetch payment details
- Order API: Use the Get Order endpoint to check order status
- Subscription Status Webhook: Receive updates about subscription lifecycle events
Step 3: Modify or Cancel Mandate
3.1 Modify Mandate
To change the billing amount or end date of an active subscription, use the Modify Subscription Mandate API.Sample Request
Response
At least one of
amount or end_date must be provided to modify the mandate.3.2 Cancel Mandate
To fully stop future debits and revoke the subscription mandate, use the Cancel Subscription Mandate API.Sample Request
Response
CANCELLED on success.
Webhooks
EximPe sends webhook notifications for both subscription lifecycle events and recurring payment events. Configure webhooks to receive real-time updates.Payment Successful Webhook (for Recurring Payments)
For each automatic recurring payment, you’ll receive a Payment Successful webhook. This webhook includes thesubscription_id field, allowing you to track which subscription the payment belongs to.
Key Fields in Payment Webhook:
subscription_id: The unique identifier of the subscriptionorder_id: The order ID for this specific paymentpayment_id: The payment transaction IDamount: The amount chargedstatus: Payment status (SUCCESS)
Subscription Status Webhook
The Subscription Status webhook is triggered when a subscription status changes or subscription information is updated. This allows you to track subscription lifecycle events and update your billing records accordingly. Common Subscription Events:PENDING→ACTIVE: Mandate created and activated successfullyACTIVE→PAUSED: Subscription temporarily pausedPAUSED→ACTIVE: Subscription resumedACTIVE→CANCELLED: Subscription cancelled by merchant or customerACTIVE→EXPIRED: Subscription reached its end datePENDING→FAILED: Mandate creation or activation failed
- New subscriptions start with
PENDINGstatus - Once mandate is approved, status changes to
ACTIVE - Subscriptions can be paused/resumed or cancelled at any time
- Subscriptions automatically expire when
payment_end_dateis reached
For general webhook setup, security, and verification, see the Webhooks Integration Guide.