Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
Hello,
I aim to make my inventory quantity 0 (out of stock) if it reaches 10 stocks only.
This is to make sure we do not oversell when we drop new products.
I ran a flow but some of the reports were unsuccessful and I am stuck. Is it also possible that I can make the flow for only a specific product?
What can I do or edit to make this flow work?
I appreciate all the help and guidance!
This is my HTTP Request currently
Solved! Go to the solution
This is an accepted solution.
First of all, you need to ask the store owner for approval for the write_inventory scope. Currently, you can probably only read values, and the request is being blocked.
Regarding triggering it on a specific product, I think you can only trigger the flow when a product is added or its quantity changes. Even if you could use a webhook to trigger it, it would be triggered every time the product status changes.
So, use your implementation but add a filter inside the flow to run only if the product handle or ID matches the selected product.
If you need further assistance or additional changes, feel free to ask!
This is an accepted solution.
At your check permission page. Click edit button, tick up the inventory permissions here
And if you want to set this flow to particular product. Put a tag on the products. And then you can add a condition in the flow, if the product has the tag, then go to the set inventory action.
This is an accepted solution.
Use your implementation, but add if statements for specific products before it. Then, you can use a dynamic variable for the product/variant ID reference e.g. {{productVariant.id}}. Try different ways and pick the best one.
Example:
If you still need assistance, feel free to ask! Please check my answer as a solution if I helped you.
Hey @Bekind24
Do you ticked up write and read inventory permission for your custom app?
Hello Sonya!
Thank you for the reply! 🙂
These are the ones I ticked. What are the other things I am missing to tick?
I am not an expert in this and only followed some guidance in the community as well.
You need write_inventory scope. You have to be the store owner not only admin.
Here is the guide:
https://help.shopify.com/en/manual/shopify-flow/reference/actions/send-http-request
This is an accepted solution.
At your check permission page. Click edit button, tick up the inventory permissions here
And if you want to set this flow to particular product. Put a tag on the products. And then you can add a condition in the flow, if the product has the tag, then go to the set inventory action.
This is an accepted solution.
First of all, you need to ask the store owner for approval for the write_inventory scope. Currently, you can probably only read values, and the request is being blocked.
Regarding triggering it on a specific product, I think you can only trigger the flow when a product is added or its quantity changes. Even if you could use a webhook to trigger it, it would be triggered every time the product status changes.
So, use your implementation but add a filter inside the flow to run only if the product handle or ID matches the selected product.
If you need further assistance or additional changes, feel free to ask!
Hi Lynth!
Thank you for explaining thoroughly about the HTTP request and the trigger flow. I was able to make it work! I should just have ticked the write_inventory scope.
Now, I just need to figure out how should the body be written as I am going to be specific to 9 products only which will be launched tonight (since it is not ideal that other products' inventory quantity be affected).
How can I find the "inventory_item_id" to change it for each product? Or should I add another condition?
Thank you in advance!
This is an accepted solution.
Use your implementation, but add if statements for specific products before it. Then, you can use a dynamic variable for the product/variant ID reference e.g. {{productVariant.id}}. Try different ways and pick the best one.
Example:
If you still need assistance, feel free to ask! Please check my answer as a solution if I helped you.
Thank you for the big help Lynth!
This is what I have come up and hopefully, it is correct and will work 😄
I have added another condition (if any conditions are met) for product variant IDs
Great 🙂 It looks good
FYI, Flow now has a Send Admin API request action that handles scopes, API key, etc for you. Highly recommend using that in the future as it's way easier.
That sounds awesome! I will look further into this Admin API
Quick question for a similar situation... I need to (trigger) detect when variant inventory is updated, then (condition) if the variant's inventory is < 3, (action) I need to update the variant's inventory to 0.
I get how to do the trigger/conditional pieces in Flow. Might you be able to provide some guidance re: what the Http Request would look like? Thanks.
I think you would use the "Send Admin API request" action and call "inventoryAdjustQuantities". Details of the inputs are here: https://shopify.dev/docs/api/admin-graphql/2024-01/mutations/inventoryAdjustQuantities
One note - be careful that you don't create an infinite loop by running on inventory updated and then update inventory. You should check both the before and after quantity to prevent it from calling the action repeatedly.
Thanks. Only variants with inventory of 1 or 2 will be set to 0. If 3 or more, no change. This'll avoid recursive updates.
Sure you don’t want to use safety stock for this?
I'm curious how safety stock could help us in our overselling issue. Please elaborate.
We are experiencing overselling during launch day because of simultaneous multiple checkouts from customers
There's some more info here:
https://www.shopify.com/retail/safety-stock
You basically set an amount (10 in your case), and it won't allow people to buy more if the inventory goes below that level.
As 2024 wraps up, the dropshipping landscape is already shifting towards 2025's trends....
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024In today’s interview, we sat down with @BSS-Commerce to discuss practical strategies f...
By JasonH Nov 13, 2024