Suggest Promo Windows
POST/api/inventory-forecasting/promo-windows/suggest
Suggest candidate promo windows for a product by clustering its detected upward demand spikes into contiguous date ranges, so a promotion can be confirmed instead of typed by hand.
Authentication: Requires Bearer token.
This consumes the same spike_up points produced by Detect Demand Anomalies: it clusters unresolved upward spikes into candidate date ranges. Downward and stockout anomalies are never suggested. Candidates are ranked by peak spike severity and capped at 10. A confirmed suggestion can be created as a promo window (Create Promo Window), measured (Measure Promo Lift), and then re-applied on a future build as a promo_lift demand modifier.
Body fields:
- product_id (required): the product to analyse.
- min_gap_days (optional): a gap larger than this many days splits two spike clusters into separate windows, 0-60 (default 3).
- lookback_days (optional): how far back to scan for spikes, 1-1095 (default 365).
Each suggestion reports the cluster's start_date and end_date, the peak spike score, the total excess units above expectation, the number of flagged days, and whether an existing promo window already overlaps the range.
Request
Responses
- 200
- 401
- 403
- 422
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Unprocessable Entity
Response Headers
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.