# Line Items batch endpoint merging instances

**URL:** <https://community.hubspot.com/t/line-items-batch-endpoint-merging-instances/99952>\
**Category:** APIs & Integrations\
**Tags:** developer-tools, sdk, object, professional\
**Created:** [February 12, 2024, 11:15am UTC](https://community.hubspot.com/t/line-items-batch-endpoint-merging-instances/99952 "2024-02-12T11:15:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![arenodi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/arenodi/32/92822_2.png) [@arenodi](https://community.hubspot.com/u/arenodi)\
**Post date:** [February 12, 2024, 11:15am UTC](https://community.hubspot.com/t/line-items-batch-endpoint-merging-instances/99952/1 "2024-02-12T11:15:27Z")

</div>

Hello Everyone, I came across an annoying problem on the line items batch end point.

I’m importing line items from salesforce into hubspot, and when there are multiple instances of the same product associated with the same deal, the api do a ‘merge’ adding just one line item in reference of that product.

Example:

Product Name: Xproduct

Product SKU: Xprod1

Oppty ID : oppty1

Deal ID: 1234

_Xproduct is inserted in Hubspot as an product object, carrying the same attributes as in Salesforce._

An Salesforce oppty ‘oppty1’ has three instances of Xproduct. When I try to batch insert three instances of Xproduct associated with deal ‘1234’, the result is only one instance of Xproduct, and the response returns the insertion of only one line item object. The endpoint does a ‘merge’, merging the three instances into one, so to speak.

I really dont know why this happens, I’m still on dev stage so I was able to spot it out. Its gonna be quite problematic when working with big volumes of data.

Anyone knows anything about that?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Berangere](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/berangere/32/220784_2.png) [@Berangere](https://community.hubspot.com/u/Berangere)\
**Post date:** [February 13, 2024, 11:55am UTC](https://community.hubspot.com/t/line-items-batch-endpoint-merging-instances/99952/2 "2024-02-13T11:55:31Z")

</div>

Hi @arenodi,  
Thank you for asking the Community!  
I’m sorry to hear about your experience regarding this. I can see how it can be frustrating.  
I understand that you are using this endpoint “[Line Items](https://developers.hubspot.com/docs/api/crm/line-items)” but when importing the line items from Salesforce into HubSpot, you don’t want them to be merged.  
I found these documentations that might be of interest.  
- [Get a line item by ID](https://legacydocs.hubspot.com/docs/methods/line-items/get_line_item_by_id)  
- [Line items overview](https://legacydocs.hubspot.com/docs/methods/line-items/line-items-overview)  
I’d like to ask our Top Experts about this: Hi @MBERARD, @Teun and [@Thomas\_Rousseau](https://community.hubspot.com/t5/user/viewprofilepage/user-id/630925) do you have suggestions to help @arenodi, please?  
If anybody else has anything to add and/or share, please feel free to join in the conversation 🙂

Thank you very much and have a great day!  
Best,  
Bérangère

---

<div class="post-metadata">

**Author:** ![eterobby](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/eterobby/32/63860_2.png) [@eterobby](https://community.hubspot.com/u/eterobby)\
**Post date:** [July 28, 2026, 8:05pm UTC](https://community.hubspot.com/t/line-items-batch-endpoint-merging-instances/99952/3 "2026-07-28T20:05:49Z")

</div>

This behavior is quite annoying. I’m trying to split a deal’s line items into multiple invoices based on future billing date. Some deals contain multiple occurrences of the same product/quantity for the same invoice because they are separate services that happen to be delivered within the same time period.

The behavior of the batch API is discarding the “duplicate” items, forcing me to use the non-batch API instead.

---

<div class="post-metadata">

**Author:** ![chighsmith](https://avatars.discourse-cdn.com/v4/letter/c/77aa72/32.png) [@chighsmith](https://community.hubspot.com/u/chighsmith)\
**Post date:** [July 28, 2026, 8:30pm UTC](https://community.hubspot.com/t/line-items-batch-endpoint-merging-instances/99952/4 "2026-07-28T20:30:17Z")

</div>

Hi there @eterobby !

I’d recommend trying the workaround of using the single line items create endpoint for these cases. You can also try differentiating the line items by adding a unique `name` or `description` per record (e.g., service period or delivery phase), which may prevent the merge behavior.

If you’d like to see this handled differently at the API level, the [Ideas Forum](https://community.hubspot.com/t5/HubSpot-Ideas/idb-p/HubSpot_Ideas) is the best place to submit it, especially with your invoice splitting use case spelled out.

Cassie, Community Manager

---

<div class="post-metadata">

**Author:** ![eterobby](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/eterobby/32/63860_2.png) [@eterobby](https://community.hubspot.com/u/eterobby)\
**Post date:** [July 28, 2026, 10:06pm UTC](https://community.hubspot.com/t/line-items-batch-endpoint-merging-instances/99952/5 "2026-07-28T22:06:16Z")

</div>

Hi Cassie,

Thank you for your response and the link to the Ideas Forum.

Unless and until the API behavior is changed, I think it would at least be worth documenting that the batch create API behaves this way. It’s quite surprising to submit an array with 3 records in `inputs` and receive a successful response where `results` contains only 2.

The existing documentation at [Create a batch of line items - HubSpot docs](https://developers.hubspot.com/docs/api-reference/latest/crm/objects/line-items/batch/create-line-items) and [CRM API | Line items - HubSpot docs](https://developers.hubspot.com/docs/api-reference/latest/crm/objects/line-items/guide) don’t mention this behavior at all, and they definitely should.

Fortunately, as I updated my script to include an appropriate `hs_position_on_quote` value for each item to preserve the expected order, I found that having a unique value for this property worked around this behavior, enabling me to use the batch API after all. This value was apparently also needed to avoid issues with the ensuing Hubspot-\>QuickBooks invoice sync process as well.

---

<div class="post-metadata">

**Author:** ![MichaelMa](https://avatars.discourse-cdn.com/v4/letter/m/b5ac83/32.png) [@MichaelMa](https://community.hubspot.com/u/MichaelMa)\
**Post date:** [July 29, 2026, 1:08pm UTC](https://community.hubspot.com/t/line-items-batch-endpoint-merging-instances/99952/8 "2026-07-29T13:08:11Z")

</div>

I’ve found years ago that the batch API will ignore multiple entries if they are exactly the same.

A huge pain to figure out and, as you noted, not really documented anywhere (except here in the Forum). I ended up just having a notes field or modifying the subject/name of the object slightly (eg, X of Y) to avoid having to deal with this issue.
