Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
Is there a way to trigger something, that would change the allow overselling status with shopify flows, on variant level?
I think you want to change the overselling status on a product variant? The word "trigger" is confusing because that's what starts a workflow and not what does the action.
You would need to use Send HTTP Request to call the productVariantUpdate API, where you can set the inventoryPolicy field to "ALLOW"
https://shopify.dev/docs/api/admin-graphql/2024-01/mutations/productVariantUpdate#argument-input
Yes correct, i want to change the overselling status on product variant level.
Is that possible to do via flows?
I gave you the answer above. Use the Send HTTP Request action to call the API directly. You'll need to create an API key for your shop. There are a bunch of threads on the community about using Send HTTP Request.
Okay pretty close:
What to put in the body, to change the variants inventory policy to "allow overselling"
If you look at the CURL examples in the docs, it shows the syntax, which you can adjust. Here's an example (not tested):
{
"query": "mutation productVariantUpdate($input: ProductVariantInput!) { productVariantUpdate(input: $input) { productVariant { id title inventoryPolicy inventoryQuantity price compareAtPrice } userErrors { field message } } }",
"variables": {
"input": {
"id": "{{ productVariant.id }}",
"inventoryPolicy": "CONTINUE"
}
}
}
Great trying it out
Getting closer, but sadly i still seem to have some issues, do you have an idea?
I think you need to POST not GET.
Seem to have same issue, very strange, is it correct understood that i need to use the api from a private app?
Just double-checked against one I have working. Your key-value aren't specified correctly.
Hi again man,
Last issue 😛
Alright so i made it like you recommended, but i can still not find the problem here, as it still say some sh*t with the api is wrong.
Once again, it is correctly understood we get the api keys from the shopify private app correct?
Hope we can solve it like last time... 🙂
URL structure is:
https://<your-domain>.myshopify.com/admin/api/latest/graphql.json
I think you are missing the admin part
Alright, so far so good, i got it working to "Continue" allow overselling.
now i we got second flow, where i have a Condition, where it needs "Confirm" if "productvariant.inventoryquantity" if equal to a metafield value.
There does not seem to be a way in flows, to select the metafield value as "inventoryquantity", do you have a liquid code for this?
Or do i need a http signal once again to get the value and use it for a condition?
There is a release coming soon that will make this better (accessing metafield values). Currently you have two ways - use the metafield in the condition and compare that to the inventory quantity. You can also use Run code to do the comparison and return true/false from that, which you can they use in a condition.
Is there any ETA on that release?
I think we will use Run code to do the comparison.
Can you help with what inputs, outputs and code i should use here, to make it check if "Variantquantity" is the same as variant metafield "smartpack.po-qty"?
This example may help (its for converting tags to metafields and returns a list of metafields to set). https://github.com/Shopify/flow-code-examples/tree/main/run-code-examples/product-tags-to-metafields
Is there an easier way than doing it this way.
How to do way no 1 then, as a condition to make sure that the value of variants metafield value is the same as the inventory qty?
No eta on the release?
ETA - very soon, but some risk it gets delayed.
For option 1 you build a condition like you want to check the value of a metafield. There is a template in the library in Flow, or many threads here on how to do that. For the value field, click the <> in the field to add the inventory variable you want
Alright tried that, will test tomorrow, can you check?
Also we have a issue when checking for a value for a curtain meta field value, but it seems to check if just one of the variants in the order have that namespace, and another have that key, and another have a value.
What am i doing wrong?
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024