X-Webhook-Signature header. It must match the webhook secret you generated in the dashboard.
Set up
- In the dashboard, go to Developers → API keys and generate a webhook secret.
- Store it as an environment variable, for example
TANDA_WEBHOOK_SECRET. Keep it out of source control. - In your handler, read
X-Webhook-Signatureand compare it with the secret using a constant-time comparison. - If they don’t match, return
401and do nothing else.
Use a constant-time comparison (
timingSafeEqual, compare_digest, hash_equals) rather than ==. A normal string comparison can leak the secret through response timing.Good practice
- Verify every request, in sandbox too, so the code path is tested before you go live.
- Accept webhooks over HTTPS only.
- Rotate the secret periodically, and immediately if you think it has leaked.
- Even with a valid signature, confirm high-value outcomes with Get transaction.

