--- title: orderEditAddVariant - GraphQL Admin description: 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. api_version: 2025-10 api_name: admin type: mutation api_type: graphql source_url: html: https://shopify.dev/docs/api/admin-graphql/latest/mutations/orderEditAddVariant md: https://shopify.dev/docs/api/admin-graphql/latest/mutations/orderEditAddVariant.md --- # order​Edit​Add​Variant mutation Requires `write_order_edits` access scope. 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. ## Arguments * allow​Duplicates [Boolean](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Boolean) Default:false Whether the mutation can create a line item for a variant that's already on the calculated order. * 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. * location​Id [ID](https://shopify.dev/docs/api/admin-graphql/latest/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/latest/scalars/Int) required The quantity of the item to add to the order. Must be a positive value. * variant​Id [ID!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/ID) required The ID of the variant to add. *** ## Order​Edit​Add​Variant​Payload returns * calculated​Line​Item [Calculated​Line​Item](https://shopify.dev/docs/api/admin-graphql/latest/objects/CalculatedLineItem) The [calculated line item](https://shopify.dev/api/admin-graphql/latest/objects/calculatedlineitem) that's added during this order edit. * calculated​Order [Calculated​Order](https://shopify.dev/docs/api/admin-graphql/latest/objects/CalculatedOrder) The [calculated order](https://shopify.dev/api/admin-graphql/latest/objects/calculatedorder) 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 * ### orderEditAddVariant reference ## Mutation Reference ```graphql mutation orderEditAddVariant($id: ID!, $variantId: ID!, $locationId: ID, $quantity: Int!, $allowDuplicates: Boolean) { orderEditAddVariant(id: $id, variantId: $variantId, locationId: $locationId, quantity: $quantity, allowDuplicates: $allowDuplicates) { calculatedLineItem { # CalculatedLineItem fields } calculatedOrder { # CalculatedOrder fields } orderEditSession { # OrderEditSession fields } userErrors { field message } } } ``` ## Input ```json { "id": "gid://shopify//10079785100", "variantId": "gid://shopify//10079785100", "locationId": "gid://shopify//10079785100", "quantity": 1, "allowDuplicates": true } ```