Skip to main content
object

Requires read_price_rules access scope.

A set of conditions, including entitlements and prerequisites, that must be met for a discount code to apply.


Note

Use the types and queries included our discount tutorials instead. These will replace the GraphQL Admin API's PriceRule object and DiscountCode union, and the REST Admin API's deprecatedPriceRule resource.


•Int

The maximum number of times that the price rule can be allocated onto an order.

•PriceRuleAllocationMethod!
non-null

The method by which the price rule's value is allocated to its entitled items.

Show enum values
•App

The application that created the price rule.

Show fields
•DiscountCombinesWith!
non-null

The discount classes that you can use in combination with Shopify discount types.

Show fields
•DateTime!
non-null

The date and time when the price rule was created.

•PriceRuleCustomerSelection!
non-null

The customers that can use this price rule.

Show fields
•[DiscountClass!]!
non-null

The classes of the discount.

Show enum values
•PriceRuleDiscountCodeConnection!
non-null

List of the price rule's discount codes.

Show fields

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.

Show filters
Anchor to default
•string

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

Example:

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

Filter by id range.

Example:

  • id:1234
  • id:>=1234
  • id:<=1234
Anchor to times_used
•integer
•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.

•DiscountCodeSortKeys
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.

Show enum values

•Count

How many discount codes associated with the price rule.

Show fields
•DateTime

The date and time when the price rule ends. For open-ended price rules, use null.

•EventConnection!
non-null

The paginated list of events associated with the price rule.

Show fields

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.

Show filters
•string

The action that occured.

Example:

  • action:create
Anchor to comments
•boolean

Whether or not to include comment-events in your search, passing false will exclude comment-events, any other value will include comment-events.

Example:

  • false
  • true
Anchor to created_at
•time

Filter by the date and time when the event occurred. Event data is retained for 1 year.

Example:

  • created_at:>2025-10-21
  • created_at:<now
•id

Filter by id range.

Example:

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

The resource type affected by this event. See EventSubjectType for possible values.

Example:

  • PRODUCT_VARIANT
  • PRODUCT
  • COLLECTION
•Boolean
Default:false

Reverse the order of the underlying list.

•EventSortKeys
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.

Show enum values

•[PriceRuleFeature!]!
non-null

A list of the price rule's features.

Show enum values
•Boolean!
non-null

Indicates whether there are any timeline comments on the price rule.

•ID!
non-null

A globally-unique ID.

•PriceRuleItemEntitlements!
non-null

The items to which the price rule applies.

Show fields
•PriceRuleLineItemPrerequisites!
non-null

The items required for the price rule to be applicable.

Show fields
•UnsignedInt64!
non-null

The ID of the corresponding resource in the REST Admin API.

•Boolean!
non-null

Whether the price rule can be applied only once per customer.

Anchor to prerequisiteQuantityRangeprerequisiteQuantityRange
•PriceRuleQuantityRange

The number of the entitled items must fall within this range for the price rule to be applicable.

Show fields
Anchor to prerequisiteShippingPriceRangeprerequisiteShippingPriceRange
•PriceRuleMoneyRange

The shipping cost must fall within this range for the price rule to be applicable.

Show fields
Anchor to prerequisiteSubtotalRangeprerequisiteSubtotalRange
•PriceRuleMoneyRange

The sum of the entitled items subtotal prices must fall within this range for the price rule to be applicable.

Show fields
Anchor to prerequisiteToEntitlementQuantityRatioprerequisiteToEntitlementQuantityRatio
•PriceRulePrerequisiteToEntitlementQuantityRatio

Quantity of prerequisite items required for the price rule to be applicable, compared to quantity of entitled items.

Show fields
•[PriceRuleShareableUrl!]!
non-null

URLs that can be used to share the discount.

Show fields
Anchor to shippingEntitlementsshippingEntitlements
•PriceRuleShippingLineEntitlements!
non-null

The shipping lines to which the price rule applies.

Show fields
•DateTime!
non-null

The date and time when the price rule starts.

•PriceRuleStatus!
non-null

The status of the price rule.

Show enum values
•String

A detailed summary of the price rule.

•PriceRuleTarget!
non-null

The type of lines (line_item or shipping_line) to which the price rule applies.

Show enum values
•String!
non-null

The title of the price rule.

•MoneyV2

The total sales from orders where the price rule was used.

Show fields
•Int!
non-null

The number of times that the price rule has been used. This value is updated asynchronously and can be different than the actual usage count.

•Int

The maximum number of times that the price rule can be used in total.

•PriceRuleValidityPeriod!
non-null

A time period during which a price rule is applicable.

Show fields
•PricingValue!
non-null

The value of the price rule.

Show union types

Deprecated fields

•DiscountClass!
non-nullDeprecated
Show enum values
Anchor to entitlementToPrerequisiteQuantityRatioentitlementToPrerequisiteQuantityRatio
•PriceRuleEntitlementToPrerequisiteQuantityRatio
Deprecated
Show fields
•[PriceRuleTrait!]!
non-nullDeprecated
Show enum values
•PriceRuleValue!
non-nullDeprecated
Show union types

Was this section helpful?

•interface

Was this section helpful?