For those who are currently syncing NetSuite and Hubspot, specifically HubSpot Deals - NetSuite Opportunities; what connector are you using and how are the syncs going between line items? We are using a custom script that syncs deals and opportunities with line items ok on the initial creation of a deal, but when we make any changes on the line level in Hubspot, those changes aren't syncing over properly; and vice versa. Need some insight, thanks
I've implemented several NetSuite-HubSpot integrations with line item syncing, and you've hit the classic pain point that breaks most custom scripts after initial setup. The issue isn't your script quality—it's the architectural mismatch between how these systems handle line items.
Why Line Item Updates Fail
1. No Stable External ID System - HubSpot line items don't have a reliable external ID field that persists across updates. When you modify a line item, there's no guaranteed way to match it back to the NetSuite opportunity line without custom tracking.
2. Different Data Models: - HubSpot: Line items are independent objects associated to deals via hs_object_id - NetSuite: Opportunity line items are child records tightly coupled to the parent with pricing rules and tax calculations
3. Update vs. Replace Behavior - NetSuite's SuiteScript often treats line item updates as delete-and-recreate operations, while HubSpot updates in place.
Practical Solutions
Option 1: Establish a System of Record (Recommended)
Choose ONE direction for line item changes:
NetSuite as Source: - Make HubSpot line items read-only - All pricing/quantity changes happen in NetSuite - Script only pulls updates from NetSuite to HubSpot - Add a custom property to store NetSuite line item internal ID
HubSpot as Source: - Sales team edits in HubSpot only - Script pushes to NetSuite and overwrites - NetSuite becomes reporting/billing destination
Option 2: Implement Line-Level External ID Tracking
Add custom fields to both systems: - HubSpot: Create "netsuite_line_id" property on line items - NetSuite: Add field to store HubSpot hs_object_id
On sync, match by external ID, not product name or position.
Option 3: Use HubSpot's v4 Associations API
GET /crm/v4/objects/deals/{dealId}/associations/line_items
This returns all line items with IDs, allowing you to build a mapping table and track changes.
Common Script Issues to Check
1. Are you comparing line items by array position? (Breaks when reordered) 2. Are you handling deletions? 3. Are you using PATCH instead of PUT? (PUT replaces all items) 4. Are you respecting NetSuite's concurrency limits? (Max 1 update/second for Opportunity records)
My Recommendation: Start with Option 1 (single source of truth). Bidirectional line item sync is complex and fragile. If you need it, Option 2 with external ID tracking is most reliable.
What platform is your custom script built on? That will help me provide more specific guidance.
Hi @GFlo_ADB , you’re not alone here. What you’re describing is one of the hardest parts of a NetSuite–HubSpot integration, and it usually works “just enough” on create, then breaks down as soon as edits happen on either side.
The core issue is that HubSpot line items and NetSuite opportunity items don’t behave like simple child records. In HubSpot, line items are tied to deals but are versioned and recalculated frequently. In NetSuite, opportunity line items are deeply coupled with pricing rules, amounts, tax, and sometimes custom scripts or workflows.
Most custom scripts or basic connectors handle initial creation fine, but struggle with updates because there’s no native, stable line-level external ID that both systems reliably respect over time. Once quantities, prices, or removals change, you get duplicates, missed updates, or partial overwrites.
The usual best practice is to explicitly define a system of record for line items. Either HubSpot owns line items and NetSuite consumes them, or NetSuite owns them and HubSpot treats them as read-only mirrors. True bidirectional sync at the line level requires diffing arrays of items, handling deletes vs updates, and respecting NetSuite’s concurrency and API limits, which is why most “it works on create” solutions fall apart on edit. HubSpot’s own APIs don’t provide any native conflict resolution here, so all of that logic has to live in the integration layer (https://developers.hubspot.com/docs/api-reference/crm-line-items-v3/guide )
Small disclosure since I’m close to this topic: I work on Stacksync. This exact line-item drift problem between NetSuite Opportunities and HubSpot Deals is one of the reasons some teams move away from custom scripts, since having stable external IDs, controlled directionality, and update-level visibility makes ongoing changes much more predictable.
Hope this gives you a clearer frame for deciding whether to fix the script or rethink the sync model.
Did my answer help? Please mark it as a solution to help others find it too.
Ruben Burdin HubSpot Advisor Founder @ Stacksync Real-Time Data Sync between any CRM and Database