We use cookies to make HubSpot's community a better place. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. To learn more, and to see a full list of cookies we use, check out our Cookie Policy (baked goods not included).
Apr 3, 2020 8:49 AM
Hi,
Can someone please tell me if I can create one JSON payload for multiple LINE ITEMS, for example like this:
Apr 6, 2020 12:49 AM
Hey @j_j,
Currently, one ecommerce sync message PUT request can only send a group of sync messages for a specific object type.
It is not possible to create multiple line items using the Send ecommerce sync messages endpoint.
Mar 27, 2021 7:01 AM
Wendy, did this ever change. Can we send multiple object types in one JSON payload? It would save us making 4 API requests for PRODUCT, DEAL, CONTACT and LINE_ITEM. Please can you let me know thanks.
Apr 10, 2020 7:13 AM - edited Apr 10, 2020 7:28 AM
Thanks for the reply.
What about with the eCommerce Bridge API? We moved to that API as it is far superior to get data in to HubSpot from an existing (bespoke) ecommerce store.
We do it like this with eCommerce Bridge:
{
"storeId": "Some Store",
"objectType": "LINE_ITEM",
"messages": [
{
"action": "UPSERT",
"changedAt": "1586432203000",
"externalObjectId": "15213434941",
"properties": {
"line_name": "Product 1",
"line_sku": "FZET27",
"line_price": "2395.00",
"line_tax": "399.17",
"line_quantity": "1"
},
"associations": {
"DEAL": [
"128633"
],
"PRODUCT": [
"FZET27"
]
}
},
{
"action": "UPSERT",
"changedAt": "1586432203000",
"externalObjectId": "153423421948",
"properties": {
"line_name": "Product 2",
"line_sku": "VLC75",
"line_price": "90.00",
"line_tax": "15",
"line_quantity": "1"
},
"associations": {
"DEAL": [
"128633"
],
"PRODUCT": [
"VLC75"
]
}
}
]
}
I take it that is valid? The documentation says we can send up to 200 objects of the same type with the eCommerce Bridge.
Apr 14, 2020 10:11 PM
Hey @j_j,
Apologise for the confusion. The following code:
{ "storeId": "{{your store id}}", "objectType": "LINE_ITEM", "messages": [ { "action": "UPSERT", "changedAt": "1586432203000", "externalObjectId": "lineitem_test1", "properties": { "price": "2395.00", "num_items": "1" }, "associations": { "DEAL": [ "dealtest1" ], "PRODUCT": [ "producttest1" ] } }, { "action": "UPSERT", "changedAt": "1586432203000", "externalObjectId": "lineitem_test2", "properties": { "price": "2395.00", "num_items": "1" }, "associations": { "DEAL": [ "dealtest2" ], "PRODUCT": [ "producttest2" ] } } ] }
would work just fine! I've tested it on my end and I'm able to see that two line items were associated to deals with products accordingly.