Guides
Webhooks
Get a signed HTTPS request the moment an order starts, progresses, finishes or is refunded — instead of polling.
Setting up an endpoint
- Build an HTTPS endpoint that accepts POST requests with a JSON body and answers 2xx quickly. Verify each request as shown below.
- In Dashboard → Webhooks, add its URL and pick the events you want, or all of them.
- Copy the endpoint’s signing secret. It starts with
whsec_; keep it on your server like an API key. - Send a test event from the dashboard and check your endpoint received and verified it.
Each endpoint gets its own copy of every event it subscribes to. Disabled endpoints get nothing, and events aren’t queued for them while disabled.
Events
| Event | Sent when | data |
|---|---|---|
order.created | An order was accepted and charged. | data.order |
order.started | Delivery began. Includes the start count. | data.order |
order.progress | Delivery crossed 25%, 50% or 75%. | data.order |
order.completed | The full quantity was delivered. | data.order |
order.partial | Delivery stopped early and the remainder was refunded. | data.order |
order.canceled | The order was canceled and fully refunded. | data.order |
refill.created | A refill request was accepted. | data.refill |
refill.completed | A refill finished restoring dropped units. | data.refill |
refill.rejected | A refill request was rejected, with the reason. | data.refill |
balance.low | Your balance fell below your alert threshold. | data.balance, data.threshold, data.currency |
payment.succeeded | Funds were added to your balance. | data.payment: id, amount, fee, method, status, balance_after, currency |
data.orderis the full order object, the same asGET /api/v3/orders/{id}returns.data.refillis the refill object.order.progressfires once each at 25%, 50% and 75%. A small or fast order can cross several at once.balance.lowfires when a debit (usually an order charge) takes your balance from at or above your alert threshold to below it. Amounts are decimal strings with five places, such as"142.10000", like everywhere else in the API.
Payload
Every event has the same envelope:
{
"id": "evt_EUKJ9j3Frm9zlEUVxB",
"type": "order.progress",
"created": "2026-11-15T10:36:12.410Z",
"data": {
"order": {
"id": 184610,
"object": "order",
"status": "in_progress",
"status_label": "In progress",
"status_reason": null,
"service": {
"id": 102,
"name": "Followers — Premium, 30-day refill"
},
"link": "https://www.tiktok.com/@mila.makes",
"target": {
"kind": "profile",
"username": "mila.makes"
},
"quantity": 1000,
"runs": null,
"interval": null,
"total_quantity": 1000,
"start_count": 28105,
"delivered": 518,
"remains": 482,
"progress": 0.518,
"rate": "2.20800",
"list_rate": "2.40000",
"discount_percent": 8,
"charge": "2.20800",
"refunded": "0.00000",
"net_charge": "2.20800",
"currency": "USD",
"reference": "panel-48213",
"source": "api_v3",
"comments": null,
"username": null,
"estimated_completion_at": "2026-11-15T11:19:40.000Z",
"cancel_requested_at": null,
"refill": {
"available": false,
"reason": "Refill opens once the order is completed.",
"window_ends_at": null
},
"cancel": {
"available": true,
"reason": null
},
"created_at": "2026-11-15T10:14:03.532Z",
"started_at": "2026-11-15T10:21:40.049Z",
"completed_at": null,
"updated_at": "2026-11-15T10:47:02.792Z"
}
}
}| Field | Meaning |
|---|---|
id | The event ID (evt_…). The same on every retry and for every endpoint — use it to drop duplicates. |
type | One of the events above. |
created | When it happened (ISO 8601, UTC) — the moment of the transition, not when we sent it. |
data | The objects involved. |
data.order is the order as it stood when we recorded the event. Delivery keeps moving, so it can be a little ahead of the milestone that triggered it — a 50% event may already show 518 of 1,000 delivered.
Headers
| Header | Value |
|---|---|
Content-Type | application/json |
User-Agent | tiksmm-webhooks/1.0 |
Tiksmm-Event | The event type, e.g. order.completed. |
Tiksmm-Delivery | This delivery’s ID (whd_…): one event to one endpoint. Shown in the dashboard’s delivery log. |
Tiksmm-Signature | t=<unix seconds>,v1=<hex> — see below. |
Verifying signatures
Anyone can POST to your URL, so check every request came from us. The signature is an HMAC-SHA256 of the timestamp, a period and the raw body, keyed with your endpoint’s secret:
Tiksmm-Signature: t=1794786741,v1=<hex>
v1 = hex( HMAC-SHA256( key = secret, message = t + "." + raw_body ) )- Split the header on commas and read
tandv1. - Compute the HMAC over
`${t}.${rawBody}`with the whole secret, including thewhsec_prefix. Use the body exactly as received — parsing and re-serializing the JSON changes it. - Compare with a constant-time comparison.
- Reject timestamps more than a few minutes old to stop replays. Each retry is signed again with a fresh
t, so a tolerance of five minutes never rejects a genuine retry.
import crypto from "node:crypto"
import express from "express"
const SECRET = process.env.TIKSMM_WEBHOOK_SECRET // the whole whsec_… string
const TOLERANCE_SECONDS = 300
function verify(rawBody, header) {
const parts = Object.fromEntries(header.split(",").map((p) => p.split("=")))
const t = Number(parts.t)
if (!t || Math.abs(Date.now() / 1000 - t) > TOLERANCE_SECONDS) return false
const expected = crypto.createHmac("sha256", SECRET).update(`${t}.${rawBody}`).digest("hex")
const a = Buffer.from(expected)
const b = Buffer.from(parts.v1 ?? "")
return a.length === b.length && crypto.timingSafeEqual(a, b)
}
const app = express()
// Use the raw body: re-serialized JSON won't match the signature.
app.post("/webhooks/tiksmm", express.raw({ type: "application/json" }), (req, res) => {
const raw = req.body.toString("utf8")
if (!verify(raw, req.get("Tiksmm-Signature") ?? "")) return res.sendStatus(400)
res.sendStatus(200) // acknowledge first…
const event = JSON.parse(raw)
queue.add(event) // …then do the work (dedupe on event.id)
})<?php
$secret = getenv('TIKSMM_WEBHOOK_SECRET'); // the whole whsec_… string
$payload = file_get_contents('php://input'); // the raw body
$header = $_SERVER['HTTP_TIKSMM_SIGNATURE'] ?? '';
parse_str(str_replace(',', '&', $header), $sig);
$t = (int) ($sig['t'] ?? 0);
$expected = hash_hmac('sha256', $t . '.' . $payload, $secret);
if ($t === 0 || abs(time() - $t) > 300 || !hash_equals($expected, $sig['v1'] ?? '')) {
http_response_code(400);
exit;
}
http_response_code(200);
$event = json_decode($payload, true);
// Queue $event for processing; dedupe on $event['id'].import hashlib
import hmac
import os
import time
from flask import Flask, abort, request
SECRET = os.environ["TIKSMM_WEBHOOK_SECRET"].encode() # the whole whsec_… string
app = Flask(__name__)
def verify(payload: bytes, header: str) -> bool:
parts = dict(p.split("=", 1) for p in header.split(",") if "=" in p)
try:
t = int(parts.get("t", "0"))
except ValueError:
return False
if t == 0 or abs(time.time() - t) > 300:
return False
expected = hmac.new(SECRET, f"{t}.".encode() + payload, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, parts.get("v1", ""))
@app.post("/webhooks/tiksmm")
def tiksmm_webhook():
if not verify(request.get_data(), request.headers.get("Tiksmm-Signature", "")):
abort(400)
event = request.get_json()
# Queue the event for processing; dedupe on event["id"].
return "", 200Check your implementation against this test vector:
| Input | Value |
|---|---|
| Secret | whsec_test_8f2kQ |
| t | 1794786741 |
| Body | {"id":"evt_EUKJ9j3Frm9zlEUVxB","type":"order.completed","created":"2026-11-15T10:59:40.112Z","data":{}} |
| v1 | 9186e8516b558a37f3e3ef1739237b2e788689d95c95e14d2501e2d84f31ab55 |
Responding
- Answer with any 2xx status to acknowledge. The body is ignored, though we keep the first 2,000 characters in the delivery log.
- Respond within 10 seconds. Acknowledge first, then do slow work (database writes, emails, calls back to our API) in the background.
- Anything else is a failure: a 3xx (we don’t follow redirects — register the final URL), 4xx, 5xx, a timeout or a connection error. The delivery log shows which, with your response.
Retries
A failed delivery is retried on this schedule — 6 attempts in all, the last one 8h 36m after the first:
| Attempt | Sent | Since the first attempt |
|---|---|---|
| 1 | Immediately | — |
| 2 | 1m after attempt 1 fails | 1m |
| 3 | 5m after attempt 2 fails | 6m |
| 4 | 30m after attempt 3 fails | 36m |
| 5 | 2h after attempt 4 fails | 2h 36m |
| 6 | 6h after attempt 5 fails | 8h 36m |
After the last attempt the delivery is marked failed. You can resend any delivery — failed or not — from the dashboard, which sends the original payload with a fresh signature. Retries go out on the next dispatch cycle, so times can be a few seconds later than shown.
Duplicates and ordering
- Expect duplicates. If your endpoint processed an event but timed out answering, we’ll send it again. Store the
ids you’ve handled and skip repeats. - Don’t rely on order. Events due at the same time are sent in parallel, and retries arrive late. Compare
created, or the order’supdated_at, before overwriting newer state with older. - Final statuses never change, so an
order.completed,order.partialororder.canceledis always safe to apply. - When in doubt, fetch the order with GET /orders/{id} — it’s always current.
The built-in test receiver
To see real deliveries without deploying anything, point an endpoint at /api/dev/webhook-receiver on this server (relative URLs are resolved against the app’s own address). It acknowledges every POST with 200 and keeps the last 50 deliveries in memory, with their headers:
curl http://localhost:3000/api/dev/webhook-receiver{
"received": [
{
"at": "2026-11-15T10:36:13.808Z",
"event": "order.progress",
"delivery": "whd_iJNt3VNHl8xxUpHymr",
"signature": "t=1794742573,v1=…",
"body": {
"id": "evt_EUKJ9j3Frm9zlEUVxB",
"type": "order.progress",
"created": "2026-11-15T10:36:12.410Z",
"data": {
"order": "…"
}
}
}
]
}The demo account comes with an endpoint pointed at this receiver, subscribed to every event. The list resets when the server restarts, and the receiver doesn’t check signatures — it’s for looking, not for production.
Something unclear or out of date? Write to [email protected] and quote the page.