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

orderEditAddLineItemDiscount mutation

Version 2021-01 (Release candidate)

Add a discount to an item added during this order edit.

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

discount ( OrderEditAppliedDiscountInput! ) required

The discount to apply to the line item.

id ( ID! ) required

The ID of the calculated order to add the discount to.

lineItemId ( ID! ) required

The ID of a line item added during this edit to add the discount to.

OrderEditAppliedDiscountInput fields

description (String)

The description of the discount.

fixedValue (MoneyInput)

The value of the discount as a fixed amount.

percentValue (Float)

The value of the discount as a percentage.

Return fields

addedDiscountStagedChange (OrderStagedChangeAddLineItemDiscount)

The staged change produced by this mutation.

calculatedLineItem (CalculatedLineItem)

The line item with the discount applied.

calculatedOrder (CalculatedOrder)

An order with the edits calculated.

userErrors ([UserError!]!)

List of errors that occurred executing the mutation.

Version 2020-10 (Latest)

Add a discount to an item added during this order edit.

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

discount ( OrderEditAppliedDiscountInput! ) required

The discount to apply to the line item.

id ( ID! ) required

The ID of the calculated order to add the discount to.

lineItemId ( ID! ) required

The ID of a line item added during this edit to add the discount to.

OrderEditAppliedDiscountInput fields

description (String)

The description of the discount.

fixedValue (MoneyInput)

The value of the discount as a fixed amount.

percentValue (Float)

The value of the discount as a percentage.

Return fields

addedDiscountStagedChange (OrderStagedChangeAddLineItemDiscount)

The staged change produced by this mutation.

calculatedLineItem (CalculatedLineItem)

The line item with the discount applied.

calculatedOrder (CalculatedOrder)

An order with the edits calculated.

userErrors ([UserError!]!)

List of errors that occurred executing the mutation.