Inbound Marketing Blog

How to integrate HubSpot and Xero

Written by Samantha Alford

Listed below is the detail of how our Inbound Accounts integration works, ie. our integration between HubSpot and Xero.

There are two main aspects of the integration: the first is the ability to update contact information in Xero and create invoices from HubSpot; and the second is the ability to view Xero invoice information within HubSpot contact and company records.

Update Contacts in Xero and create invoices from HubSpot deal stage change

When a deal stage is changed to Closed Won in HubSpot our integration does the following:

  1. We look up any associated contacts and/or companies that are associated with the deal as well as the deal name and amount.  
  2. Where there is a company associated with the deal, we grab the following properties from HubSpot (note that the following properties refer to the HubSpot 'internal' property names): name, address, address2, city, state, zip, country. Also note that when we copy address fields to Xero, we put them in the Postal Address fields in Xero, not the Street Address fields (so it makes sense for these fields to be postal address values in HubSpot).  If you need them in both please advise us and we can provide a custom integration to populate those fields.
  3. Where there is a contact associated with the deal, we grab the following properties from HubSpot (firstname, lastname, email, address, city, state, zip, country). Note same as point 2 above regarding Postal address fields.
  4. If there is no company associated with the deal, we use the contact information from the contact record to create the contact in Xero if it doesn't already exist, or update the contact information if HubSpot has different information to Xero.  Note that currently we only add/update the Postal Address fields in Xero from the HubSpot address properties, not the Xero Street Address fields. The contact's first and last name in HubSpot will be the Contact Name in Xero. When we create the invoice, we create it with the HubSpot associated contact as the "To" that the Xero invoice is created for.
  5. If there is a company associated with the deal, we use the company properties to create or update the contact in Xero.  The Contact Name in Xero will be the Company Name in HubSpot. Note that currently we only add/update the Postal Address fields in Xero from the HubSpot address properties, not the Xero Street Address fields. If there is also a contact associated with the deal, we use the contact's first name, last name and email to populate the Xero Primary Person field's first name, last name and email address. If there is no contact associated with the deal, we do not overwrite the Xero Primary Person field, rather we leave it as is in Xero. We will then create the invoice with the company name as the invoice "To" field.
  6. The invoice will be created with the settings you nominated when you sign up, ie:
    1. Status: The invoice will be created in Draft unless you have requested us specifically to create them Approved status
    2. Date: The invoice date with be the date the deal stage is changed to Closed Won
    3. Due Date: The invoice due date will be the number of days that you specified in your sign up after the invoice date (eg. if you specified 14 days in your sign up and the invoice date is 1 July then the invoice due date will be 15 July).
    4. Description: If you are using the Products features of the Sales Pro version of HubSpot and applying products to your deals, the Xero Description line items will be each of the products as separate lines in the Xero Description part of the invoice. If you are NOT using the products features of the Sales Pro version, the description will be a single line description with the Deal Name as the description.
    5. Quantity: If you are using the Products features of the Sales Pro version of HubSpot and applying products to your deals, the Quantity will be the quantity as specified in the number of products in the deal.  If you are NOT using the products features of the Sales Pro version, the Quantity will be 1.
    6. Unit Price: If you are using the Products features of the Sales Pro version of HubSpot and applying products to your deals, the Unit Price will be the Unit Price as specified in the individual products in the deal.  If you are NOT using the products features of the Sales Pro version, the Unit Price will be the Deal Amount.
    7. Discount: If you are using the Products features of the Sales Pro version of HubSpot and applying products to your deals, the Disc % will be the Discount amount expressed as a percentage (regardless of whether you have specified percentage or dollar amount in the discount field in HubSpot) as specified in the specific product in the deal.  If you are NOT using the products features of the Sales Pro version, the Disc % is not specified.
    8. Account: the account for each description line is the the account as indicated by the account number you specified in your sign up (unless you have custom code developed which identifies which products are associated with which accounts).
    9. Tax Rate: the tax rate is determined by the settings in Xero associated with the account specified.
    10. GST: GST is added to the amounts in the description lines if you have specified in your sign up that your amounts are GST exclusive. Alternatively, if you have specified that your amounts are GST inclusive, we calculate the GST from the total amount of the line items (ie. Amount divided by 11).

View Invoices in HubSpot

Our addon allows you to see Xero Invoice information in HubSpot.

Note the following rules apply:

  1. If the invoice has been created for a company, you will see the invoice in the Company record.
  2. If the invoice has been created for an individual contact, you will see the invoice in the Contact record.
  3. The Invoice information displayed in HubSpot includes: the Invoice Number (which also links to the invoice in Xero if the person clicking the link has a login that enables them to see Xero invoices); Invoice Due Date; Amount (including tax); and the total of any Amount(s) Paid to date. 
  4. If the invoice was created by the deal stage change using our add-on, the invoice in Xero will also contain a link back to the deal in HubSpot that created the invoice.

Xero Invoices in HubSpot

Samantha Alford

Written by Samantha Alford

Samantha is the founder and CEO of Inbound Addons, an agency she formed to help people and their organisations succeed by changing the way they market online. She can often be found geeking out developing HubSpot integrations or "add-ons" to help extend the value of HubSpot by connecting it to other applications or extending it's functional capability.