APIs & Integrations

eibach-cv
Contributor

Custom Product Property Not Updating via Ecommerce Bridge API

SOLVE

I created a custom product property named "availability" in Hubspot via Data Management > Properties which is showing when I view a product

eibach-cv_0-1619458381876.png

I checked it via the get product properties endpoint and have verified it is there

eibach-cv_1-1619458465723.png

And defined it in my mapping settings

eibach-cv_2-1619458496344.png

But after running an update to a product, it is not showing up on Hubspot. My API call is below:

{
            "storeId": "eib-wsm",
            "objectType": "PRODUCT",
            "messages": [
                {
                    "action": "UPSERT",
                    "externalObjectId": "438",
                    "properties": {
                        "availability": "OUT_OF_STOCK",
                    },
                    "associations": {

                    }
                }
            ]
        }
1 Accepted solution
Willson
Solution
HubSpot Employee
HubSpot Employee

Custom Product Property Not Updating via Ecommerce Bridge API

SOLVE

Hey @eibach-cv ,

 

I think there is an issue with validation in relation to the associations. I've just re-tested the request but removed the associations parameter and it's worked. See my payload here:

{
  "storeId": "eib-wsm",
  "objectType": "PRODUCT",
  "messages": [
    {
      "action": "UPSERT",
      "externalObjectId": "438",
      "properties": {
        "availability": "OUT_OF_STOCK"
      }
    }
  ]
}

 

Can you test the above snippet on another object to see if this works for you? Thanks

 

Product Manager @ HubSpot

View solution in original post

0 Upvotes
13 Replies 13
Willson
Solution
HubSpot Employee
HubSpot Employee

Custom Product Property Not Updating via Ecommerce Bridge API

SOLVE

Hey @eibach-cv ,

 

I think there is an issue with validation in relation to the associations. I've just re-tested the request but removed the associations parameter and it's worked. See my payload here:

{
  "storeId": "eib-wsm",
  "objectType": "PRODUCT",
  "messages": [
    {
      "action": "UPSERT",
      "externalObjectId": "438",
      "properties": {
        "availability": "OUT_OF_STOCK"
      }
    }
  ]
}

 

Can you test the above snippet on another object to see if this works for you? Thanks

 

Product Manager @ HubSpot
0 Upvotes
eibach-cv
Contributor

Custom Product Property Not Updating via Ecommerce Bridge API

SOLVE

That worked!

 

So my understanding is there should never be an associations parameter in a request if there are no values for it?

 

Thank you all for the help.

0 Upvotes
MichaelC
Guide | Partner
Guide | Partner

Custom Product Property Not Updating via Ecommerce Bridge API

SOLVE

@eibach-cv  well, now we have a bug (or similary) and we have done our best to find out what is wrong.

 

@natsumimori please get in touch with the product team through your internal channels to investigate why custom properties within the Ecommerce Bridge API and /v2/sync/messages does not work when updating. Se above thread for more info. 



Need further help with integrations or business development?



Want to help me?

Go to the following links and read through the ideas. If you like them - give the idea an upvote

Upvote the following ideas:

Willson
HubSpot Employee
HubSpot Employee

Custom Product Property Not Updating via Ecommerce Bridge API

SOLVE

Hey @MichaelC , thanks for the extensive digging on this one - @natsumimori has reached out to me now to take a look into this one for you guys!

 

@eibach-cv are you able to DM me your Portal ID that you're using with the Ecomm Bridge? I assume you're not using a Developer App to work with the bridge, if you are, can you forward along the App ID. 

 

Thanks

Product Manager @ HubSpot
eibach-cv
Contributor

Custom Product Property Not Updating via Ecommerce Bridge API

SOLVE

@Willson 

Will do!

0 Upvotes
MichaelC
Guide | Partner
Guide | Partner

Custom Product Property Not Updating via Ecommerce Bridge API

SOLVE

@eibach-cv  did you run the sync errors api to see if any error code showed up there?

GET https://api.hubapi.com/extensions/ecomm/v2/sync/errors



Need further help with integrations or business development?



Want to help me?

Go to the following links and read through the ideas. If you like them - give the idea an upvote

Upvote the following ideas:

0 Upvotes
MichaelC
Guide | Partner
Guide | Partner

Custom Product Property Not Updating via Ecommerce Bridge API

SOLVE

@eibach-cv 

 

Thats an old version of the API. If I read up correctly you should now update the products and its properties directly in the v3 api > objects > products.

 

https://developers.hubspot.com/docs/api/crm/products

In the overview description: 

For B2C users, these endpoints allow you to list available products on your website through HubSpot. You can also personalize your product library for each visitor using smart content

 

What you are looking for:

PATCH /crm/v3/objects/products/{productId}

 

There are also batch solutions for working with many products at the same time. For instance searching all object with the property availability = OUT_OF_STOCK or objects (products) with a certain store id. 

 

Everything you need should be found in v3 docs. 

 

If that doesnt help you - please get back to this thread and we can discuss options further. Me myself use v3 objects products to code solutions towards b2b and I know it works smooth and good. 🙂 

 

Michael

 



Need further help with integrations or business development?



Want to help me?

Go to the following links and read through the ideas. If you like them - give the idea an upvote

Upvote the following ideas:

0 Upvotes
eibach-cv
Contributor

Custom Product Property Not Updating via Ecommerce Bridge API

SOLVE

@MichaelC 

Are you sure I should be using v3 with the eCommerce Bridge API? On the ecommerce bridge landing page it doesn't mention anything about v3, only v1 and v2: https://developers.hubspot.com/docs/api/marketing/ecomm-bridge.

 

In those v3 docs, I don't see where you define a store id, which makes me think it doesn't work with ecommerce bridge.

MichaelC
Guide | Partner
Guide | Partner

Custom Product Property Not Updating via Ecommerce Bridge API

SOLVE

@eibach-cv 

 

Nope, e-commerce api is news to me. So when you make a PUT call with above json, nothing happens in the CRM? Help me understand the problem further. 



Need further help with integrations or business development?



Want to help me?

Go to the following links and read through the ideas. If you like them - give the idea an upvote

Upvote the following ideas:

0 Upvotes
eibach-cv
Contributor

Custom Product Property Not Updating via Ecommerce Bridge API

SOLVE

@MichaelC 

 

Correct, the products don't get a value assigned to the "availability" property, it is left blank and no errors show up. All other properties (that aren't custom) have the correct values assigned.

eibach-cv_2-1619540213708.png

 

eibach-cv_1-1619540153370.png

 

 

0 Upvotes
MichaelC
Guide | Partner
Guide | Partner

Custom Product Property Not Updating via Ecommerce Bridge API

SOLVE

@natsumimori @eibach-cv 

 

I dont really get your api call fully. You write that you are using products and endpoint update reference: https://developers.hubspot.com/docs/api/crm/products.

I do not understand the messages array - why whould the property be a part of the messages? I think the solution might be to move the properies object to an later stage (se picture below)  of the code removing it from the messages array. But it might be due to lack of understanding your code fully. Please explain more in the URL you call and the method you use together with the full json of the call (as above). 

 

MichaelC_0-1619518521602.png

 

Michael

 



Need further help with integrations or business development?



Want to help me?

Go to the following links and read through the ideas. If you like them - give the idea an upvote

Upvote the following ideas:

eibach-cv
Contributor

Custom Product Property Not Updating via Ecommerce Bridge API

SOLVE

@MichaelC wrote:

why whould the property be a part of the messages?


That is where it's supposed to be according to the ecommerce bridge API: https://legacydocs.hubspot.com/docs/methods/ecommerce/v2/send-sync-messages

 

URL: /extensions/ecomm/v2/sync/messages?hapikey=****

Method: PUT

The full JSON is what I wrote in this post.

natsumimori
Community Manager
Community Manager

Custom Product Property Not Updating via Ecommerce Bridge API

SOLVE

Hi @eibach-cv , thank you for reaching out to the HubSpot Community.

 

@MichaelC and @LPM , would you mind sharing your advice for @eibach-cv ?