Back to Razorpay in Google Sheets
SheetXAI logo
Razorpay logo
Razorpay · Google Sheets Guide

Bulk-Cancel Stale Razorpay Payment Links From a Sheet

2026-05-13
4 min read
See the Excel version →

The Scenario

You are a billing coordinator. Last quarter you sent 55 payment links for invoices that are now either paid through other channels, cancelled, or superseded by revised invoices. Those 55 links are still active in Razorpay, showing up in your dashboard, confusing your finance team, and occasionally resulting in clients paying old amounts.

You have the link IDs in a Google Sheet — column A, one per row. You need them all cancelled.

The slow version:

  • Log into the Razorpay dashboard
  • Navigate to Payment Links
  • Search for each link by ID — the search only accepts one at a time
  • Click the link, click Cancel, confirm the cancellation
  • Switch back to Sheets, write "Cancelled" in column B
  • Repeat 55 times
  • Run out of patience by link 20. Start missing rows.

The fast version is one prompt.

The Easy Way: One Prompt in SheetXAI

SheetXAI is an AI agent inside your spreadsheet that can cancel every payment link in column A and write the result back, without you opening the Razorpay dashboard once.

Open the SheetXAI sidebar and type:

For each payment link ID in column A of this sheet, cancel the Razorpay payment link and write "Cancelled" to column B if successful. If the cancellation fails for any reason, write the error message to column B instead.

SheetXAI iterates through all 55 rows, calls the Razorpay cancel endpoint for each link ID, and writes the result back per row.

What You Get

A completed cancellation log:

  • Column B — "Cancelled" for every successfully cancelled link, or the error message for any that failed
  • All 55 rows processed — no manual clicking, no pagination
  • A record you can share — the sheet is the cancellation audit trail

Your finance team can see immediately which links are closed. If 3 rows have errors in column B, those are the only ones needing manual attention.

If you want to cross-check the result by fetching the updated link status from Razorpay, ask SheetXAI to add a "Verified Status" column. It fetches each link after cancellation and writes the confirmed status.

What If the Data Is Not Quite Ready

Bulk cancellation has edge cases. SheetXAI handles them inline.

You ran a partial cancellation last month and column A has a mix of already-cancelled and still-active links.

For each payment link ID in column A, check the current status of the link in Razorpay. If it is already cancelled, write "Already Cancelled" to column B and skip the cancellation call. If it is still active, cancel it and write "Cancelled" to column B. Log any errors in column C.

A few rows were copied incorrectly and have partial IDs.

For each payment link ID in column A, attempt to fetch the link from Razorpay to validate it before cancelling. If the fetch fails with a "not found" error, write "Invalid ID" to column B and skip cancellation. For valid links, proceed with cancellation.

You want to keep links where the client at least opened the URL, even if they didn't pay.

For each payment link ID in column A, fetch the link details from Razorpay and check the "view_count" field. If view_count is 0, cancel the link and write "Cancelled — never viewed" to column B. If view_count is greater than 0, skip cancellation and write "Skipped — client opened link" to column B.

When you want the full cleanup — validate IDs, skip already-cancelled, cancel active ones, and write a summary

For each payment link ID in column A: first fetch the link to check its current status. If it is already cancelled, write "Already Cancelled" to column B. If the ID is not found, write "Invalid" to column B. If the link is active, cancel it and write "Cancelled" to column B. Then write a summary starting in cell D1: total links processed, total cancelled, total already cancelled, total invalid.

The pattern: the validation, the conditional cancellation, and the summary all happen in one prompt.

Try It

Get the 7-day free trial of SheetXAI and open your sheet of stale payment link IDs, then ask it to cancel them all and log the results. The Razorpay integration is included in every SheetXAI plan. For related workflows, see how to generate payment links in bulk or the Razorpay in Google Sheets overview.

Stop memorizing formulas.
Tell your spreadsheet what to do.

Join 4,000+ professionals saving hours every week with SheetXAI.

Learn more