- Plan type:
ON_DEMAND. Your agent raises every charge. There’s no fixed charge schedule. - Payment method: UPI AutoPay (
upi).
What your customer experiences
From the customer’s side, setting up AutoPay is a short chat. The following example shows a customer whose wallet balance is too low to pay a bill:
The next time the wallet runs low, the agent tells the customer the amount and recharges the wallet without a new approval.
Key concepts
Keep these concepts in mind as you build your integration:- Consent comes first. Every AutoPay tool needs the customer’s
access_tokenfrom the AgentPay consent step. See Get the customer’s consent. - A subscription holds the mandate. You create one subscription for each customer. It carries the plan, which sets
plan_max_amount, the most any single recharge can be. - The customer authorises once. An
AUTHpayment returns a UPI AutoPay link. After the customer approves it, the subscription becomesACTIVE. - Every recharge is a charge. A
CHARGEpayment debits the customer’s UPI account through the mandate. A charge isn’t instant. Cashfree sends the customer a pre-debit notification and debits their account at least 24 hours later, on or after thepayment_schedule_date. The charge staysPENDINGuntil then, and becomesSUCCESSorFAILEDafter the debit. - You choose the IDs.
subscription_idandpayment_idare your own references. They belong to this customer only, so a token for another customer can’t see or change them. - The phone number comes from the consent. Never ask the customer for it.
- Ask the customer for their email address.
create_subscriptionneeds it, and it doesn’t come from the consent.
Set up AutoPay and recharge the wallet
Before you start, make sure you have:
- The AgentPay MCP server connected to your agent. See Connect your agent.
- A valid
access_tokenfor the customer from the AgentPay consent flow. - AutoPay mandates enabled for your account.
1
Create the subscription
Ask the customer for their email address, then call The subscription starts as
create_subscription with an ON_DEMAND plan. Set plan_max_amount to the largest recharge you expect to need:Arguments
INITIALIZED. Save the subscription_session_id for the next step.2
Request UPI AutoPay approval
Call The response contains UPI app links in
raise_subscription_charge with payment_type set to AUTH:Arguments
data.payload. Send the customer the default link, or the link for their UPI app.3
Wait for the customer to approve
The customer opens the link and approves the AutoPay mandate in their UPI app with their UPI PIN. Ask them to tell you when they’re done.
4
Confirm the subscription is active
Call
get_subscription until subscription_status is ACTIVE and authorisation_details.authorization_status is ACTIVE. If the authorisation fails, tell the customer and send a new AUTH request with a new payment_id.Stop polling if the subscription reaches one of these statuses:LINK_EXPIRED: the customer didn’t approve in time. Create a new subscription with a newsubscription_id.CUSTOMER_CANCELLEDorCANCELLED: the subscription has ended. Create a new one only if the customer asks.
5
Raise a recharge
When the wallet balance can’t cover what the customer wants to pay, tell the customer the amount, then call
raise_subscription_charge with payment_type set to CHARGE:Arguments
payment_amount can’t exceed the plan’s plan_max_amount. Use a new payment_id for every recharge.The debit happens at least 24 hours after Cashfree notifies the customer, so tell the customer when to expect the money.6
Check the result
After the scheduled debit, call
get_subscription_payments and find your payment_id. When payment_status is SUCCESS, check the balance with get_wallet_balance and continue with the bill payment. If the bill’s ref_id is more than 15 minutes old by then, fetch the bill again before you debit the wallet. If it’s FAILED, read failure_details.failure_reason and tell the customer.Manage the mandate
After setup, you can change the subscription or a single recharge. Always confirm with the customer before you cancel anything. The following actions are available:Tool reference
AutoPay mandates add six tools to the AgentPay MCP server. Every tool needs the customer’saccess_token. Tools that create or change something also accept an optional idempotency_key. Send the same key when you retry the same request, so Cashfree doesn’t process it twice.
Send dates in ISO 8601 format with a time zone offset, for example
2026-11-12T00:00:00+05:30. Send all amounts in rupees, not paise. IDs can contain up to 200 letters, digits, dots, underscores or hyphens.
create_subscription
Creates an on-demand subscription for the consented customer.Response
get_subscription
Returns the subscription’s current status and mandate details.Response (excerpt)
Subscription statuses
A subscription can have the following statuses:
When a customer pauses or cancels the mandate in their UPI app, the status changes within 30 to 45 minutes.
manage_subscription
Cancels the subscription.
The response is the updated subscription, in the same format as
get_subscription. CANCEL can’t be undone.
raise_subscription_charge
Requests UPI AutoPay approval, or raises a recharge on an active subscription.Response (AUTH)
Response (CHARGE)
CHARGE response isn’t the final result. Check get_subscription_payments until the payment is SUCCESS or FAILED.
get_subscription_payments
Lists every approval and recharge for the subscription.Response
PENDING to SUCCESS, FAILED or CANCELLED.
manage_subscription_payment
Retries or cancels a single recharge.
The response is the updated payment, in the same format as an item from
get_subscription_payments.
Troubleshooting
The following table lists common errors and how to fix them:Talk to the customer
Your agent talks to the customer in plain terms. Follow these practices:- Explain what AutoPay is for and the maximum amount per recharge before you send the approval link.
- Tell the customer the amount before every recharge.
- Confirm before you cancel a subscription or a recharge.
- If the customer wants your agent to stop, cancel their subscription before you revoke consent.
- Don’t mention tokens, session IDs, payment IDs or tool names.
- Don’t ask for the customer’s phone number. It comes from their consent.
Test in sandbox
Use the same sandbox server URL, API key and consent OTP as in Test in sandbox, then complete the following checks:- Setup. Create a subscription, request approval and confirm it becomes
ACTIVE. - Recharge. Raise a
CHARGEand confirm it appears inget_subscription_payments. - Limits. Raise a
CHARGEaboveplan_max_amountand check that your agent handles the error. - Retry. Retry a failed recharge with
manage_subscription_payment. - Cancel. Cancel the subscription and check that Cashfree refuses new recharges.
In beta, sandbox responses for AutoPay mandates are sample data. Statuses don’t change over time, so use them to check your request format and agent flow, not real payment outcomes.