Hi there, I want to get which selling plan associate with the product variants using storefront graphql API, I have already gotten the selling plan groups for the product, but not able to get which plan is associated with product variants. also, I have tried the “sellingPlanAllocations” (Ref :- https://shopify.dev/api/storefront/2022-04/objects/SellingPlanAllocation) connection but it gives me an error “Field ‘sellingPlanAllocations’ doesn’t exist on type ‘ProductVariant’”.
Here is my storefront graphql code (i am not able to put whole code here so i add shorter version)
and the code gives me an error: message: “Field ‘sellingPlanAllocations’ doesn’t exist on type ‘ProductVariant’” please provide me a way to fix this. Thanks
In the 2022-04 version you linked there is a **ProductVariant.**sellingPlanAllocations connection, but it requires an argument, and there’s no id field on the SellingPlanAllocation.
The sellingPlanAllocations also are not included on the admin API’s ProductVariant, which uses the SellingPlanGroups instead. Is it possible you have the wrong endpoint?
Hopefully that helps, but if you continue to see an unexpected result could you share the endpoint, your full query, and the X-Request-ID value from the response’s headers so I can take a closer look?
Hi JamesG,
Thanks for reply.
I am using 2022-04 API Version.
Can you please send me example of the “sellingPlanAllocations” query with product variant?
Thanks.