GraphQL DraftOrderCreate: how to create a draft order with more than 250 items

Hi, I have found a problem and I haven’t found any solution. ¿bug? ¿error? ¿limit?

I think that Shopify has a limit with, probable, all lineitems’ arrays.

I have try to send a graphQL mutation to create a draft order with more than 250 lineitems, and I have get this error MAX_INPUT_SIZE_EXCEEDED:

{"errors":[{"message":"Input size greater than 250.","locations":[{"line":3,"column":25}],"path":["draftOrderCreate","input","lineItems"],"extensions":{"code":"MAX_INPUT_SIZE_EXCEEDED"}}],"response":{},"status":200,"body":{"errors":[{"message":"Input size greater than 250.","locations":[{"line":3,"column":25}],"path":["draftOrderCreate","input","lineItems"],"extensions":{"code":"MAX_INPUT_SIZE_EXCEEDED"}}],"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":null,"throttleStatus":{"maximumAvailable":1000,"currentlyAvailable":990,"restoreRate":50}}}},"timestamps":[...............]}

I can’t find any info about this error in API documentation

What is the way to create a draft with more than 250 items?

I can’t create it and after update it with more articles because probably, I will get again the MAX_INPUT_SIZE_EXCEEDED error, won’t I ?

Please, help us,

Thanks a lot.

3 Likes

HI, could anyone from Shopify or any other community member help me? Thanks.

60 days. Could anybody from support help us? Thanks

I have found this for cart/checkout limits: 500 lines

https://shopify.dev/docs/custom-storefronts/building-with-the-storefront-api/cart#:~:text=The%20cart%20supports%20a%20maximum,the%20customer%20completes%20their%20checkout.

and

https://community.shopify.com/c/shopify-design/getting-an-error-cart-error-your-cart-can-t-contain-more-than/td-p/1574276

Even in the second line, a shopify expert talks about draft orders with 600 lines.

But, is it not possible, only 250 lines.

Please help us.

Almost HALF A YEAR, no answer from support team. Still waiting.

Hi @juan3211 ,

Thanks for your post. The limit of 250 that you are seeing is the “Maximum input array size limit”, so you can add more to the draft order but only up to 250 at once. There’s a short mention of this in the dev docs here:

Link: [Shopify Dev Docs: API Rate limits - Maximum Input array size]

Input arguments that accept an array have a maximum size of 250. Queries and mutations return an error if an input array exceeds 250 items.

Hope you have a great day,
Jon551

Thanks but i dont know exactly the process.

Imagine that I use draftOrderCreate mutation with the first 250 lines.

Which is the mutation to add products to a draftOrder?

I only can see draftOrderUpdate mutation, but it need ALL products, not only the new products that I want to add, so again, I have the 250 limit.

Hope your asnwer with the how to do this.

Thanks.

Hi @juan3211 , adding line items to a draft order in excess of the limit is likely to cause issues with processing orders. It would be advisable to make multiple orders for these situations. Our developer teams are aware of requests from merchants to increase the line item maximums for draft orders but currently our recommendation is not to use a single order for processing line items beyond the maximums. Hope this helps!

And what about these?:

I have found this for cart/checkout limits: 500 lines

https://shopify.dev/docs/custom-storefronts/building-with-the-storefront-api/cart#:~:text=The%20cart….

and

https://community.shopify.com/c/shopify-design/getting-an-error-cart-error-your-cart-can-t-contain-m…

Even a shopify expert talks about draft orders with 600 lines.

2 Likes

Hi, any answer about these two links? Any expected date to improve this? Thanks

1 Like

Hi @juan3211 ,

Thanks for your reply. We’ve investigated some more and found you are correct that at this time only the first 250 items on a draft order can be added via API and to add more than that you’d have to add them via the web admin.

We’re submitting some feedback on your behalf about this and at this time have no estimate of when it will change.

Have a great day,
Jon551

Thanks so you dont have any expected date? Thanks

Hi? any expected date?

Hi @juan3211 ,

Thanks for your reply. Currently there is no estimated time available as to when this behaviour might change.

You can keep up to date with announcements about upcoming changes on these pages:

Hope you have a great day,
Jon551

Sorry I need more information, I need to decide to wait or not to wait and change platform, thanks. Coudl you please ask at least if they are going to do it or not? Thanks

Hi jumping in on this thread. I noticed some similar behaviour change a couple of days ago (September 2nd).

Now we can only add 50 line items to a draft order. Any items over 50, silently fail. The draft order is completed without any error message, but when you look at the draft order it only contains 50 line items.

Can we get this addressed ASAP. I have critical business apps that depend on orders being successfully created with more than 50 items. And if we’re not getting any errors back, then this could be a massive problem.

1 Like

Hi, any update?

1 Like

This is also a large need for our B2B merchants especially.

1 Like

More than 300 days, NO answer.

1 Like