Price Rule List

🔒

Requires price_rules access scope. More access scope

The Price Rule List API retrieves a list of price rules that can be applied to customer orders.

This API is especially useful for:

  1. Fetching all active and inactive price rules in your store.
  2. Filtering price rules by specific criteria such as start date, end date, or usage count.
  3. Retrieving detailed configurations of discount rules for analysis or updates.

Request Parameters

Public Request Parameters

📘

Public Request Parameters

Query Parameters

ParameterTypeRequiredDescriptionExample
limitint32NoResult per page. Maximum is 250. Default is 50.50
starts_at_minint32NoFilter price rules that started after this date (Unix timestamp).1581152471
starts_at_maxint32NoFilter price rules that started before this date (Unix timestamp).1581152471
ends_at_minint32NoFilter price rules that ended after this date (Unix timestamp).1581152471
ends_at_maxint32NoFilter price rules that ended before this date (Unix timestamp).1581152471
times_usedint32NoFilter price rules by the number of times they have been used.0

Response Explanation

Public Response Parameters

📘

Public Response Parameters

Successful Response

Field Type Example Description
price_rules array[object] See below. Array containing price rule objects.
price_rules[].id string "91f9a466-7c8c-46e7-9774-64874a641534" Unique identifier of the price rule.
price_rules[].title string "Buy $180 get $20 off,once for one customer" Title of the price rule.
price_rules[].value double 20 Value of the discount.
price_rules[].value_type string "fixed_amount" Type of the discount value. Options: percentage, fixed_amount.
price_rules[].usage_limit string "100" Maximum number of times the discount can be used. -1 means no limit.
price_rules[].times_used string "0" Number of times the discount has been used.
price_rules[].allocation_method string "" Allocation method for the discount.
price_rules[].allocation_limit string "0" Redeem count limit per checkout. 0 means no limit.
price_rules[].once_per_customer string "1" Indicates if the discount can be used only once per customer. "1" means yes.
price_rules[].prerequisite string "1" Indicates if the discount has prerequisites. "1" means yes.
price_rules[].customer_selection string "all" Specifies the customer selection for the discount.
price_rules[].target_selection string "all" Specifies the target product selection for the discount.
price_rules[].target_type string "" Specifies the type of target for the discount.
price_rules[].created_at string "2022-06-17 15:00:03" Timestamp of when the price rule was created.
price_rules[].updated_at string "2022-06-17 15:00:03" Timestamp of when the price rule was last updated.
price_rules[].starts_at string "1655431200" Start time of the discount (Unix timestamp).
price_rules[].ends_at string "-1" End time of the discount (Unix timestamp).
price_rules[].entitled_product_ids array[string] [] List of product IDs entitled for the discount.
price_rules[].entitled_filter_ids array[string] [] List of filter IDs entitled for the discount.
price_rules[].entitled_filter_list array[string] [] List of entitled filter data for the discount.
price_rules[].variant_product_ids array[string] [] List of variant product IDs entitled for the discount.
price_rules[].prerequisite_subtotal_range array[object] See below. Prerequisite for total amount range.
price_rules[].prerequisite_subtotal_range[].greater_than_or_equal_to string "180" Minimum subtotal value to qualify for the discount.
price_rules[].prerequisite_subtotal_range[].value string "20" Discount value applied.
price_rules[].prerequisite_quantity_range array[object] See below. Prerequisite for total quantity range.
price_rules[].prerequisite_quantity_range[].greater_than_or_equal_to string "5" Minimum quantity to qualify for the discount.
price_rules[].prerequisite_quantity_range[].value string "20" Discount value applied.

Error Response

Error responses in the API can be represented using two different fields: errors and error. Both fields provide details about issues encountered during request processing. Below is an explanation of the fields with their respective examples and descriptions.

FieldTypeExampleDescription
errorsArray[ "invalid line_item id"]A list of errors encountered during the request processing.
FieldTypeExampleDescription
errorString "store is not active"Indicates an error encountered during the process

Error Detail

Status CodeMessagePossible ReasonExample Response
400Bad RequestInvalid input format or request structure (e.g., missing required fields or incorrect data types).Bad Request
UnauthorizedThe request is missing valid authentication credentials or the credentials provided are invalid.Unauthorized
422Limit must be an integer.The limit provided is invalid.Limit must be an integer.
Starts At Min must be an integer.The Starts At Min provided is invalid.tarts At Min must be an integer
Starts At Max must be an integerThe Starts At Max provided is invalid.Starts At Max must be an integer
Ends At Min must be an integerThe Ends At Min provided is invalid.Ends At Min must be an integer
Times Used must be an integer.The Times provided is invalid.Times Used must be an integer

API Structure Overview

Language
Credentials
Header
URL
Click Try It! to start a request and see the response here!