<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Not able to import duplicate line items in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Not-able-to-import-duplicate-line-items/m-p/1029851#M75993</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/812800"&gt;@Andre3&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; Thanks for your post and for including your details. I'd like to invite some of our community members to the conversation — hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/17186"&gt;@Anton&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/293284"&gt;@dsmarion&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/9259"&gt;@Mike_Eastwood&lt;/a&gt;, do&amp;nbsp;you have any suggestions for&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/812800"&gt;@Andre3&lt;/a&gt;?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much for taking a look! — Jaycee&lt;/P&gt;</description>
    <pubDate>Tue, 20 Aug 2024 21:15:22 GMT</pubDate>
    <dc:creator>Jaycee_Lewis</dc:creator>
    <dc:date>2024-08-20T21:15:22Z</dc:date>
    <item>
      <title>Not able to import duplicate line items</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Not-able-to-import-duplicate-line-items/m-p/1029385#M75959</link>
      <description>&lt;P&gt;I'm having issues batch creating line items when there are multiple duplicate line items. HubSpot is removing my duplicate line items.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ex: I am sending 10 line items, but 7 are exactly the same. HubSpot response is 5 line items. HubSPot consolidates repeated line items into a single line item with quantity set to 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I ensure that all line items, including duplicates, are imported?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my function:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def create_batch_line_items(self, deal_id, line_items): """ Create multiple line items in HubSpot :param deal_id: Deal ID :param line_items: List of line items """ from hubspot.crm.line_items import BatchInputSimplePublicObjectInputForCreate, ApiException hubspot_line_items = [] for item in line_items: hubspot_item = { "associations": [ { "to": {"id": deal_id}, "types": [{"associationCategory": "HUBSPOT_DEFINED", "associationTypeId": 20}] } ], "properties": { "hs_sku": item['hs_sku'], "name": item['name'], "quantity": item['quantity'], "price": item['price'], # Convert cents to dollars # Convert cents to dollars "hs_cost_of_goods_sold": item['cost'], "hs_line_item_currency_code": "NZD", "supplier_name": item.get('supplier_name', '') } } hubspot_line_items.append(hubspot_item) batch_input_simple_public_object_input_for_create = BatchInputSimplePublicObjectInputForCreate( inputs=hubspot_line_items) try: response = self.client.crm.line_items.batch_api.create( batch_input_simple_public_object_input_for_create=batch_input_simple_public_object_input_for_create) return response.results except ApiException as e: print("Exception when calling line_items_api-&amp;gt;create: %s\n" % e)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="original line items" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/125153i133C4D8BAEF01756/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-08-20 at 5.29.25 PM.jpg" alt="original line items" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;original line items&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="returned line items" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/125154i019072B4232270B9/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-08-20 at 5.30.10 PM.jpg" alt="returned line items" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;returned line items&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2024 06:16:32 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Not-able-to-import-duplicate-line-items/m-p/1029385#M75959</guid>
      <dc:creator>Andre3</dc:creator>
      <dc:date>2024-08-20T06:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to import duplicate line items</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Not-able-to-import-duplicate-line-items/m-p/1029851#M75993</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/812800"&gt;@Andre3&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; Thanks for your post and for including your details. I'd like to invite some of our community members to the conversation — hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/17186"&gt;@Anton&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/293284"&gt;@dsmarion&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/9259"&gt;@Mike_Eastwood&lt;/a&gt;, do&amp;nbsp;you have any suggestions for&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/812800"&gt;@Andre3&lt;/a&gt;?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much for taking a look! — Jaycee&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2024 21:15:22 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Not-able-to-import-duplicate-line-items/m-p/1029851#M75993</guid>
      <dc:creator>Jaycee_Lewis</dc:creator>
      <dc:date>2024-08-20T21:15:22Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to import duplicate line items</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Not-able-to-import-duplicate-line-items/m-p/1030179#M76018</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/812800"&gt;@Andre3&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;SKU is the unique identifier here so it needs to be changed for every call. You can't create line items with the same SKU other than that you can create line items with the same name for reference you can see SS.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this doesn't solve your problem please explain in detail what you mean by duplicate line item, with the properties which are the same and which are not.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GRajput_0-1724241724375.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/125257iA0CF477F57938477/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GRajput_0-1724241724375.png" alt="GRajput_0-1724241724375.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I hope this will help you out. Please mark it as &lt;STRONG&gt;Solution Accepted and upvote&lt;/STRONG&gt; to help another Community member. &lt;BR /&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2024 12:02:16 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Not-able-to-import-duplicate-line-items/m-p/1030179#M76018</guid>
      <dc:creator>GRajput</dc:creator>
      <dc:date>2024-08-21T12:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to import duplicate line items</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Not-able-to-import-duplicate-line-items/m-p/1031602#M76109</link>
      <description>&lt;P&gt;Hi Andre,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can create duplicate line items if you send separate API requests to create each of them, and then one more API request to assign them to a deal. As an example, we created 10 line items with 10 API request (please see screenshots of API request and API response for the first two of them below), and then used 11th API request to assign those to the deal (the screenshot of the API request and API response attached).&lt;/P&gt;
&lt;P&gt;You can contact us &lt;A href="https://migratemycrm.com?utm_source=hs&amp;amp;utm_medium=social&amp;amp;utm_campaign=forum" target="_blank" rel="noopener"&gt;here&lt;/A&gt; if you'd need more support with line items migration.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-08-23 at 11.18.42 AM.png" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/125472i33D9B1FD8972ABBA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-08-23 at 11.18.42 AM.png" alt="Screenshot 2024-08-23 at 11.18.42 AM.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-08-23 at 11.18.59 AM.png" style="width: 871px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/125474i5D6B0FE062A303D9/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-08-23 at 11.18.59 AM.png" alt="Screenshot 2024-08-23 at 11.18.59 AM.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-08-23 at 11.19.13 AM.png" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/125471i33ECA0AC443E5399/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-08-23 at 11.19.13 AM.png" alt="Screenshot 2024-08-23 at 11.19.13 AM.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-08-23 at 11.19.46 AM.png" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/125473iF9EC7A2347DDB381/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-08-23 at 11.19.46 AM.png" alt="Screenshot 2024-08-23 at 11.19.46 AM.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-08-23 at 11.20.12 AM.png" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/125478i7937011390393BC2/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-08-23 at 11.20.12 AM.png" alt="Screenshot 2024-08-23 at 11.20.12 AM.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-08-23 at 11.20.21 AM.png" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/125475iDF8B8E286666A3B0/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-08-23 at 11.20.21 AM.png" alt="Screenshot 2024-08-23 at 11.20.21 AM.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-08-23 at 11.21.00 AM.png" style="width: 877px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/125476i0423CD79BAE8255D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-08-23 at 11.21.00 AM.png" alt="Screenshot 2024-08-23 at 11.21.00 AM.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-08-23 at 11.21.10 AM.png" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/125477iBBDF7BAE5DA31EB4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-08-23 at 11.21.10 AM.png" alt="Screenshot 2024-08-23 at 11.21.10 AM.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-08-23 at 11.21.23 AM.png" style="width: 801px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/125481iF97BC33DCF52E063/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-08-23 at 11.21.23 AM.png" alt="Screenshot 2024-08-23 at 11.21.23 AM.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-08-23 at 11.21.36 AM.png" style="width: 569px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/125479iF5AD19D52FB9FCAB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-08-23 at 11.21.36 AM.png" alt="Screenshot 2024-08-23 at 11.21.36 AM.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-08-23 at 11.21.44 AM.png" style="width: 554px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/125480iAF08999E56A1BDCA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-08-23 at 11.21.44 AM.png" alt="Screenshot 2024-08-23 at 11.21.44 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2024 17:43:42 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Not-able-to-import-duplicate-line-items/m-p/1031602#M76109</guid>
      <dc:creator>LucyGisaMuganwa</dc:creator>
      <dc:date>2024-08-23T17:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to import duplicate line items</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Not-able-to-import-duplicate-line-items/m-p/1032016#M76128</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Thanks. We have decided to add a suffix to each repeated line item SKU, which will solve our problem.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Aug 2024 23:24:08 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Not-able-to-import-duplicate-line-items/m-p/1032016#M76128</guid>
      <dc:creator>Andre3</dc:creator>
      <dc:date>2024-08-25T23:24:08Z</dc:date>
    </item>
  </channel>
</rss>

