# PriceRule - admin-graphql - OBJECT Version: 2024-10 ## Description Price rules are a set of conditions, including entitlements and prerequisites, that must be met in order for a discount code to apply. We recommend using the types and queries detailed at [Getting started with discounts](https://shopify.dev/docs/apps/selling-strategies/discounts/getting-started) instead. These will replace the GraphQL `PriceRule` object and REST Admin `PriceRule` and `DiscountCode` resources. ### Access Scopes `read_price_rules` access scope. ## Fields * [allocationLimit](/docs/api/admin-graphql/2024-10/scalars/Int): Int - The maximum number of times that the price rule can be allocated onto an order. * [allocationMethod](/docs/api/admin-graphql/2024-10/enums/PriceRuleAllocationMethod): PriceRuleAllocationMethod! - The method by which the price rule's value is allocated to its entitled items. * [app](/docs/api/admin-graphql/2024-10/objects/App): App - The application that created the price rule. * [combinesWith](/docs/api/admin-graphql/2024-10/objects/DiscountCombinesWith): DiscountCombinesWith! - 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](/docs/api/admin-graphql/2024-10/scalars/DateTime): DateTime! - The date and time when the price rule was created. * [customerSelection](/docs/api/admin-graphql/2024-10/objects/PriceRuleCustomerSelection): PriceRuleCustomerSelection! - The customers that can use this price rule. * [discountClass](/docs/api/admin-graphql/2024-10/enums/DiscountClass): DiscountClass! - The [discount class](https://help.shopify.com/manual/discounts/combining-discounts/discount-combinations) that's used to control how discounts can be combined. * [discountCodesCount](/docs/api/admin-graphql/2024-10/objects/Count): Count - How many discount codes associated with the price rule. * [endsAt](/docs/api/admin-graphql/2024-10/scalars/DateTime): DateTime - The date and time when the price rule ends. For open-ended price rules, use `null`. * [entitlementToPrerequisiteQuantityRatio](/docs/api/admin-graphql/2024-10/objects/PriceRuleEntitlementToPrerequisiteQuantityRatio): PriceRuleEntitlementToPrerequisiteQuantityRatio - Quantity of prerequisite items required for the price rule to be applicable, compared to quantity of entitled items. * [features](/docs/api/admin-graphql/2024-10/enums/PriceRuleFeature): PriceRuleFeature! - A list of the price rule's features. * [hasTimelineComment](/docs/api/admin-graphql/2024-10/scalars/Boolean): Boolean! - Indicates whether there are any timeline comments on the price rule. * [id](/docs/api/admin-graphql/2024-10/scalars/ID): ID! - A globally-unique ID. * [itemEntitlements](/docs/api/admin-graphql/2024-10/objects/PriceRuleItemEntitlements): PriceRuleItemEntitlements! - The items to which the price rule applies. * [itemPrerequisites](/docs/api/admin-graphql/2024-10/objects/PriceRuleLineItemPrerequisites): PriceRuleLineItemPrerequisites! - The items required for the price rule to be applicable. * [legacyResourceId](/docs/api/admin-graphql/2024-10/scalars/UnsignedInt64): UnsignedInt64! - The ID of the corresponding resource in the REST Admin API. * [oncePerCustomer](/docs/api/admin-graphql/2024-10/scalars/Boolean): Boolean! - Whether the price rule can be applied only once per customer. * [prerequisiteQuantityRange](/docs/api/admin-graphql/2024-10/objects/PriceRuleQuantityRange): PriceRuleQuantityRange - The number of the entitled items must fall within this range for the price rule to be applicable. * [prerequisiteShippingPriceRange](/docs/api/admin-graphql/2024-10/objects/PriceRuleMoneyRange): PriceRuleMoneyRange - The shipping cost must fall within this range for the price rule to be applicable. * [prerequisiteSubtotalRange](/docs/api/admin-graphql/2024-10/objects/PriceRuleMoneyRange): PriceRuleMoneyRange - The sum of the entitled items subtotal prices must fall within this range for the price rule to be applicable. * [prerequisiteToEntitlementQuantityRatio](/docs/api/admin-graphql/2024-10/objects/PriceRulePrerequisiteToEntitlementQuantityRatio): PriceRulePrerequisiteToEntitlementQuantityRatio - Quantity of prerequisite items required for the price rule to be applicable, compared to quantity of entitled items. * [shareableUrls](/docs/api/admin-graphql/2024-10/objects/PriceRuleShareableUrl): PriceRuleShareableUrl! - URLs that can be used to share the discount. * [shippingEntitlements](/docs/api/admin-graphql/2024-10/objects/PriceRuleShippingLineEntitlements): PriceRuleShippingLineEntitlements! - The shipping lines to which the price rule applies. * [startsAt](/docs/api/admin-graphql/2024-10/scalars/DateTime): DateTime! - The date and time when the price rule starts. * [status](/docs/api/admin-graphql/2024-10/enums/PriceRuleStatus): PriceRuleStatus! - The status of the price rule. * [summary](/docs/api/admin-graphql/2024-10/scalars/String): String - A detailed summary of the price rule. * [target](/docs/api/admin-graphql/2024-10/enums/PriceRuleTarget): PriceRuleTarget! - The type of lines (line_item or shipping_line) to which the price rule applies. * [title](/docs/api/admin-graphql/2024-10/scalars/String): String! - The title of the price rule. * [totalSales](/docs/api/admin-graphql/2024-10/objects/MoneyV2): MoneyV2 - The total sales from orders where the price rule was used. * [traits](/docs/api/admin-graphql/2024-10/enums/PriceRuleTrait): PriceRuleTrait! - A list of the price rule's features. * [usageCount](/docs/api/admin-graphql/2024-10/scalars/Int): Int! - 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](/docs/api/admin-graphql/2024-10/scalars/Int): Int - The maximum number of times that the price rule can be used in total. * [validityPeriod](/docs/api/admin-graphql/2024-10/objects/PriceRuleValidityPeriod): PriceRuleValidityPeriod! - A time period during which a price rule is applicable. * [value](/docs/api/admin-graphql/2024-10/unions/PriceRuleValue): PriceRuleValue! - The value of the price rule. * [valueV2](/docs/api/admin-graphql/2024-10/unions/PricingValue): PricingValue! - The value of the price rule. ## Connections * [discountCodes](/docs/api/admin-graphql/2024-10/connections/PriceRuleDiscountCodeConnection): PriceRuleDiscountCodeConnection! * [events](/docs/api/admin-graphql/2024-10/connections/EventConnection): EventConnection! ## Related queries ## Related mutations ## Related Unions ## Examples