The REST Admin API is a legacy API as of October 1, 2024. Starting April 1, 2025, all new public apps must be built exclusively with the GraphQL Admin API. For details and migration steps, visit our migration guide.
Price Rule
price_rules
access scope.We recommend using the GraphQL Admin API to manage discounts. The Discount types
available in the GraphQL Admin API are intended to replace the GraphQL Admin PriceRule
object and REST Admin PriceRule
and DiscountCode
resources.
You can use the PriceRule resource to create discounts using conditions. You can then associate the conditions with a discount code by using the DiscountCode resource. Merchants can distribute the discount codes to their customers.
Using the PriceRule resource, you can create discounts that specify a discount as a percentage, a fixed amount, or free shipping. You use entitlements and prerequisites to dynamically build these discounts.
To learn about how to associate a price rule with a discount code, see the DiscountCode resource.
Create a price rule
You can create price rules with entitlements and prerequisites. Entitlements describe the designated resources that a discount applies to, such as specific products, variants, or collections. Prerequisites describe the requirements that must be met in order for the discount to apply to the entitled resources. For example, you might want a discount to apply only to a certain shipping price range, or a certain subtotal range.
You can use entitlements, prereqisites, and other conditions to create discounts, such as the following examples:
- $10 off the buyer's order if the total exceeds $40
- 15% off certain collections
- free shipping on orders over $100.00 for Canadian buyers, redeemable up to 20 times
For examples of how to create price rules, see the POST method.
Endpoints
- post/admin/api/latest/price_
rules. json Creates a price rule - get/admin/api/latest/price_
rules. json Retrieves a list of price rules - get/admin/api/latest/price_
rules/{price_ rule_ id}. json Retrieves a single price rule - get/admin/api/latest/price_
rules/count. json Retrieves a count of all price rules - put/admin/api/latest/price_
rules/{price_ rule_ id}. json Updates an existing a price rule - del/admin/api/latest/price_
rules/{price_ rule_ id}. json Remove an existing PriceRule
The PriceRule resource
Properties
The allocation method of the price rule. Valid values:
Show allocation_method properties
- each: The discount is applied to each of the entitled items. For example, for a price rule that takes $15 off, each entitled line item in a checkout will be discounted by $15.
- across: The calculated discount amount will be applied across the entitled items. For example, for a price rule that takes $15 off, the discount will be applied across all the entitled items.
When the value of target_type
is shipping_line
, then this value must be each
.
The date and time (ISO 8601 format) when the price rule was created.
The date and time (ISO 8601 format) when the price rule was updated.
The customer selection for the price rule. Valid values:
Show customer_selection properties
- all: The price rule is valid for all customers.
- prerequisite: The customer must either belong to one of the customer segments specified by
customer_segment_prerequisite_ids
, or be one of the customers specified byprerequisite_customer_ids
.
The date and time (ISO 8601 format) when the price rule ends. Must be after starts_at
.
A list of IDs of collections whose products will be eligible to the discount. It can be used only with
target_type
set to line_item
and target_selection
set to entitled
.
It can't be used in combination with entitled_product_ids
or entitled_variant_ids
.
A list of IDs of shipping countries that will be entitled to the discount. It can be used only with target_type
set to shipping_line
and target_selection
set to entitled
.
A list of IDs of products that will be entitled to the discount. It can be used only with target_type
set to line_item
and target_selection
set to entitled
.
If a product variant is included in entitled_variant_ids
, then entitled_product_ids
can't include the ID of the product associated with that variant.
A list of IDs of product variants that will be entitled to the discount. It can be used only with target_type
set to line_item
and target_selection
set to entitled
.
If a product is included in entitled_product_ids
, then entitled_variant_ids
can't include the ID of any variants associated with that product.
The ID for the price rule.
Whether the generated discount code will be valid only for a single use per customer. This is tracked using customer ID.
A list of customer IDs. For the price rule to be applicable, the customer must match one of the specified customers.
If prerequisite_customer_ids
is populated, then customer_segment_prerequisite_ids
must be empty.
The PriceRule resource
Anchor to POST request, Creates a price rulepostCreates a price rule
Creates a price rule
Create a Buy X Get Y price rule that gives one free ipod touch if customer buys 2 ipods
Create a Buy X Get Y price rule that gives one free ipod touch if customer buys 2 ipods
Show price_rule properties
The title of the price rule. This is used by the Shopify admin search to retrieve discounts. It is also displayed on the Discounts page of the Shopify admin for bulk discounts.
For non-bulk discounts, the discount code is displayed on the admin.
For a consistent search experience, use the same value for title
as the code
property of the associated discount code.
The value type of the price rule. Valid values:
Show value_type properties
- fixed_amount: Applies a discount of
value
as a unit of the store's currency. For example, ifvalue
is -30 and the store's currency is USD, then $30 USD is deducted when the discount is applied. - percentage: Applies a percentage discount of
value
. For example, ifvalue
is -30, then 30% will be deducted when the discount is applied.
If target_type
is shipping_line
, then only percentage
is accepted.
The value of the price rule. If if the value of target_type
is shipping_line
, then only -100
is accepted.
The value must be negative.
The customer selection for the price rule. Valid values:
Show customer_selection properties
- all: The price rule is valid for all customers.
- prerequisite: The customer must either belong to one of the customer segments specified by
customer_segment_prerequisite_ids
, or be one of the customers specified byprerequisite_customer_ids
.
The target type that the price rule applies to. Valid values:
Show target_type properties
- line_item: The price rule applies to the cart's line items.
- shipping_line: The price rule applies to the cart's shipping lines.
The target selection method of the price rule. Valid values:
Show target_selection properties
- all: The price rule applies the discount to all line items in the checkout.
- entitled: The price rule applies the discount to selected entitlements only.
The allocation method of the price rule. Valid values:
Show allocation_method properties
- each: The discount is applied to each of the entitled items. For example, for a price rule that takes $15 off, each entitled line item in a checkout will be discounted by $15.
- across: The calculated discount amount will be applied across the entitled items. For example, for a price rule that takes $15 off, the discount will be applied across all the entitled items.
When the value of target_type
is shipping_line
, then this value must be each
.
The date and time (ISO 8601 format) when the price rule starts.
List of collection ids that will be a prerequisites for a Buy X Get Y discount. The entitled_collection_ids
can be used only with:
Show prerequisite_collection_ids properties
target_type
set toline_item
,target_selection
set toentitled
,allocation_method
set toeach
andprerequisite_to_entitlement_quantity_ratio
defined.
prerequisite_product_ids
or prerequisite_variant_ids
.A list of IDs of products that will be entitled to the discount. It can be used only with target_type
set to line_item
and target_selection
set to entitled
.
If a product variant is included in entitled_variant_ids
, then entitled_product_ids
can't include the ID of the product associated with that variant.
Buy/Get ratio for a Buy X Get Y discount. prerequisite_quantity
defines the necessary 'buy' quantity and entitled_quantity
the offered 'get' quantity.
The prerequisite_to_entitlement_quantity_ratio
can be used only with:
Show prerequisite_to_entitlement_quantity_ratio properties
value_type
set topercentage
,target_type
set toline_item
,target_selection
set toentitled
,allocation_method
set toeach
,prerequisite_product_ids
orprerequisite_variant_ids
orprerequisite_collection_ids
defined andentitled_product_ids
orentitled_variant_ids
orentitled_collection_ids
defined.
Cannot be used in combination with prerequisite_subtotal_range
, prerequisite_quantity_range
or prerequisite_shipping_price_range
.
The number of times the discount can be allocated on the cart - if eligible. For example a Buy 1 hat Get 1 hat for free discount can be applied 3 times on a cart having more than 6 hats, where maximum of 3 hats get discounted - if the allocation_limit
is 3. Empty (null
) allocation_limit
means unlimited number of allocations.
allocation_limit
is only working with Buy X Get Y discount. The default value on creation will be null
(unlimited).
Create a price rule that gives a select group of customers $5 off their order
Create a price rule that gives a select group of customers $5 off their order
Show price_rule properties
The title of the price rule. This is used by the Shopify admin search to retrieve discounts. It is also displayed on the Discounts page of the Shopify admin for bulk discounts.
For non-bulk discounts, the discount code is displayed on the admin.
For a consistent search experience, use the same value for title
as the code
property of the associated discount code.
The target type that the price rule applies to. Valid values:
Show target_type properties
- line_item: The price rule applies to the cart's line items.
- shipping_line: The price rule applies to the cart's shipping lines.
The target selection method of the price rule. Valid values:
Show target_selection properties
- all: The price rule applies the discount to all line items in the checkout.
- entitled: The price rule applies the discount to selected entitlements only.
The allocation method of the price rule. Valid values:
Show allocation_method properties
- each: The discount is applied to each of the entitled items. For example, for a price rule that takes $15 off, each entitled line item in a checkout will be discounted by $15.
- across: The calculated discount amount will be applied across the entitled items. For example, for a price rule that takes $15 off, the discount will be applied across all the entitled items.
When the value of target_type
is shipping_line
, then this value must be each
.
The value type of the price rule. Valid values:
Show value_type properties
- fixed_amount: Applies a discount of
value
as a unit of the store's currency. For example, ifvalue
is -30 and the store's currency is USD, then $30 USD is deducted when the discount is applied. - percentage: Applies a percentage discount of
value
. For example, ifvalue
is -30, then 30% will be deducted when the discount is applied.
If target_type
is shipping_line
, then only percentage
is accepted.
The value of the price rule. If if the value of target_type
is shipping_line
, then only -100
is accepted.
The value must be negative.
The customer selection for the price rule. Valid values:
Show customer_selection properties
- all: The price rule is valid for all customers.
- prerequisite: The customer must either belong to one of the customer segments specified by
customer_segment_prerequisite_ids
, or be one of the customers specified byprerequisite_customer_ids
.
A list of customer segment IDs. For the price rule to be applicable, the customer must be in the group of customers matching a customer segment.
If customer_segment_prerequisite_ids
is populated, then prerequisite_customer_ids
must be empty.
The date and time (ISO 8601 format) when the price rule starts.
Create a price rule that gives the buyer $10.00 off an order
Create a price rule that gives the buyer $10.00 off an order
Show price_rule properties
The title of the price rule. This is used by the Shopify admin search to retrieve discounts. It is also displayed on the Discounts page of the Shopify admin for bulk discounts.
For non-bulk discounts, the discount code is displayed on the admin.
For a consistent search experience, use the same value for title
as the code
property of the associated discount code.
The target type that the price rule applies to. Valid values:
Show target_type properties
- line_item: The price rule applies to the cart's line items.
- shipping_line: The price rule applies to the cart's shipping lines.
The target selection method of the price rule. Valid values:
Show target_selection properties
- all: The price rule applies the discount to all line items in the checkout.
- entitled: The price rule applies the discount to selected entitlements only.
The allocation method of the price rule. Valid values:
Show allocation_method properties
- each: The discount is applied to each of the entitled items. For example, for a price rule that takes $15 off, each entitled line item in a checkout will be discounted by $15.
- across: The calculated discount amount will be applied across the entitled items. For example, for a price rule that takes $15 off, the discount will be applied across all the entitled items.
When the value of target_type
is shipping_line
, then this value must be each
.
The value type of the price rule. Valid values:
Show value_type properties
- fixed_amount: Applies a discount of
value
as a unit of the store's currency. For example, ifvalue
is -30 and the store's currency is USD, then $30 USD is deducted when the discount is applied. - percentage: Applies a percentage discount of
value
. For example, ifvalue
is -30, then 30% will be deducted when the discount is applied.
If target_type
is shipping_line
, then only percentage
is accepted.
The value of the price rule. If if the value of target_type
is shipping_line
, then only -100
is accepted.
The value must be negative.
The customer selection for the price rule. Valid values:
Show customer_selection properties
- all: The price rule is valid for all customers.
- prerequisite: The customer must either belong to one of the customer segments specified by
customer_segment_prerequisite_ids
, or be one of the customers specified byprerequisite_customer_ids
.
The date and time (ISO 8601 format) when the price rule starts.
Create a price rule that gives the buyer 15% off a specific collection
Create a price rule that gives the buyer 15% off a specific collection
Show price_rule properties
The title of the price rule. This is used by the Shopify admin search to retrieve discounts. It is also displayed on the Discounts page of the Shopify admin for bulk discounts.
For non-bulk discounts, the discount code is displayed on the admin.
For a consistent search experience, use the same value for title
as the code
property of the associated discount code.
The target type that the price rule applies to. Valid values:
Show target_type properties
- line_item: The price rule applies to the cart's line items.
- shipping_line: The price rule applies to the cart's shipping lines.
The target selection method of the price rule. Valid values:
Show target_selection properties
- all: The price rule applies the discount to all line items in the checkout.
- entitled: The price rule applies the discount to selected entitlements only.
The allocation method of the price rule. Valid values:
Show allocation_method properties
- each: The discount is applied to each of the entitled items. For example, for a price rule that takes $15 off, each entitled line item in a checkout will be discounted by $15.
- across: The calculated discount amount will be applied across the entitled items. For example, for a price rule that takes $15 off, the discount will be applied across all the entitled items.
When the value of target_type
is shipping_line
, then this value must be each
.
The value type of the price rule. Valid values:
Show value_type properties
- fixed_amount: Applies a discount of
value
as a unit of the store's currency. For example, ifvalue
is -30 and the store's currency is USD, then $30 USD is deducted when the discount is applied. - percentage: Applies a percentage discount of
value
. For example, ifvalue
is -30, then 30% will be deducted when the discount is applied.
If target_type
is shipping_line
, then only percentage
is accepted.
The value of the price rule. If if the value of target_type
is shipping_line
, then only -100
is accepted.
The value must be negative.
The customer selection for the price rule. Valid values:
Show customer_selection properties
- all: The price rule is valid for all customers.
- prerequisite: The customer must either belong to one of the customer segments specified by
customer_segment_prerequisite_ids
, or be one of the customers specified byprerequisite_customer_ids
.
A list of IDs of collections whose products will be eligible to the discount. It can be used only with
target_type
set to line_item
and target_selection
set to entitled
.
It can't be used in combination with entitled_product_ids
or entitled_variant_ids
.
The date and time (ISO 8601 format) when the price rule starts.
Create a price rule that gives the buyer free shipping on orders
over $50.00 that can be used up to 20 times
Create a price rule that gives the buyer free shipping on orders over $50.00 that can be used up to 20 times
Show price_rule properties
The title of the price rule. This is used by the Shopify admin search to retrieve discounts. It is also displayed on the Discounts page of the Shopify admin for bulk discounts.
For non-bulk discounts, the discount code is displayed on the admin.
For a consistent search experience, use the same value for title
as the code
property of the associated discount code.
The target type that the price rule applies to. Valid values:
Show target_type properties
- line_item: The price rule applies to the cart's line items.
- shipping_line: The price rule applies to the cart's shipping lines.
The target selection method of the price rule. Valid values:
Show target_selection properties
- all: The price rule applies the discount to all line items in the checkout.
- entitled: The price rule applies the discount to selected entitlements only.
The allocation method of the price rule. Valid values:
Show allocation_method properties
- each: The discount is applied to each of the entitled items. For example, for a price rule that takes $15 off, each entitled line item in a checkout will be discounted by $15.
- across: The calculated discount amount will be applied across the entitled items. For example, for a price rule that takes $15 off, the discount will be applied across all the entitled items.
When the value of target_type
is shipping_line
, then this value must be each
.
The value type of the price rule. Valid values:
Show value_type properties
- fixed_amount: Applies a discount of
value
as a unit of the store's currency. For example, ifvalue
is -30 and the store's currency is USD, then $30 USD is deducted when the discount is applied. - percentage: Applies a percentage discount of
value
. For example, ifvalue
is -30, then 30% will be deducted when the discount is applied.
If target_type
is shipping_line
, then only percentage
is accepted.
The value of the price rule. If if the value of target_type
is shipping_line
, then only -100
is accepted.
The value must be negative.
The maximum number of times the price rule can be used, per discount code.
The customer selection for the price rule. Valid values:
Show customer_selection properties
- all: The price rule is valid for all customers.
- prerequisite: The customer must either belong to one of the customer segments specified by
customer_segment_prerequisite_ids
, or be one of the customers specified byprerequisite_customer_ids
.
The minimum subtotal for the price rule to be applicable. It has the following property:
Show prerequisite_subtotal_range properties
- greater_than_or_equal_to: The subtotal of the entitled cart items must be greater than or equal to this value for the discount to apply.
The date and time (ISO 8601 format) when the price rule starts.
/admin/api/2025-07/price_ rules. json
Response
Anchor to GET request, Retrieves a list of price rulesgetRetrieves a list of price rules
Retrieves a list of price rules. Note: This endpoint implements pagination by using links that are provided in the response header. To learn more, refer to Make paginated requests to the REST Admin API.
Show price rules created before date (format 2017-03-25T16:15:47-04:00).
Show price rules created after date (format 2017-03-25T16:15:47-04:00).
Show price rules ending before date (format 2017-03-25T16:15:47-04:00).
Show price rules ending after date (format 2017-03-25T16:15:47-04:00).
The maximum number of results to retrieve.
Restrict results to after the specified ID.
Show price rules starting before date (format 2017-03-25T16:15:47-04:00).
Show price rules starting after date (format 2017-03-25T16:15:47-04:00).
Show price rules with times used.
Show price rules last updated before date (format 2017-03-25T16:15:47-04:00).
Show price rules last updated after date (format 2017-03-25T16:15:47-04:00).
Retrieve all price rules
Retrieve all price rules
Retrieve all price rules after a specified ID
Retrieve all price rules after a specified ID
Restrict results to after the specified ID.
/admin/api/2025-07/price_ rules. json
Response
Anchor to GET request, Retrieves a single price rulegetRetrieves a single price rule
Retrieves a single price rule
Retrieve a single price rule by its ID
Retrieve a single price rule by its ID
/admin/api/2025-07/price_ rules/507328175. json
Response
Anchor to GET request, Retrieves a count of all price rulesgetRetrieves a count of all price rules
Retrieves a count of all price rules.
Retrieve a count of all price rules
Retrieve a count of all price rules
/admin/api/2025-07/price_ rules/count. json
Response
Anchor to PUT request, Updates an existing a price ruleputUpdates an existing a price rule
Updates an existing a price rule
Update the title of a price rule
Update the title of a price rule
Show price_rule properties
The ID for the price rule.
The title of the price rule. This is used by the Shopify admin search to retrieve discounts. It is also displayed on the Discounts page of the Shopify admin for bulk discounts.
For non-bulk discounts, the discount code is displayed on the admin.
For a consistent search experience, use the same value for title
as the code
property of the associated discount code.
/admin/api/2025-07/price_ rules/507328175. json
Response
Anchor to DELETE request, Remove an existing PriceRuledelRemove an existing Price Rule
Deletes a price rule
Delete a price rule
Delete a price rule