Skip to main content
Anchor to DiscountNodeConnection

DiscountNodeConnection

connection

An auto-generated type for paginating through multiple DiscountNodes.

Anchor to Fields with this connectionFields with this connection

•OBJECT

The fields that will be kept as part of a customer merge preview.

•OBJECT

A merchant-defined group of buyers identified by conditions such as their region, retail location, or company location. Each market allows configuration of a distinct, localized buyer experience. Customizations include, but are not limited to, currency, pricing and product availability, web presence, and content translations.


Was this section helpful?

Anchor to Queries with this connectionQueries with this connection

•query

Returns a list of discounts.

Arguments

•String

The elements that come after the specified cursor.

•String

The elements that come before the specified cursor.

•Int

The first n elements from the paginated list.

•Int

The last n elements from the paginated list.

•String

A filter made up of terms, connectives, modifiers, and comparators. You can apply one or more filters to a query. Learn more about Shopify API search syntax.

Anchor to default
•string

Filter by a case-insensitive search of multiple fields in a document.

Example:

  • query=Bob Norman
  • query=title:green hoodie
•string

Filter by the discount code. Not supported for bulk discounts.

Example:

  • code:WELCOME10
Anchor to combines_with
•string

Filter by the Shopify Functions discount classes that the discount type can combine with. Supports multiple values separated by commas (e.g., combines_with:product_discounts,order_discounts).

Valid values:

  • order_discounts
  • product_discounts
  • shipping_discounts

Example:

  • combines_with:product_discounts
  • combines_with:product_discounts,order_discounts
Anchor to combines_with.product_discounts_with_tags_on_same_cart_line
•string

Filter by a combines with tag applied to discounts on the same cart line. Supports multiple tags separated by commas (e.g., combines_with.product_discounts_with_tags_on_same_cart_line:priority,exclusive).

Example:

  • combines_with.product_discounts_with_tags_on_same_cart_line:priority
  • combines_with.product_discounts_with_tags_on_same_cart_line:priority,exclusive
Anchor to context
•string

Filter by the context type. Supports multiple values separated by commas (e.g., context:all,market). When multiple values are provided, results include discounts that match any of them.

Valid values:

  • all
  • customer
  • segment
  • market

Example:

  • context:segment
  • context:all,market
Anchor to created_at
•time

Filter by the date and time, in the shop's timezone, when the discount was created.

Example:

  • created_at:>'2020-10-21T23:39:20Z'
  • created_at:<now
  • created_at:<='2024'
Anchor to customer_ids
•string

Filter by specific customer IDs that are eligible for the discount.

Example:

  • customer_ids:123456789
  • customer_ids:123,456
Anchor to discount_class
•string

Filter by the discount class. Supports multiple classes separated by commas (e.g., discount_class:product,order).

Valid values:

  • order
  • product
  • shipping

Example:

  • discount_class:product
  • discount_class:product,order
Anchor to discount_type
•string

Filter by the discount type. Supports multiple types separated by commas (e.g., discount_type:percentage,fixed_amount).

Valid values:

  • app
  • bogo
  • fixed_amount
  • free_shipping
  • percentage

Example:

  • discount_type:fixed_amount
  • discount_type:percentage,fixed_amount
Anchor to ends_at
•time

Filter by the date and time, in the shop's timezone, when the discount ends.

Example:

  • ends_at:>'2020-10-21T23:39:20Z'
  • ends_at:<now
  • ends_at:<='2024'
•id

Filter by id range.

Example:

  • id:1234
  • id:>=1234
  • id:<=1234
Anchor to market_ids
•string

Filter by specific market IDs that are eligible for the discount. Supports multiple IDs separated by commas (e.g., market_ids:123,456).

Example:

  • market_ids:123456789
  • market_ids:123,456
•string

Filter by the discount method. Supports multiple methods separated by commas (e.g., method:code,automatic).

Anchor to - `automatic`<br/> - `code`
•
  • method:code
    - method:code,automatic
Anchor to segment_ids
•string

Filter by specific segment IDs that are eligible for the discount. Supports multiple IDs separated by commas (e.g., segment_ids:123,456).

Example:

  • segment_ids:123456789
  • segment_ids:123,456
Anchor to starts_at
•time

Filter by the date and time, in the shop's timezone, when the discount becomes active and is available for customer use.

Example:

  • starts_at:>'2020-10-21T23:39:20Z'
  • starts_at:<now
  • starts_at:<='2024'
•string

Filter by the status of the discount. Supports multiple statuses separated by commas (e.g., status:active,scheduled).

Valid values:

  • active
  • expired
  • scheduled

Example:

  • status:scheduled
  • status:active,scheduled
•string

Filter by a tag applied to the discount. Supports multiple tags separated by commas (e.g., tag:loyalty,clearance).

Example:

  • tag:loyalty
  • tag:loyalty,clearance
Anchor to times_used
•integer

Filter by the number of times the discount has been used. For example, if a "Buy 3, Get 1 Free" t-shirt discount is automatically applied in 200 transactions, then the discount has been used 200 times.

This value is updated asynchronously. As a result, it might be different than the actual usage count.

Example:

  • times_used:0
  • times_used:>150
  • times_used:>=200
•string

Filter by the discount name that displays to merchants in the Shopify admin and to customers.

Example:

  • title:Black Friday Sale
•string

Filter by the discount type. Supports multiple types separated by commas (e.g., type:percentage,fixed_amount).

Valid values:

  • all
  • all_with_app
  • app
  • bxgy
  • fixed_amount
  • free_shipping
  • percentage

Example:

  • type:percentage
  • type:percentage,fixed_amount
Anchor to updated_at
•time

Filter by the date and time, in the shop's timezone, when the discount was last updated.

Example:

  • updated_at:>'2020-10-21T23:39:20Z'
  • updated_at:<now
  • updated_at:<='2024'
•Boolean
Default:false

Reverse the order of the underlying list.

•ID

The ID of a saved search. The search’s query string is used as the query argument.

•DiscountSortKeys
Default:ID

Sort the underlying list using a key. If your query is slow or returns an error, then try specifying a sort key that matches the field used in the search.



Was this section helpful?

•[DiscountNodeEdge!]!
non-null

The connection between the node and its parent. Each edge contains a minimum of the edge's cursor and the node.

•[DiscountNode!]!
non-null

A list of nodes that are contained in DiscountNodeEdge. You can fetch data about an individual node, or you can follow the edges to fetch data about a collection of related nodes. At each node, you specify the fields that you want to retrieve.

•PageInfo!
non-null

An object that’s used to retrieve cursor information about the current page.


Was this section helpful?