Skip to content

    Integrations

    Webhooks

    A webhook tells another app when something changes in your inventory: stock goes up or down, an item runs low, a new item is added. Simple Inventory sends each change to a web address the other app gives you. Zapier's Catch Hook is a common example.

    You can also create a webhook that works the other way, so another app can send stock updates to Simple Inventory. See Receive stock updates from another app.

    Owners and Admins manage webhooks in the web app, under Settings → Integrations → Webhooks. For the full technical reference, see the API docs.

    Add a webhook

    1. Go to Settings → Integrations → Webhooks.
    2. Click Add Webhook (or Add your first webhook).
    3. Give it a Name, for example "Zapier" or "Google Sheets".
    4. Under What should it do?, choose Send updates to another app.
    5. Paste the other app's address into Address to send to. It must start with https:// (or http://). Addresses on private or internal networks are refused.
    6. Under Send these changes, tick the changes the other app should hear about. Tick at least one. Ticking every box also includes any new kinds of change added later.
    7. Optional: add Notes (optional) about what the webhook is for.
    8. Click Create webhook.

    A Webhook created dialog shows the webhook's Secret. You only need it if the other app checks signatures (Zapier doesn't). It's shown only once, so copy it now, then click Done.

    The Add webhook dialog with Send updates to another app selected, an https address entered, and Stock changed and Low stock ticked under Send these changes

    The changes you can send

    Change Sent when
    Stock changed Stock was added, removed or counted
    Low stock An item dropped to its low stock level
    Out of stock An item ran out
    Item created A new item was added
    Item updated An item's name, SKU, price, folder or other details changed
    Item archived An item was archived, on the web or in the phone app

    What each delivery contains is described in Webhook deliveries and Events.

    Check a webhook

    The list shows each webhook's name, where it sends and which changes, and its status: Active, Paused or Turned off. A Zapier or API badge marks webhooks created by a Zap or through the API.

    Click a webhook to see its details: the address it Sends to, its Events, when it was Last delivered, and its notes.

    Send a test

    Click Send test. Simple Inventory sends a test message to the address right away. (Webhooks created by a Zap or through the API, and webhooks that receive updates, don't have this button.)

    • Test delivered means the other app accepted it (a 2xx answer), with the status and how long it took.
    • Test didn't go through shows the error or the status the other app answered with.

    A test that goes through also clears the webhook's count of failed deliveries.

    Recent deliveries

    Under the details, Recent deliveries lists what was sent, newest first. Each row shows the change and its status:

    Status Meaning
    Waiting to send Queued
    Delivered The other app confirmed it got this
    Will retry The last try failed; it shows when the next try is
    Failed Every try failed, or the other app refused it
    Not sent The webhook was paused, turned off or deleted before it went out, or the organization's subscription was inactive

    Click a row to see what the other app answered and the exact payload that was sent.

    Pause, change the secret, or delete

    • Pause stops deliveries. "Changes made while it's paused won't be sent later." Click Resume to start again.
    • New secret creates a new secret. The current one stops working straight away, so give the new one to the other app. Zapier webhooks don't have this button, because Zapier doesn't check signatures.
    • Delete removes the webhook and stops deliveries straight away.

    Webhooks created by a Zap are managed by Zapier: turning the Zap off removes the webhook automatically. If you delete one here instead, updates stop reaching that Zap, but Zapier won't know. Webhooks created through the API can be removed by the app that created them. Webhooks created by a Zap or through the API stop sending if the person whose API key created them is no longer an Owner or Admin.

    When deliveries fail

    Simple Inventory treats any 2xx answer as delivered.

    The other app... What happens
    Doesn't answer, times out, or answers 408, 429 or 5xx Simple Inventory tries again after 1 minute, 5 minutes, 30 minutes, 2 hours and 8 hours. After the sixth try, the delivery fails.
    Answers any other 4xx status, or a redirect Simple Inventory can't follow (no Location header, more than 3 redirects, or to a blocked address) The delivery fails straight away. Other redirects are followed; see Retries and failures.
    Answers 410 Gone The webhook is turned off straight away. A webhook created by a Zap or the API is deleted instead.

    Each retry of a delivery carries the same delivery ID, so the other app can ignore one it has already handled.

    When a delivery fails, the webhook shows how many have failed in a row. After 10 failed deliveries in a row, it turns itself off: the page shows Turned off after repeated failures and nothing is sent. Check the address is right and the other app is working, then click Turn back on.

    Verifying signatures

    Each delivery is a POST with a JSON body and these headers:

    http
    X-SI-Event: inventory.updated
    X-SI-Delivery-Id: <same on every retry>
    X-SI-Timestamp: <Unix seconds>
    X-SI-Signature: v1=<hex HMAC-SHA256 of "<timestamp>.<body>">
    

    To check a delivery came from Simple Inventory, compute an HMAC-SHA256 of the timestamp, a full stop and the raw body, using the webhook's secret as the key. Compare the hex digest with the part after v1=, and reject timestamps more than five minutes old. The webhook's details page has a code example under For developers: verifying signatures, and Webhook deliveries has the full reference.

    Receive stock updates from another app

    1. Click Add Webhook and choose Receive stock updates from another app.
    2. Give it a Name and click Create webhook.
    3. The dialog shows the Address for the other app to post to and a Secret. Give both to the other app. The secret is shown only once.

    The other app can then set an item's stock, take stock off for a completed order, or add it back for a refunded one, matching items by SKU. An archived item with that SKU isn't changed. Stock changes it makes are saved in the item's history with the source API. Each request has to be signed with the secret.

    While the webhook is paused, updates sent to its address are refused. Recent updates received lists what arrived and whether it was Accepted, Rejected or Ignored. An update for a SKU that no item has still shows as Accepted in this list, because the request itself was valid, but nothing changes: the other app gets processed: false, and the row's Result reads null. An update for an archived item, or one whose quantity is too large, also shows as Accepted and changes nothing; its Result gives the reason, such as {"reason":"Item is archived"}.

    For the request format, see Receive stock updates.

    When your subscription is inactive

    Webhooks keep working while your organization is active, in its trial, or past due (a card payment failed and is being retried). When the trial has ended without a plan, the subscription is cancelled or unpaid, or the organization is closed:

    • Outgoing deliveries aren't sent. They show as Not sent, don't count as failures, and aren't sent later. The webhook stays active and delivers the next change once the organization is active again.
    • Incoming updates are acknowledged but not applied, then or later.

    See Plans & billing.