---
title: PriceRule - GraphQL Admin
description: >-
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](https://shopify.dev/docs/apps/selling-strategies/discounts/getting-started)
instead. These will replace the GraphQL Admin API's
[`PriceRule`](https://shopify.dev/docs/api/admin-graphql/latest/objects/PriceRule)
object and
[`DiscountCode`](https://shopify.dev/docs/api/admin-graphql/latest/unions/DiscountCode)
union, and the REST Admin API's
deprecated[`PriceRule`](https://shopify.dev/docs/api/admin-rest/unstable/resources/pricerule)
resource.
api_version: 2026-01
api_name: admin
type: object
api_type: graphql
source_url:
html: 'https://shopify.dev/docs/api/admin-graphql/latest/objects/PriceRule'
md: 'https://shopify.dev/docs/api/admin-graphql/latest/objects/PriceRule.md'
---
# PriceRule
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 \\\Price\Rule\\\ object and \\\Discount\Code\\\ union, and the REST Admin API\'s deprecated\\\Price\Rule\\\ resource.
***
## Fields
* allocationLimit
[Int](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Int)
The maximum number of times that the price rule can be allocated onto an order.
* allocationMethod
[PriceRuleAllocationMethod!](https://shopify.dev/docs/api/admin-graphql/latest/enums/PriceRuleAllocationMethod)
non-null
The method by which the price rule's value is allocated to its entitled items.
* app
[App](https://shopify.dev/docs/api/admin-graphql/latest/objects/App)
The application that created the price rule.
* combinesWith
[DiscountCombinesWith!](https://shopify.dev/docs/api/admin-graphql/latest/objects/DiscountCombinesWith)
non-null
The [discount classes](https://help.shopify.com/manual/discounts/combining-discounts/discount-combinations) that you can use in combination with [Shopify discount types](https://help.shopify.com/manual/discounts/discount-types).
* createdAt
[DateTime!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/DateTime)
non-null
The date and time when the price rule was created.
* customerSelection
[PriceRuleCustomerSelection!](https://shopify.dev/docs/api/admin-graphql/latest/objects/PriceRuleCustomerSelection)
non-null
The customers that can use this price rule.
* discountClasses
[\[DiscountClass!\]!](https://shopify.dev/docs/api/admin-graphql/latest/enums/DiscountClass)
non-null
The classes of the discount.
* discountCodes
[PriceRuleDiscountCodeConnection!](https://shopify.dev/docs/api/admin-graphql/latest/connections/PriceRuleDiscountCodeConnection)
non-null
List of the price rule's discount codes.
* first
[Int](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Int)
### Arguments
The first `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).
* after
[String](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String)
The elements that come after the specified [cursor](https://shopify.dev/api/usage/pagination-graphql).
* last
[Int](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Int)
The last `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).
* before
[String](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String)
The elements that come before the specified [cursor](https://shopify.dev/api/usage/pagination-graphql).
* reverse
[Boolean](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Boolean)
Default:false
Reverse the order of the underlying list.
* sortKey
[DiscountCodeSortKeys](https://shopify.dev/docs/api/admin-graphql/latest/enums/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](https://shopify.dev/api/usage/pagination-graphql#search-performance-considerations).
* query
[String](https://shopify.dev/docs/api/admin-graphql/latest/scalars/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](https://shopify.dev/api/usage/search-syntax).
* * default
string
* id
id
* times\_used
integer
- Filter by a case-insensitive search of multiple fields in a document.
- Example:
* `query=Bob Norman`
* `query=title:green hoodie`
Filter by `id` range.
- Example:
* `id:1234`
* `id:>=1234`
* `id:<=1234`
* savedSearchId
[ID](https://shopify.dev/docs/api/admin-graphql/latest/scalars/ID)
The ID of a [saved search](https://shopify.dev/api/admin-graphql/latest/objects/savedsearch#field-id). The search’s query string is used as the query argument.
***
* discountCodesCount
[Count](https://shopify.dev/docs/api/admin-graphql/latest/objects/Count)
How many discount codes associated with the price rule.
* endsAt
[DateTime](https://shopify.dev/docs/api/admin-graphql/latest/scalars/DateTime)
The date and time when the price rule ends. For open-ended price rules, use `null`.
* events
[EventConnection!](https://shopify.dev/docs/api/admin-graphql/latest/connections/EventConnection)
non-null
The paginated list of events associated with the price rule.
* first
[Int](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Int)
### Arguments
The first `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).
* after
[String](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String)
The elements that come after the specified [cursor](https://shopify.dev/api/usage/pagination-graphql).
* last
[Int](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Int)
The last `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).
* before
[String](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String)
The elements that come before the specified [cursor](https://shopify.dev/api/usage/pagination-graphql).
* reverse
[Boolean](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Boolean)
Default:false
Reverse the order of the underlying list.
* sortKey
[EventSortKeys](https://shopify.dev/docs/api/admin-graphql/latest/enums/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](https://shopify.dev/api/usage/pagination-graphql#search-performance-considerations).
* query
[String](https://shopify.dev/docs/api/admin-graphql/latest/scalars/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](https://shopify.dev/api/usage/search-syntax).
* * action
string
* comments
boolean
* created\_at
time
* id
id
* subject\_type
string
- The action that occured.
- Example:
* `action:create`
Whether or not to include [comment-events](https://shopify.dev/api/admin-graphql/latest/objects/CommentEvent) in your search, passing `false` will exclude comment-events, any other value will include comment-events.
- Example:
* `false`
* `true`
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:=1234`
* `id:<=1234`
The resource type affected by this event. See [EventSubjectType](https://shopify.dev/api/admin-graphql/latest/enums/EventSubjectType) for possible values.
Example:
* `PRODUCT_VARIANT`
* `PRODUCT`
* `COLLECTION`
***
* features
[\[PriceRuleFeature!\]!](https://shopify.dev/docs/api/admin-graphql/latest/enums/PriceRuleFeature)
non-null
A list of the price rule's features.
* hasTimelineComment
[Boolean!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Boolean)
non-null
Indicates whether there are any timeline comments on the price rule.
* id
[ID!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/ID)
non-null
A globally-unique ID.
* itemEntitlements
[PriceRuleItemEntitlements!](https://shopify.dev/docs/api/admin-graphql/latest/objects/PriceRuleItemEntitlements)
non-null
The items to which the price rule applies.
* itemPrerequisites
[PriceRuleLineItemPrerequisites!](https://shopify.dev/docs/api/admin-graphql/latest/objects/PriceRuleLineItemPrerequisites)
non-null
The items required for the price rule to be applicable.
* legacyResourceId
[UnsignedInt64!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/UnsignedInt64)
non-null
The ID of the corresponding resource in the REST Admin API.
* oncePerCustomer
[Boolean!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Boolean)
non-null
Whether the price rule can be applied only once per customer.
* prerequisiteQuantityRange
[PriceRuleQuantityRange](https://shopify.dev/docs/api/admin-graphql/latest/objects/PriceRuleQuantityRange)
The number of the entitled items must fall within this range for the price rule to be applicable.
* prerequisiteShippingPriceRange
[PriceRuleMoneyRange](https://shopify.dev/docs/api/admin-graphql/latest/objects/PriceRuleMoneyRange)
The shipping cost must fall within this range for the price rule to be applicable.
* prerequisiteSubtotalRange
[PriceRuleMoneyRange](https://shopify.dev/docs/api/admin-graphql/latest/objects/PriceRuleMoneyRange)
The sum of the entitled items subtotal prices must fall within this range for the price rule to be applicable.
* prerequisiteToEntitlementQuantityRatio
[PriceRulePrerequisiteToEntitlementQuantityRatio](https://shopify.dev/docs/api/admin-graphql/latest/objects/PriceRulePrerequisiteToEntitlementQuantityRatio)
Quantity of prerequisite items required for the price rule to be applicable, compared to quantity of entitled items.
* shareableUrls
[\[PriceRuleShareableUrl!\]!](https://shopify.dev/docs/api/admin-graphql/latest/objects/PriceRuleShareableUrl)
non-null
URLs that can be used to share the discount.
* shippingEntitlements
[PriceRuleShippingLineEntitlements!](https://shopify.dev/docs/api/admin-graphql/latest/objects/PriceRuleShippingLineEntitlements)
non-null
The shipping lines to which the price rule applies.
* startsAt
[DateTime!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/DateTime)
non-null
The date and time when the price rule starts.
* status
[PriceRuleStatus!](https://shopify.dev/docs/api/admin-graphql/latest/enums/PriceRuleStatus)
non-null
The status of the price rule.
* summary
[String](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String)
A detailed summary of the price rule.
* target
[PriceRuleTarget!](https://shopify.dev/docs/api/admin-graphql/latest/enums/PriceRuleTarget)
non-null
The type of lines (line\_item or shipping\_line) to which the price rule applies.
* title
[String!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String)
non-null
The title of the price rule.
* totalSales
[MoneyV2](https://shopify.dev/docs/api/admin-graphql/latest/objects/MoneyV2)
The total sales from orders where the price rule was used.
* usageCount
[Int!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/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.
* usageLimit
[Int](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Int)
The maximum number of times that the price rule can be used in total.
* validityPeriod
[PriceRuleValidityPeriod!](https://shopify.dev/docs/api/admin-graphql/latest/objects/PriceRuleValidityPeriod)
non-null
A time period during which a price rule is applicable.
* valueV2
[PricingValue!](https://shopify.dev/docs/api/admin-graphql/latest/unions/PricingValue)
non-null
The value of the price rule.
### Deprecated fields
* discountClass
[DiscountClass!](https://shopify.dev/docs/api/admin-graphql/latest/enums/DiscountClass)
non-nullDeprecated
* entitlementToPrerequisiteQuantityRatio
[PriceRuleEntitlementToPrerequisiteQuantityRatio](https://shopify.dev/docs/api/admin-graphql/latest/objects/PriceRuleEntitlementToPrerequisiteQuantityRatio)
Deprecated
* traits
[\[PriceRuleTrait!\]!](https://shopify.dev/docs/api/admin-graphql/latest/enums/PriceRuleTrait)
non-nullDeprecated
* value
[PriceRuleValue!](https://shopify.dev/docs/api/admin-graphql/latest/unions/PriceRuleValue)
non-nullDeprecated
***
## Map
### Fields with this object
* [DraftOrderDiscountNotAppliedWarning.priceRule](https://shopify.dev/docs/api/admin-graphql/latest/objects/DraftOrderDiscountNotAppliedWarning#field-DraftOrderDiscountNotAppliedWarning.fields.priceRule)
***
## Interfaces
* * [CommentEventSubject](https://shopify.dev/docs/api/admin-graphql/latest/interfaces/CommentEventSubject)
interface
* [HasEvents](https://shopify.dev/docs/api/admin-graphql/latest/interfaces/HasEvents)
interface
* [LegacyInteroperability](https://shopify.dev/docs/api/admin-graphql/latest/interfaces/LegacyInteroperability)
interface
* [Node](https://shopify.dev/docs/api/admin-graphql/latest/interfaces/Node)
interface
***
## PriceRule Implements
### Implements
* [CommentEventSubject](https://shopify.dev/docs/api/admin-graphql/latest/interfaces/CommentEventSubject)
* [HasEvents](https://shopify.dev/docs/api/admin-graphql/latest/interfaces/HasEvents)
* [LegacyInteroperability](https://shopify.dev/docs/api/admin-graphql/latest/interfaces/LegacyInteroperability)
* [Node](https://shopify.dev/docs/api/admin-graphql/latest/interfaces/Node)