Connectors

/

HubSpot

/

Create HubSpot collection tasks for overdue Stripe invoices
Write
Cross-Connector

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.

Try PopdockAI free
Get a live demo
Create HubSpot collection tasks for overdue Stripe invoices
Set up HubSpot collection tasks for our overdue Stripe invoices and any charges that failed this week.
4 overdue Stripe invoices found; 2 are ready for new HubSpot tasks. - INV-1042, Northwind Traders, 1,250.00 USD, due 2026-10-15, card declined - INV-1038, Contoso, 640.00 USD, due 2026-10-20 - Already has an open task: INV-1029 - Unmatched: INV-1051, no HubSpot contact or company for that email Shall I create the 2 collection tasks?
HubSpot
Sample figures. Your results come from your own account.
stripe-get-invoice
stripe-get-charge
hubspot-get-contacts
hubspot-get-companies
hubspot-get-tasks
hubspot-add-task

On this page

The problem

The problem

The prompt

Who it's for

How it works

Tools used

Connector

HubSpot

HubSpot
Run it on your own HubSpot data.

Connect HubSpot, pick your AI tool and paste the prompt.

Try PopdockAI free

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.

Prompt
**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.

Your AI tool

02

Match

It finds the HubSpot contact or company by email and skips invoices with an open task.

hubspot-get-contacts
hubspot-get-companies
hubspot-get-tasks

03

Confirm

You review the table, largest amount first, and say yes.

No items found.

04

Create

It creates one collection task per invoice and checks each one exists.

Your AI tool

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.

get-data

stripe-get-invoice

Returns invoices (number, customer, status, dates, totals, amount remaining) from Stripe.
get-data

stripe-get-charge

Returns charges (amount, status, refunds, customer, card used) from Stripe.
get-data

hubspot-get-contacts

Returns contact records from HubSpot CRM, with email, phone, company, lifecycle stage, lead status, owner and location from the HubSpot connector. Filter by company id, state region, contact owner, email, last name, create date, company name, record id, lifecycle stage, lead status.
get-data

hubspot-get-companies

Returns company records from HubSpot CRM, with domain, industry, lifecycle stage, owner, location and revenue from the HubSpot connector. Filter by record id, company domain name, industry, lifecycle stage, annual revenue, state region, company owner, company name, create date, country region.
get-data

hubspot-get-tasks

Returns tasks in HubSpot, with title, status, priority, type, due date, assignee and related contact from the HubSpot connector. Filter by assigned to, is overdue, due date, task title, task status, task type, contact email, priority.
run-action

hubspot-add-task

Creates a task in HubSpot and returns the new task's ID. Required: Due date. Optional: Subject, Notes, Status, Priority, Type, Owner ID, Company IDs, Contact IDs, Deal IDs. Writes to HubSpot.
Read only.Nothing in HubSpot Changes

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.

How Popdock AI secures your data

The outcome

One collection task for every overdue invoice

Try PopdockAI free
Get a live demo

Related use cases

More ways to put this data to work

All Ramp use cases

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.

Try PopdockAI Free
See Documentation