Anchor to orderEditUpdateDiscountorder
orderEditUpdateDiscount
mutation
Requires access scope. Also: The user must have apply_discounts_to_orders permission.
Updates a manual line level discount on the current order edit. For more information on how to use the GraphQL Admin API to edit an existing order, refer to Edit existing orders.
Anchor to Arguments
Arguments
- Anchor to discountdiscount•Order
Edit requiredApplied Discount Input! The updated discount.
- Anchor to discountApplicationIddiscount•
Application Id ID!required The ID of the calculated discount application to update.
- •ID!required
The ID of the calculated order from which to update the discount.
Was this section helpful?
Anchor to OrderEditUpdateDiscountPayload returnsOrderEditUpdateDiscountPayload returns
- Anchor to calculatedOrdercalculated•
Order An order with the edits applied but not saved.
- Anchor to userErrorsuser•
Errors The list of errors that occurred from executing the mutation.
Was this section helpful?
Mutation Reference
mutation orderEditUpdateDiscount($discount: OrderEditAppliedDiscountInput!, $discountApplicationId: ID!, $id: ID!) {
orderEditUpdateDiscount(discount: $discount, discountApplicationId: $discountApplicationId, id: $id) {
calculatedOrder {
# CalculatedOrder fields
}
userErrors {
field
message
}
}
}
Input
{
"discount": {
"description": "<your-description>",
"fixedValue": {
"amount": "29.99",
"currencyCode": ""
},
"percentValue": 1.1
},
"discountApplicationId": "gid://shopify/<objectName>/10079785100",
"id": "gid://shopify/<objectName>/10079785100"
}
{
"discount": {
"description": "<your-description>",
"fixedValue": {
"amount": "29.99",
"currencyCode": ""
},
"percentValue": 1.1
},
"discountApplicationId": "gid://shopify/<objectName>/10079785100",
"id": "gid://shopify/<objectName>/10079785100"
}
input OrderEditAppliedDiscountInput {
description: String
fixedValue: MoneyInput
percentValue: Float
}
input MoneyInput {
amount: Decimal!
currencyCode: CurrencyCode!
}