How to create a draft order with more than 250 items?

Hi, I have found a problem and I haven’t found any solution.

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 line items, 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 ?

The other issue is that if you create a draft with more than 50 items like lets say 55 shopify only creates 50.

Thanks a lot.

Original post is here GraphQL DraftOrderCreate: how to create a draft order with more than 250 items - Shopify Community

Can you add additional line items afterwards?

We use the rest API for a client and was planning to migrate to gql, but this might be an issue.

Hey Blanklob,

Our product team shipped a fix for the line item issue yesterday - can you confirm if you’re still seeing this on your side?

This is fixed thanks but first one remains an issue.

Hey if you did try to add in API it will remove the first 250, and you get limited again.

2 Likes

I ran into the same problem with draft orders this week with a Business-to-Business customer ordering more than 250 items. After investigating, there doesn’t seem to be a proper solution to this as of yet. The API is wildly inconsistent between storefront cart creation, GraphQL order creation, and GraphQL draft order creation.

Here are the limits I was able to determine by testing the API with GraphiQL and Mechanic.

Notes:

  1. Although the API sets a specific limit of 2,000 line items on the orderCreate mutation, if you actually try to do it the API gets really unstable. GraphiQL times out with an internal server error, while Mechanic sometimes works and sometimes times out. When it does work, it takes anywhere from 3 to 5 minutes for the order to create. Dropping the line item quantity to 1,500 seems to fix things though, and both GraphiQL and Mechanic are reliably able to create the orders in around 30–40 seconds.

  2. As noted by a Shopify Staff member here, orders in excess of 250 line items are “likely to cause issues with processing orders.” I suspect Shopify will be able to handle it fine, and so far it seems like the Shopify admin has no issues with these giant orders. Where you may run into issues though is with 3rd party apps, as this is a nebulous area that doesn’t seem to be fully defined or consistent across Shopify’s APIs.