<?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: API V3 Batch Create Associations is not working as expected in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/API-V3-Batch-Create-Associations-is-not-working-as-expected/m-p/402203#M39838</link>
    <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I'm pretty sure, I was able to associate multiple line items to multiple deals earlier. I checked again, and it moves the association as you said.&lt;BR /&gt;&lt;BR /&gt;I have some deals to import with some products to attach by using line items, is there any way to automatically create line items and associate them to deals ?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Davy&lt;/P&gt;</description>
    <pubDate>Fri, 22 Jan 2021 07:12:22 GMT</pubDate>
    <dc:creator>DRousselin</dc:creator>
    <dc:date>2021-01-22T07:12:22Z</dc:date>
    <item>
      <title>API V3 Batch Create Associations is not working as expected</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/API-V3-Batch-Create-Associations-is-not-working-as-expected/m-p/401869#M39757</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I'm currently struggling with the HubSpot support team because they can't understand a single request.&lt;BR /&gt;&lt;BR /&gt;I'm using the Batch Create Associations endpoint from V3 API : /crm/v3/associations/deal/line_item/batch/create&lt;BR /&gt;&lt;BR /&gt;I'm trying to associate line items to deals.&lt;BR /&gt;&lt;BR /&gt;First of all, you can't associate multiple line items to multiple deals at once, this is tricky when you know that you are using a BATCH function.&lt;BR /&gt;&lt;BR /&gt;So, you need to proceed by deal and make 1 API Call per deal to associate multiple line items.&lt;BR /&gt;&lt;BR /&gt;I have the following Payloads and API Responses :&lt;BR /&gt;&lt;BR /&gt;Payload 1 :&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
	"inputs": [
		{
			"from": {
				"id": "3961097101"
			},
			"to": {
				"id": "1080141388"
			},
			"type": "deal_to_line_item"
		},
		{
			"from": {
				"id": "3961097101"
			},
			"to": {
				"id": "1004976138"
			},
			"type": "deal_to_line_item"
		}
	]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;Payload 2 :&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
	"inputs": [
		{
			"from": {
				"id": "3961035447"
			},
			"to": {
				"id": "1080141388"
			},
			"type": "deal_to_line_item"
		},
		{
			"from": {
				"id": "3961035447"
			},
			"to": {
				"id": "1004976138"
			},
			"type": "deal_to_line_item"
		}
	]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;API Response 1 :&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
  "status": "COMPLETE",
  "results": [
    {
      "from": {
        "id": "3961097101"
      },
      "to": {
        "id": "1004976138"
      },
      "type": "deal_to_line_item"
    },
    {
      "from": {
        "id": "1080141388"
      },
      "to": {
        "id": "3961097101"
      },
      "type": "line_item_to_deal"
    },
    {
      "from": {
        "id": "3961097101"
      },
      "to": {
        "id": "1080141388"
      },
      "type": "deal_to_line_item"
    },
    {
      "from": {
        "id": "1004976138"
      },
      "to": {
        "id": "3961097101"
      },
      "type": "line_item_to_deal"
    }
  ],
  "startedAt": "2021-01-20T10:17:24.909Z",
  "completedAt": "2021-01-20T10:17:24.959Z"
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;API Response 2 :&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
  "status": "COMPLETE",
  "results": [
    {
      "from": {
        "id": "3961035447"
      },
      "to": {
        "id": "1080141388"
      },
      "type": "deal_to_line_item"
    },
    {
      "from": {
        "id": "3961035447"
      },
      "to": {
        "id": "1004976138"
      },
      "type": "deal_to_line_item"
    },
    {
      "from": {
        "id": "1004976138"
      },
      "to": {
        "id": "3961035447"
      },
      "type": "line_item_to_deal"
    },
    {
      "from": {
        "id": "1080141388"
      },
      "to": {
        "id": "3961035447"
      },
      "type": "line_item_to_deal"
    }
  ],
  "startedAt": "2021-01-20T10:17:25.938Z",
  "completedAt": "2021-01-20T10:17:25.993Z"
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;As you can see, both requests seems correct according to the responses.&lt;BR /&gt;&lt;BR /&gt;When I check if the associations are correctly set, there is a problem, I only get the associations on the second object and not the first object.&lt;BR /&gt;&lt;BR /&gt;If I try to set associations on the first object, the associations are present.&lt;BR /&gt;&lt;BR /&gt;If I try to set associations on the second object, the associations are removed from the first object and added to the second object.&lt;BR /&gt;&lt;BR /&gt;If I try to associate them without the batch method, it works perfectly.&lt;BR /&gt;&lt;BR /&gt;There is definitely a BUG inside the batch method.&lt;BR /&gt;&lt;BR /&gt;It's been now 9 working days and the problem is still not solved.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 12:52:58 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/API-V3-Batch-Create-Associations-is-not-working-as-expected/m-p/401869#M39757</guid>
      <dc:creator>DRousselin</dc:creator>
      <dc:date>2021-01-21T12:52:58Z</dc:date>
    </item>
    <item>
      <title>Re: API V3 Batch Create Associations is not working as expected</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/API-V3-Batch-Create-Associations-is-not-working-as-expected/m-p/401999#M39777</link>
      <description>&lt;P&gt;Hey &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/157327"&gt;@DRousselin&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry that you are having issues.&amp;nbsp; I will review with the internal team to see where this is.&lt;/P&gt;
&lt;P&gt;In the interim, will throw some other community folks into this and see if they have experienced a similar issue or know of a solve&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/158"&gt;@jpsanchez&lt;/a&gt; , &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/137640"&gt;@HenryCipolla&lt;/a&gt; , &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/80052"&gt;@malcolm1&lt;/a&gt; , &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/66301"&gt;@Bryantworks&lt;/a&gt;&amp;nbsp; have you noticed an issue with something like this?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 17:08:24 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/API-V3-Batch-Create-Associations-is-not-working-as-expected/m-p/401999#M39777</guid>
      <dc:creator>dennisedson</dc:creator>
      <dc:date>2021-01-21T17:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: API V3 Batch Create Associations is not working as expected</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/API-V3-Batch-Create-Associations-is-not-working-as-expected/m-p/402074#M39791</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/157327"&gt;@DRousselin&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for providing the examples. It looks like you are attempting to associate a line_item to multiple deals across your two different calls. A &lt;A href="https://developers.hubspot.com/docs/api/crm/understanding-the-crm" target="_blank" rel="noopener"&gt;line_item is only able to be associated to a single deal&lt;/A&gt;, which is why you are seeing the assocaition move.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I tested out the behavior of the non-batch API and that also moved the association from the deal it was previously on to the one specificed in my API call.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have any examples of a line_item being associated to multiple deals, please send them my way (feel free to DM if you don't feel comfortable sharing here) as that would be a bug.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;BR /&gt;Zack&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 20:39:44 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/API-V3-Batch-Create-Associations-is-not-working-as-expected/m-p/402074#M39791</guid>
      <dc:creator>zwolfson</dc:creator>
      <dc:date>2021-01-21T20:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: API V3 Batch Create Associations is not working as expected</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/API-V3-Batch-Create-Associations-is-not-working-as-expected/m-p/402203#M39838</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I'm pretty sure, I was able to associate multiple line items to multiple deals earlier. I checked again, and it moves the association as you said.&lt;BR /&gt;&lt;BR /&gt;I have some deals to import with some products to attach by using line items, is there any way to automatically create line items and associate them to deals ?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Davy&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 07:12:22 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/API-V3-Batch-Create-Associations-is-not-working-as-expected/m-p/402203#M39838</guid>
      <dc:creator>DRousselin</dc:creator>
      <dc:date>2021-01-22T07:12:22Z</dc:date>
    </item>
  </channel>
</rss>

