Get Price Rule

Retrieves detailed information about a specific price rule based on its ID.

🔒

Requires price_rules access scope. More access scope

The Price Rule Detail API retrieves detailed information about a specific price rule based on its ID.

This API is especially useful for:

  1. Fetching detailed information about a price rule for analysis or modification.
  2. Verifying the attributes of a specific discount rule applied to products.
  3. Retrieving prerequisite or entitlement conditions for a price rule.

Request Parameters

Public Request Parameters

📘

Path Parameters

FieldTypeRequiredDescriptionExample
price_rule_idstringYesPrice rule ID.91f9a466-7c8c-46e7-9774-64874a641534

Response Explanation

Public Response Parameters

📘

Successful Response

ParameterTypeExampleDescription
codestring200Error code (200 indicates success)
messagestringSuccessError message
dataobject{...}Contains the price rules data
data.price_ruleobject {...}price rule object
Price Rule Object Structure
ParameterTypeExampleDescription
idstringpr_123456Unique identifier of the price rule
titlestringSummer SaleName of the price rule
valuefloat10.0Discount value amount
value_typestringfixed_amountType of discount value (fixed_amount, percentage)
usage_limitint32100Maximum number of times the rule can be used
times_usedint3245Number of times the rule has been used
allocation_methodstringeachHow the discount is allocated (each, across)
allocation_limitint321Limit of discount allocation
allocation_limit_amountfloat5.0Maximum amount for allocation limit
once_per_customerint321Whether the rule applies once per customer (1=yes, 0=no)
prerequisiteint320Prerequisite condition flag
customer_selectionstringallCustomer selection method (all, prism, explicit)
target_selectionstringallTarget selection method (all, prism, explicit)
target_typestringline_itemType of target (line_item, shipping_line)
target_price_typestringoriginalPrice type target (original, current)
created_atstring2023-06-20T15:30:00ZTimestamp when the price rule was created
updated_atstring2023-06-21T09:15:00ZTimestamp when the price rule was last updated
starts_atstring2023-06-01T00:00:00ZStart date of the price rule
ends_atstring2023-06-30T23:59:59ZEnd date of the price rule
prerequisite_customer_idsarray of strings["cust_123", "cust_456"]List of prerequisite customer IDs
prerequisite_customer_segment_idsarray of strings["seg_123", "seg_456"]List of prerequisite customer segment IDs
entitled_product_idsarray of strings["prod_123", "prod_456"]List of entitled product IDs
entitled_variant_idsarray of strings["var_123", "var_456"]List of entitled variant IDs
entitled_filter_idsarray of strings["flt_123", "flt_456"]List of entitled filter IDs
entitled_filter_listarray of strings["filter1", "filter2"]List of entitled filter list items
variant_product_idsarray of strings["prod_123", "prod_456"]List of variant product IDs
entitled_collection_idsarray of strings["coll_123", "coll_456"]List of entitled collection IDs
entitled_area_listarray of strings["area1", "area2"]List of entitled area list items
prerequisite_subtotal_rangearray of objects[ {...} ]Prerequisite subtotal range conditions
prerequisite_quantity_rangearray of objects[ {...} ]Prerequisite quantity range conditions

Prerequisite Subtotal Range Object Structure

ParameterTypeExampleDescription
greater_than_or_equal_tostring100.0Minimum subtotal amount
valuestring100.0Subtotal value
value_percentagestring10.0Subtotal percentage value
value_event_typestringpurchaseEvent type for value calculation
value_conditionstringgreater_thanCondition for value comparison
target_typestringline_itemTarget type for value
target_dataarray of strings["prod_123"]Target data for value

Prerequisite Quantity Range Object Structure

ParameterTypeExampleDescription
greater_than_or_equal_tostring5Minimum quantity
valuestring5Quantity value
value_percentagestring10.0Quantity percentage value
value_event_typestringpurchaseEvent type for quantity
value_conditionstringgreater_thanCondition for quantity comparison
target_typestringline_itemTarget type for quantity
target_dataarray of strings["prod_123"]Target data for quantity

Error Response

FieldTypeExampleDescription
codestringInvalidParameterError http message
messagestring``Error message

API Structure Overview

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