facing issue in orderEditAddLineItemDiscount mutation

Shopify Partner
3 0 1

mutation

mutation orderEditAddLineItemDiscount($idID!, $lineItemIdID!, $discountOrderEditAppliedDiscountInput!) {
  orderEditAddLineItemDiscount(id$idlineItemId$lineItemIddiscount$discount) {
    addedDiscountStagedChange {
      id
    }
    calculatedLineItem {
      id
    }
    calculatedOrder {
      id
    }
    userErrors {
      field
      message
    }
  }
}
 
getting error
 {
                    "field": [
                        "lineItemId"
                    ],
                    "message""Only items added during the current edit may be discounted."
                }
0 Likes

The line item id you inputted is not correct. If you add a new variant to the order, then use the calculatedLineItemID returned from the response. It should be ok. 

The graphQL sequence:

  1. OrderEditBegin
  2. Add a new variant
  3. Add discount to the new variant
  4. CommitEdit

 

 

SPO - SEO App to research keywords & edit social link preview
0 Likes