orderEditAddVariant - admin-graphql - MUTATION
Version: 2024-10
Description:
Adds a line item from an existing product variant.
Access Scopes
`write_order_edits` access scope.
Arguments
-
allowDuplicates:
Boolean -
Whether the mutation can create a line item for a variant that's already on the calculated order.
-
id:
ID! -
The ID of the [calculated order](https://shopify.dev/api/admin-graphql/latest/objects/calculatedorder)
to edit.
-
locationId:
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! -
The quantity of the item to add to the order. Must be a positive value.
-
variantId:
ID! -
The ID of the variant to add.
Returns
-
calculatedLineItem:
CalculatedLineItem
The [calculated line item](https://shopify.dev/api/admin-graphql/latest/objects/calculatedlineitem)
that's added during this order edit.
-
calculatedOrder:
CalculatedOrder
The [calculated order](https://shopify.dev/api/admin-graphql/latest/objects/calculatedorder)
with the edits applied but not saved.
-
userErrors:
UserError!
The list of errors that occurred from executing the mutation.
Examples