# Send a Razorpay payment link the moment a deal is won

> When a HubSpot deal hits Closed Won, we create the payment link, email it to the customer, and log it back on the deal so nothing slips.

- Workflow type: agent
- Services: Razorpay, HubSpot, Gmail, Slack
- Categories: Sales, Finance
- Published: 2026-08-09

## What it does

- Watches your HubSpot pipeline and reacts the moment a deal is marked Closed Won.
- Creates a Razorpay payment link for the exact deal amount, with the customer's name and email already filled in.
- Emails the customer a short invoice style note naming the deal and the amount, then files the link and its reference back on the deal record.
- Posts any deal missing an amount, a contact email, or the right currency to Slack, so someone can fix the record instead of losing the sale.

## What you'll need

- A HubSpot account with a pipeline where deals move into a Closed Won stage.
- A Razorpay account that can accept payments in Indian rupees.
- A Gmail account to send the payment emails from.
- A Slack workspace and a channel where records that need fixing get flagged.
- A field on the HubSpot deal to hold the payment status, so you can see at a glance who has been asked to pay.

## Prompt

When a HubSpot deal moves to Closed Won, collect the money without anyone opening Razorpay. Trigger this on a HubSpot webhook for a deal stage change, and only act when the new stage is Closed Won. Ignore every other stage change.

Start by reading the deal with the HubSpot Get Deal operation, pulling the deal name, the amount, the deal currency, the stage and the associated contact. Then read that contact with HubSpot Get Contact to get their name, email address and phone number. Keep the HubSpot deal id from the webhook, because it is the key that ties everything together later.

Before creating anything, check the deal is safe to bill. Skip it if there is no amount, if the amount is zero, or if there is no associated contact with an email address. Also confirm the deal currency is INR, because the Razorpay payment link is created in Indian rupees and billing a dollar figure as rupees would be wrong. When a deal fails any of these checks, do not create a link and do not email anyone. Post it to Slack with the Send a Message operation instead, naming the deal, its owner and exactly what is missing, so someone can fix the record rather than silently dropping the sale.

For deals that pass, create the link with the Razorpay Create a Payment Link operation. Razorpay expects the amount in paise, so multiply the HubSpot deal amount by 100 and send a whole number: a deal worth 25000 becomes 2500000. Set the currency to INR. Fill the customer name, email and contact from the HubSpot contact, and write a description that names the deal. Stamp the HubSpot deal id into the Razorpay notes field under a key such as hubspot_deal_id, so any payment that arrives can always be traced back to the deal. Notes accept up to 15 key value string pairs, so add the deal name and deal owner there as well. Leave Razorpay's own SMS and email notifications off, because we send the email ourselves through Gmail and do not want the customer contacted twice.

Email the link to the contact with the Gmail Send a Message operation. Keep it short and invoice style: address them by first name, name the deal, state the amount in rupees, include the payment link, and sign off from the deal owner. No marketing copy and no long preamble, this is a request for payment.

Then write the result back onto the record. Use HubSpot Create Note to attach a note to the deal holding the payment link URL and the Razorpay payment link reference, which is the id beginning with plink_, so finance can match an incoming payment to a deal later. Use HubSpot Update Deal to set a payment status property on the deal, for example to Payment link sent, so the pipeline shows at a glance which won deals have been asked to pay.

Two rules to keep this quiet and safe. First, if the deal already has a payment link recorded on it, do not create a second one, just stop, because deal stage changes can fire more than once for the same deal. Second, post one clear Slack message per skipped deal rather than a batch summary, so each broken record can be picked up and fixed on its own.

Treat the CRM as swappable. This is staged against HubSpot because it is the most commonly paired CRM, but the same shape works on a Salesforce or Pipedrive pipeline: read the won deal, create the link for the deal amount, email it to the contact, and write the link and its reference back onto the record.

## How to customize

- Change which pipeline stage sets it off, so the link goes out at signed contract rather than Closed Won.
- Reword the customer email, add your payment terms, or put an expiry date on the link.
- Pick the Slack channel for problem records, and set an amount above which a person reviews the link before it goes out.

## Example output

Subject: Payment link for Acme Retail annual licence

Hi Priya,

Thanks for confirming the Acme Retail annual licence. The agreed amount is Rs 2,50,000.

You can pay securely here: https://rzp.io/l/example

Any questions, just reply to this email.

Best,
Rahul

## FAQ

### Will this work on HubSpot Free?

Yes. The automation runs outside HubSpot and simply reads the deal, adds a note and updates a field, so you do not need HubSpot's paid automation tools. You only need deals moving through a pipeline.

### What happens if a won deal has no amount or no contact email?

Nothing is sent. The deal is skipped and posted to your Slack channel naming the deal and exactly what is missing, so the record gets fixed rather than the sale quietly disappearing.

### Does this work for currencies other than Indian rupees?

The payment links are created in Indian rupees, so the deal currency is checked first. Deals in another currency are skipped and flagged in Slack instead of being billed at the wrong value.

### Can I use it with a different CRM?

Yes. It is set up for HubSpot because that is the most common pairing, but the same flow works on a Salesforce or Pipedrive pipeline: read the won deal, create the link, email it, and write the details back on the record.

### Could a customer be emailed twice if the deal is edited again?

No. Before creating anything it checks whether the deal already has a payment link on it, and stops if one is there. Stage changes can fire more than once, so this guard matters.

### How do we match a payment back to the deal it came from?

The deal reference is stamped onto the payment itself when the link is created, and the link plus its reference are written onto the deal as a note, so finance can match money to deals from either side.

Use this prompt in General Input: https://www.generalinput.com/prompts/send-a-razorpay-payment-link-the-moment-a-deal-is-won