Currently, when an automatic discount applies to an order, the only field that identifies which discount it was is title on AutomaticDiscountApplication:
{
order(id: "gid://shopify/Order/123") {
discountApplications(first: 10) {
nodes {
... on AutomaticDiscountApplication {
title # the only identifying field
index
value { ... }
allocationMethod
targetSelection
targetType
}
}
}
}
}
title is unsuitable as an identifier for two reasons:
- It’s mutable.
titleis the discount’s display name, which merchants can rename at any time in the admin. There’s no stable reference back to the source discount (e.g. theDiscountAutomaticNodeID). - It’s not guaranteed to be unique. Multiple automatic discounts can share the same
title, so matching on it is ambiguous even on a single order at a single point in time.
This contrasts with DiscountCodeApplication, which exposes a code field — a durable string that reliably identifies the underlying discount.
The index field doesn’t help either: it’s documented as an ordered index indicating precedence for calculations, so it’s only meaningful relative to other applications on the same order, not a cross-order identifier.
Why this matters
Any app or integration that needs to reconcile order-level discounts back to the discounts that produced them — reporting, accounting/ERP sync, promotion performance analysis, reconciliation — has to match on title. Because title is both mutable and non-unique, that matching is unreliable: renaming a discount silently breaks it, and two discounts sharing a title make it ambiguous. There’s no way to detect or recover from either case after the fact.
Requested change
Add a durable, unique identifier to AutomaticDiscountApplication (and ideally to the DiscountApplication interface where applicable), such as a reference to the source discount’s ID (DiscountAutomaticNode). This would give automatic discounts the same reconcilability that code already provides for code-based discounts.