APIs & Integrations

Guilty
Member

LINE_ITEM is not being synced in Ecommerce Bridge

SOLVE

I am building an integration for an Ecommerce site using the Hubspot Ecom Bridge (v2).

 

I am sending the following data:

 

First creating the CONTACT: 

 

 

{
    "storeId": "default",
    "objectType": "CONTACT",
    "messages": [
        {
            "action": "UPSERT",
            "changedAt": 1571817122335,
            "externalObjectId": "36",
            "properties": {
                "firstname": "fake",
                "lastname": "example",
                "email": "fake@example.com",
                "phone": ""
            }
        }
    ]
}

Then the DEAL

{
    "storeId": "default",
    "objectType": "DEAL",
    "messages": [
        {
            "action": "UPSERT",
            "changedAt": 1571817123335,
            "externalObjectId": "b861f650b17465fbd385fd2980d219d3",
            "properties": {
                "name": "Order: b861f650b17465fbd385fd2980d219d3",
                "stage": "checkout_completed"
            },
            "associations": {
                "CONTACT": [
                    "36"
                ]
            }
        }
    ]
}

And then tying them together with a LINE_ITEM.

{
    "storeId": "default",
    "objectType": "LINE_ITEM",
    "messages": [
        {
            "action": "UPSERT",
            "changedAt": 1571817124335,
            "externalObjectId": "29",
            "properties": {
                "price": 40,
                "num_items": 1,
                "tax_amount": 0
            },
            "associations": {
                "DEAL": [
                    "b861f650b17465fbd385fd2980d219d3"
                ],
                "PRODUCT": [
                    "RRE-001"
                ]
            }
        }
    ]
}

 

However checking the sync error log (via the api) i get the following error:

 

{
    results: [
        {
            portalId: 6580926,
            storeId: "default",
            objectType: "LINE_ITEM",
            externalObjectId: "29",
            changedAt: 1571817124335,
            erroredAt: 1571817122966,
            type: "INVALID_ASSOCIATION_PROPERTY",
            details: "Invalid associations [hs_assoc__deal_id: default__b861f650b17465fbd385fd2980d219d3]. Do those objects exist?",
            status: "OPEN"
        }
        
        // Old errors removed for brevity..
    ]
}

Invalid associations [hs_assoc__deal_id: default__b861f650b17465fbd385fd2980d219d3]. Do those objects exist?

 

Since i previously sent sync messages that would create these items, why am i getting this error saying that hte object does not exist.

 

 

The product is synced in hubspot, using the SKU as the "ID" which in this case is RRE-001.

0 Upvotes
1 Accepted solution
Guilty
Solution
Member

LINE_ITEM is not being synced in Ecommerce Bridge

SOLVE

Observation:

 

I have purposelly changed the timestamps to be 1000ms apart from eachother as i noticed that if all the sync messages are sent on basically the same timestamp it is unreliable(sometimes it works, sometimes not), but in this case i accidentally set the LINE_ITEM create timestamp into the future, which might be the reason it fails, can anyone from the API team @ hubspot confirm?

View solution in original post

1 Reply 1
Guilty
Solution
Member

LINE_ITEM is not being synced in Ecommerce Bridge

SOLVE

Observation:

 

I have purposelly changed the timestamps to be 1000ms apart from eachother as i noticed that if all the sync messages are sent on basically the same timestamp it is unreliable(sometimes it works, sometimes not), but in this case i accidentally set the LINE_ITEM create timestamp into the future, which might be the reason it fails, can anyone from the API team @ hubspot confirm?