Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

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

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

juan3211
Shopify Partner
126 0 42

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.

Replies 17 (17)

juan3211
Shopify Partner
126 0 42

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

juan3211
Shopify Partner
126 0 42

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....

and

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

 

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.

juan3211
Shopify Partner
126 0 42

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

ShopifyDevSup
Shopify Staff
1453 238 522

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

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

juan3211
Shopify Partner
126 0 42

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.

ShopifyDevSup
Shopify Staff
1453 238 522

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!

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

juan3211
Shopify Partner
126 0 42

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.

juan3211
Shopify Partner
126 0 42

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

ShopifyDevSup
Shopify Staff
1453 238 522

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

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

juan3211
Shopify Partner
126 0 42

Thanks so you dont have any expected date? Thanks

juan3211
Shopify Partner
126 0 42

Hi? any expected date?

ShopifyDevSup
Shopify Staff
1453 238 522

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

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

juan3211
Shopify Partner
126 0 42

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

ozzyonfire
Shopify Partner
51 2 17

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. 

juan3211
Shopify Partner
126 0 42

Hi, any update? 

MikeCDG
Shopify Partner
18 0 6

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

juan3211
Shopify Partner
126 0 42

More than 300 days, NO answer.