Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Re: webhook product update does not return the inventory_management field

webhook product update does not return the inventory_management field

tuanhd-valuence
Visitor
1 0 3

webhook poroduct update version 2024-07 does not return the inventory_management field
https://shopify.dev/docs/api/admin-rest/2024-07/resources/webhook#event-topics-products-update

but 

webhook poroduct update version 2024-04 does return the inventory_management field
https://shopify.dev/docs/api/admin-rest/2024-04/resources/webhook#event-topics-products-update

Screenshot 2024-07-08 at 14.15.05.pngScreenshot 2024-07-08 at 14.21.13.png

 

Replies 14 (14)

jne
Shopify Partner
8 0 12

I ran into this too.   Just spend hours debugging a problem in our app and it looks like I'm hitting the exact thing you refer to -- inventory_management missing in the latest webhook version.  Would love to see this addressed.

 

-Jeff

 

GetAllTool
Shopify Partner
37 0 7

We also need this field, or please return the availableForSale field in the webhook

matbra
Shopify Partner
1 0 1

We ran into this too. We need this property or at least a substitution for it. Since its value was based on the "Track quantity"-Checkbox in the shopify-Admin it was an indicator for our app to trust the inventory quantity we get with the webhook or not. Because it was removed our app doesn't work as expected anymore. Only solution so far is to switch back to version 2024-4.

markko
Shopify Partner
17 0 4

We also have issues due to this change. We are a sales channel app and with this change, products are oversold, which already caused problems to our merchants. Also had to go back to webhooks version 2024-04 again... We want to go to 2024-07 as soon as possible though, so that we can enable discounts for the draft order that our sales channel creates. Please help us with this.

- Did my answer help? Mark my post with a Like.
- Did I solve your problem? Mark my post as an Accepted Solution.

- Co-Founder of Shopify App Claimbase, that lets you sell directly through your Instagram page thanks to instant checkout links.
jne
Shopify Partner
8 0 12

I went back to 2024-04 webhooks for now.  I submitted a ticket about this to Shopify customer support yesterday.  Will let you folks know if I here back with anything.

 

 

markko
Shopify Partner
17 0 4

Yeah, we went back too...

That would be awesome, thank you, appreciate it!

- Did my answer help? Mark my post with a Like.
- Did I solve your problem? Mark my post as an Accepted Solution.

- Co-Founder of Shopify App Claimbase, that lets you sell directly through your Instagram page thanks to instant checkout links.
jne
Shopify Partner
8 0 12

woops.  typo.  Hear back not here back.

jne
Shopify Partner
8 0 12

I received a response from Shopify tech support on this.

 

They basically said:

 

1) The inventory_management in the webhook was removed as part of the separation of products/variants and inventory in their object model.

2) Covered in this release note -- https://shopify.dev/changelog/product-variant-field-cleanup

3) They suggest using GraphQL rather than REST APIs in general going forward (no surprise).
4) We can use the products/update along with the inventory inventory_items/update webhooks, but they admit this might be complicated dance to coordinate the information for a variant.
5) They suggest instead a better approach may be to call the GraphQL API to get inventory info from the webhook callback to find out whether inventory is being tracked for a variant.  It's unfortunate to have to make the call, but their claim is GraohQL calls are much cheaper/more performant than REST API calls
6) If all of this ends up being too painful and a blocker, then I should reach out to support again to see if there are other options to explore.

 

-Jeff

 

GetAllTool
Shopify Partner
37 0 7

I think querying via Graphql is quite unnecessary, considering the huge amount of products/update webhook calls, it would be a huge waste of resources to have to query via Graphql every time

Jonathan-HA
Shopify Partner
339 26 109

I agree, those API requests add up when you have a lot of users and many update/create events constantly getting triggered.  We've rolled back to the 2024-04 version of the webhook for now as well.  Hope Shopify reconsiders this change.

Co-Founder / Developer at Highview Apps
Our Shopify Apps: EZ Exporter | EZ Inventory | EZ Importer | EZ Notify | EZ Fulfill
anitaShopify
Shopify Staff
5 0 6
Hey all, FYI we are looking into this, let us get back to you ASAP - just
wanted to let you know that this is on our radar!
anitaShopify
Shopify Staff
5 0 6

Hey all! This was documented in the changelog: https://shopify.dev/changelog/product-variant-field-cleanup. TLDR: you should subscribe to inventory_items/{} topics and use the `tracked` field in the webhook payload.

jne
Shopify Partner
8 0 12

I've looked into doing that but it is really messy.   Depending on which order the webhooks get fired/picked up by my code, I can end up with an inventory id that I don't yet have a product variant for (so I just have to store it in my local db expecting I'll get a variant later) or I can end up with an variant where I don't immediately know whether the inventory is tracked -- so I have to defer actions til I eventually get the inventory_items webhook.  And I have to coordinate the timestamps of the product and the inventory_management webhooks to see who is more recent whether they correlate to the same change, etc.   Probably possible, but definitely a royal pain to get consistently right

 

It used to be a piece of cake.

 

-Jeff

 

markko
Shopify Partner
17 0 4

I have to agree to Jeff. We run an app that creates draft orders based on comments and DMs on Instagram, which is often highly time sensitive. We have thought of ways we could get around the latest changes. The only solutions we came up with would make the experience for merchants and their customers significantly worse.

 

@anitaShopify , do you already have an indication on how Shopify wants to proceed with this topic?

 

Thank you!

- Did my answer help? Mark my post with a Like.
- Did I solve your problem? Mark my post as an Accepted Solution.

- Co-Founder of Shopify App Claimbase, that lets you sell directly through your Instagram page thanks to instant checkout links.