Order status callback
When an order reaches a terminal status (delivered, failed, reversed, expired) we POST this event to your callback_url. Nothing is sent for cancelled (the cancel answer is the confirmation), for the older completed status, or while an order is held (not terminal).
Verify authenticity with the X-Faas-Signature header — it's the hex HMAC-SHA256 of the exact raw request body under your webhook secret (the standard Stripe/GitHub signing scheme). The HMAC key is the secret exactly as you were shown it, as text (its UTF-8 bytes): do not hex-decode it. Compute over the bytes you received, before any JSON parsing, and compare in constant time. Respond 2xx to acknowledge. The body (and signature) are stable across every attempt, so a receiver that deduplicates on either sees one logical event.
Retries. A 5xx, a 3xx (redirects are not followed), a timeout or a connection error gets up to 5 immediate attempts with exponential backoff (pauses of about 7.5 seconds in all between them; each attempt can itself take up to 10 seconds), then up to 10 further replays, about one a minute — roughly 10 minutes from the first attempt to the last. A slow endpoint or a busy replay queue can stretch that window. After that the event is abandoned and not redelivered automatically: an endpoint that is down for longer misses it. Poll GET /v1/orders/{id} (or GET /v1/orders?status=…) for any order that has not reached a terminal status in your records — the order status is always authoritative, the callback is a notification. A 4xx stops the immediate burst — it is your endpoint's verdict, and repeating the same request seconds later cannot change it — but the event is still queued, and a 4xx on a replay abandons it there and then.
Two 4xx codes are the exception. 408 Request Timeout and 429 Too Many Requests mean "not now" rather than "not ever", so they keep the full set of spaced replays instead of being abandoned. They still get no immediate retries: the burst completes in about 7.5 seconds, and hammering an endpoint that just asked us to slow down only spends your rate limit faster.
Delivery constraints. Your endpoint must respond within 5 seconds (connect + headers + body timeout each), and each attempt ends after 10 seconds in total. The status code is the verdict: a status received in time stands even if the response body is still arriving (it is cut off); no status within the deadline counts as a timeout. HTTP redirects are not followed — the callback_url must be the final destination. Retrying never blocks order processing. Every POST carries User-Agent: MyStars-FaaS-Webhook/1.0 (+https://mystars.tg) — allowlist it if a bot-protection rule sits in front of your endpoint.
Secret rotation (rollover). During the grace window after you rotate your webhook secret, this header may carry multiple comma-separated signatures (the new and the previous secret). Treat the header as a comma-separated list and accept the request if any entry matches your secret — so you can switch from the old secret to the new one at any point in the window without dropping a webhook. Outside a rotation it is a single signature, so naive single-value verification keeps working day to day. You rotate with /api_rotate_webhook in the bot; the previous secret keeps signing for 24 hours, and a new rotation is refused until that window has closed (contact support if a secret leaked inside it).
Signature V2 and event identity (additive). Every callback also carries X-Faas-Signature-V2 — the same HMAC computed over the send time and the body, so a receiver can refuse a replayed capture — plus X-Faas-Event-Id (stable across attempts) and X-Faas-Event-Type (order.delivered and so on). The body gains id, type and created_at after the existing fields. Existing X-Faas-Signature verifiers keep working unchanged.
Headers
Hex HMAC-SHA256 of the raw body under your webhook secret. May be a comma-separated list of signatures during a secret-rotation rollover — accept if ANY matches your secret.
t=TIMESTAMP,v1=SIGNATURE: TIMESTAMP is the send time in unix seconds (re-stamped on every attempt) and SIGNATURE the hex HMAC-SHA256, under your webhook secret, of the string TIMESTAMP + "." + raw body. The HMAC key is the secret as text (its UTF-8 bytes, not hex-decoded) and the body is the exact bytes received, before any JSON parsing. One v1 per active secret (current first) during a rotation. Accept when any v1 matches (constant-time compare) and TIMESTAMP is within 5 minutes of your clock. The example is the developer guide's test vector (secret whsec_vector_one, TIMESTAMP 1767225600).
The event id, identical on every attempt — the dedup key (equals the body id).
The event type, for example campaign.paid or order.delivered (equals the body type).
Payload
Example payload
{
"failure_reason": "undeliverable"
}Response
Acknowledged. Any 2xx stops retries.
Changes
Webhooks have no change history: a webhook is keyed by its event name rather than a path and method, so no recorded change can name it.