Discount Context
Requires Apps must have access scope.
The type used to define which buyers can use the discount.
Anchor to Possible typesPossible types
- •OBJECT
Indicates that a discount applies to all buyers without restrictions, enabling universal promotions that reach every customer. This selection removes buyer-specific limitations from discount eligibility.
For example, a flash sale or grand opening promotion would target all buyers to maximize participation and store visibility.
Learn more about discount targeting.
- •Discount
Buyer Selection! non-null All buyers are eligible for the discount.
- •Discount
- •OBJECT
Defines customer targeting for discounts through specific individual customers. This object allows merchants to create exclusive discounts that are only available to explicitly selected customers.
For example, a VIP customer appreciation discount might target specific high-value customers by individually selecting them, or a beta program discount could be offered to selected early adopters.
Use
to:
- Target specific individual customers for exclusive promotions
- Create personalized discount experiences for selected customers
- Offer special discounts to VIP or loyal customers
- Provide exclusive access to promotions for specific individuals
This targeting method requires you to add each customer who should be eligible for the discount. For broader targeting based on customer attributes or segments, use
instead.
Learn more about creating customer-specific discounts using
and
.
- Anchor to customerscustomers•[Customer!]!non-null
The list of individual customers eligible for the discount.
- •OBJECT
Represents customer segments that are eligible to receive a specific discount, allowing merchants to target promotions to defined groups of customers. This enables personalized marketing campaigns based on customer behavior and characteristics.
For example, a "VIP Customer 15% Off" promotion might target a segment of high-value repeat customers, while a "New Customer Welcome" discount could focus on first-time buyers.
Segment-based discounts help merchants create more relevant promotional experiences and improve conversion rates by showing the right offers to the right customers at the right time.
- Anchor to segmentssegments•[Segment!]!non-null
The list of customer segments who are eligible for the discount.
Anchor to Fields with this unionFields with this union
- •OBJECT
The
object stores information about automatic discounts that are managed by an app using Shopify Functions. Use
when you need advanced, custom, or dynamic discount capabilities that aren't supported by Shopify's native discount types.
Learn more about creating custom discount functionality.
NoteThe
object has similar functionality to the
object, with the exception that
stores information about discount codes that are managed by an app using Shopify Functions.
API versions prior to
2025-10
only return automatic discounts withcontext
set toall
, discounts with other values are filtered out.- •OBJECT
The
object lets you manage amount off discounts that are automatically applied on a cart and at checkout. Amount off discounts give customers a fixed value or a percentage off the products in an order, but don't apply to shipping costs.
The
object stores information about automatic amount off discounts that apply to specific products and variants, collections, or all items in a cart.
Learn more about working with Shopify's discount model, including limitations and considerations.
Note- •OBJECT
The
object lets you manage buy X get Y discounts (BXGY) that are automatically applied on a cart and at checkout. BXGY discounts incentivize customers by offering them additional items at a discounted price or for free when they purchase a specified quantity of items.
The
object stores information about automatic BXGY discounts that apply to specific products and variants, collections, or all items in a cart.
Learn more about working with Shopify's discount model, including limitations and considerations.
Note- •OBJECT
The
object lets you manage free shipping discounts that are automatically applied on a cart and at checkout. Free shipping discounts are promotional deals that merchants offer to customers to waive shipping costs and encourage online purchases.
The
object stores information about automatic free shipping discounts that apply to specific products and variants, collections, or all items in a cart.
Learn more about working with Shopify's discount model, including limitations and considerations.
Note- •OBJECT
The
object stores information about code discounts that are managed by an app using Shopify Functions. Use
when you need advanced, custom, or dynamic discount capabilities that aren't supported by Shopify's native discount types.
Learn more about creating custom discount functionality.
Note- •OBJECT
The
object lets you manage amount off discounts that are applied on a cart and at checkout when a customer enters a code. Amount off discounts give customers a fixed value or a percentage off the products in an order, but don't apply to shipping costs.
The
object stores information about amount off code discounts that apply to specific products and variants, collections, or all items in a cart.
Learn more about working with Shopify's discount model, including limitations and considerations.
Note- •OBJECT
The
object lets you manage buy X get Y discounts (BXGY) that are applied on a cart and at checkout when a customer enters a code. BXGY discounts incentivize customers by offering them additional items at a discounted price or for free when they purchase a specified quantity of items.
The
object stores information about BXGY code discounts that apply to specific products and variants, collections, or all items in a cart.
Learn more about working with Shopify's discount model, including limitations and considerations.
Note- •OBJECT
The
object lets you manage free shipping discounts that are applied on a cart and at checkout when a customer enters a code. Free shipping discounts are promotional deals that merchants offer to customers to waive shipping costs and encourage online purchases.
The
object stores information about free shipping code discounts that apply to specific products and variants, collections, or all items in a cart.
Learn more about working with Shopify's discount model, including limitations and considerations.
Note