orderEditAddLineItemDiscount is in fact a set operation

The name orderEditAddLineItemDiscount is misleading. If you use it twice, the second discount will overwrite the first one.

So a better name would be orderEditSetLineItemDiscount.

The documentation page does not mention that you can only have 1 discount.

1 Like

Hi Stefan,

I can confirm that this is currently expected behaviour, with current platform limitations where you can only edit an order to add a single discount per line item after the order is created.

I’ve sent some feedback on your behalf internally to change the mutation name, and to update the Shopify.dev documentation so this limitation is more clearly presented.

You can also submit feedback yourself from the Shopify.dev documentation directly, by scrolling down to the bottom of the page and selecting Was this section helpful? No and entering any feedback you wish to share.

While I can’t guarantee when or if this change will be implemented, I can assure you that our developers and product teams do take all feedback with great value when determining future features and changes to the platform!

1 Like

Hi @Kellan-Shopify, thank you for your response.

One more thing to add on the matter. Apparently, if I set a discount via orderEditAddLineItemDiscount, on a line item that has quantity > 1, then the amount applied is quantity * discount amount.

That can’t be right

Hi @Stefan_Buciu,

I can confirm this is actually expected behaviour, with fixed amount manual discounts added to an order being applied with allocationMethod: ACROSS, and percentage manual discounts being applied with allocationMethod: EACH.

This means that Fixed Amount discounts are expected to be applied to “each” individual items in the line item, and Percentage discounts are expected to be applied “across” the whole line item.

As stated, this is expected behaviour and is currently done by design, however I will also be submitting feedback on your behalf that you would like the ability to select the allocationMethod for each manual discount type during order edits. Again you can also submit any feedback through our Shopify.dev documentation as mentioned in my previous replies.