# Your store's events
Source: https://docs.sellhidden.com/webhooks
Hidden sends your server a signed POST for every event you subscribe to, tries again when your server fails, and logs every delivery in the dashboard.
## Set up your endpoint
### 1. Add an endpoint.
**Developers** > **Webhooks** > **Add endpoint**
**Endpoint URL**: your public https address. Under **Events**, tick the ones you want. Copy the secret from **Copy your signing secret** (shown once) into `HIDDEN_WEBHOOK_SECRET`.
Each endpoint has a label, a list of subscribed events, its own signing secret (rotate it any time) and a delivery log you can filter and resend from. Free: 1 endpoint, log kept 7 days. Starter: 5 endpoints, 14 days. Pro and Enterprise: no limit, 30 and 90 days. Private and local addresses are rejected.
From code: `POST /webhooks` with `url` and `events`. The answer carries `webhook.secret`, this one time. See the [webhooks API](https://docs.sellhidden.com/reference/webhooks).
### 2. Check the signature.
```http
X-Hidden-Timestamp: <Unix seconds>
X-Hidden-Signature: sha256=<hex>
```
**Node** · `webhook.mjs`
```javascript
import { createHmac, timingSafeEqual } from "node:crypto";
export function verifyHidden(raw, timestamp, signature, secret) {
const age = Math.abs(Date.now() / 1000 - Number(timestamp));
// missing, or more than 5 minutes off
if (!timestamp || !(age <= 300)) return false;
const want = Buffer.from(createHmac("sha256", secret)
.update(`${timestamp}.${raw}`).digest("hex"));
const got = Buffer.from(
String(signature ?? "").replace(/^sha256=/, ""));
return got.length === want.length && timingSafeEqual(got, want);
}
export async function POST(req) {
// the body exactly as sent: never parse it first
const raw = await req.text();
const ok = verifyHidden(raw,
req.headers.get("x-hidden-timestamp"),
req.headers.get("x-hidden-signature"),
process.env.HIDDEN_WEBHOOK_SECRET);
if (!ok) return new Response("bad signature", { status: 401 });
const { event, data } = JSON.parse(raw);
if (event === "payment.paid" && !data.test)
await fulfilOnce(data.reference, data.id); // your code
return new Response("ok"); // any 2xx within 15 seconds
}
```
**curl** · `read it back`
```bash
# A shell cannot take a webhook.
# Read the payment back instead:
curl https://api.sellhidden.com/v1/payments/7K2Q-9XHD \
-H "Authorization: Bearer $HIDDEN_API_KEY"
```
**Python** · `verify.py`
```python
import hashlib, hmac, time
def verify_hidden(raw: bytes, timestamp: str, signature: str,
secret: str) -> bool:
timestamp, signature = timestamp or "", signature or ""
if (not timestamp.isascii() or not timestamp.isdigit()
or abs(time.time() - int(timestamp)) > 300):
return False # missing, or more than 5 minutes off
want = hmac.new(secret.encode(), timestamp.encode() + b"." + raw,
hashlib.sha256).hexdigest()
return hmac.compare_digest(want.encode(),
signature.removeprefix("sha256=").encode())
```
**PHP** · `verify.php`
```php
<?php
function verify_hidden(string $raw, string $timestamp,
string $signature, string $secret): bool {
if (!ctype_digit($timestamp)
|| abs(time() - (int) $timestamp) > 300) return false;
$want = hash_hmac("sha256", $timestamp . "." . $raw, $secret);
return hash_equals($want,
preg_replace('/^sha256=/', '', $signature));
}
// $raw = file_get_contents("php://input");
// the headers are HTTP_X_HIDDEN_TIMESTAMP and
// HTTP_X_HIDDEN_SIGNATURE in $_SERVER
```
HMAC-SHA256 of `<timestamp>.<raw body>`, keyed with the whole `whsec_...` secret in `HIDDEN_WEBHOOK_SECRET`.
A test case for your signature check:
- Secret: `whsec_0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef`
- Timestamp: `1794910361`
- Body: `{"id":"evt_0123456789abcdef","event":"payment.paid","createdAt":"2026-11-17T10:12:41.000Z","data":{"id":"7K2Q-9XHD","status":"paid","amountUsd":49}}`
- Signature: `sha256=dc2d0686941478580ce6baf166d24016b291529e1c3cc72819295b2520171a08`
The timestamp is old, so the 5-minute check refuses it: for this test, check the HMAC alone or set the clock to `1794910361`.
### 3. Handle `order.paid`.
Store orders send `order.paid`. The same check, then your part:
**Node** · `orders.mjs`
```javascript
import { verifyHidden } from "./webhook.mjs";
export async function POST(req) {
// the raw body, exactly as sent
const raw = await req.text();
const ok = verifyHidden(raw,
req.headers.get("x-hidden-timestamp"),
req.headers.get("x-hidden-signature"),
process.env.HIDDEN_WEBHOOK_SECRET);
if (!ok) return new Response("bad signature", { status: 401 });
const { event, data } = JSON.parse(raw);
if (event === "order.paid" && !data.test)
await onOrderPaid(data); // your code, once per orderId
return new Response("ok"); // any 2xx within 15 seconds
}
```
**curl** · `read it back`
```bash
# A shell cannot take a webhook.
# Read the order back instead:
curl https://api.sellhidden.com/v1/orders/4MPT-8WQA \
-H "Authorization: Bearer $HIDDEN_API_KEY"
```
**Python** · `orders.py`
```python
import json, os
from flask import Flask, request # pip install flask
from verify import verify_hidden # verify.py above
app = Flask(__name__)
@app.post("/hidden-webhook")
def hidden_webhook():
raw = request.get_data() # the body exactly as sent
ts = request.headers.get("X-Hidden-Timestamp")
sig = request.headers.get("X-Hidden-Signature")
secret = os.environ["HIDDEN_WEBHOOK_SECRET"]
if not verify_hidden(raw, ts, sig, secret):
return "bad signature", 401
body = json.loads(raw)
data = body["data"]
if body["event"] == "order.paid" and not data.get("test"):
on_order_paid(data) # your code, once per orderId
return "ok" # any 2xx within 15 seconds
```
**PHP** · `orders.php`
```php
<?php
require __DIR__ . "/verify.php";
$raw = file_get_contents("php://input"); // as sent
$ok = verify_hidden($raw,
$_SERVER["HTTP_X_HIDDEN_TIMESTAMP"] ?? "",
$_SERVER["HTTP_X_HIDDEN_SIGNATURE"] ?? "",
(string) getenv("HIDDEN_WEBHOOK_SECRET"));
if (!$ok) {
http_response_code(401);
exit("bad signature");
}
$body = json_decode($raw, true);
$data = $body["data"];
if ($body["event"] === "order.paid" && empty($data["test"])) {
on_order_paid($data); // your code, once per orderId
}
echo "ok"; // any 2xx within 15 seconds
```
Do your part once per `data.orderId`: a retry sends the same event again.
## What an order goes through.
Every step is a webhook event. Most orders take the first three: created, paid, delivered.
**The usual path**
| Event | What it means |
| --- | --- |
| `order.created` | The buyer checked out. Nothing is paid yet. |
| `order.paid` | The payment is confirmed. Delivery starts right after. |
| `order.delivered` | Every item reached the buyer. |
**Or one of these**
| Event | What it means |
| --- | --- |
| `order.underpaid` | Less than the total arrived. The buyer can send the rest until `payableUntil`. |
| `order.manual_claimed` | The buyer sent proof for a manual payment. Check it in the dashboard. |
| `order.expired` | Not paid in full in time. |
| `order.cancelled` | Cancelled before it was paid. |
| `order.delivery_failed` | An item could not be delivered. |
| `order.oversold` | Stock ran out after the payment. |
| `order.refunded` | Refunded, most often to the buyer's store balance. |
API payments send their own four events, never `order.*` (see Payments under Every event). Tick each by name: wildcards such as `payment.*` are refused.
## Every event.
33 events you can pick, plus `webhook.test`.
**Events you can pick**
**Orders**
| Event | Sent when |
| --- | --- |
| `order.created` | The buyer checked out, or Hidden opened a subscription's renewal order (with `renewal: true` and `subscriptionId`). Nothing is paid yet. |
| `order.paid` | Payment confirmed, or a manual payment verified. Delivery starts right after. |
| `order.delivered` | Every item in the order was delivered. |
| `order.delivery_failed` | One or more items could not be delivered. Adds `reason` (`oversold` or `delivery_failed`) and `failures`, one entry per item with its error. An endpoint that lists the older name `order.failed` still gets it under that name; pick `order.delivery_failed` for a new one. |
| `order.oversold` | Stock ran out for a paid order, so part of it waits for a restock. Sent alongside `order.delivery_failed` with the same payload. |
| `order.underpaid` | The buyer sent less than the amount due. Adds `receivedUsd`, `remainingUsd` and `payableUntil`: the buyer can pay the rest until then, or you accept or refund what arrived. |
| `order.manual_claimed` | A buyer submitted proof for a manual payment method. Adds `proof`, `proofImage` (`true` when an image was attached) and `manualMethod`. Verify it in the dashboard. |
| `order.expired` | Not paid in full in time. After `order.underpaid`, `paidAmountUsd` is what arrived: accept or refund it. |
| `order.cancelled` | Cancelled by the seller, an admin or a refunded payment. Adds `reason`. |
| `order.refunded` | The order was refunded: to the buyer's store balance, or back to the card when a card checkout was refunded in your own card account. Adds `refundedUsd` and `reason`, and `partialPayment: true` when only part of the total had arrived. |
**Payments**
| Event | Sent when |
| --- | --- |
| `payment.paid` | An API payment was paid in full, within your tolerance, or accepted by you. Carries the payment object: deliver now. |
| `payment.underpaid` | Less than the amount arrived. `underpaid` holds `receivedUsd`, `remainingUsd` and `payableUntil`. |
| `payment.expired` | The payment expired. `paidUsd` above 0 means money arrived and waits for you to accept it. |
| `payment.cancelled` | The payment was cancelled through the API or the dashboard. |
**Subscriptions**
| Event | Sent when |
| --- | --- |
| `subscription.created` | A buyer paid the first period of a subscription variation, or started its free trial. The data is the subscription as one flat object (`subscriptionId`, `status`, `interval`, `quantity`, the period dates, the buyer and the product), plus `orderId`, `trial` and `keys`, the license keys delivered so far. |
| `subscription.renewed` | The buyer paid a renewal (from the email link, the order page or automatically from store balance), or you extended it by one period. Adds the renewal `orderId` and the new period dates; on an extension `orderId` is `null` and `extendedBySeller` is `true`. |
| `subscription.expiring` | The period ends within the store's reminder window and the buyer was emailed a one-click renewal checkout. Adds `renewalOrderId` and `renewalUrl`. |
| `subscription.cancelled` | The buyer or the seller cancelled the subscription. It stays active until `currentPeriodEnd` (`cancelAtPeriodEnd`). Adds `cancelledBy` and `endsAt`. When the seller ends it at once, only `subscription.expired` is sent. |
| `subscription.expired` | The period and its grace days passed without a renewal (`reason` is `expired`), or a cancelled subscription reached its period end or the seller ended it at once (`reason` is `cancelled`). Discord roles granted by it are removed; the payload lists every license key it delivered (`keys`) so you can disable them on your side. |
**Top-ups**
| Event | Sent when |
| --- | --- |
| `topup.paid` | A buyer added funds to their store balance. Same payload as `order.paid`, with `orderKind` `topup`. |
**Stock**
| Event | Sent when |
| --- | --- |
| `product.low_stock` | A product or variation has 3 units or fewer left after a sale. Adds `productId`, `productSlug`, `title`, `variantId`, `variantLabel`, `deliveryType`, `remaining` and `threshold`. |
| `product.out_of_stock` | A product or variation sold its last unit. Same payload as `product.low_stock`, with `remaining` 0. |
**Tickets**
| Event | Sent when |
| --- | --- |
| `ticket.opened` | A buyer opened a support ticket. Adds `ticketId`, `orderId`, `buyerEmail`, `subject` and `message`. |
| `ticket.reply` | A buyer replied on one of their tickets. Adds `ticketId`, `messageId`, `orderId`, `buyerEmail`, `subject`, `message` and `from` (`buyer`). |
**Reviews**
| Event | Sent when |
| --- | --- |
| `review.created` | A buyer left a review. `replacedAutomatic` is `true` when it replaces an automatic rating. |
| `review.edited` | A buyer edited their review while it could still be changed. |
**Withdrawals**
| Event | Sent when |
| --- | --- |
| `withdrawal.requested` | A withdrawal was requested from the store balance, by you or by the automatic threshold. |
| `withdrawal.processed` | A withdrawal was sent (with the transaction hash) or returned to the balance. |
**Affiliates**
| Event | Sent when |
| --- | --- |
| `affiliate.commission.created` | A paid order was attributed to an affiliate, or you added a manual adjustment. Adds `commissionId`, `affiliateId`, `affiliateCode`, `affiliateEmail`, `orderId`, `amountUsd`, `baseUsd`, `pct`, `status` (`pending`, or `flagged` when a fraud guard tripped), `flagReason` and `releaseAt`. |
| `affiliate.commission.released` | The hold passed (or you released it) and the amount was added to the affiliate's store balance. Same payload, with `releasedAt`. |
| `affiliate.commission.reversed` | The order was refunded or you reversed the commission. Adds `reason` and `clawedBackUsd` (what came back out of an already credited balance). |
**Store and plan**
| Event | Sent when |
| --- | --- |
| `store.debt_limit` | Your balance went past the debt limit and manual payment methods were paused, or it recovered and they resumed. Adds `paused`, `balanceUsd` and `debtLimitUsd`. |
| `plan.changed` | A paid plan was activated or renewed, or the store went back to Free when it ended. Adds `plan`, `period` and `planExpiresAt`. |
**Sent only when you ask**
| Event | What it means |
| --- | --- |
| `webhook.test` | You pressed **Send test event** in the dashboard, or called `POST /webhooks/{id}/test`. Sent whatever the endpoint's events are, and never retried. |
Each sample is the `data` of one event's body. Every order event, and `topup.paid`, sends the order as `order.paid` shows it, with its own `status` (the payment keys are `null` until it is paid) and what its line adds. `buyerName`, `payCurrency`, `network`, `txHash` and `items[].productSlug` come only with `order.paid` and `topup.paid`. The payment events send [the payment object](https://docs.sellhidden.com/reference/payments#object), and the subscription events [the subscription](https://docs.sellhidden.com/reference/subscriptions#subscriptions-subscriptions-get) as the API returns it, each with what its line adds.
**order.paid**
`data`
```json
{
"buyerName": null,
"payCurrency": "USDT",
"network": "Tron (TRC20)",
"txHash": "7c1e…a90b",
"orderId": "clx…",
"publicRef": "4MPT-8WQA",
"orderKind": "product",
"storeId": "clx…",
"status": "paid",
"buyerEmail": "buyer@example.com",
"discordUserId": null,
"grossUsd": 29,
"discountUsd": 0,
"buyerTotalUsd": 29,
"sellerNetUsd": 29,
"platformFeeUsd": 0,
"platformFeePaidByBuyerUsd": 0,
"feeUsd": 0,
"netUsd": 29,
"feeBornBy": "seller",
"networkFeeUsd": null,
"couponCode": null,
"paymentMethod": "crypto",
"paidWithBalance": false,
"manualMethodId": null,
"paidAmountUsd": 29,
"paidCurrency": "USDT",
"txReference": "clx…",
"paidAt": "2026-09-26T10:01:12.000Z",
"deliveredAt": null,
"refundedAt": null,
"createdAt": "2026-09-26T09:58:40.000Z",
"customFields": {},
"items": [
{
"itemId": "clx…",
"productId": "clx…",
"productSlug": "lifetime-license",
"title": "Lifetime license",
"variantId": "clx…",
"variantLabel": "Lifetime",
"quantity": 1,
"unitPriceUsd": 29,
"deliveryStatus": "pending"
}
]
}
```
**webhook.test**
`data`
```json
{
"message": "This is a test delivery from Hidden. Your endpoint received it and the signature headers are real.",
"store": {
"id": "clx…",
"slug": "my-store",
"name": "My Store"
},
"sample": {
"orderId": "ord_test_0000000000",
"status": "paid",
"buyerEmail": "buyer@example.com",
"grossUsd": 25,
"discountUsd": 0,
"buyerTotalUsd": 25,
"platformFeeUsd": 0,
"sellerNetUsd": 25,
"couponCode": null,
"paymentMethod": "crypto",
"items": [
{
"productId": "prd_test",
"title": "Sample product",
"variantId": null,
"quantity": 1,
"unitPriceUsd": 25,
"deliveryStatus": "pending"
}
]
}
}
```
## Headers and payload.
Deliveries are JSON POSTs with six headers.
```http
Content-Type: application/json
User-Agent: Hidden-Webhooks/1.0 (+https://sellhidden.com)
X-Hidden-Event: order.paid
X-Hidden-Delivery: clx…
X-Hidden-Timestamp: 1790416872
X-Hidden-Signature: sha256=<hex>
```
`what arrives`
```json
{
"id": "evt_9f2c1a7b3d5e6f80",
"event": "order.paid",
"createdAt": "2026-09-26T10:01:12.000Z",
"data": {
"orderId": "clx…",
"publicRef": "4MPT-8WQA",
"status": "paid"
}
}
```
`X-Hidden-Event` names the event, `X-Hidden-Delivery` is the id of the delivery, `X-Hidden-Timestamp` is Unix seconds and `X-Hidden-Signature` carries the HMAC.
| Key | Type | Description |
| --- | --- | --- |
| `id` | string | The event id, `evt_` and 16 hex characters. The same on every retry, and for every endpoint that gets this event. |
| `event` | string | The event name, as in `X-Hidden-Event`. |
| `createdAt` | string | When the event happened (ISO 8601, UTC). It does not change on a retry. |
| `data` | object | The event's object: the order, the payment, the subscription and so on. Each event's line above says what it holds. |
On `order.paid` and `topup.paid`, `payCurrency` is the coin the buyer paid with, `network` is the name of its network for people to read, such as "Tron (TRC20)" (do not compare it in code), and `txHash` is the transaction hash on the blockchain once it is known. On every order event, `txReference` is Hidden's own id for the crypto payment, or `null` when there is none.
Anything but a 2xx counts as a failure, a redirect too. The body you return is ignored.
Orders a seller creates with **Test order** in the dashboard send the same events with `"test": true` in `data` (and in the dynamic delivery request), and have `test: true` in the API. Nothing was paid for them: never deliver or count a test order.
## Retries and duplicates.
Answer 2xx within 15 seconds, or Hidden tries again: 7 attempts over about 45 hours.
A failed delivery is retried up to six times: about 30 minutes, then 1, 2, 6, 12 and 24 hours after each failed attempt. Retries are sent in batches at :00 and :30, so one can leave up to 5 minutes early or about 25 minutes late.
- Retried: no answer within 15 seconds, a redirect, a 5xx and every 4xx not listed below, 401, 403 and 429 too, for example from a firewall in front of your server.
Not retried: 400, 404, 410 and 422, which say the request itself is wrong, and an address on a private or local network.
Every retry sends the same body, with the same event `id` and the same `X-Hidden-Delivery`, and a fresh timestamp and signature. The same event can reach you twice: do your part once per order or payment, and ignore an event `id` you already handled.
After 6 deliveries in a row fail, even after their retries, the endpoint is switched off and its pending retries stop. Hidden emails you its last answer and how to fix it, and switches it back on when it answers: every 6 hours for 7 days it sends the newest failed event again, and on a 2xx the events it missed in those days follow. Events raised while it is off are not sent. You can also switch it back on yourself in the dashboard; then use **Resend** for what failed.
Use **Send test event** to receive a signed `webhook.test` delivery, and **Resend** on any failed row to replay its exact payload.
## Webhooks in the dashboard and the API
- [Open the dashboard](https://dashboard.sellhidden.com): Developers, then Webhooks: add an endpoint, send a test event, read the log.
- [The webhooks API](https://docs.sellhidden.com/reference/webhooks): Create endpoints, rotate secrets and read deliveries from your code.
- [Create an endpoint](https://docs.sellhidden.com/reference/webhooks#webhooks-webhooks-create)
- [Rotate the secret](https://docs.sellhidden.com/reference/webhooks#webhooks-webhooks-rotate)
- [Delivery log](https://docs.sellhidden.com/reference/webhooks#webhooks-webhooks-deliveries)