DiscountContextInput now includes markets , letting you apply discounts per regional market / retail location / B2B company location. Supports all discount types (Basic / BXGY / App / Free Shipping, both automatic and code).
Targeting across three axes: all / customerSegments / customers."which market" There was no way to narrow by a geographic or channel axis like this.
markets , and just by specifying the target markets you can deliver different discounts by region, by retail location, or by B2B partner.
All discount types supported: for both automatic and code-based discounts, markets can be specified.
| Eligibility combinations | Supported? | Notes |
|---|---|---|
markets only |
OK | Applies broadly at the market level |
markets + all |
OK | Applies to all customers within the market |
markets + customers |
OK | Applies to specified customers within the market |
markets + customerSegments |
Not allowed | Markets and customer segments are mutually exclusive |
# mutation 抜粋(イメージ) discountCodeBasicCreate( basicCodeDiscount: { title: "JP Spring Sale", discountContext: { markets: ["gid://shopify/Market/123"] # ← 今回追加 # customers / customerSegments / all はここに並ぶ } ... } )
# Market から紐づくディスカウントを取得 { market(id: "gid://shopify/Market/123") { discountsCount discounts(first: 50) { nodes { ... } } } }
context:marketFor bulk-fetching all "discounts that have some market eligibility attached."
market_idsOnly the discounts tied to a specific market discountNodes for fetching from it.
* The code above is a conceptual illustration based on the article's description. Verify the exact field names and arguments in the Admin GraphQL API reference.
A new option added alongside the existing eligibility. It applies to all types—Basic / BXGY / App / Free Shipping—and to both automatic and code discounts.
You can't build an AND condition like "the VIP segment in the Japan market" with this feature alone. If you need both, handle it on the market side, or substitute a customer list (customers) narrowed down within the market.
Assign it to a parent region (e.g., North America) and it's inherited by children (Canada) too. However, there is no inheritance across Region ↔ B2B ↔ Retail. You need a design that accounts for the type.
Market.discounts/discountsCount , letting you directly retrieve the list/count of discounts tied to a market.Auditing campaigns by market becomes easier.
Apps and integration ETLs hitting older versions cannot fetch discounts with market eligibility at all (they're implicitly filtered out). This causes incidents where discounts "appear to disappear" on the order and analytics side, so before using this feature, audit the versions across all clients .
markets you specify. Apply it to "North America" and it automatically cascades down to Canada, the USA, and Mexico.Market.discounts gives you a one-shot reverse lookup.Market.discounts + the order's payment/store information. Turn consistent location identification into an operational rule.markets you specify. Limited-time campaigns can also be layered on per customer.