Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
We've been developing a mobile using the mobile buy SDK (Android and iOS).
We can't find a way to display the selling plan associated with a variant when querying orders, is it possible?
We can't find any property related to selling plans (or contracts) in the OrderLineItem query.
I was looking for the same today. I couldn't find it in the Rest API but they have it here in the order line item in GraphQL:
I'm using the MobileBuy SDK to make those API calls and I can't find the sellingPlan field in the GraphQL definition.
Also the field is not present in the documentation (https://shopify.dev/api/storefront/2023-01/objects/OrderLineItem).
Have you been able to do the query successfully?
Sorry I didn't grasp the you were using the Storefront API. I was referencing the Admin API (https://shopify.dev/api/admin-graphql/2022-10/objects/LineItem#field-lineitem-sellingplan).
Looking through the Storefront API it looks like they expose the selling plan allocation off the product so you could try to find it here: https://shopify.dev/api/storefront/2022-10/objects/SellingPlanAllocation
This property is how they display the selling plan details in liquid so I would check there.
That returns all the sellingPlans available on that product, not the one applied.
Can't even get it by using that in storeFront API.
Field 'sellingPlan' doesn't exist on type 'OrderLineItem'
Hey Lorenzo did you find a solution to this? I'm trying to access sellingPlan attached to the OrderLineItem, no luck.
Hi Araskavakli, no I didn't found a solution.
That's a shame. How do you build a headless customer account page and show an order with subscription otherwise?
End up finding a solution to this?
Unfortunately no.