Skip to content

The moment it happens

Log new Stripe invoices in HubSpot and Slack

Each new Stripe invoice updates the customer's company in HubSpot and is posted in your finance channel.

Runs
The moment it happens
Apps
HubSpot, Slack
AI
Not needed
Access
HubSpot companies read+write; Slack chat:write

Send this to your assistant

Create a ClickRuntime automation: when Stripe creates an invoice, update the customer's HubSpot company with the amount and date, and post it in #finance.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

An account manager is about to call a customer about a renewal, opens HubSpot, and has no idea the customer was invoiced last week for an upgrade. Billing lives in Stripe, relationships live in HubSpot, and finance hears about invoices only when they check the dashboard.

Copying invoice amounts into the CRM as they are created keeps sales and account managers informed, and a post in #finance gives the finance team a running feed of what was billed. Subscription businesses use it so everyone who talks to customers sees the same billing picture.

What you get out of it

  • Sales sees billing in the CRM

    The latest invoice amount and date sit on the company record, so nobody walks into a call unaware of a recent charge or upgrade.

  • Finance sees invoices as they happen

    A message in #finance for each invoice gives a live view of billing without opening Stripe.

  • No manual copying

    Nobody has to export invoices and paste totals into HubSpot. The records stay current without anyone remembering to update them.

  • Better renewal and upsell conversations

    Knowing what a customer pays and when they were last billed helps account managers time renewals and spot accounts that are growing.

How it works

What happens, step by step

  1. ClickRuntime starts as soon as Stripe reports that a new invoice was created.

  2. It ignores any notice it has already handled, so a repeated delivery is not posted twice.

  3. It finds the customer's company in HubSpot and updates it with the invoice amount and date.

  4. A short message with the customer, amount and link is posted in your #finance Slack channel.

Before it runs live

  • Connect HubSpot
  • Connect Slack, then invite the app to the channel (type /invite @ClickRuntime there)
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Log new Stripe invoices in HubSpot and Slackjust nowSucceeded
Slack · #financeInvoice INV-0142: Acme Logistics 2,400.00 USD, annual plan upgrade. HubSpot company updated.

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Act only on the items that match your own rules, and skip the rest
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Google Sheets
  • Combine it with other HubSpot and Slack steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
stripe_invoices_update_hubspot_and_post_to_slack.pyexample
from clickruntime import on_event, credentials, http, notify, state

@on_event
def handle(event):
    if state.get(f"done:{event.event_id}"):
        return {"skipped": "duplicate"}
    inv = event.json["data"]["object"]
    company_id = (inv.get("metadata") or {}).get("hubspot_company_id")
    amount = inv["amount_due"] / 100
    if company_id:
        http.patch(f"https://api.hubapi.com/crm/v3/objects/companies/{company_id}",
                   headers={"Authorization": f"Bearer {credentials.secret('HUBSPOT_API_KEY')}"},
                   json={"properties": {"last_invoice_amount": amount, "last_invoice_date": inv["created"] * 1000}})
    notify.slack(f"Invoice {inv.get('number') or inv['id']}: {inv.get('customer_name') or inv.get('customer_email')} "
                 f"{amount:,.2f} {inv['currency'].upper()} {inv.get('hosted_invoice_url') or ''}", channel="#finance")
    state.set(f"done:{event.event_id}", True)
    return {"invoice": inv["id"], "hubspot_updated": bool(company_id)}

FAQ

Common questions

How does it find the right HubSpot company?
It matches on a HubSpot company ID stored in the Stripe invoice's metadata, which is the most reliable link. You can also match on the customer's email domain.
Which invoice details are saved?
The invoice amount and date, in company properties you choose, such as Last invoice amount and Last invoice date. The Slack post also includes a link to the invoice.
What if an invoice is created by mistake and voided?
The record shows the latest invoice created. You can also listen for voided invoices and post a correction to the same channel.
What permissions does it need?
HubSpot companies read+write; Slack chat:write. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run for each event the app sends.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Log new Stripe invoices in HubSpot and Slack” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.