Skip to main content
Log inSign up

Shopify uses cookies to provide necessary site functionality and improve your experience. By using our website, you agree to our privacy policy and our cookie policy.

queryDeprecated

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

ID!required

The ID of the PriceRule to return.


Was this section helpful?

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.

allocationLimit

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

allocationMethod
non-null

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

app

The application that created the price rule.

combinesWith
non-null

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

createdAt
non-null

The date and time when the price rule was created.

customerSelection
non-null

The customers that can use this price rule.

discountClass
non-null

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

discountCodes
non-null

List of the price rule's discount codes.

discountCodesCount

How many discount codes associated with the price rule.

endsAt

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

events
non-null

The paginated list of events associated with the price rule.

features
non-null

A list of the price rule's features.

hasTimelineComment
non-null

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

id
non-null

A globally-unique ID.

itemEntitlements
non-null

The items to which the price rule applies.

itemPrerequisites
non-null

The items required for the price rule to be applicable.

legacyResourceId
non-null

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

oncePerCustomer
non-null

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

prerequisiteQuantityRange

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

prerequisiteShippingPriceRange

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

prerequisiteSubtotalRange

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

prerequisiteToEntitlementQuantityRatio

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

shareableUrls
non-null

URLs that can be used to share the discount.

shippingEntitlements
non-null

The shipping lines to which the price rule applies.

startsAt
non-null

The date and time when the price rule starts.

status
non-null

The status of the price rule.

summary

A detailed summary of the price rule.

target
non-null

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

title
non-null

The title of the price rule.

totalSales

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

usageCount
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

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

validityPeriod
non-null

A time period during which a price rule is applicable.

valueV2
non-null

The value of the price rule.

entitlementToPrerequisiteQuantityRatio
Deprecated

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

traits
non-nullDeprecated

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

value
non-nullDeprecated

The value of the price rule. Use valueV2 instead.


Was this section helpful?