orderEditAddLineItemDiscount mutation
Add a discount to an item added during this order edit.
Required access
write_order_edits access scope.
On this page
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.
mutation orderEditAddLineItemDiscount($id: ID!, $lineItemId: ID!, $discount: OrderEditAppliedDiscountInput!) { orderEditAddLineItemDiscount(id: $id, lineItemId: $lineItemId, discount: $discount) {} } { “id”: “Z2lkOi8vU2hvcGlmeS9FeGFtcGxlLzE=”, “lineItemId”: “Z2lkOi8vU2hvcGlmeS9FeGFtcGxlLzE=”, “discount”: {} }
<font style="color:#1F61A0;">addedDiscountStagedChange</font> <font style="color:#555555;">{</font><font style="color:#1F61A0;">id</font><font style="color:#555555;">}</font><font style="color:#1F61A0;">calculatedLineItem</font> <font style="color:#555555;">{</font><font style="color:#1F61A0;">id</font><font style="color:#555555;">}</font><font style="color:#1F61A0;">calculatedOrder</font> <font style="color:#555555;">{</font><font style="color:#1F61A0;">id</font><font style="color:#555555;">}</font><font style="color:#1F61A0;">userErrors</font> <font style="color:#555555;">{</font><font style="color:#1F61A0;">field</font><font style="color:#1F61A0;">message</font><font style="color:#555555;">}</font>
Arguments
OrderEditAppliedDiscountInput fields
- description (
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01))
The description of the discount. - fixedValue (
[MoneyInput](https://shopify.dev/docs/admin-api/graphql/reference/common-objects/moneyinput))
The value of the discount as a fixed amount. - percentValue (
[Float](https://shopify.dev/docs/admin-api/graphql/reference/scalar#float-2021-01))
The value of the discount as a percentage.
Return fields
- addedDiscountStagedChange (
[OrderStagedChangeAddLineItemDiscount](https://shopify.dev/docs/admin-api/graphql/reference/orders/orderstagedchangeaddlineitemdiscount))
The staged change produced by this mutation. - calculatedLineItem (
[CalculatedLineItem](https://shopify.dev/docs/admin-api/graphql/reference/orders/calculatedlineitem))
The line item with the discount applied. - calculatedOrder (
[CalculatedOrder](https://shopify.dev/docs/admin-api/graphql/reference/orders/calculatedorder))
An order with the edits calculated. - userErrors (
[[UserError!]!](https://shopify.dev/docs/admin-api/graphql/reference/usererror))
List of errors that occurred executing the mutation.
