--- title: OrderEditSession - GraphQL Admin description: An edit session for an order. api_version: unstable api_name: admin source_url: html: https://shopify.dev/docs/api/admin-graphql/unstable/objects/ordereditsession md: https://shopify.dev/docs/api/admin-graphql/unstable/objects/ordereditsession.md --- # Order​Edit​Session object Requires `read_order_edits` access scope. An edit session for an order. ## Fields * id [ID!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/ID) non-null The unique ID of the order edit session. *** ## Map No referencing types *** ## Queries * [order​Edit​Session](https://shopify.dev/docs/api/admin-graphql/unstable/queries/orderEditSession) query Returns a `OrderEditSession` resource by ID. * id [ID!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/ID) required ### Arguments The ID of the `OrderEditSession` to return. *** *** ## \OrderEditSession Queries ### Queried by * \[order​Edit​Session](https://shopify.dev/docs/api/admin-graphql/unstable/queries/orderEditSession) *** ## Mutations * [order​Edit​Add​Custom​Item](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/orderEditAddCustomItem) mutation Adds a custom line item to an existing order. For example, you could add a gift wrapping service as a [custom line item](https://shopify.dev/apps/fulfillment/order-management-apps/order-editing#add-a-custom-line-item). To learn how to edit existing orders, refer to [Edit an existing order with Admin API](https://shopify.dev/apps/fulfillment/order-management-apps/order-editing). * id [ID!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/ID) required ### Arguments The ID of the [calculated order](https://shopify.dev/api/admin-graphql/latest/objects/calculatedorder) or the order edit session to edit. This is the edit to which the custom item is added. * title [String!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/String) required The name of the custom item to add. * sku [String](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/String) The optional SKU for the custom item to add. * location​Id [ID](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/ID) The ID of the retail [location](https://shopify.dev/api/admin-graphql/latest/objects/location) (if applicable) from which the custom item is sold. Used for tax calculations. A default location will be chosen automatically if none is provided. * price [Money​Input!](https://shopify.dev/docs/api/admin-graphql/unstable/input-objects/MoneyInput) required The unit price of the custom item. This value can't be negative. * quantity [Int!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/Int) required The quantity of the custom item. This value must be greater than zero. * taxable [Boolean](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/Boolean) Whether the custom item is taxable. Defaults to `true`. * requires​Shipping [Boolean](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/Boolean) Whether the custom item requires shipping. Defaults to `false`. * weight [Weight​Input](https://shopify.dev/docs/api/admin-graphql/unstable/input-objects/WeightInput) Specifies the weight unit and value inputs. *** * [order​Edit​Add​Line​Item​Discount](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/orderEditAddLineItemDiscount) mutation Adds a discount to a line item on the current order edit. 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). * id [ID!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/ID) required ### Arguments The ID of the [calculated order](https://shopify.dev/api/admin-graphql/latest/objects/calculatedorder) or the order edit session to edit. * line​Item​Id [ID!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/ID) required The ID of the calculated line item to add the discount to. * discount [Order​Edit​Applied​Discount​Input!](https://shopify.dev/docs/api/admin-graphql/unstable/input-objects/OrderEditAppliedDiscountInput) required The discount to add to the line item. *** * [order​Edit​Add​Shipping​Line](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/orderEditAddShippingLine) mutation Adds a custom shipping line to an [`Order`](https://shopify.dev/docs/api/admin-graphql/latest/objects/Order) during an edit session. Specify the shipping title and price to create a new [`ShippingLine`](https://shopify.dev/docs/api/admin-graphql/latest/objects/ShippingLine). Returns a [`CalculatedOrder`](https://shopify.dev/docs/api/admin-graphql/latest/objects/CalculatedOrder) showing the order with edits applied but not yet saved. To save your changes, use the [`orderEditCommit`](https://shopify.dev/docs/api/admin-graphql/latest/mutations/orderEditCommit) mutation. Learn more about [editing existing orders](https://shopify.dev/docs/apps/build/orders-fulfillment/order-management-apps/edit-orders). * id [ID!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/ID) required ### Arguments The ID of the [calculated order](https://shopify.dev/api/admin-graphql/latest/objects/calculatedorder) or the order edit session to edit. This is the edit to which the shipping line is added. * shipping​Line [Order​Edit​Add​Shipping​Line​Input!](https://shopify.dev/docs/api/admin-graphql/unstable/input-objects/OrderEditAddShippingLineInput) required The shipping line to be added. *** * [order​Edit​Add​Variant](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/orderEditAddVariant) mutation Adds a line item from an existing product variant. As of API version 2025-04, the [orderEditAddVariant](https://shopify.dev/api/admin-graphql/latest/mutations/ordereditaddvariant) API will respect the contextual pricing of the variant. * id [ID!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/ID) required ### Arguments The ID of the [calculated order](https://shopify.dev/api/admin-graphql/latest/objects/calculatedorder) or the order edit session to edit. * variant​Id [ID!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/ID) required The ID of the variant to add. * location​Id [ID](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/ID) The ID of the [location](https://shopify.dev/api/admin-graphql/latest/objects/location) to check for inventory availability. A default location ID is chosen automatically if none is provided. * quantity [Int!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/Int) required The quantity of the item to add to the order. Must be a positive value. * allow​Duplicates [Boolean](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/Boolean) Default:false Whether the mutation can create a line item for a variant that's already on the calculated order. *** * [order​Edit​Begin](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/orderEditBegin) mutation Starts editing an order. Mutations are operating on `OrderEdit`. All order edits start with `orderEditBegin`, have any number of `orderEdit`\* mutations made, and end with `orderEditCommit`. * id [ID!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/ID) required ### Arguments The ID of the order to begin editing. *** * [order​Edit​Remove​Discount](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/orderEditRemoveDiscount) mutation Removes a discount on the current order edit. 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). * id [ID!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/ID) required ### Arguments The ID of the [calculated order](https://shopify.dev/api/admin-graphql/latest/objects/calculatedorder) or the order edit session to edit. This is the edit from which the discount is removed. * discount​Application​Id [ID!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/ID) required The ID of the [calculated discount application](https://shopify.dev/api/admin-graphql/latest/interfaces/calculateddiscountapplication) to remove. *** * [order​Edit​Remove​Shipping​Line](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/orderEditRemoveShippingLine) mutation Removes a shipping line from an existing order. 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). * id [ID!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/ID) required ### Arguments The ID of the [calculated order](https://shopify.dev/api/admin-graphql/latest/objects/calculatedorder) or the order edit session to edit. This is the edit from which the shipping line is removed. * shipping​Line​Id [ID!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/ID) required The ID of the calculated shipping line to remove. *** * [order​Edit​Set​Quantity](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/orderEditSetQuantity) mutation Sets the quantity of a line item on an order that's being edited. Use this mutation to increase, decrease, or remove items by adjusting their quantities. Setting the quantity to zero effectively removes the line item from the order. The item still exists as a data structure with zero quantity. When decreasing quantities, you can optionally restock the removed items to inventory by setting the `restock` parameter to `true`. Learn more about [editing workflows for existing orders](https://shopify.dev/docs/apps/build/orders-fulfillment/order-management-apps/edit-orders). * id [ID!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/ID) required ### Arguments 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/unstable/scalars/ID) required The ID of the calculated line item to edit. * quantity [Int!](https://shopify.dev/docs/api/admin-graphql/unstable/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/unstable/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/unstable/scalars/ID) Deprecated *** * [order​Edit​Update​Discount](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/orderEditUpdateDiscount) mutation Updates a manual line level discount on the current order edit. 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). * id [ID!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/ID) required ### Arguments The ID of the [calculated order](https://shopify.dev/api/admin-graphql/latest/objects/calculatedorder) or the order edit session to edit. This is the edit used to update the discount. * discount [Order​Edit​Applied​Discount​Input!](https://shopify.dev/docs/api/admin-graphql/unstable/input-objects/OrderEditAppliedDiscountInput) required The updated discount. * discount​Application​Id [ID!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/ID) required The ID of the [calculated discount application](https://shopify.dev/api/admin-graphql/latest/interfaces/calculateddiscountapplication) to update. *** * [order​Edit​Update​Shipping​Line](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/orderEditUpdateShippingLine) mutation Updates a shipping line on the current order edit. 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). * id [ID!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/ID) required ### Arguments The ID of the [calculated order](https://shopify.dev/api/admin-graphql/latest/objects/calculatedorder) or the order edit session to edit. This is the edit used to update the shipping line. * shipping​Line [Order​Edit​Update​Shipping​Line​Input!](https://shopify.dev/docs/api/admin-graphql/unstable/input-objects/OrderEditUpdateShippingLineInput) required The updated shipping line. * shipping​Line​Id [ID!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/ID) required The ID of the calculated shipping line to update. *** * [order​Edit​Remove​Line​Item​Discount](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/orderEditRemoveLineItemDiscount) mutation Deprecated * id [ID!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/ID) required ### Arguments The ID of the [calculated order](https://shopify.dev/api/admin-graphql/latest/objects/calculatedorder) or the order edit session to edit. This is the edit from which the line item discount is removed. * discount​Application​Id [ID!](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/ID) required The ID of the [calculated discount application](https://shopify.dev/api/admin-graphql/latest/interfaces/calculateddiscountapplication) to remove. *** *** ## <\~> OrderEditSession Mutations ### Mutated by * <\~>[order​Edit​Add​Custom​Item](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/orderEditAddCustomItem) * <\~>[order​Edit​Add​Line​Item​Discount](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/orderEditAddLineItemDiscount) * <\~>[order​Edit​Add​Shipping​Line](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/orderEditAddShippingLine) * <\~>[order​Edit​Add​Variant](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/orderEditAddVariant) * <\~>[order​Edit​Begin](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/orderEditBegin) * <\~>[order​Edit​Remove​Discount](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/orderEditRemoveDiscount) * <\~>[order​Edit​Remove​Shipping​Line](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/orderEditRemoveShippingLine) * <\~>[order​Edit​Set​Quantity](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/orderEditSetQuantity) * <\~>[order​Edit​Update​Discount](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/orderEditUpdateDiscount) * <\~>[order​Edit​Update​Shipping​Line](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/orderEditUpdateShippingLine) *** ## Interfaces * [Node](https://shopify.dev/docs/api/admin-graphql/unstable/interfaces/Node) interface *** ## ||-OrderEditSession Implements ### Implements * ||-[Node](https://shopify.dev/docs/api/admin-graphql/unstable/interfaces/Node)