HubSpot 'Closed-Won' Deals to Xero Invoices (Make.com)

Automate accounting workflows by instantly generating Xero invoices from closed HubSpot deals using Make.com.

Tools: HubSpotXero

Platform: Make.com

Short Answer

A seamless, real-time sync where every 'Closed-Won' deal in HubSpot triggers the creation/update of a Xero Contact and a corresponding Draft Invoice, including specific line items and tax considerations.

The Problem

Manual entry of sales data into accounting software causes billing delays, human error in line-item pricing, and data silos between Sales and Finance teams. Sales reps lose visibility into whether their deals have been converted into invoices.

The Outcome

A seamless, real-time sync where every 'Closed-Won' deal in HubSpot triggers the creation/update of a Xero Contact and a corresponding Draft Invoice, including specific line items and tax considerations.

Step-by-Step Guide

1. **Create Scenario**: Log into Make.com, click '+ Create a new scenario', and name it 'HubSpot to Xero Invoice Sync'. 2. **HubSpot Trigger**: Add the 'HubSpot CRM' module and select 'Watch Deals'. Connect your account via OAuth2. Set the 'Property to monitor' to 'Deal Stage'. 3. **Set Filter**: Click the link between the HubSpot module and the next step. Label it 'Only Closed-Won'. Set the condition where `Deal Stage` (ID) equals your specific 'Closed Won' internal ID. 4. **Fetch Line Items**: Add the HubSpot 'List Line Items for an Object' module. Map the 'Deal ID' from the trigger to ensure you retrieve the products associated with the deal. 5. **Xero Contact Lookup**: Add the 'Xero' module 'Get/Search for a Contact'. Search by 'Name' or 'Email' using HubSpot Company data. 6. **Create/Update Contact**: Use a 'Router' or the 'Update a Contact' module if the search returns no results, ensuring the Xero ledger has the latest address from HubSpot. 7. **Map Line Items (Iterator)**: Use a Make.com 'Iterator' if there are multiple products. Map the array of line items from Step 4. 8. **Create Xero Invoice**: Add the 'Xero' module 'Create an Invoice'. Map the Contact ID from Step 5. Set the 'Status' to 'DRAFT'. Map line items using the `map()` function or the Iterator's output. 9. **Currency & Date Formatting**: Use Make's built-in functions: `{{formatDate(now; "YYYY-MM-DD")}}` for the invoice date and `{{parseNumber(deal_amount)}}` to ensure numerical compatibility. 10. **Update HubSpot**: Add a HubSpot 'Update a Deal' module. Map the Xero Invoice ID to a custom HubSpot field 'Xero Invoice Link' to provide visibility to the sales team. 11. **Error Handling**: Right-click the Xero module and select 'Add error handler'. Choose 'Break' or 'Email' to notify the admin if an invoice fails due to missing tax rates or account codes.