Create price rule
POST/openapi/2025-06/price_rules
Creates a new price rule for discounts or promotions on the store.
Request
- application/json
- Body
- Example
Bodyrequired
- Array [
- ]
- Array [
- ]
price_rule object
Price rule
Title of this price rule
Value for this discount
Discount type. Options: fixed_amount for a fixed discount, or percentage for a percentage discount
The usage limit. -1 means no limit
Redeem count limit for checkout: 0~999, 0 means only one redeem allowed, 999 means no limit
Maximum usage per customer. -1 or 0 means no limit
Indicates if this discount has prerequisites. 1 means yes, 0 means no
Target products allowed for this discount. Options: all for all products, entitled for specific products
Target type of this discount
Start time of the discount. Format: YYYY-MM-DDTHH:mm:ssZ
End time of the discount. Format: YYYY-MM-DDTHH:mm:ssZ
Specifies the product IDs allowed for the price rule. Required only when target_selection is entitled
Specifies the product variant IDs allowed for the price rule
Specify the collections allowed of the discount
prerequisite_subtotal_range object[]
Prerequisite for the total amount of the money
To specify the value which the price has to greater than or equal to
The value
Percentage value
Value event type
Value condition
Target type
Target data
prerequisite_quantity_range object[]
Prerequisite for the total count of the products
To specify the value which the price has to greater than or equal to
The value
Percentage value
Value event type
Value condition
Target type
Target data
{
"price_rule": {
"title": "string",
"value": 0,
"value_type": "string",
"usage_limit": 0,
"allocation_limit": 0,
"once_per_customer": 0,
"prerequisite": 0,
"target_selection": "string",
"target_type": "string",
"starts_at": "string",
"ends_at": "string",
"entitled_product_ids": [
"string"
],
"entitled_variant_ids": [
"string"
],
"entitled_collection_ids": [
"string"
],
"prerequisite_subtotal_range": [
{
"greater_than_or_equal_to": "string",
"value": "string",
"value_percentage": "string",
"value_event_type": "string",
"value_condition": "string",
"target_type": "string",
"target_data": [
"string"
]
}
],
"prerequisite_quantity_range": [
{
"greater_than_or_equal_to": "string",
"value": "string",
"value_percentage": "string",
"value_event_type": "string",
"value_condition": "string",
"target_type": "string",
"target_data": [
"string"
]
}
]
}
}
Responses
- 200
OK
- application/json
- Schema
- Example
Schema
- Array [
- ]
- Array [
- ]
- Array [
- ]
error code
error message
data object
price_rule object
Price rule
Price rule ID
Title
The value
Value type
Usage limit. -1 means unlimited
Number of times used
Allocation method
Allocation limit
Allocation limit amount
Whether usable once per customer
Prerequisite condition
Customer selection criteria
Target selection
Target type
Target price type
Creation timestamp, in ISO-8601 format
Last update timestamp, in ISO-8601 format
Start timestamp
End timestamp
List of prerequisite customer IDs
Customer segment prerequisite IDs
Entitled product IDs
Entitled variant IDs
Entitled filter IDs
List of entitled filters
Product IDs of variants
Entitled collection IDs
entitled_area_list object[]
List of entitled areas
Country code (e.g., CN)
List of province codes
prerequisite_subtotal_range object[]
Subtotal prerequisite range
Greater than or equal to value
The value
Percentage value
Value event type
Value condition
Target type
Target data
prerequisite_quantity_range object[]
Quantity prerequisite range
Greater than or equal to value
The value
Percentage value
Value event type
Value condition
Target type
Target data
{
"code": "string",
"message": "string",
"data": {
"price_rule": {
"id": "string",
"title": "string",
"value": 0,
"value_type": "string",
"usage_limit": 0,
"times_used": 0,
"allocation_method": "string",
"allocation_limit": 0,
"allocation_limit_amount": 0,
"once_per_customer": 0,
"prerequisite": 0,
"customer_selection": "string",
"target_selection": "string",
"target_type": "string",
"target_price_type": "string",
"created_at": "string",
"updated_at": "string",
"starts_at": "string",
"ends_at": "string",
"prerequisite_customer_ids": [
"string"
],
"prerequisite_customer_segment_ids": [
"string"
],
"entitled_product_ids": [
"string"
],
"entitled_variant_ids": [
"string"
],
"entitled_filter_ids": [
"string"
],
"entitled_filter_list": [
"string"
],
"variant_product_ids": [
"string"
],
"entitled_collection_ids": [
"string"
],
"entitled_area_list": [
{
"country_code": "string",
"province_codes": [
"string"
]
}
],
"prerequisite_subtotal_range": [
{
"greater_than_or_equal_to": "string",
"value": "string",
"value_percentage": "string",
"value_event_type": "string",
"value_condition": "string",
"target_type": "string",
"target_data": [
"string"
]
}
],
"prerequisite_quantity_range": [
{
"greater_than_or_equal_to": "string",
"value": "string",
"value_percentage": "string",
"value_event_type": "string",
"value_condition": "string",
"target_type": "string",
"target_data": [
"string"
]
}
]
}
}
}