Price Rule Detail

🔒

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

📘

Public Request Parameters

Path Parameters

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

Response Explanation

Public Response Parameters

📘

Public Response Parameters

Successful Response

Field Type Example Description
price_rule object See fields below. Object containing details about the created price rule.
price_rule[]
id
string "2d7e416a-444f-4491-ae04-c50f47154140" Unique identifier of the price rule.
price_rule[]
title
string "Buy 2 Get 1 Free" Title of this price rule.
price_rule[]
value
double 10.5 Value of the discount.
price_rule[]
value_type
string "fixed_amount" Type of the discount value. Options: percentage, fixed_amount.
price_rule[]
usage_limit
string "100" Maximum number of times the discount can be used. -1 means no limit.
price_rule[]
times_used
string "5" Number of times the discount has been used.
price_rule[]
allocation_method
string "each" Allocation method for the discount.
price_rule[]
allocation_limit
string "1" Redeem count limit per checkout. 0 means no limit.
price_rule[]
once_per_customer
string "0" Indicates if the discount can be used only once per customer. "1" means yes.
price_rule[]
prerequisite
string "1" Indicates if the discount has prerequisites. "1" means yes.
price_rule[]
customer_selection
string "specific" Specifies the customer selection for the discount.
price_rule[]
target_selection
string "entitled" Specifies the target product selection for the discount.
price_rule[]
target_type
string "line_item" Specifies the type of target for the discount.
price_rule[]
created_at
string "2024-12-19 10:00:00" Timestamp of when the price rule was created.
price_rule[]
updated_at
string "2024-12-20 12:00:00" Timestamp of when the price rule was last updated.
price_rule[]
starts_at
string "1700000000" Start time of the discount (Unix timestamp).
price_rule[]
ends_at
string "1700500000" End time of the discount (Unix timestamp).
price_rule[]
entitled_product_ids
array[string] ["product-1", "product-2", "product-3"] List of product IDs entitled for the discount.
price_rule[]
entitled_variant_ids
array[string] ["variant-1", "variant-2"] List of product variant IDs entitled for the discount.
price_rule[]
prerequisite_quantity_range
array[object] See fields below. Prerequisite for total product quantity in the cart.
price_rule[]
prerequisite_quantity_range.greater_than_or_equal_to
string "3" Minimum quantity of products required to apply the discount.
price_rule[]
prerequisite_quantity_range.value
string "15" Value used for discount application.
price_rule[]
prerequisite_quantity_range.target_type
string "line_item" Specifies the type of target for the discount.
price_rule[]
prerequisite_quantity_range.target_data
array[string] ["target-1", "target-2"] List of target data IDs for the discount rule.
price_rule[]
prerequisite_subtotal_range
array[object] See fields below. Prerequisite for total cart amount.
price_rule[]
prerequisite_subtotal_range.greater_than_or_equal_to
string "100" Minimum subtotal amount required to apply the discount.
price_rule[]
prerequisite_subtotal_range.value
string "20" Discount value applied when subtotal condition is met.
price_rule[]
prerequisite_subtotal_range.target_type
string "line_item" Specifies the type of target for the discount.
price_rule[]
prerequisite_subtotal_range.target_data
array[string] ["subtotal-target-1"] List of target data IDs for the subtotal discount rule.

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
404Not FoundThe id provided is not existed."Not found"

API Structure Overview

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