For discussing the development and integration of subscription-enabled shops using Shopify's Subscription APIs.
We are facing a very strange API issue, when trying to query for LineItemSellingPlan property of LineItems, because as soon as the SellingPlan is edited, the property will remain "null", even when the name is clearly visible!
Steps for reproduction with Conjured Memberships app
1. I have installed the app on my dev store
2. Set up a subscription plan in Conjured Membership app.
3. Checkout in the storefront and subscribe to a daily Order. Order does come in (for example order ID: 5151690555641)
3. We want to query LineItemSellingPlan https://shopify.dev/api/admin-graphql/2023-01/objects/LineItemSellingPlan via GQL API and read it's sellingPlanId property. Allow me to demonstrate query:
query {
order(id: "gid://shopify/Order/5151690555641") {
lineItems(first: 1) {
edges {
node {
id
sellingPlan {
name
sellingPlanId
}
}
}
}
}
}
I get the result:
{ "data": { "order": { "lineItems": { "edges": [ { "node": { "id": "gid://shopify/LineItem/12847052456185", "sellingPlan": { "name": "Subscription, Delivery every day", "sellingPlanId": null } } } ] } } } }
Notice the "name" property is there in the GQL response! But sellingPlanId is "NULL" (regardless of API version) but the subscription is definitely still active every day, and the link is shown on the order page correctly (as evidenced by the screenshot below "View Subscription").
There is almost certainly a bug on the API side, because we contacted app developers, Conjured, as well and they couldn't find anything wrong with setups on our or their side, and the strange fact is, we setup another Subscription Plan, and orders that come through that subscription, for example 5151777325305, sellingPlanId is returned by the GQL API!
{ "data": { "order": { "lineItems": { "edges": [ { "node": { "id": "gid://shopify/LineItem/12847212757241", "sellingPlan": { "name": "Normal Weekly - $10 billed every 1 week", "sellingPlanId": "gid://shopify/SellingPlan/3874488569" } } } ] } } } }
Is there any explanation of why the first order's sellingPlanId is "NULL" (and name is populated!?), while seconds works as expected?