Hello,
I’m currently struggling with the HubSpot support team because they can’t understand a single request.
I’m using the Batch Create Associations endpoint from V3 API : /crm/v3/associations/deal/line_item/batch/create
I’m trying to associate line items to deals.
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.
So, you need to proceed by deal and make 1 API Call per deal to associate multiple line items.
I have the following Payloads and API Responses :
Payload 1 :
{
"inputs": [
{
"from": {
"id": "3961097101"
},
"to": {
"id": "1080141388"
},
"type": "deal_to_line_item"
},
{
"from": {
"id": "3961097101"
},
"to": {
"id": "1004976138"
},
"type": "deal_to_line_item"
}
]
}
Payload 2 :
{
"inputs": [
{
"from": {
"id": "3961035447"
},
"to": {
"id": "1080141388"
},
"type": "deal_to_line_item"
},
{
"from": {
"id": "3961035447"
},
"to": {
"id": "1004976138"
},
"type": "deal_to_line_item"
}
]
}
API Response 1 :
{
"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"
}
API Response 2 :
{
"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"
}
As you can see, both requests seems correct according to the responses.
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.
If I try to set associations on the first object, the associations are present.
If I try to set associations on the second object, the associations are removed from the first object and added to the second object.
If I try to associate them without the batch method, it works perfectly.
There is definitely a BUG inside the batch method.
It’s been now 9 working days and the problem is still not solved.