Quick overview
This workflow runs hourly to find won HubSpot deals without a QuickBooks invoice number, then creates the matching customer and invoice in QuickBooks Online and posts Slack alerts when a contact email is missing, an invoice needs review, or a step fails.
How it works
- Runs every hour on a schedule.
- Searches HubSpot for deals in the configured “won” stage that do not have a
quickbooks_invoice_number, then keeps only deals closed on or after the configured start date and with an amount greater than zero.
- For each deal, fetches the deal’s associated contact and line item IDs from HubSpot and loads the primary contact details.
- If the contact has no email, updates the HubSpot deal to mark it as
MISSING-CONTACT and posts a Slack message asking sales to add a contact email.
- If the contact has an email, pulls HubSpot line item details, finds an existing QuickBooks Online customer by email (or creates one if none exists), and builds an invoice payload.
- Creates the invoice in QuickBooks Online, writes the QuickBooks invoice number back to the HubSpot deal to prevent double billing, and either emails the invoice via QuickBooks (when enabled and under the amount limit) or posts a Slack message asking finance to review and send it.
- Posts a Slack alert with the deal, failing step, and error details whenever any invoice-processing step fails.
Setup
- Add credentials for a HubSpot private app token (deals/contacts/line items read and deals write), QuickBooks Online OAuth2, and Slack.
- In HubSpot, create a single-line text deal property with the internal name
quickbooks_invoice_number.
- In the workflow configuration values, set your HubSpot portal ID, QuickBooks company ID and URLs (sandbox or production), won stage value, startFromCloseDate, default QuickBooks item ID, payment terms, auto-send settings/limit, Slack channel, and invoice memo text.