Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

How to get selling plan associated with an order line item?

How to get selling plan associated with an order line item?

Lorenzoliveto
Shopify Partner
11 0 7

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.

Replies 10 (10)

jsullivan5
Shopify Partner
3 0 2

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:

jsullivan5_0-1659050732321.png

 

Lorenzoliveto
Shopify Partner
11 0 7

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?

jsullivan5
Shopify Partner
3 0 2

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.

 

MihailStoica96
Visitor
3 0 0

That returns all the sellingPlans available on that product, not the one applied.

MihailStoica96
Visitor
3 0 0

Can't even get it by using that in storeFront API.

Field 'sellingPlan' doesn't exist on type 'OrderLineItem'

araskavakli
Tourist
6 0 2

Hey Lorenzo did you find a solution to this? I'm trying to access sellingPlan attached to the OrderLineItem, no luck.

Lorenzoliveto
Shopify Partner
11 0 7

Hi Araskavakli, no I didn't found a solution.

araskavakli
Tourist
6 0 2

That's a shame. How do you build a headless customer account page and show an order with subscription otherwise?

Kalen_Jordan
Shopify Partner
779 36 139

End up finding a solution to this?

araskavakli
Tourist
6 0 2

Unfortunately no.