Skip to main content

Schedule a Ruleset

By default, a ruleset takes effect as soon as it is published and remains in effect until deactivated or deleted. However, Price Rules allows you to set start and expiry dates on rulesets so that you can easily schedule and manage limited-time promotions.

To schedule a promotion with Price Rules, create a ruleset that defines the promotion and set the start_date and expiry_date properties:

NameTypeDescription
start_datestring enumerationThe UTC-formatted date and time when the ruleset takes effect.
expiry_datestring enumerationThe UTC-formatted date and time after which the ruleset is no longer in effect.
note

When start_date and expiry_date are not defined, the ruleset takes effect as soon as it is published and does not expire until the ruleset is deleted or the active property of the ruleset is set to false.

This example ruleset uses start_date and expiry_date to schedule a 10%-off promotion for Black Friday 2025:

{
"ruleset": {
"external_id": "SEASONAL_SALE",
"internal_name": "Example of Seasonal Sale",
"start_date": "2025-11-28T00:00:00Z",
"expiry_date": "2025-11-30T23:59:00Z",
"product_selection": {
"type": "PRODUCTS_ALL"
},
"rules": [
{
"type": "DISCOUNT",
"conditions": [],
"actions": [
{
"type": "PRICE_ADJUST_PERCENT",
"value": -10
}
]
}
]
}
}

To publish your scheduled promotion, use the Price Rules API to create a ruleset.

For more examples, refer to the other how-to guides in the left-hand menu.