I’m running into a frustrating issue with the draftOrderCreate
mutation.
Some of my merchants sell products that have subscriptions enabled, but one-time purchases are also allowed. These products have requiresSellingPlan: false
and display both options on the storefront.
Here’s the problem:
- If I submit a draft order like this:
"lineItems": [
{
"variantId": "gid://shopify/ProductVariant/49330574819602",
"quantity": 1
}
]
I get this error:
“Failed to create managed assignment”
- But if I try including the
sellingPlanId
explicitly:
"lineItems": [
{
"variantId": "gid://shopify/ProductVariant/49330574819602",
"quantity": 1,
"sellingPlanId": "gid://shopify/SellingPlan/691514343698"
}
]
Then I get:
“Field is not defined on DraftOrderLineItemInput”
It seems like draft orders don’t support subscriptions — fair — but they also fail even when no subscription is required. This makes it impossible to submit draft orders for products that support subscriptions but don’t require them.
Has anyone found a workaround for this?
I’ve contacted Shopify Partner Support and they confirmed that subscriptions aren’t supported in draft orders. But in this case, I’m not trying to submit a subscription order — I just want to place a one-time purchase for a product that happens to have a selling plan available.
Any advice or insight is appreciated.
Thanks,
Neil
1 Like
Hey @Neil_Magnuson!
I just tested this on my store with a product that can sell with or without a subscription and I was able to create the draft order.
The error Failed to create managed assignment
seems related more to the inventory or location of the product. Can you share more details on how this is configured for this product? I’ll set up my product the same way and see if I can replicate the same error on my end. The x-request-id from your request returning this error will help as well if I need to consult our logs.
Hey Kyle!
Thanks, I appreciate you taking a look.
I’m an app dev running an influencer gifting app, a main function is submitting draft orders. This is from one of my client’s shops, so I don’t have access to the full product configuration or inventory/location setup.
You are right that subscriptions are not the problem.
I am trying to recreate this error, and so far determined its not bundles nor subscriptions, so I’m thinking it might be “managed markets” or something weird with inventory location., like you said.
Here is what I believe is the x-request ids of the orders in question: 2wVE6hCo5ZX54WFfjHiV3SGN7e6. Here is another one: 2wVE6eAYzCkU7a6edQXBfSmqFu9.
I also dont have “read_inventory” to get the inventory data about this product.
I appreciate your help in determining what is causing this error.
Thanks for that additional context Neil!
As suspected, the error does appear to be inventory related, and is not expected. Our team is looking in to this further. I’ll let you know once we have any updates.
Thank you Kyle! please let me know what the team finds!
1 Like