Put products on sale for a limited time
set_product_discountGives products a percentage (or fixed amount) discount for a limited time, e.g. "20% off these 5 wines until Sunday 23:59". It uses PrestaShop's own specific prices, so the shop shows the old and new price automatically and the discount ends by itself. Choose products with ids (best: ask top_products first) or a search word/category. Preview first, then confirm; undo removes it. Always show the preview to the user and get their explicit approval before calling again with confirm=true and the preview_id. Paid plans only. Max 100 products. To apply it later instead of now, call with confirm=true, the preview_id AND apply_at (the store's local time, YYYY-MM-DDTHH:MM).
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "set_product_discount"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ids | No | ||
| sku | No | ||
| from | No | Start, store local time, YYYY-MM-DD or YYYY-MM-DDTHH:MM. Default: now. | |
| store | No | Store address or id. Leave empty if you have only one store. | |
| until | No | End, store local time: YYYY-MM-DD (end of that day) or YYYY-MM-DDTHH:MM. | |
| amount | No | Fixed amount off, in the shop currency (tax excluded). | |
| search | No | ||
| confirm | No | Set true ONLY after the user approved the preview. | |
| percent | No | Percent off the normal price (use this OR amount). | |
| apply_at | No | Only with confirm=true: apply later. Store local time, YYYY-MM-DDTHH:MM, between 5 minutes and 90 days from now. | |
| category | No | ||
| preview_id | No | The preview_id returned by the preview call (required with confirm=true). |