Focusing on managing products, variants, and collections through the API.
Hi!
We're integrating now existing Shopify store into one of our applications that already has some product info in there.
What we need is to match our products with the ones in existing Shopify store.
What we can use to match those is the SKU of a variant.
Is there a way to query this directly using Storefront API?
So far my best guess is not, but answers are from few years back: https://community.shopify.com/c/products-variants-and/could-i-query-a-productvariant-by-id-of-the-va...
maybe something changed in the meantime and it's possible now?
Thanks a lot!
Solved! Go to the solution
This is an accepted solution.
Hey @marbor3
If I'm understanding correctly you want to look up a product by SKU? Right now that's not possible with the Storefront API but it is possible with the Admin API. Depending on the number of products it could be worth using the Admin API to create a map.
{
productVariants(first: 10, query: "sku:ABC12345") {
nodes {
id
}
}
}
Scott | Developer Advocate @ Shopify
This is an accepted solution.
Hey @marbor3
If I'm understanding correctly you want to look up a product by SKU? Right now that's not possible with the Storefront API but it is possible with the Admin API. Depending on the number of products it could be worth using the Admin API to create a map.
{
productVariants(first: 10, query: "sku:ABC12345") {
nodes {
id
}
}
}
Scott | Developer Advocate @ Shopify