Log every captured Razorpay payment to Sheets and Slack

By General Input

The moment Razorpay captures a payment, we add a row to your revenue spreadsheet and post a short confirmation to your team's Slack channel.

Integrations

  • Razorpay
  • Google Sheets
  • Slack

Type

Deterministic Code

Categories

  • Finance
  • Operations

Every time a Razorpay payment is captured, log it and tell the team, with no judgement calls in the loop. Trigger this on a Razorpay webhook for the payment captured event, so the workflow runs the moment the money is confirmed.

First, append one row to my Google Sheets revenue tracker using Append Values. The row should hold the payment id, the order id, the amount in rupees, the currency, the payment method, the customer email, the customer contact number, the notes field, and the capture time as a readable date.

Then post a one-line confirmation to my Slack channel using Send a Message, naming the amount, the payment method and the customer. Keep it to a single line that a revenue channel can scan without opening anything.

Two fields in the Razorpay payload need converting before anything is written or posted. Amounts arrive as integers in paise, so divide by 100 to get rupees, and apply that to both the sheet row and the Slack message. Capture times arrive as Unix epoch seconds, so format them as a human readable date and time rather than writing the raw number.

Razorpay ids are prefixed by type, pay_ for payments and order_ for orders, so write them through unchanged as text. The notes field is a free form object of up to 15 key value string pairs, so flatten it into something readable for a single cell rather than dropping it. Razorpay does not always collect an email or a contact number, so when either is missing write an empty cell and carry on rather than failing the run.

Keep the sheet append and the Slack post independent of each other. Append the ledger row first, then post to Slack, and make sure a failure posting to Slack never rolls back, blocks or retries the spreadsheet row. A Slack hiccup should never cost me the ledger entry.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentLocal listing health board for every location you manageWin back LiveChat visitors whose chats went unansweredLet support send one-off Loops emails without an engineerStop cold emails to anyone with a live deal in PipedriveiMessage campaign console with pre-flight checks and delivery boardChat quality review board for LiveChat support leadsLinkedIn Ads budget pacing dashboard for every client accountFront desk appointment confirmation board for the next 3 daysGive your team Looker numbers without buying more seats