For discussing the development and integration of subscription-enabled shops using Shopify's Subscription APIs.
I have asked this before, and I am not sure I ever got an answer.
When Shopify bundles up a product and sends it the subscription create code, it only ever sends the product ID not the variant ID. If a product has only one variant why is that not included in the payload? Anytime I use the mutation sellingPlanGroupCreate I am expected to provide a variant ID and it seems like Shopify is making that difficult. Am I wrong? Here is my console log, so if anyone has any filler info on this, I would appreciate what I am missing here. Must be something obvious.
Solved! Go to the solution
This is an accepted solution.
Hi, just to be clear, you are talking about extensions on the product details page, is that correct?
After investigating, I confirmed that the presence of the variant id depends on which page you are.
Detailed behaviors of these extension points were implemented as follows:
- Product admin page `e.g. https://example.myshopify.com/admin/products/12345`
- Variant admin page `e.g. https://example.myshopify.com/admin/products/12345/variants/6789`
We also realized that this information is not documented anywhere. We will update the page accordingly.
Hope this helps!
To learn more visit the Shopify Help Center or the Community Blog.
Hi,
Would you mind offering me the mutation that doesn't return the variant ID so I can have a closer look?
Thanks!
To learn more visit the Shopify Help Center or the Community Blog.
I don't think you understand. This is an internal Shopify Subscription extension API issue. Shopify supplies data about the product for creating a subscription to the extension, and I am seeing it send a product ID but NO variant ID. Therefore when I want to USE a mutation like the one I pointed out, I do not have the information I need from Shopify. Can you explain why that is? Why do I not get a variant ID here? And how does this work when there are > 1 variants and we want to set a subscription against only 1 of many variants?
Shopify is lacking a lot of clarity here it seems?
This is an accepted solution.
Hi, just to be clear, you are talking about extensions on the product details page, is that correct?
After investigating, I confirmed that the presence of the variant id depends on which page you are.
Detailed behaviors of these extension points were implemented as follows:
- Product admin page `e.g. https://example.myshopify.com/admin/products/12345`
- Variant admin page `e.g. https://example.myshopify.com/admin/products/12345/variants/6789`
We also realized that this information is not documented anywhere. We will update the page accordingly.
Hope this helps!
To learn more visit the Shopify Help Center or the Community Blog.
One thing does not really make sense here, and it seems like an undercooked turkey in the oven, bear with me, I may be wrong... you have a case where the variant is selected, for example the variant admin page versions. However, when only the default variant exists, that has no analog. Why not? If I say "create me a plan", from this aspect, I do not get the luxury of having the variantId? Seems like an oversight remains.
But yes, thanks for more clarity as per that above explanation.
I see, so the ask here is to include the default `variantId` when product doesn't have variants.
I will take your feedback back to the team!
To learn more visit the Shopify Help Center or the Community Blog.
I think it makes sense this ask. So I appreciate your understanding here! Thanks.