REST API
Webhooks
Webhooks push events about the stores you track to your server: sales, stock, prices, ads and store changes. You add the endpoint in the app, EcomScout signs every delivery, your server answers with a 2xx.
Set up an endpoint
Webhooks are set up in the app, not through the API, and come with paid plans. Events are about stores you track with Signals, and each event only includes the products you track.
- In the app, open Integrations, then Webhooks, and choose Add endpoint.
- Enter an HTTPS address on your server.
- Pick what to receive: everything, insights only, or single event types.
- Copy the signing secret (
whsec_...). You need it to check deliveries. - Press Send test and confirm your server answered.
The same screen shows the last 25 deliveries of each endpoint with their status.
What a delivery looks like
A delivery is a POST with a JSON body. Every body has the same outer fields: id, type, created_at, the tracked store under signal and the event itself under data.
| Header | What it holds |
|---|---|
X-EcomScout-Event | The event type, for example signal.sales. |
X-EcomScout-Event-Id | The id of the event (evt_...). A retry sends the same id. |
X-EcomScout-Signature | Timestamp and signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of "t.raw_body" with your signing secret>. |
X-EcomScout-Delivery-Attempt | 1 for the first try, 2 for the retry. |
X-EcomScout-Secret | The old plain secret, kept for endpoints made before signatures. |
Check the signature
Compute the HMAC over the timestamp, a dot and the raw body, then compare it with v1. Use the body as it arrived, before any JSON parsing.
import crypto from 'node:crypto';
// Express: app.post('/webhooks/ecomscout', express.raw({ type: 'application/json' }), handler)
export function verifyEcomScout(rawBody, signatureHeader, secret) {
const parts = Object.fromEntries(signatureHeader.split(',').map((p) => p.split('=')));
const expected = crypto
.createHmac('sha256', secret)
.update(`${parts.t}.${rawBody}`)
.digest('hex');
const fresh = Math.abs(Date.now() / 1000 - Number(parts.t)) < 300;
return fresh && crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1));
}import hashlib, hmac, time
def verify_ecomscout(raw_body: bytes, signature_header: str, secret: str) -> bool:
parts = dict(p.split("=", 1) for p in signature_header.split(","))
signed = f"{parts['t']}.".encode() + raw_body
expected = hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest()
fresh = abs(time.time() - int(parts["t"])) < 300
return fresh and hmac.compare_digest(expected, parts["v1"])Retries and order
- Answer with a 2xx within 15 seconds. Do slow work after you answer.
- On a 5xx, a 429, a timeout or a network error there is one retry, about 2 seconds later. A 4xx is not retried.
- The retry carries the same event id, so store the ids you handled and skip repeats.
- Events can arrive out of order. Sort by
created_atwhen order matters.
Events
Data
| Event | Sent when |
|---|---|
signal.salesSales | Units and revenue per variant, sent after every probe that sees sales or restocks |
signal.daily_payloadDaily payload | The full daily report for yesterday (same JSON as GET /v1/signals/{id}/daily) |
signal.availability_changedSold out / back in stock | Variants that sold out or came back since the last probe |
signal.probe_completedProbe completed | Every finished probe with health and counts (frequent) |
signal.health_changedHealth changed | Data quality state changed, e.g. healthy, then blocked |
Sales
| Event | Sent when |
|---|---|
sales_spikeSales spike | Unusual surge in sales |
sales_dropSales drop | Notable drop or zero sales |
restock_detectedRestock | Products restocked |
new_bestsellerNew bestseller | A product took off |
price_changePrice change | Tracked product price changed |
Store
| Event | Sent when |
|---|---|
traffic_shiftTraffic shift | Significant traffic change |
app_changeApp change | Apps installed or removed |
store_updateStore update | Revenue, rating or catalog changes |
Social
| Event | Sent when |
|---|---|
social_follower_changeFollower change | Notable follower count change |
social_new_platformNew social account | New social platform discovered |
social_verified_changeVerified change | Verified badge gained or lost |
Ads
| Event | Sent when |
|---|---|
ad_new_campaignNew ads | New ad campaigns detected |
ad_stoppedAds stopped | Ads went inactive |
ad_winnerAd winner | Ad running 30+ days |
ad_summaryAds summary | Daily ads probe recap |
ad_ai_analysisAI ad analysis | AI strategy summary after an ads probe |
Recaps
| Event | Sent when |
|---|---|
probe_summaryDaily probe recap | Short daily sales recap |
weekly_recapWeekly recap | Weekly summary |
Example payloads
One example body per event. Open the one you need.
signal.sales Sales
{
"id": "evt_9f2c41d07a8b4e5f9c1d2e3f4a5b6c7d",
"type": "signal.sales",
"created_at": "2026-10-02T09:15:04.112Z",
"signal": {
"id": "665f1c2ab4e8a1d2c3f40001",
"domain": "gruntstyle.com",
"store_name": "Grunt Style"
},
"data": {
"date": "2026-10-02",
"units_sold": 7,
"revenue": 209.93,
"currency": "USD",
"variants": [
{
"variant_id": 40211234567890,
"product_handle": "this-well-defend-tee",
"product_title": "This We'll Defend Tee",
"variant_title": "Black / L",
"unit_price": 29.99,
"units_sold": 5,
"revenue": 149.95,
"inventory_before": 212,
"inventory_after": 207,
"restocked": false,
"restock_units": 0
}
]
}
}signal.daily_payload Daily payload
{
"id": "evt_9f2c41d07a8b4e5f9c1d2e3f4a5b6c7d",
"type": "signal.daily_payload",
"created_at": "2026-10-02T00:41:12.000Z",
"signal": {
"id": "665f1c2ab4e8a1d2c3f40001",
"domain": "gruntstyle.com",
"store_name": "Grunt Style"
},
"data": {
"date": "2026-10-01",
"website_url": "https://gruntstyle.com",
"currency": "USD",
"daily_summary": {
"total_orders": 41,
"products_sold": 9,
"variants_sold": 23,
"units_sold": 64,
"total_revenue": 1919.36,
"average_order_value": 46.81,
"vs_previous_day": {
"total_revenue": {
"previous": 1707.6,
"change": 211.76,
"change_pct": 12.4
}
}
},
"products": [
{
"product_id": "this-well-defend-tee",
"product_name": "This We'll Defend Tee",
"units_sold": 22,
"total_revenue": 659.78,
"share_of_store_revenue": 0.3438,
"variants": [
{
"variant_id": 40211234567890,
"sku": "TWD-BLK-L",
"variant_title": "Black / L",
"units_sold": 9,
"total_revenue": 269.91
}
]
}
],
"availability_changes": [
{
"time": "2026-10-01 14:02:11",
"product_id": "american-flag-hoodie",
"variant_id": 40211234567892,
"variant_title": "Charcoal / M",
"status": "sold_out"
}
],
"coverage": {
"data_method": "cart_probe",
"health": "healthy",
"tracked_products": 25
}
}
}signal.availability_changed Sold out / back in stock
{
"id": "evt_9f2c41d07a8b4e5f9c1d2e3f4a5b6c7d",
"type": "signal.availability_changed",
"created_at": "2026-10-02T09:15:04.112Z",
"signal": {
"id": "665f1c2ab4e8a1d2c3f40001",
"domain": "gruntstyle.com",
"store_name": "Grunt Style"
},
"data": {
"changes": [
{
"variant_id": 40211234567892,
"product_handle": "american-flag-hoodie",
"product_title": "American Flag Hoodie",
"variant_title": "Charcoal / M",
"price": 54.99,
"status": "sold_out",
"detected_at": "2026-10-02T09:15:00Z"
}
]
}
}signal.probe_completed Probe completed
{
"id": "evt_9f2c41d07a8b4e5f9c1d2e3f4a5b6c7d",
"type": "signal.probe_completed",
"created_at": "2026-10-02T09:15:04.112Z",
"signal": {
"id": "665f1c2ab4e8a1d2c3f40001",
"domain": "gruntstyle.com",
"store_name": "Grunt Style"
},
"data": {
"date": "2026-10-02",
"source": "cron",
"full_probe": true,
"health": "healthy",
"variants_probed": 84,
"variants_with_stock_count": 81,
"units_sold_since_last_probe": 7,
"revenue_since_last_probe": 209.93,
"availability_changes": 1,
"currency": "USD"
}
}signal.health_changed Health changed
{
"id": "evt_9f2c41d07a8b4e5f9c1d2e3f4a5b6c7d",
"type": "signal.health_changed",
"created_at": "2026-10-02T09:15:04.112Z",
"signal": {
"id": "665f1c2ab4e8a1d2c3f40001",
"domain": "gruntstyle.com",
"store_name": "Grunt Style"
},
"data": {
"previous_state": "warming_up",
"state": "healthy",
"reason": "Stock is readable on 81/84 variants (78 in stock); sales recorded in the last 7 days.",
"since": "2026-10-02T09:15:04.000Z"
}
}sales_spike Sales spike
{
"id": "evt_1b7e0c3d9a6f4e2b8c5d1a0f9e8d7c6b",
"type": "sales_spike",
"created_at": "2026-10-02T16:00:02.000Z",
"signal": {
"id": "665f1c2ab4e8a1d2c3f40001",
"domain": "gruntstyle.com"
},
"data": {
"severity": "alert",
"title": "Grunt Style: sales surged 3x",
"body": "45 units today vs 15 yesterday ($1,350 revenue).",
"label": "Sales Spike",
"domain": "gruntstyle.com"
},
"event": "sales_spike",
"severity": "alert",
"title": "Grunt Style: sales surged 3x",
"body": "45 units today vs 15 yesterday ($1,350 revenue).",
"label": "Sales Spike",
"timestamp": "2026-10-02T16:00:02.000Z",
"domain": "gruntstyle.com"
}Try it on real data. The free plan has 10 credits a day and works with the MCP connector. API keys come with paid plans.