Send Adyen payment links when a HubSpot deal is Ready to Invoice

By General Input

When a deal moves into your payment stage, we generate an Adyen link, save it to the deal, and email your customer for you.

Integrations

  • Adyen
  • HubSpot
  • Gmail

Type

Agentic Task

Categories

  • Sales
  • Finance

Trigger: a HubSpot webhook that fires when a deal's stage property (dealstage) changes. The webhook payload gives us the deal ID and the new stage.

The workflow should run as an agent that quietly handles the whole payment-link handoff so a sales rep never has to build a link by hand.

Step 1. Gate on stage. Only proceed if the new stage is in a configured set that means "ready to charge" (defaults: Send Payment, Ready to Invoice). Otherwise stop silently.

Step 2. Load the deal. Call HubSpot Get Deal (operation 3314ca84-0991-487d-ab84-ae728fa05aff) for the deal ID from the webhook. Fetch at minimum: dealname, amount, deal_currency_code, dealstage, and any custom payment_link_url property the org uses. Include associations so we get the primary contact ID. If Get Deal cannot resolve associations directly, fall back to HubSpot Search Deals (operation 1699c943-c219-41e3-99f4-560a70eb2d66) to fetch the same data with associations included.

Step 3. Skip conditions (all silent no-ops, no email, no note):

a) Amount below a configurable minimum (default 50 in the deal's currency). b) A payment_link_url property is already populated on the deal, OR a prior note on the deal already contains an Adyen payment link. If a prior link exists, optionally verify it is still active with Adyen Get Payment Link (operation 1d98037b-3c78-4b93-a6d7-d0547def36d6) before deciding to no-op; if that link is expired, allow generating a new one. c) The deal has no primary contact with an email address.

Step 4. Load the primary contact. Call HubSpot Get Contact (operation fbcb9ff5-910e-47ac-bc08-51023960f996) for the associated contact to retrieve email, firstname, and lastname.

Step 5. Create the payment link. Call Adyen Create Payment Link (operation d3cf2e86-112e-4f9e-8c80-168cf76af80b) with:

amount.value = deal amount converted to Adyen minor units (multiply by 100 for USD/EUR/GBP; use the correct exponent for zero-decimal or three-decimal currencies)

amount.currency = deal_currency_code from HubSpot

reference = the HubSpot deal ID exactly (this is the reconciliation key, do not prefix or mutate it)

merchantAccount = the configured Adyen merchant account for this org

shopperEmail = the primary contact's email

description = the deal name

Step 6. Write the link back to HubSpot. Call HubSpot Create Note (operation eebca9bb-fa33-4c6c-b10e-a57f3045619a) with the returned payment URL and the deal name, associated to the deal ID. If the org has a payment_link_url custom deal property, also call HubSpot Update Deal (operation 46465aa3-faa3-4666-86f9-b5cb7a31b62f) to set that property so the link is visible on the deal record itself.

Step 7. Draft and send the customer email. Compose a short, personalised message to the primary contact that greets them by first name, references the deal by name, states the amount and currency in human-readable form (e.g. EUR 1,250.00, not 125000 minor units), includes the payment link on its own line, and closes with a brief thank-you. Keep it concise, plain-text-friendly, and no marketing filler. Send it via Gmail Send a Message (operation 78d2e3de-d8b8-4dbd-89d8-08010564b919) from the connected Gmail account.

Nuances the agent must respect: use the deal ID as Adyen's reference so payments can be reconciled later; format the customer-visible amount using the deal's currency, not minor units; never generate a second link when a live one exists; never send the email if link creation fails; and never edit or delete existing notes.

Configurable knobs the author should surface: the list of qualifying deal stage names, the minimum-amount threshold, whether to update a payment_link_url custom property in addition to writing a note, and the email tone/signature block.

Related prompts

Explore more prompts
Win back LiveChat visitors whose chats went unansweredTurn Mailjet email clicks into ranked HubSpot follow-upsiMessage campaign console with pre-flight checks and delivery boardA searchable RFP answer library your bid team drafts fromSee which target accounts just started advertising on LinkedInAccount health board that puts product usage next to your CRMLook up a customer's full chat history mid conversationChase the paperwork every new client and vendor still owesLusha prospecting workbench with credit-safe revealsWhich companies your LinkedIn ads reach, matched to your CRM