notableaddedShopify calls it: New
Add selling plans to draft order line items with the Admin GraphQL API
- Announced
- Tags
- GraphQL-Admin-API
- Severity
- notable, set by
reef/rss-rule-v1 - Source
- https://shopify.dev/changelog/add-selling-plans-to-draft-order-line-items-with-the-admin-graphql-api
Admin GraphQL API version 2027-01 adds selling plan support to draft orders. You can now apply a selling plan to a draft order line item and read back the applied plan. These fields are additive, so no action is required to keep your app working.
What's added
On the GraphQL Admin API, three new fields let your app work with selling plans on draft orders:
DraftOrderLineItemInput.sellingPlanIdsets the selling plan to apply when you create or update a draft order line item. This input field can apply todraftOrderCalculate,draftOrderCreate, anddraftOrderUpdate. Note that you can only attach selling plans to product variant line items.DraftOrderLineItem.sellingPlanApplicationreturns the selling plan applied to a line item on a saved draft order.CalculatedDraftOrderLineItem.sellingPlanApplicationreturns the applied selling plan on the calculated draft order, so you can preview the result before you save.
The following example applies a selling plan to a line item and reads back the applied plan:
mutation {
draftOrderCreate(input: {
lineItems: [{
variantId: "gid://shopify/ProductVariant/1",
quantity: 1,
sellingPlanId: "gid://shopify/SellingPlan/1"
}]
}) {
draftOrder {
lineItems(first: 1) {
nodes {
sellingPlanApplication { sellingPlanId name }
}
}
}
userErrors { field message }
}
}
Behavior to account for
- Only recurring and prepaid subscription plans are supported. Fixed-billing plans, such as pre-orders and try before you buy, aren't.
- B2B draft orders, custom line items, and price overrides on selling plan lines aren't supported.
draftOrderCompleteis not yet supported: callingdraftOrderCompleteon a draft that has a selling plan line item returns a user error and creates no order. You can send the draft order invoice to checkout viadraftOrderInvoiceSend.
Learn more about this change in our product changelog and help docs.
The text above is the source's. reef added the severity, the dates it could read from the text, and the endpoints and scopes named in code.