Shopify themes, liquid, logos, and UX
{'errors': [{'message': 'Variable $input of type DraftOrderInput! was provided invalid value for lineItems.0.selling_plan_id (Field is not defined on DraftOrderLineItemInput)', 'locations': [{'line': 2, 'column': 31}], 'extensions': {'value': {'email': 'test@test.com', 'lineItems': [{'variantId': 'gid://shopify/ProductVariant/1111111111', 'quantity': 2, 'selling_plan_id': 'gid://shopify/SellingPlanGroup/11111111111'}]}, 'problems': [{'path': ['lineItems', 0, 'selling_plan_id'], 'explanation': 'Field is not defined on DraftOrderLineItemInput'}]}}]}
Hey @AndrewVINSI,
This error occurs because the Shopify GraphQL API doesn't support adding selling plans directly to draft orders through the selling_plan_id field on DraftOrderLineItemInput.
The DraftOrderLineItemInput type doesn't have a selling_plan_id field, which is why you're getting the "Field is not defined" error. This is a limitation of Shopify's draft order API.
If possible, bypass draft orders entirely and create orders directly with selling plans:
mutation orderCreate($order: OrderInput!) { orderCreate(order: $order) { order { id name } userErrors { field message } } }
With variables:
{ "order": { "lineItems": [ { "variantId": "gid://shopify/ProductVariant/1111111111", "quantity": 2, "sellingPlanId": "gid://shopify/SellingPlanGroup/11111111111" } ], "email": "test@test.com" } }
As a temporary workaround, you could store the selling plan ID in custom attributes and handle it in your order processing:
{ "input": { "email": "test@test.com", "lineItems": [ { "variantId": "gid://shopify/ProductVariant/1111111111", "quantity": 2, "customAttributes": [ { "key": "selling_plan_id", "value": "gid://shopify/SellingPlanGroup/11111111111" } ] } ] } }
The most straightforward approach is to use the Orders API directly if your use case allows it, as it has proper support for selling plans. If you specifically need draft orders, you'll need to handle the selling plan application as a separate step after order creation.
Hope this helps!
Shubham | Untechnickle
Helping for free: hello@untechnickle.com
Don't forget to say thanks, it'll make my day - just send me an email!
Get Revize for Free | Let your shoppers edit orders post-purchase | Get Zero Support Tickets | #1 Order Editing + Upsell App
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025