sync_config.deal.outbound in the API.
When HubSpot deal sync runs
Deal sync needs the Deals toggle on, and a customer withhubspot_deal_id in its metadata. Customers created by customer sync have it.
Each run works from the subscription’s current line items, so a later run picks up changes made in between. For example, after you activate a draft subscription, the next quantity change or add-on syncs all of its fixed-price line items.
How deal sync updates HubSpot line items
- Only fixed-price line items sync. Usage-based line items do not appear on the deal.
- Synced line items are updated in place. Flexprice remembers which HubSpot line item belongs to each subscription line item and updates it on every run.
- New line items are created and associated with the deal.
- Ended line items stay on the deal. A line item that ended before the current billing period keeps its end date in HubSpot, so the deal keeps its history.
- Failures are retried. Each line item syncs on its own, so one failure does not block the others. A run that fails is retried up to three times.
HubSpot deal line item properties
Every line item gets the subscription’s billing period as its frequency, including one-time charges such as setup fees, so HubSpot counts them as recurring revenue.
How deal sync sets the HubSpot deal amount
After the line items sync, Flexprice waits 10 seconds for HubSpot to recalculate the deal’s annual contract value (hs_acv). It then reads hs_acv and writes it to the deal’s amount. If HubSpot has not calculated hs_acv yet, the amount stays as it was until the next deal sync.
If any line item fails to sync after all retries, Flexprice skips the amount update for that run.
What HubSpot deal sync leaves unchanged
- Deal stage and other deal properties. Flexprice only writes
amount. - Edits made in HubSpot. Flexprice does not read line items back. The next deal sync overwrites the properties in the table above with Flexprice’s values.
- Line items deleted in HubSpot. Flexprice does not recreate them on its own. Every later deal sync for that subscription fails for the deleted line item and skips the amount update, until you remove the link as described in the next section.
- Cancellations. Cancelling a subscription does not update or remove the deal’s line items.
Recreating a HubSpot line item deleted from a deal
Flexprice links each subscription line item to the HubSpot line item it created. To have Flexprice create a new HubSpot line item, remove that link with Delink integration mapping, passing the Flexprice subscription line item ID:Moving synced line items to a different HubSpot deal
Deal sync associates a line item with a deal only when it creates the HubSpot line item. After that it updates the same HubSpot line item on every run. So changing the customer’shubspot_deal_id does not move line items that already synced: they stay on the old deal, and only line items created afterwards go to the new one. The deal amount is then read from the new deal, which is missing the old items.
To move a subscription’s line items to another deal:
- Set
hubspot_deal_idin the customer’s metadata to the new deal’s record ID. - Remove the HubSpot link of each fixed-price line item on the subscription, with the
DELETE /v1/integrations/linkcall shown in the previous section. The line item IDs are in the subscription’sline_items. - The next deal sync for the subscription, started by a quantity change, an add-on, or a completed checkout, creates the line items on the new deal.
- In HubSpot, delete the old line items from the previous deal if they should not stay there. Flexprice no longer tracks them once their links are removed.

