Skip to main content
Customer sync turns the contacts on your HubSpot deals into Flexprice customers. When HubSpot reports that a deal was won, or created if you subscribe to that event, Flexprice reads every contact associated with the deal and creates or links one Flexprice customer per contact. Customer sync runs one way: Flexprice never creates or updates contacts in HubSpot.

When HubSpot customer sync runs

Customer sync starts when HubSpot sends a deal event to the Flexprice webhook URL. Set up the subscriptions as described in Step 4 of the connection setup.
  • No toggle controls customer sync. It runs whenever a verified deal event arrives. To stop it, pause or delete the deal subscriptions in your HubSpot app.
  • Only contacts are imported. Companies associated with the deal are not.
  • A deal with no contacts creates nothing.
  • A deal with several contacts creates several customers, one per contact, all carrying the same deal ID.

How Flexprice matches HubSpot contacts to customers

Flexprice checks each contact on the deal in this order:
  1. Already linked. If a Flexprice customer is already linked to the contact, Flexprice skips it. The customer keeps the deal ID of the deal that first imported it.
  2. Same email. If a Flexprice customer has the contact’s email address, Flexprice links that customer to the contact and leaves the customer record unchanged.
  3. New customer. Otherwise, Flexprice creates a customer from the contact, as described in the next section.
A customer linked by email does not get the hubspot_deal_id or hubspot_contact_id metadata keys. Deal sync and quote sync read the deal ID from hubspot_deal_id and skip customers without it. To include such a customer, add hubspot_deal_id (the HubSpot deal’s record ID) and hubspot_contact_id to the customer’s metadata. Invoice sync works for these customers without any change.

HubSpot contact fields copied to Flexprice customers

A customer created from a HubSpot contact gets these values:
Flexprice accepts only two-letter ISO 3166-1 country codes, such as US or IN, for address_country. HubSpot’s country contact property is free text, so a value like United States makes the customer creation fail and the contact is not imported. Store two-letter codes in the contact’s country property, or leave it empty.
Later changes to the contact in HubSpot are not copied to the Flexprice customer.

Finding the HubSpot contact linked to a customer

Customers created by customer sync carry the contact ID in metadata.hubspot_contact_id. For any linked customer, including customers linked by email, call Get entity integration mappings:
The HubSpot link is the item with provider_type set to hubspot. Its provider_entity_id is the HubSpot contact ID, and its metadata.hubspot_deal_id is the deal that created the link.

Troubleshooting HubSpot customer sync