Skip to main content
Log inSign up
object

Requires read_price_rules access scope.

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 instead. These will replace the GraphQL PriceRule object and REST Admin PriceRule and DiscountCode resources.

Anchor to Fields and connectionsFields and connections

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

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

The application that created the price rule.

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

DateTime!non-null

The date and time when the price rule was created.

The customers that can use this price rule.

The discount class that's used to control how discounts can be combined.

List of the price rule's discount codes.

How many discount codes associated with the price rule.

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

The paginated list of events associated with the price rule.

A list of the price rule's features.

Boolean!non-null

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

ID!non-null

A globally-unique ID.

The items to which the price rule applies.

The items required for the price rule to be applicable.

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

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

Anchor to prerequisiteShippingPriceRangeprerequisiteShippingPriceRange

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

Anchor to prerequisiteSubtotalRangeprerequisiteSubtotalRange

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

Anchor to prerequisiteToEntitlementQuantityRatioprerequisiteToEntitlementQuantityRatio

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

URLs that can be used to share the discount.

Anchor to shippingEntitlementsshippingEntitlements

The shipping lines to which the price rule applies.

DateTime!non-null

The date and time when the price rule starts.

The status of the price rule.

A detailed summary of the price rule.

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

String!non-null

The title of the price rule.

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

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.

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

A time period during which a price rule is applicable.

The value of the price rule.

Show
deprecated fields and connections Deprecated
Anchor to entitlementToPrerequisiteQuantityRatioentitlementToPrerequisiteQuantityRatio

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

[PriceRuleTrait!]!non-nullDeprecated

A list of the price rule's features. Use features instead.

PriceRuleValue!non-nullDeprecated

The value of the price rule. Use valueV2 instead.


Was this section helpful?

Show
deprecated queries Deprecated
queryDeprecated

Returns a code price rule resource by ID. Use codeDiscountNode instead.

queryDeprecated

Returns a list of price rule resources that have at least one associated discount code. Use codeDiscountNodes instead.


Was this section helpful?

Show
deprecated mutations Deprecated
mutationDeprecated

Activate a price rule. Use discountCodeActivate instead.

mutationDeprecated

Create a price rule using the input. Use discountCodeBasicCreate instead.

mutationDeprecated

Deactivate a price rule. Use discountCodeDeactivate instead.

mutationDeprecated

Create a discount code for a price rule. Use discountRedeemCodeBulkAdd instead.

mutationDeprecated

Update a discount code for a price rule. Use discountCodeBasicUpdate instead.

mutationDeprecated

Updates a price rule using its ID and an input. Use discountCodeBasicUpdate instead.


Was this section helpful?