The Scenario
You are a SaaS product manager. Your trial-to-paid conversion campaign just closed and you have 400 new paying customers in a Google Sheet — name, email, and phone number. Before you can set up their recurring subscriptions in Razorpay, every one of them needs to exist as a Razorpay customer record.
The Razorpay customer creation API accepts name, email, and phone. You need to call it 400 times and write the resulting customer_id back to the sheet so the subscriptions team can use it.
The slow version:
- Write a script to loop through the sheet and call the API
- Handle authentication, rate limits, and error responses in code
- Run the script, get an error on row 47 because the phone number has dashes
- Fix the script, re-run from row 47
- Realize rows 1-46 already have customer IDs and you are about to create duplicates
- The subscriptions team has been waiting for three hours.
The fast version is one prompt.
The Easy Way: One Prompt in SheetXAI
SheetXAI is an AI agent inside your spreadsheet that can call the Razorpay API per row and write results back, without you writing a single line of code.
Open the SheetXAI sidebar and type:
For each row in this sheet, create a Razorpay customer using the name in column A, email in column B, and phone in column C. Write the resulting customer_id to column D. If a customer already exists with that email, write the existing customer ID instead. Log any other error in column E.
SheetXAI iterates through all 400 rows, calls the Razorpay customer creation endpoint for each one, handles deduplication by email, and writes results back to the sheet row by row.
What You Get
A sheet with all 400 rows updated:
- Column D — the Razorpay
customer_idfor each row - Column E — any error message for rows that failed, blank if it succeeded
- Deduplication handled — existing customers get their existing ID, not a duplicate record
The subscriptions team can start immediately. Column D is what they need to create subscriptions. No handoff, no second export, no script.
If 12 rows have errors in column E, ask SheetXAI to summarize the error patterns and suggest fixes. It reads column E and tells you what went wrong.
What If the Data Is Not Quite Ready
Customer lists from trial systems are rarely clean. SheetXAI handles the fixes and the creation in the same prompt.
When phone numbers have inconsistent formatting
Some rows have +91-XXXXX-XXXXX, some have 91XXXXXXXXXX, some just have 10 digits. The Razorpay API expects E.164 format.
Normalize all phone numbers in column C to E.164 format before creating the Razorpay customers. If a number cannot be normalized to a valid Indian mobile number, skip that row and write "Invalid phone" in column E. Then create the customers for all valid rows.
When some rows are missing email addresses
A handful of rows have a name and phone but no email. Razorpay requires an email.
Create Razorpay customers for all rows where column B has a valid email address. For rows where column B is empty or blank, skip customer creation and write "Missing email" in column E. Log all created customer IDs in column D.
When you want to verify customers were created before the subscriptions team uses them
You want to double-check the output by fetching each created customer back from Razorpay.
After creating the Razorpay customer for each row, immediately fetch the customer record using the returned customer_id and verify the email matches column B. If there is a mismatch, write "Verify" in column F.
When the sheet has 400 rows but 60 already have customer IDs from a previous partial run
Someone ran the creation process last week and it got through 340 rows before the session expired.
For each row in this sheet, check if column D already has a customer_id. If it does, skip that row. If column D is empty, create a Razorpay customer using name, email, and phone from columns A, B, and C, and write the new customer_id to column D. Log errors in column E.
The pattern: the prompt does the conditional logic row by row. You do not need to pre-filter the sheet or write deduplication code.
Try It
Get the 7-day free trial of SheetXAI and open your new customer sheet, then ask it to create the Razorpay records and write the IDs back. 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.
