Create Price Rule
POST /v2/price-rule
Creates a new price rule in the pricing engine. This endpoint validates the provided configuration, applies default parameters, and returns the created rule object. It supports defining target products, customers, and applicable date ranges. Discounts can be defined as percentages, and stacking behavior can be controlled via the allowStacking flag.
Request Body
{
"name": "DiscountExample",
"type": "discount",
"productIDs": [
"b52ad07c-47fd-4509-abce-432cace1d77d"
],
"active": true,
"allowStacking": false,
"percentage": 10,
"dateRange": {
"from": "2023-06-01T00:00:00.000Z",
"to": "2023-08-31T23:59:59.999Z"
}
}
Response Example
{
"name": "DiscountExample",
"tenant": "example-tenant-id",
"type": "discount",
"productIDs": [
"product-id-1"
],
"customerIDs": [],
"productCollectionIDs": [],
"customerCollectionIDs": [],
"dateRange": {
"from": "2023-06-01T00:00:00.000Z",
"to": "2023-08-31T23:59:59.999Z"
},
"active": true,
"allowStacking": false,
"percentage": 10,
"deleted": null,
"_id": "rule-id-1",
"priceRange": [],
"created": "2025-10-22T09:14:09.252Z",
"updated": "2025-10-22T09:14:09.252Z",
"id": "rule-id-1"
}