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:
sets the selling plan to apply when you create or update a draft order line item. This input field can apply to,, and. Note that you can only attach selling plans to product variant line items.returns the selling plan applied to a line item on a saved draft order.returns 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 }
}
}
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.
is not yet supported: callingon 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 via.
Learn more about this change in our product changelog and help docs.
Was this page helpful?