Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
Hi,
Is there any way to update the quantity of specific products using Shopify Flow? not looking to use any 3rd part apps.
e.g. Trigger happened >> set the quantity for a specific product to 100.
I don't want to hide/unhide the product, I just want to auto-update the inventory.
is it possible by using flow, I searched on all templates and couldn't find one.
Thanks
Solved! Go to the solution
This is an accepted solution.
Thanks, Lily for your help, although it wasn't exactly what I was looking for, it did lead me in the right direction and I was able to find a solution that worked for me. I appreciate your assistance.
In case anyone looking for the same thing here is what worked for me:
use Post instead of Put, and use this URL to set the inventory level:
https://your-development-store.myshopify.com/admin/api/2023-01/inventory_levels/set.json
Body:
{"location_id": 213334567,"inventory_item_id": 12345467789,"available":33}
Hi,
We do not have a Flow action to do that yet. However, if you have some technical skills, you could do that now by calling the Shopify admin API to update the product inventory. We don't have any plans yet to add this action short-term, but we've made a note that you are looking for it.
Hope this helps.
Lily
To learn more visit the Shopify Help Center or the Community Blog.
BTW, in order to help prioritization of this request, I suggest that you add a request at the merchant frustration
To learn more visit the Shopify Help Center or the Community Blog.
Thanks, Lily,
Do you mean using shopify admin API + Shopify Folw? or this could be done usnig Shopify Admin API alone?
would appreciate it if you could share some more example in what I should connect Shopify Admin API to?
Thanks
Yes, I do mean to use Shopify admin API + Shopify Flow.
BTW, the previous link I gave you is GraphQL API, which I don't think can easily used by you. Instead, you should use the REST API . The API has details on the header you need as well in the example:
```
curl -d '{"variant":{"id":808950810,"metafields":[{"key":"new","value":"newvalue","type":"single_line_text_field","namespace":"global"}]}}' \
-X PUT "https://your-development-store.myshopify.com/admin/api/2022-10/variants/808950810.json" \
-H "X-Shopify-Access-Token: {access_token}" \
-H "Content-Type: application/json"
```
In order to get an `access_token`, you could follow this instruction.
You could use the `Send HTTP Request` action in Flow. So, the flow would look something like this:
To learn more visit the Shopify Help Center or the Community Blog.
Thank you, Lily, for your helpful insight and support. I am still encountering below error, even after changing "newvalue" to "100" as the desired quantity setting and attempting to leave "newvalue" as is, still get the same error.
This is an accepted solution.
Thanks, Lily for your help, although it wasn't exactly what I was looking for, it did lead me in the right direction and I was able to find a solution that worked for me. I appreciate your assistance.
In case anyone looking for the same thing here is what worked for me:
use Post instead of Put, and use this URL to set the inventory level:
https://your-development-store.myshopify.com/admin/api/2023-01/inventory_levels/set.json
Body:
{"location_id": 213334567,"inventory_item_id": 12345467789,"available":33}
Nice! Though I was no expert on the admin API, I was happy to have helped. 🙂
To learn more visit the Shopify Help Center or the Community Blog.
Thanks buddy, this helped so much!! Just want to add some additional info for other noobs like me! 🙂
To get API Access Token I followed this: https://mixedanalytics.com/knowledge-base/get-your-shopify-access-token/
Location Id: Go to Shopify Settings and select the location, you can find the location ID in the URL.
Inventory Item ID: I used {{productVariant.inventoryItem.legacyResourceId}}
Available: Input number for desired inventory amount to insert.
For me it looked something like this (I wanted to set quantity to 0 based on my conditions):
{"location_id": 213334567,"inventory_item_id": {{productVariant.inventoryItem.legacyResourceId}},"available": 0}
Bonus Tip: I setup an internal email action at the end to also notify me every time the flow automation set a product inventory to 0.
Hello Mussty,
For example can you set a rule when the stocklevel is 2 you let shopify flow edit it to 0?
I would like that or do you not have something like this?
Kind regards
Stan Legebeke
Hi Stan, I have done exactly this, for me when stock level reaches 3 or less I overide stock level to 0 with shopify flow using the method above. I cant open flow on my phone with full view, I will reply tomorrow with a screenshot from my laptop on how how I did it.
Thankyou, that is exactly what I am looking for.
Thanks in advance.
Hi Stan, no worries at all!
Here is how my flow automation is set up: I will probably remove the email at the end as it gets annoying. I set it up just to see if it was working as intended.
Send HTTP Request setup:
Email Setup:
If you follow the rest it should be easy to set up.
Thanks a lot, I will implement it and hope it reduces a lot of issues when product stock is low.
Hello Mussty,
I have been working on this for a few days, but can't seem to get it to work. I want to create a flow that adjusts the inventory of an item once monthly, when I run the flow it get
{"errors":"Not Found"}
Same thing when I follow the link itself. Not sure what is wrong, I believe I followed everything mentioned in the thread. Were there any other steps you took?
Bit of a noob, appreciate any help!
You are getting that on the Send HTTP Request? I think it would help to see your configuration but my first guess is that you are using the wrong ID to set inventory.
Hi Paul, yes that's right. Attaching the configuration and exact error below.
{"status":404,"response_body":"{\"errors\":\"Not Found\"}","verb":"POST","url":"https://your-store.myshopify.com/admin/api/2023-01/inventory_levels/set.json","request_body":"{\"location_id\": xyz,\"inventory_item_id\": xyz,\"available\":5}\n\n"}
Thanks in Advance!
Are you sure the ID's match? Probably doesn't matter but remove any whitespace after the string, since I see 2 newlines. Is neither of those work, try it with postman or some API client to get it working.
Hi Paul, when you are referring to ID do you mean Store ID, inventory ID, or Location ID? I have a feeling that the URL is the problem as its giving a 404 and I was actually able to accidentally access the login page of other stores with the same API. I have checked the Store ID several times to ensure it is accurate.
Hi!
Really appreciate the help I got here!
BBPT I was stuck on with the same 404 error and you might have the same issue.
Note that the "inventory_item_id" is not the same value as the variant ID you can pick up on the product/variant page link.
I used Matrixify to retrieve the variables I needed but you can also get via API.
You can use /adjust to add or subtract a quantity instead of setting a value.
Hope this helps!
User | RANK |
---|---|
3 | |
2 | |
2 | |
2 | |
2 |
Transform this holiday season into a shopping spree. Plus, learn how to effortlessly open ...
By Jasonh Dec 8, 2023Make the shift from discounts to donations, and witness your business not only thrive fina...
By Holly Dec 4, 2023On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023