Skip to main content
Available in🇮🇳 India
Once you capture a payment, Razorpay Checkout returns a razorpay_payment_id. You can use this id to fetch the token_id, which is used to create and charge subsequent payments. You can retrieve the token_id using the Dashboard or the APIs given below.

Token States

A UPI Autopay token (mandate) transitions through the following states during its lifecycle. Ensure your integration handles all of these states to avoid unexpected failures.
Watch Out!
  • Only tokens in the confirmed state can be used to execute subsequent payments.
  • If a token transitions to paused, cancellation_initiated or cancelled, any subsequent payment attempt against that token will fail.
  • Tokens in the cancellation_initiated state will eventually transition to cancelled once NPCI confirms the closure. Do not treat cancellation_initiated as a final state.
  • Tokens in the rejected state indicate that the customer declined the mandate. You will need to initiate a new mandate registration for the customer.
  • Sometimes the customer cancels the token after the pre-debit notification (PDN) is sent. In such cases, you receive both the token.cancelled and the payment.failed webhooks.

2.1. Fetch Token by Payment ID

Use the below endpoint to fetch the token_id using a payment_id. GET /payments/:id
NoteYou can also retrieve the token_id against the payment_id from the payment.authorized webhook.

Path Parameter

id mandatory : string The unique identifier of the payment to be retrieved. For example, pay_1Aa00000000002.

2.2. Fetch Tokens by Customer ID

Watch Out!The UPI tokens are not populated in the API response if the save_vpa feature is not enabled in your account. Please raise a request with our Support team to get this activated.

Path Parameter

id mandatory : string The unique identifier of the customer for whom tokens are to be retrieved. For example, cust_1Aa00000000002.

2.3. Cancel Token

You can cancel tokens that are in the initiated, confirmed or paused state. You can also retry a cancellation for a token that is in the cancellation_initiated state. Razorpay does not perform any additional validation checks before forwarding the cancellation request to NPCI. The interim cancellation_initiated status is returned when the cancellation request is acknowledged but a successful callback from the downstream partners is not yet received. When the gateway returns a callback confirming the cancellation, the status updates to cancelled and the token.cancelled webhook is triggered. Wait for the token.cancelled webhook before suspending or terminating subscription services, or applying any late payment fees to customers. Use the following endpoint to cancel a token. This initiates the cancellation of the mandate from NPCI. PUT /customers/:customer_id/tokens/:token_id/cancel
customer_id mandatory : string The unique identifier of the customer with whom the token is linked. For example, cust_1Aa00000000002.token_id mandatory : string The unique identifier of the token that is to be cancelled. For example, token_1Aa00000000001.

Error Response Parameters

Given below is a list of possible errors you may face while cancelling a token.
  • Description: The token provided is not a recurring/autopay token and is not eligible for cancellation via this API.
  • Next Steps: Please ensure you are passing a valid UPI Autopay recurring token. Non-recurring tokens cannot be cancelled using this API.
  • Description: The UPI mandate linked to this token is not in a cancellable state. The mandate may already be revoked or failed.
  • Next Steps: Please check the current status of the mandate before attempting cancellation. Cancellation is only allowed when the mandate is in confirmed or active state.
  • Description: The token provided does not belong to the authenticated customer. Cross-customer token access is not permitted.
  • Next Steps: Please verify that the token_id belongs to the customer in context and retry with the correct token.
  • Description: The token provided was not created under your merchant account. Cross-merchant token access is not permitted.
  • Next Steps: Please ensure you are using tokens created under your own merchant account and retry with the correct token_id.
  • Description: A cancellation or update operation is already in progress for this token. Simultaneous requests on the same token are not allowed.
  • Next Steps: Please wait at least 60 seconds before retrying the cancellation request. Avoid sending duplicate or parallel cancel requests for the same token.

2.4. Delete Tokens

Deleting a token removes it from Razorpay’s database. The deleted token will not appear on the Dashboard or when all tokens are fetched. However, it does not cancel the mandate. If you wish to delete the mandate with Razorpay, you must first cancel it using the Cancel Token API. The following endpoint deletes a token. DELETE /customers/:customer_id/tokens/:token_id
customer_id mandatory : string The unique identifier of the customer with whom the token is linked. For example, cust_1Aa00000000002.token_id mandatory : string The unique identifier of the token that is to be deleted. For example, token_1Aa00000000001.
deleted : boolean Indicates whether the token is deleted. Possible values:
  • true: The token is deleted successfully.
  • false: The token was not deleted.
Last modified on November 10, 2026