Draft Orders API Limitations

Hello,

I thought I would create one issue for this rather than creating a few on draft orders as a topic.
From a partner perspective the api is slow compared to other endpoints and lacks some features would make building on it much easier and a more seamless experience for merchants.

Draft Order Reserved Inventory

Currently draft orders cannot have a location set for them via GraphQL, this means that when using the reserve inventory functionality it only takes the inventory from the default location.
This is normally a mechants warehouse, and so this is key functionality missing for retailers and those with multiple stores.

Draft Order API Performance

The API endpoint for creating draft orders and updating them is much slower than other endpoints in graphql.

You can see in these graphs, showing the request duration in ms:

  1. Get draft order attributes
  2. Get draft order with line items
  3. Set metafields mutation
  4. Set metafields mutation
  5. Draft order update mutation
  6. Draft order create mutation

You can see that interacting with the draft order create and update methods is almost 3x slower than the corresponding metafield requests.
I’m seeing this across thousands of requests.
I know the creation/update are handling line items, metafields and tags. However the performance really impacts merchants, who in my case are waiting in store for these to be created.

Unknown limits

As raised in this thread there is a unknown limit to how many draft orders we can create in parallel and very little we can do to be aware of this or work with it.

Filtering

Currently filtering is really limited down to tags and a handful of fields, metafield filtering as raised here would help.
But also being able to filter on other key fields like PO Number, the location of the draft order (when this can be set) or being able to set a different source so we could use that.

Function integration

Currently draft orders don’t trigger or have the configurable to trigger functions such as order routing or constraints.
This is useful in some ways for apps/merchants but also means standard processes can’t be enforced via these functions which you would want.

Draft orders is an awesome capability but compared to other resources, its API is quite limiting.

2 Likes

Hey @JordanFinners

Thanks for such a detailed and thorough wrap-up of the issues and limitations you’re seeing with the draft orders API!

For the issues you mentioned around concurrency limits, and filtering, it’s best to keep those on their respective threads for follow-ups to help when other developers see similar issues.

Looking closer on what you shared regarding your inventory assignment point and the function capabilities.

I tested a few orders to better see what you are seeing, and draft orders do follow shipping and delivery profile configurations rather than defaulting to a single location.
For example, when I tested with customers in different regions, the inventory was correctly reserved from the appropriate locations based on my configured shipping rules.

For functions, there was a December 2024 update that closed the loop by adding full Shopify Functions support to draft orders including delivery customization:

Does this help solve those inventory assignment concerns, or give you better tools to manage location routing for your multi-store merchants?

I definitely pass along the analytics and test results you shared to the draft order team so they can see exactly what you’re experiencing with the performance patterns.

Hey Kyle,

Thank you for the detailed response and trying out options as well! Really appreciate it :smiley:

In terms of location, we don’t always have a customer for a draft order and so it would be helpful to be able to do this programmatically via the API.
For example, in retail examples we aren’t going to be shipping the draft order anywhere and may not have customer to identify it with but would still like the draft order associated with that location, similar to how you can see what location an order/fulfillment order is associated with.

Hmm do you know if order routing and fulfillment constraints do support it as its not mentioned in the docs? I know they are newer than that update and don’t seem to see them working for draft orders, as @blanklob has also experienced.

Thank you again for trying all this out for me and passing on the performance feedback to the team, if they need more specifics about requests etc please let me know. :folded_hands:

yea last time I checked draft order trigger order routing but they dont consider it, meaning its always primary or default location being selected for fulfillment once a draft reserves inventory, or scheduled to reserve inventory.