PriceRules
Defines discount conditions and benefits (fixed amount, percentage, or free shipping) that generate discount codes or automatic discounts.
Columns
| Name | Type | ReadOnly | References | Description |
| Id [KEY] | Long | True |
A unique numeric identifier for the price rule. | |
| AllocationMethod | String | False |
Specifies how the discount amount is distributed. Valid values: each – applies the discount to each entitled item; across – applies the total discount across all entitled items. The allowed values are each, across. | |
| CustomerSelection | String | False |
Defines which customers are eligible for the price rule. Valid values: all – applies to all customers; prerequisite – applies only to customers in the specified saved searches or customer list. The allowed values are all, prerequisite. | |
| EntitledCollectionIds | String | False |
A comma-separated list of collection IDs whose products are eligible for the discount. Used only when TargetType is line_item and TargetSelection is entitled. Cannot be combined with EntitledProductIds or EntitledVariantIds. | |
| EntitledCountryIds | String | False |
A comma-separated list of country IDs whose shipping lines are eligible for the discount. Used only when TargetType is shipping_line and TargetSelection is entitled. | |
| EntitledProductIds | String | False |
A comma-separated list of product IDs eligible for the discount. Used only when TargetType is line_item and TargetSelection is entitled. | |
| EntitledVariantIds | String | False |
A comma-separated list of product variant IDs eligible for the discount. Used only when TargetType is line_item and TargetSelection is entitled. | |
| OncePerCustomer | Bool | False |
Indicates whether each customer can use the discount only once. Tracked using the customer ID. | |
| PrerequisiteCustomerIds | String | False |
A list of specific customer IDs who qualify for this price rule. Cannot be used together with PrerequisiteSavedSearchIds. | |
| PrerequisiteQuantityRange | String | False |
The minimum quantity required for the price rule to apply. Contains the property greater_than_or_equal_to defining the threshold. | |
| PrerequisiteSavedSearchIds | String | False |
A list of saved customer search IDs. Customers must be in one of these searches to qualify. Cannot be used with PrerequisiteCustomerIds. | |
| PrerequisiteShippingPriceRange | String | False |
The maximum shipping cost allowed for the price rule to apply. Contains the property less_than_or_equal_to defining the threshold. | |
| PrerequisiteSubtotalRange | String | False |
The minimum subtotal required for the price rule to apply. Contains the property greater_than_or_equal_to defining the threshold. | |
| TargetSelection | String | False |
Specifies which items the discount applies to. Valid values: all – applies to all eligible items; entitled – applies only to selected entitlements. | |
| TargetType | String | False |
Specifies what the discount applies to. Valid values: line_item – applies to cart line items; shipping_line – applies to shipping lines. | |
| UsageLimit | Int | False |
The maximum number of times the price rule can be used per discount code. | |
| PrerequisiteProductIds | String | False |
A list of product IDs required for a Buy X Get Y discount. Must be used with TargetType=line_item, TargetSelection=entitled, AllocationMethod=each, and a defined PrerequisiteToEntitlementQuantityRatio. | |
| PrerequisiteVariantIds | String | False |
A list of variant IDs required for a Buy X Get Y discount. Must be used with TargetType=line_item, TargetSelection=entitled, AllocationMethod=each, and a defined PrerequisiteToEntitlementQuantityRatio. | |
| PrerequisiteCollectionIds | String | False |
A list of collection IDs required for a Buy X Get Y discount. Cannot be combined with PrerequisiteProductIds or PrerequisiteVariantIds. | |
| Value | Decimal | False |
The discount amount or percentage represented as a negative number. If TargetType is shipping_line, only -100 is accepted. | |
| ValueType | String | False |
Specifies the discount type. Valid values: fixed_amount – applies a fixed currency discount; percentage – applies a percentage discount. If TargetType is shipping_line, only percentage is valid. | |
| PrerequisiteToEntitlementQuantityRatio | String | False |
Defines the Buy X Get Y ratio for applicable discounts. Specifies the number of items to buy (prerequisite_quantity) and the number offered (entitled_quantity). | |
| Images | String | False |
A list of image objects related to the product or rule. | |
| ProductType | String | False |
The category or classification of the product related to the rule, useful for filtering and searching. | |
| Options | String | True |
Custom property names associated with the product. | |
| PublishedScope | String | False |
Indicates where the product is published. Typically includes online store and Point of Sale channels. | |
| Tags | String | False |
Keywords or labels assigned for categorization. Separate multiple tags with commas. | |
| TemplateSuffix | String | True |
The suffix of the Liquid template being used for the product page. | |
| Title | String | False |
The display name or title of the price rule or related product. | |
| Vendor | String | False |
The name of the vendor associated with the product or rule. | |
| StartsAt | Datetime | False |
The date and time when the price rule becomes active. | |
| EndsAt | Datetime | False |
The date and time when the price rule expires. Must be later than StartsAt. | |
| PublishedAt | Datetime | True |
The date and time when the rule or product was published to the online store channel. | |
| CreatedAt | Datetime | True |
The date and time when the price rule was created. | |
| UpdatedAt | Datetime | True |
The date and time when the price rule was last modified. |
Pseudo-Columns
Pseudo-columns are fields that can only be used in the types of statements under which they are explicitly listed. They are not standard columns but instead provide additional functionality for specific operations.
| Name | Type | Description |
| Published | Bool |
Indicates whether the associated product is published (true) or hidden (false). |
| MetafieldsGlobalTitleTag | String |
An SEO-optimized title for the product or price rule. |
| MetafieldsGlobalDescriptionTag | String |
An SEO-optimized description for the product or price rule. |