API version: unstable
API version: 2021-01 Release candidate
API version: 2020-10 Latest
API version: 2020-07
API version: 2020-04
API version: 2020-01
API version: 2019-10 Unsupported
API version: 2019-07 Unsupported

orderEditAddVariant mutation

Version unstable

Add a line item from an existing product variant.

Required access

write_order_edits access scope.

Interactive example

This is an example mutation query. Use the embedded interactive tool below to edit the query.

Hint: use Ctrl + Space for autocompleting fields.


Arguments

allowDuplicates ( Boolean )

Whether or not this mutation can create a line item with a variant that is already present on the order. Default false.

id ( ID! ) required

The ID of the calculated order to edit.

locationId ( ID )

The ID of the location that this item will be fulfilled from. A default will be chosen automatically if none is provided.

quantity ( Int! ) required

The amount of the item to add to the order. Must be a positive value.

variantId ( ID! ) required

The ID of the variant to add.

Return fields

calculatedLineItem (CalculatedLineItem)

The added line item.

calculatedOrder (CalculatedOrder)

An order with the edits calculated.

userErrors ([UserError!]!)

List of errors that occurred executing the mutation.

Version 2021-01 (Release candidate)

Add a line item from an existing product variant.

Required access

write_order_edits access scope.

Interactive example

This is an example mutation query. Use the embedded interactive tool below to edit the query.

Hint: use Ctrl + Space for autocompleting fields.


Arguments

allowDuplicates ( Boolean )

Whether or not this mutation can create a line item with a variant that is already present on the order. Default false.

id ( ID! ) required

The ID of the calculated order to edit.

locationId ( ID )

The ID of the location that this item will be fulfilled from. A default will be chosen automatically if none is provided.

quantity ( Int! ) required

The amount of the item to add to the order. Must be a positive value.

variantId ( ID! ) required

The ID of the variant to add.

Return fields

calculatedLineItem (CalculatedLineItem)

The added line item.

calculatedOrder (CalculatedOrder)

An order with the edits calculated.

userErrors ([UserError!]!)

List of errors that occurred executing the mutation.

Version 2020-10 (Latest)

Add a line item from an existing product variant.

Required access

write_order_edits access scope.

Interactive example

This is an example mutation query. Use the embedded interactive tool below to edit the query.

Hint: use Ctrl + Space for autocompleting fields.


Arguments

allowDuplicates ( Boolean )

Whether or not this mutation can create a line item with a variant that is already present on the order. Default false.

id ( ID! ) required

The ID of the calculated order to edit.

locationId ( ID )

The ID of the location that this item will be fulfilled from. A default will be chosen automatically if none is provided.

quantity ( Int! ) required

The amount of the item to add to the order. Must be a positive value.

variantId ( ID! ) required

The ID of the variant to add.

Return fields

calculatedLineItem (CalculatedLineItem)

The added line item.

calculatedOrder (CalculatedOrder)

An order with the edits calculated.

userErrors ([UserError!]!)

List of errors that occurred executing the mutation.

Version 2020-07

Add a line item from an existing product variant.

Required access

write_order_edits access scope.

Interactive example

This is an example mutation query. Use the embedded interactive tool below to edit the query.

Hint: use Ctrl + Space for autocompleting fields.


Arguments

id ( ID! ) required

The ID of the calculated order to edit.

locationId ( ID )

The ID of the location that this item will be fulfilled from. A default will be chosen automatically if none is provided.

quantity ( Int! ) required

The amount of the item to add to the order. Must be a positive value.

variantId ( ID! ) required

The ID of the variant to add.

Return fields

calculatedLineItem (CalculatedLineItem)

The added line item.

calculatedOrder (CalculatedOrder)

An order with the edits calculated.

userErrors ([UserError!]!)

List of errors that occurred executing the mutation.

Version 2020-04

Add a line item from an existing product variant.

Required access

write_order_edits access scope.

Interactive example

This is an example mutation query. Use the embedded interactive tool below to edit the query.

Hint: use Ctrl + Space for autocompleting fields.


Arguments

id ( ID! ) required

The ID of the calculated order to edit.

locationId ( ID )

The ID of the location that this item will be fulfilled from. A default will be chosen automatically if none is provided.

quantity ( Int! ) required

The amount of the item to add to the order. Must be a positive value.

variantId ( ID! ) required

The ID of the variant to add.

Return fields

calculatedLineItem (CalculatedLineItem)

The added line item.

calculatedOrder (CalculatedOrder)

An order with the edits calculated.

userErrors ([UserError!]!)

List of errors that occurred executing the mutation.

Version 2020-01

Add a line item from an existing product variant.

Required access

write_order_edits access scope.

Interactive example

This is an example mutation query. Use the embedded interactive tool below to edit the query.

Hint: use Ctrl + Space for autocompleting fields.


Arguments

id ( ID! ) required

The ID of the calculated order to edit.

locationId ( ID )

The ID of the location that this item will be fulfilled from. A default will be chosen automatically if none is provided.

quantity ( Int! ) required

The amount of the item to add to the order. Must be a positive value.

variantId ( ID! ) required

The ID of the variant to add.

Return fields

calculatedLineItem (CalculatedLineItem)

The added line item.

calculatedOrder (CalculatedOrder)

An order with the edits calculated.

userErrors ([UserError!]!)

List of errors that occurred executing the mutation.

Version 2019-10 (Unsupported)

Add a line item from an existing product variant.

Required access

write_order_edits access scope.

Interactive example

This is an example mutation query. Use the embedded interactive tool below to edit the query.

Hint: use Ctrl + Space for autocompleting fields.


Arguments

id ( ID! ) required

The ID of the calculated order to edit.

locationId ( ID )

The ID of the location that this item will be fulfilled from. A default will be chosen automatically if none is provided.

quantity ( Int! ) required

The amount of the item to add to the order. Must be a positive value.

variantId ( ID! ) required

The ID of the variant to add.

Return fields

calculatedLineItem (CalculatedLineItem)

The added line item.

calculatedOrder (CalculatedOrder)

An order with the edits calculated.

userErrors ([UserError!]!)

List of errors that occurred executing the mutation.

Version 2019-07 (Unsupported)

Add a line item from an existing product variant.

Required access

write_order_edits access scope.

Interactive example

This is an example mutation query. Use the embedded interactive tool below to edit the query.

Hint: use Ctrl + Space for autocompleting fields.


Arguments

id ( ID! ) required

The ID of the calculated order to edit.

locationId ( ID )

The ID of the location that this item will be fulfilled from. A default will be chosen automatically if none is provided.

quantity ( Int! ) required

The amount of the item to add to the order. Must be a positive value.

variantId ( ID! ) required

The ID of the variant to add.

Return fields

calculatedLineItem (CalculatedLineItem)

The added line item.

calculatedOrder (CalculatedOrder)

An order with the edits calculated.

userErrors ([UserError!]!)

List of errors that occurred executing the mutation.

Version 2019-04 (Unsupported)

Add a line item from an existing product variant.

Required access

write_order_edits access scope.

Interactive example

This is an example mutation query. Use the embedded interactive tool below to edit the query.

Hint: use Ctrl + Space for autocompleting fields.


Arguments

id ( ID! ) required

The ID of the calculated order to edit.

locationId ( ID )

The ID of the location that this item will be fulfilled from. A default will be chosen automatically if none is provided.

quantity ( Int! ) required

The amount of the item to add to the order. Must be a positive value.

variantId ( ID! ) required

The ID of the variant to add.

Return fields

calculatedLineItem (CalculatedLineItem)

The added line item.

calculatedOrder (CalculatedOrder)

An order with the edits calculated.

userErrors ([UserError!]!)

List of errors that occurred executing the mutation.