APIs & Integrations

testuser27
Participant

Sync Line Items with Products in E commerce Brideg Store

SOLVE

{
"storeId": "test-hubspot-store",
"objectType": "LINE_ITEM",
"messages": [
{
"action": "UPSERT",
"externalObjectId": "Lineitem_xx12345_0012345",
"properties": {
"product_quantity": 2
},
"associations": {
"PRODUCT": [
"145747165"
]
}
}
]
}

I was trying to sync product quantity to the product that is also created using ecommerce sync message api but i'm not able to sync external properties using line items or association of product .
AnotherQuery :
Line item object id can be anything ?

0 Upvotes
1 Accepted solution
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

Sync Line Items with Products in E commerce Brideg Store

SOLVE

Hey @testuser27,

 

Thanks for providing the following.

 

Taking a look at the sync message using this endpoint: Get all sync errors for a specific account > I'm able to see the following:

 

{
portalId:7943290,
storeId:"test-hubspot-store",
objectType:"LINE_ITEM",
externalObjectId:"Lineitem_xx12345_0012345",
changedAt:1599198216453 (September 4, 2020, Fri, 1:43:36pm UTC+08:00),
erroredAt:1599198216570 (September 4, 2020, Fri, 1:43:36pm UTC+08:00),
type:"MISSING_REQUIRED_PROPERTY",
details:"Message missing required fields [hs_assoc__deal_id]",
status:"OPEN"},

 

This error indicate that when sending the sync message, you didn't include the `hs_assoc__deal_id` field. For example:

 

{
"storeId": "test-hubspot-store",
"objectType": "LINE_ITEM",
"messages": [
{
"action": "UPSERT",
"externalObjectId": "Lineitem_xx12345_0012345",
"properties": {
"product_quantity": 2,
"hs_assoc__deal_id": "0000"
},
"associations": {
"PRODUCT": [
"145747165"
]
}
}
]
}

 

Let me know if this works!

View solution in original post

5 Replies 5
WendyGoh
HubSpot Employee
HubSpot Employee

Sync Line Items with Products in E commerce Brideg Store

SOLVE

Hey @testuser27,

 

Just to clarify, are you looking to associate a product with a line item while creating a line item via the ecommerce sync message endpoint? However, you're not seeing the association? In this case, are you seeing the line item? 

 

If not, could you share with me the portal ID in question? Are you using the hapikey or oauth authentication?

 

 

testuser27
Participant

Sync Line Items with Products in E commerce Brideg Store

SOLVE

Hey @WendyGoh 
I was trying to associate line items with a product. Actually i want to sync product quantity in Hubspot product but as per doc quantity can be sync using line item only so that's why i'm syncing line item with product.

Are you using the hapikey or oauth authentication?  
I'm using hapikey.

Portal id : 7943290

Thanks

0 Upvotes
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

Sync Line Items with Products in E commerce Brideg Store

SOLVE

Hey @testuser27,

 

Thanks for providing the following.

 

Taking a look at the sync message using this endpoint: Get all sync errors for a specific account > I'm able to see the following:

 

{
portalId:7943290,
storeId:"test-hubspot-store",
objectType:"LINE_ITEM",
externalObjectId:"Lineitem_xx12345_0012345",
changedAt:1599198216453 (September 4, 2020, Fri, 1:43:36pm UTC+08:00),
erroredAt:1599198216570 (September 4, 2020, Fri, 1:43:36pm UTC+08:00),
type:"MISSING_REQUIRED_PROPERTY",
details:"Message missing required fields [hs_assoc__deal_id]",
status:"OPEN"},

 

This error indicate that when sending the sync message, you didn't include the `hs_assoc__deal_id` field. For example:

 

{
"storeId": "test-hubspot-store",
"objectType": "LINE_ITEM",
"messages": [
{
"action": "UPSERT",
"externalObjectId": "Lineitem_xx12345_0012345",
"properties": {
"product_quantity": 2,
"hs_assoc__deal_id": "0000"
},
"associations": {
"PRODUCT": [
"145747165"
]
}
}
]
}

 

Let me know if this works!

eibach-cv
Contributor

Sync Line Items with Products in E commerce Brideg Store

SOLVE

Hi, I am struggling with a similar issue.

 

What is the value of the hs_assoc__deal_id property and PRODUCT association in the example?

 

Are they the externalObjectId we assign or is it the hubspot generated id?

0 Upvotes
testuser27
Participant

Sync Line Items with Products in E commerce Brideg Store

SOLVE

Thank you for support  @WendyGoh 
It works now.

0 Upvotes