--- title: orderEditSetQuantity - GraphQL Admin description: Sets the quantity of a line item on an order that is being edited. For more information on how to use the GraphQL Admin API to edit an existing order, refer to [Edit existing orders](https://shopify.dev/apps/fulfillment/order-management-apps/order-editing). api_version: 2025-10 api_name: admin type: mutation api_type: graphql source_url: html: https://shopify.dev/docs/api/admin-graphql/latest/mutations/orderEditSetQuantity md: https://shopify.dev/docs/api/admin-graphql/latest/mutations/orderEditSetQuantity.md --- # order​Edit​Set​Quantity mutation Requires `write_order_edits` access scope. Sets the quantity of a line item on an order that is being edited. For more information on how to use the GraphQL Admin API to edit an existing order, refer to [Edit existing orders](https://shopify.dev/apps/fulfillment/order-management-apps/order-editing). ## Arguments * id [ID!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/ID) required The ID of the [calculated order](https://shopify.dev/api/admin-graphql/latest/objects/calculatedorder) or the order edit session to edit. The edit changes the quantity on the line item. * line​Item​Id [ID!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/ID) required The ID of the calculated line item to edit. * quantity [Int!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Int) required The new quantity to set for the line item. This value cannot be negative. * restock [Boolean](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Boolean) Whether or not to restock the line item when the updated quantity is less than the original quantity. * location​Id [ID](https://shopify.dev/docs/api/admin-graphql/latest/scalars/ID) Deprecated *** ## Order​Edit​Set​Quantity​Payload returns * calculated​Line​Item [Calculated​Line​Item](https://shopify.dev/docs/api/admin-graphql/latest/objects/CalculatedLineItem) The calculated line item with the edits applied but not saved. * calculated​Order [Calculated​Order](https://shopify.dev/docs/api/admin-graphql/latest/objects/CalculatedOrder) The calculated order with the edits applied but not saved. * order​Edit​Session [Order​Edit​Session](https://shopify.dev/docs/api/admin-graphql/latest/objects/OrderEditSession) The order edit session with the edits applied but not saved. * user​Errors [\[User​Error!\]!](https://shopify.dev/docs/api/admin-graphql/latest/objects/UserError) non-null The list of errors that occurred from executing the mutation. *** ## Examples * ### orderEditSetQuantity reference ## Mutation Reference ```graphql mutation orderEditSetQuantity($id: ID!, $lineItemId: ID!, $quantity: Int!, $restock: Boolean) { orderEditSetQuantity(id: $id, lineItemId: $lineItemId, quantity: $quantity, restock: $restock) { calculatedLineItem { # CalculatedLineItem fields } calculatedOrder { # CalculatedOrder fields } orderEditSession { # OrderEditSession fields } userErrors { field message } } } ``` ## Input ```json { "id": "gid://shopify//10079785100", "lineItemId": "gid://shopify//10079785100", "quantity": 1, "restock": true } ``` ##### Variables ``` { "id": "gid://shopify//10079785100", "lineItemId": "gid://shopify//10079785100", "quantity": 1, "restock": true } ```