Skip to content

    API reference

    Webhook deliveries

    A webhook sends an HTTP POST to your URL whenever one of its events happens in your inventory. This page is for the developer receiving those requests. To add, pause or test a webhook in the app, see Webhooks; to subscribe a URL from your own code, see Subscriptions. Both are delivered exactly as described here.

    When deliveries are sent

    Changes are sent only while the webhook is on. Pausing a webhook stops deliveries without deleting it: a delivery that comes due while it's paused is cancelled, including a retry, and changes made while it's paused are never sent. Nothing is saved up for later.

    A webhook can be limited to some events. One that has all six ticked also covers any events added later.

    While the organization's trial has ended or its subscription has lapsed, nothing is sent either; see Subscription status.

    Delivery format

    Each delivery is a JSON body sent with these headers:

    Header Value
    Content-Type application/json
    User-Agent SimpleInventory-Webhook/1.0
    X-SI-Event The event name, such as inventory.updated.
    X-SI-Delivery-Id The delivery's ID: the same as id in the body, and the same on every retry.
    X-SI-Timestamp When this attempt was sent, in Unix seconds.
    X-SI-Signature v1= followed by the signature. See Verify signatures.
    json
    {
      "id": "dlv_48213_9",
      "event": "inventory.updated",
      "createdAt": "2026-10-12T09:41:28.512Z",
      "organizationId": 12,
      "data": {
        "id": 98231,
        "occurredAt": "2026-10-12T09:41:27.000Z",
        "type": "out",
        "quantityChange": -3,
        "previousQuantity": 17,
        "newQuantity": 14,
        "notes": "Order #1042",
        "source": "api",
        "item": {
          "id": 123,
          "name": "Blue Mug",
          "sku": "MUG-BLU",
          "quantity": 14,
          "unitCost": 4.5,
          "salePrice": 12,
          "lowStockThreshold": 5,
          "description": "12 oz ceramic mug",
          "barcode": "0123456789012",
          "folderId": 7,
          "folderName": "Kitchen",
          "parentItemId": null,
          "variantValues": null,
          "isVariantGroup": false,
          "archived": false,
          "createdAt": "2026-10-01T14:03:11.000Z",
          "updatedAt": "2026-10-12T09:41:27.000Z",
          "url": "https://app.simpleinventory.io/item/123"
        }
      }
    }
    
    Field Type Description
    id string The delivery's ID: unique per event and webhook. Treat it as an opaque string and use it to skip deliveries you've already handled.
    event string The event name.
    createdAt string When the delivery was queued (ISO 8601, UTC).
    organizationId integer Your organization's ID.
    data object The event. Its shape depends on the event; see Event payloads.

    A retry sends the same body again; only X-SI-Timestamp and X-SI-Signature change.

    Acknowledging a delivery

    Reply with any 2xx status within 10 seconds to acknowledge a delivery, and do slow work afterwards. A timeout counts as a failure and is retried.

    The same delivery can arrive more than once, and deliveries are not guaranteed to arrive in order. Use X-SI-Delivery-Id to skip repeats and the event's occurredAt to order events.

    Test deliveries

    Send test on a webhook you added in Settings delivers an event named test (the button isn't offered on subscriptions made through the API or Zapier), so you can check your endpoint answers before real events arrive. A test delivery has event: "test", a random UUID as its id, and data holding message, webhookId and webhookName instead of an item. It is signed like any other delivery.

    A failed test doesn't count toward switching the webhook off, and a successful one resets the failure count.

    Verify signatures

    Every delivery is signed with your webhook's secret, so you can check it came from Simple Inventory and wasn't altered. The secret starts with whsec_; you see it once, when the webhook is created or when you replace it with New secret, and the old one stops working straight away.

    The signature is a hex HMAC-SHA256 of the X-SI-Timestamp value, a period, and the raw request body, keyed with the whole secret, whsec_ prefix included:

    http
    X-SI-Signature: v1=hex( HMAC_SHA256( secret, "<X-SI-Timestamp>.<raw body>" ) )
    
    1. Read the raw body bytes, before any JSON parsing.
    2. Reject the request if X-SI-Timestamp is more than 5 minutes from now. This stops an old request being replayed.
    3. Compute the expected signature and compare it with a constant-time comparison.
    js
    import crypto from "node:crypto";
    import express from "express";
    
    const app = express();
    // The signing secret shown when you created the webhook (it starts with whsec_).
    const SECRET = process.env.SIMPLE_INVENTORY_WEBHOOK_SECRET;
    
    // express.raw keeps the exact bytes we signed. Parsing the JSON and
    // re-serialising it would change them and break the signature.
    app.post("/simple-inventory", express.raw({ type: "application/json" }), (req, res) => {
      const timestamp = req.get("X-SI-Timestamp") ?? "";
      const signature = req.get("X-SI-Signature") ?? "";
      const rawBody = req.body.toString("utf8");
    
      // Reject anything more than 5 minutes old, so a captured request
      // can't be replayed later.
      const ageSeconds = Math.abs(Date.now() / 1000 - Number(timestamp));
      if (!timestamp || !(ageSeconds <= 300)) {
        return res.status(400).send("Stale or missing timestamp");
      }
    
      const expected =
        "v1=" +
        crypto
          .createHmac("sha256", SECRET)
          .update(`${timestamp}.${rawBody}`)
          .digest("hex");
    
      const given = Buffer.from(signature);
      const wanted = Buffer.from(expected);
      if (given.length !== wanted.length || !crypto.timingSafeEqual(given, wanted)) {
        return res.status(401).send("Invalid signature");
      }
    
      const delivery = JSON.parse(rawBody);
      // Retries reuse the same id: skip any delivery you have already handled.
      console.log(delivery.id, delivery.event);
    
      res.sendStatus(200); // Acknowledge first, then do any slow work.
    });
    
    app.listen(3000);
    

    Save it as server.mjs (or set "type": "module" in package.json), run npm install express, and start it with SIMPLE_INVENTORY_WEBHOOK_SECRET=whsec_… node server.mjs.

    Subscriptions made through the API come with a secret too, but it is never returned by the API. See Subscriptions.

    Retries and failures

    Your URL answers Outcome
    2xx Delivered. A success also resets the webhook's failure count.
    Timeout, network error, 408, 429, 5xx Retried after 1 minute, 5 minutes, 30 minutes, 2 hours and 8 hours: 6 attempts in all over about 10 hours 40 minutes. If the last attempt fails, the delivery is marked failed.
    410 Gone Sending to that URL stops: a webhook added in Settings is switched off, and a subscription made through the API or Zapier is removed.
    Any other 4xx Failed straight away, with no retries.
    A redirect: 301, 302, 303 Followed, as a GET without the body. The outcome is that of the final answer, so a 2xx there counts as delivered.
    A redirect: 307, 308 Followed with the same POST, body and headers. The outcome is that of the final answer.
    More than 3 redirects, a redirect without a Location header, or a redirect to an address the URL rules refuse Failed straight away, with no retries.

    The 10-second limit covers the whole exchange, redirects included.

    After 10 failed deliveries in a row, the webhook is switched off automatically. A delivery counts once, after its last attempt. Fix your endpoint, then turn the webhook back on with Turn back on in Settings → Integrations → Webhooks; that starts the count again.

    URL rules

    A webhook or subscription URL is checked when it's saved and again on every delivery. When saved, the URL itself is checked; on every delivery, so are the addresses its hostname resolves to at that moment.

    Rule Detail
    Scheme https:// or http://. Use HTTPS.
    Length Up to 2,048 characters.
    Credentials No user name or password in the URL (https://user:pass@…).
    Host A fully qualified public hostname such as hooks.example.com, or a public IP address. Refused: localhost, single-word names, names ending in .local, .localhost, .localdomain, .internal, .home.arpa, .in-addr.arpa or .ip6.arpa, and private, loopback, link-local, shared (CGNAT), multicast, documentation and other reserved addresses.
    Query string Allowed.
    At delivery A hostname that resolves only to refused addresses fails the delivery with no retries. Each redirect is checked the same way.

    The URL is stored in normalized form (for example, with a lowercase host), which is what the API returns.