Start free

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.

  1. In the app, open Integrations, then Webhooks, and choose Add endpoint.
  2. Enter an HTTPS address on your server.
  3. Pick what to receive: everything, insights only, or single event types.
  4. Copy the signing secret (whsec_...). You need it to check deliveries.
  5. 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.

Headers of a webhook delivery
HeaderWhat it holds
X-EcomScout-EventThe event type, for example signal.sales.
X-EcomScout-Event-IdThe id of the event (evt_...). A retry sends the same id.
X-EcomScout-SignatureTimestamp and signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of "t.raw_body" with your signing secret>.
X-EcomScout-Delivery-Attempt1 for the first try, 2 for the retry.
X-EcomScout-SecretThe 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.

Node
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));
}
Python
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_at when order matters.

Events

Data

Data events
EventSent when
signal.salesSalesUnits and revenue per variant, sent after every probe that sees sales or restocks
signal.daily_payloadDaily payloadThe full daily report for yesterday (same JSON as GET /v1/signals/{id}/daily)
signal.availability_changedSold out / back in stockVariants that sold out or came back since the last probe
signal.probe_completedProbe completedEvery finished probe with health and counts (frequent)
signal.health_changedHealth changedData quality state changed, e.g. healthy, then blocked

Sales

Sales events
EventSent when
sales_spikeSales spikeUnusual surge in sales
sales_dropSales dropNotable drop or zero sales
restock_detectedRestockProducts restocked
new_bestsellerNew bestsellerA product took off
price_changePrice changeTracked product price changed

Store

Store events
EventSent when
traffic_shiftTraffic shiftSignificant traffic change
app_changeApp changeApps installed or removed
store_updateStore updateRevenue, rating or catalog changes

Social

Social events
EventSent when
social_follower_changeFollower changeNotable follower count change
social_new_platformNew social accountNew social platform discovered
social_verified_changeVerified changeVerified badge gained or lost

Ads

Ads events
EventSent when
ad_new_campaignNew adsNew ad campaigns detected
ad_stoppedAds stoppedAds went inactive
ad_winnerAd winnerAd running 30+ days
ad_summaryAds summaryDaily ads probe recap
ad_ai_analysisAI ad analysisAI strategy summary after an ads probe

Recaps

Recaps events
EventSent when
probe_summaryDaily probe recapShort daily sales recap
weekly_recapWeekly recapWeekly summary

Example payloads

One example body per event. Open the one you need.

signal.sales Sales
JSON
{
  "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
JSON
{
  "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
JSON
{
  "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
JSON
{
  "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
JSON
{
  "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
JSON
{
  "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.