Order Edit Manual Discount Mutation & Discount Class Enhancements

10/31/2026, 12:00:30 AM

The API now supports adding a manual order‑level discount during an order‑edit session via the new orderEditAddManualOrderDiscount mutation. This mutation stages the discount, creating an OrderStagedChangeAddManualDiscount record that is committed only when orderEditCommit is called. The payload includes the staged change, a preview of the CalculatedOrder, and the updated OrderEditSession, plus any field‑level user errors. Several calculated discount application objects (Automatic, Code, Manual, Script) now expose a discountClass enum to identify whether the discount applies to the order, a product, or shipping, returning null for non‑classified (manual) discounts. Additionally, CalculatedOrder receives a discountApplications connection that reflects all staged changes, allowing clients to preview which discounts will be added or removed before committing. Developers should update client code to handle the new mutation, process the staged change object, and consider the new discountClass field when filtering or displaying discounts, and use the discountApplications connection to view the current edit’s discount state.

Mutation Changes

➕ Added Mutations (1)

orderEditAddManualOrderDiscount

Adds a manual order-level discount during an order edit session.

The discount is allocated across all line items. The changes remain staged until committed with the
orderEditCommit mutation.

If the edit already has a staged manual order-level discount, this replaces it. If the order already has an
active manual order-level discount, remove it with
orderEditRemoveDiscount first.

To change or remove the discount later in the edit, use
orderEditUpdateDiscount or
orderEditRemoveDiscount.

Type Changes

➕ Added Types (2)

🏗️OrderEditAddManualOrderDiscountPayload➕ AddedOBJECT

Return type for orderEditAddManualOrderDiscount mutation.

Fields: addedManualDiscountStagedChange, calculatedOrder, orderEditSession, userErrors
🏗️OrderStagedChangeAddManualDiscount➕ AddedOBJECT

A manual order-level discount staged during the current order edit.

Fields: description, id, value

🔄 Modified Types (6)

🏗️CalculatedAutomaticDiscountApplication🔄 Modified
➕ Field added: discountClass

The class of the discount application: order, product or shipping. Returns null when the discount has no class, such as a manual discount.

🏗️CalculatedDiscountApplication🔄 Modified
➕ Field added: discountClass

The class of the discount application: order, product or shipping. Returns null when the discount has no class, such as a manual discount.

🏗️CalculatedDiscountCodeApplication🔄 Modified
➕ Field added: discountClass

The class of the discount application: order, product or shipping. Returns null when the discount has no class, such as a manual discount.

🏗️CalculatedManualDiscountApplication🔄 Modified
➕ Field added: discountClass

The class of the discount application: order, product or shipping. Returns null when the discount has no class, such as a manual discount.

🏗️CalculatedOrder🔄 Modified
➕ Field added: discountApplications

The order's discount applications with the current edit's staged changes applied: discounts being removed
are left out and discounts being added are included.

🏗️CalculatedScriptDiscountApplication🔄 Modified
➕ Field added: discountClass

The class of the discount application: order, product or shipping. Returns null when the discount has no class, such as a manual discount.