php - Shopify - Retrieves multiple variant detail by multiple variant id
Is there any way to get multiple variant details using multiple variant id in single shopify call. Actually, I want to get price of all product variant which are listed in order using shopify call.
I know following way for get single variant detail using id
If you want the price of all the variants of a product, make one API call, and use the product ID. You'll get back all the variants, making it trivial to iterate through them to get prices.
At the moment of writing, you can only retrieve all variants for a product via Shopify API (https://shopify.dev/docs/admin-api/rest/reference/products/product-variant#index-2021-04).
If you're looking for retrieving unrelated, it's not possible via the API now.
But I think it's possible to submit multiple concurrent requests using a task queue or async requests. I'm also trying to speed up getting several variants at once.
Didn't find the answer?
Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.