PriceRule
Requires 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 object and REST Admin
and
resources.
Anchor to Fields and connectionsFields and connections
- Anchor to allocationLimitallocation•
Limit The maximum number of times that the price rule can be allocated onto an order.
- Anchor to allocationMethodallocation•
Method PriceRule non-nullAllocation Method! The method by which the price rule's value is allocated to its entitled items.
- •
The application that created the price rule.
- Anchor to combinesWithcombines•
With DiscountCombines non-nullWith! The discount classes that you can use in combination with Shopify discount types.
- Anchor to createdAtcreated•
At DateTime! non-null The date and time when the price rule was created.
- Anchor to customerSelectioncustomer•
Selection PriceRule non-nullCustomer Selection! The customers that can use this price rule.
- Anchor to discountClassdiscount•
Class DiscountClass! non-null The discount class that's used to control how discounts can be combined.
- Anchor to discountCodesdiscount•
Codes PriceRule non-nullDiscount Code Connection! List of the price rule's discount codes.
- Anchor to discountCodesCountdiscount•
Codes Count How many discount codes associated with the price rule.
- Anchor to endsAtends•
At The date and time when the price rule ends. For open-ended price rules, use
null
.- Anchor to eventsevents•Event
Connection! non-null The paginated list of events associated with the price rule.
- Anchor to featuresfeatures•[Price
Rule non-nullFeature!]! A list of the price rule's features.
- Anchor to hasTimelineCommenthas•
Timeline Comment Boolean!non-null Indicates whether there are any timeline comments on the price rule.
- •ID!non-null
A globally-unique ID.
- Anchor to itemEntitlementsitem•
Entitlements PriceRule non-nullItem Entitlements! The items to which the price rule applies.
- Anchor to itemPrerequisitesitem•
Prerequisites PriceRule non-nullLine Item Prerequisites! The items required for the price rule to be applicable.
- Anchor to legacyResourceIdlegacy•
Resource Id UnsignedInt64! non-null The ID of the corresponding resource in the REST Admin API.
- Anchor to oncePerCustomeronce•
Per Customer Boolean!non-null Whether the price rule can be applied only once per customer.
- Anchor to prerequisiteQuantityRangeprerequisite•
Quantity Range The number of the entitled items must fall within this range for the price rule to be applicable.
- Anchor to prerequisiteShippingPriceRangeprerequisite•
Shipping Price Range The shipping cost must fall within this range for the price rule to be applicable.
- Anchor to prerequisiteSubtotalRangeprerequisite•
Subtotal Range The sum of the entitled items subtotal prices must fall within this range for the price rule to be applicable.
- Anchor to prerequisiteToEntitlementQuantityRatioprerequisite•
To Entitlement Quantity Ratio Quantity of prerequisite items required for the price rule to be applicable, compared to quantity of entitled items.
- Anchor to shareableUrlsshareable•
Urls [PriceRule non-nullShareable Url!]! URLs that can be used to share the discount.
- Anchor to shippingEntitlementsshipping•
Entitlements The shipping lines to which the price rule applies.
- Anchor to startsAtstarts•
At DateTime! non-null The date and time when the price rule starts.
- Anchor to statusstatus•Price
Rule non-nullStatus! The status of the price rule.
- Anchor to summarysummary•
A detailed summary of the price rule.
- Anchor to targettarget•Price
Rule non-nullTarget! The type of lines (line_item or shipping_line) to which the price rule applies.
- Anchor to titletitle•String!non-null
The title of the price rule.
- Anchor to totalSalestotal•
Sales The total sales from orders where the price rule was used.
- Anchor to usageCountusage•
Count 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.
- Anchor to usageLimitusage•
Limit The maximum number of times that the price rule can be used in total.
- Anchor to validityPeriodvalidity•
Period PriceRule non-nullValidity Period! A time period during which a price rule is applicable.
- Anchor to valueV2value•
V2 PricingValue! non-null The value of the price rule.