Draft Order Fails "Failed to create managed assignment" error

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

Hey Neil, closing the loop on this issue. This should be resolved now. Have you seen any new instances of this occurring? I’ll mark it as solved for now, but do let me know if you’re still seeing issues here.

1 Like

Hey Kyle you’re right it has not been happening anymore.

Neil

1 Like

Awesome! Thanks for confirming. :clinking_beer_mugs:

Hey Kyle,

I’ve been getting a new error more frequently, it seems intermittent: Error finding/creating LedgerDocument. shop_id=27274575990, document_uri=gid://shopify/DraftOrder/1517728727372. When I resubmit it works fine. Here are the details:

We’re seeing intermittent failures when calling the draftOrderCreate mutation. The response returns:


{"data":{"draftOrderCreate":{"draftOrder":null,"userErrors":[{"field":null,"message":"Error finding/creating LedgerDocument. shop_id=27274575990, document_uri=gid://shopify/DraftOrder/1517728727372"}]}}}

This happens sporadically — typically multiple requests in the same minute — and when we immediately retry the exact same mutation, it succeeds without any changes.

Here are some recent examples:

  • shop_id: 27274575990, document_uri: gid://shopify/DraftOrder/1517728727372

  • shop_id: 27274575990, document_uri: gid://shopify/DraftOrder/1517728760140

  • shop_id: 27274575990, document_uri: gid://shopify/DraftOrder/1517728661836

Could you please confirm if there are any known issues with the ledger or draft order services for this shop, or if there’s any mitigation you recommend on our end?

Thanks so much,
Neil Magnuson
Creator Gift Link (Influencer Gift Form)

Hey Neil, I can take a look. When did you first notice this error occurring and has it been ongoing since then?

Hey man,

It’s been happening at least 3-4x per week since September 1st.

As I said, when I resubmit the order it works fine. My app has a flow that takes the draft order and completes it.

Thanks for looking into it.

Thanks! Do you by chance have the x-request-id from the response headers of one of those recent examples that returned the error?

Hey Neil, are you still seeing this issue? If so, are you able to get an x-request-id from one of those recent events?

Hey, I just got this error on an order:

{“data”:{“draftOrderCreate”:{“draftOrder”:null,“userErrors”:[{“field”:null,“message”:“Add customer’s email, shipping phone number, and shipping address for Managed Markets orders”},{“field”:null,“message”:“Change merchant of record on this order to do the following: create an order with zero value; ship restricted products.”}]}},“extensions”:{“cost”:{“requestedQueryCost”:10,“actualQueryCost”:10,“throttleStatus”:{“maximumAvailable”:2000,“currentlyAvailable”:1990,“restoreRate”:100}}}}

I’m sorry but i dont know where to find the x-request id.

Hey @Neil_Magnuson the error you’re seeing is because free orders (zero dollar value) aren’t supported by Managed Markets.

The Managed Markets fulfillment documentation has a little more context: “Free orders aren’t supported by Managed Markets. When you create an order with a zero dollar value to countries or regions managed by Managed Markets, you need to be your own merchant of record for those orders.”

Also, regarding your earlier question about finding the x-request-id, that’s available in the API response headers, not in the response body.

Example of what that looks like in an API client like Postman
image

We are experiencing the same issue for the draftOrderCreate mutation:

UserErrors: Error finding/creating LedgerDocument. shop_id=I_REMOVED_THIS, document_uri=gid://shopify/DraftOrder/1354000924976

This issue occurred twice, once at Fri, Dec 12, 25, 06:34:52 PM GMT+1 and the other at Fri, Dec 12, 25, 07:57:49 PM GMT+1.

Today we reattempted one of these mutations and the draft order got created just fine. To me this doesn’t seem to be any issue on our application’s end - but rather seems to be an internal Shopify error?

Can you help us debug this issue so we can prevent it happening in the future?

Hey @Filip_Minic, can you share the x-request-id from the response headers of your mutation? I’ll see if I can find anything that stands out in the logs.

These errors have proved to be a major headache and they are happening in the hundreds of numbers which is causing major order fulfillment issues.

We have x-request-ids of draft orders that failed to create:

Hey @Filip_Minic, those request id’s don’t appear to be from failing draftOrderCreate mutations. Can you double check. If possible make sure it’s from within the last week or so to ensure it will be available in our logs.