Decrase inventory of product y when product x is bought

Hello,

we recently made a new Product. The product variants contain another product. So we have product X which contains product Y. If product X is bought the product Y stock should be decreased by 1 either. But if product Y is bought product X stock shall not be decreased by 1. We are using the App connected Inventory but the problem is, even with “Bundles” product X stock gets decreased if product Y is bought. I was looking for a solution using the shopify Flow app. But I was not able to find a solution, where I can decrease the inventory quantity of a product.

Is there a possibility to create such a workflow, where the inventory quantity of 1 product is decreased when another product is ordered?

kindest regards

Niclas

You would need to use Send HTTP Request with this mutation: https://shopify.dev/api/admin-graphql/2022-10/mutations/inventoryAdjustQuantity to make that adjustment in Flow.

Hello Paul,

thank you for your answer. To do this http request I need furture help. I need to set a URL and Headers as Key and Value. I don`t know which values I need to set for them.

See: https://shopify.dev/api/admin-graphql

The CURL samples best show the headers you need to send.

But I also dont know which URL to set. I never worked with these API Calls. If anybody could provide me further help I would really aprecciate this.

I tried to get this http request work, but I still get errors.

I dont know what key and value I have to place in here as I already have the headers in the http code.

I also selected “Post” as http Method like it says in the code.
I am really new to http requests. I hope you can help me further so I can make this work.

See the -H lines for what key values you need.

For example:

key: Content-Type

value: application/json

I’d recommend using Postman or something like that to test it first. Once it’s working, move it to Flow.