/
/
Turn overdue Stripe invoices into HubSpot collection tasks
For finance teams who want every late Stripe payment followed up in HubSpot, by asking their AI assistant to set up the tasks.
On this page
Connector
Connect HubSpot, pick your AI tool and paste the prompt.
The problem
Overdue Stripe invoices get two collection tasks or none
Chasing late payments means pulling overdue invoices and failed charges from Stripe, finding each customer in HubSpot and creating a follow-up task. Done by hand, some invoices get two tasks, others none, and recovered payments still get chased.
Without PopdockAI
- Pull overdue invoices and failed charges from Stripe
- Find each customer in HubSpot by email
- Check for an existing collection task
- Create tasks by hand and miss a few
With PopdockAI
- Past due invoices and recent failed charges are read, with paid ones dropped
- Each is matched to a HubSpot contact or company by email
- Invoices already being chased are skipped
- You confirm the table before any task is created
The prompt
Use this prompt
Copy it into any AI tool connected to PopdockAI. Swap the values in braces for your own.
**Objective:** For Stripe invoices that are open and past due, and for charges that failed in the last `{lookback-days}` days (default 7), create one HubSpot collection task per invoice on the customer's contact and company, at most `{max-records}` tasks (default 25). Nothing is written until the user confirms.
**Step 1: Find payment problems in Stripe**
Call `stripe-get-invoice` with `status` set to open, `due-date.to` set to today and `max-records` 200. Keep `invoice-id`, `number`, `customer-email`, `customer-name`, `amount-remaining`, `currency`, `due-date` and `hosted-invoice-url`.
Call `stripe-get-charge` with `status` set to failed, `created.from` set to today minus `{lookback-days}` days (7 if empty) and `max-records` 200. For a failed charge with an `invoice-id` not already kept, call `stripe-get-invoice` with `invoice-id` set to it; if that invoice is now paid, the payment recovered and is left out. Otherwise keep the invoice with the charge's `failure-message`. A failed charge with no invoice is listed for information only.
Amounts are in minor units: divide by 100 (not for zero-decimal currencies such as JPY).
**Step 2: Find the customer in HubSpot**
The join is the Stripe `customer-email` against the HubSpot contact `email`, compared case-insensitively after trimming. Call `hubspot-get-contacts` with `email` set to it and keep `record-id` and `company-id`. If no contact comes back, call `hubspot-get-companies` with `company-domain-name` set to the email's domain (skip free mail domains such as gmail.com, outlook.com, yahoo.com and hotmail.com) and keep its `record-id`. If nothing matches, or several records match, list the invoice as unmatched and do not create a task for it.
**Step 3: Skip invoices that already have a task**
Call `hubspot-get-tasks` with `task-title.contains` set to the invoice `number`. If a task comes back whose `task-status` is not completed, skip the invoice and show that task.
**Step 4: Confirm**
Show a table, largest amount first and at most `{max-records}` rows (25 if empty): customer, email, invoice number, amount remaining and currency, due date, latest failure message, and the HubSpot record it will be linked to. Ask for an explicit yes and offer to exclude rows. Do not continue without a yes.
**Step 5: Write and verify**
For each confirmed invoice, call `hubspot-add-task` once with `subject` set to "Collect Stripe invoice <number>", `body` set to the amount remaining, currency, due date, failure message and hosted invoice link, `due-date` today, `status` NOT_STARTED, `priority` HIGH, `type` TODO, `contact-ids` set to the contact `record-id` when there is one, and `company-ids` set to the company id when there is one. Leave `owner-id` unset unless the user gives a numeric HubSpot owner ID. Then call `hubspot-get-tasks` with `task-title.contains` set to each number and confirm the task exists. Report created, failed and skipped rows.
**Rules & Guidelines:**
* `stripe-get-invoice` and `stripe-get-charge` are on the stripe server; `hubspot-get-contacts`, `hubspot-get-companies`, `hubspot-get-tasks` and `hubspot-add-task` are on the hubspot server.
* The only write tool allowed is `hubspot-add-task`, once per confirmed invoice and only after the confirmation in Step 4. Call no other hubspot-add, hubspot-update, hubspot-rename, hubspot-remove, hubspot-subscribe, hubspot-unsubscribe or hubspot-import tool, and do not use the engagement task tools.
* The stripe server has no write tools; only the stripe read tools named here are used, and nothing is charged, refunded or sent to the customer.
* Never put card numbers or bank details in a task. Keep the subject format exactly as given; the complete-paid-stripe-invoice-tasks prompt finds these tasks by it.
**Validation:**
* If Stripe shows no overdue invoice and no failed charge, say so and stop.
* If the user declines or does not answer, stop with nothing written.
* Never create a second open task for the same invoice number. Never match on a name alone.Who it's for
One answer, three teams that use it
Collections specialists
Get a task for every late payment
Turn overdue invoices and failed charges into tasks on the right HubSpot record, with no doubles.
Create HubSpot collection tasks for Stripe invoices that are past due and charges that failed in the last 7 days.
Accounts receivable
Chase the biggest amounts first
See the table sorted by amount before any task is created, so effort goes where the money is.
Which overdue Stripe invoices have no collection task in HubSpot yet? Start with the largest.
Account managers
Know when your customer is late
Late payments land as tasks on your contacts, so you can mention them before the next conversation.
Set up collection tasks in HubSpot for overdue Stripe invoices from Contoso and Fabrikam.
How it works
What PopdockAI does when you ask
Your AI assistant reads overdue invoices and failed charges from Stripe and matches each customer in HubSpot. Tasks are only created after you confirm, and Stripe is only read.
01
Find
It reads open past-due invoices and recent failed charges from Stripe.
02
Match
It finds the HubSpot contact or company by email and skips invoices with an open task.
03
Confirm
You review the table, largest amount first, and say yes.
04
Create
It creates one collection task per invoice and checks each one exists.
What PopdockAI provides
The tools behind the answer
Ready made tools for HubSpot and one secure connection to your AI tool. No code, no exports.
stripe-get-invoice
stripe-get-charge
hubspot-get-contacts
hubspot-get-companies
hubspot-get-tasks
hubspot-add-task
This report is built from Get data tools only. PopdockAI applies the row, field and parameter rules your admin sets, and every query is written to the audit trail.
The outcome
One collection task for every overdue invoice
Related use cases
More ways to put this data to work
One prompt template with infinite possibilities.
Your AI assistant adapts its approach, tone, and capabilities to match each unique context while you maintain a single, manageable workflow.
Join forward-thinking companies that are transforming their operations with intelligent, secure AI automation.

.webp)
