Skip to main content
Instead of polling the AntifraudAI API to check on transaction outcomes or case status changes, webhooks let AntifraudAI push events to your server the moment they happen. This enables real-time alerting, automated case triage workflows, and instant order fulfilment or cancellation — all without a single polling loop.

Supported Webhook Events


Creating a Webhook

1

Open the Webhooks settings

In the AntifraudAI dashboard, navigate to Settings → Webhooks and click Add Endpoint.
2

Enter your endpoint URL

Provide a publicly accessible HTTPS URL on your server. AntifraudAI will send HTTP POST requests to this URL for each subscribed event.
3

Select events to subscribe to

Check the events you want to receive. You can subscribe to individual events or use “Send all events” to receive everything.
4

Save and copy the signing secret

Click Save. AntifraudAI will display a signing secret (prefixed whsec_). Copy it now — it will not be shown again. Store it securely in your environment variables and use it to verify incoming webhook signatures.

Webhook Payload

AntifraudAI delivers events as JSON POST requests. Below is an example payload for the transaction.screened event:

Verifying Webhook Signatures

AntifraudAI signs every webhook request using HMAC-SHA256 and includes the signature in the X-AntifraudAI-Signature HTTP header. You must verify this signature before processing the payload. The signature is computed as:
Always verify the webhook signature before processing the payload. Skip this check and you risk processing forged requests crafted by a third party to manipulate your fraud operations workflow.
Use a constant-time comparison (e.g. hmac.compare_digest in Python, crypto.timingSafeEqual in Node.js) when comparing signatures. Standard string equality is vulnerable to timing attacks.

Retries

If your server does not return a 2xx HTTP status code within 30 seconds, AntifraudAI considers the delivery attempt failed and will retry using exponential backoff: After 5 failed attempts, the delivery is marked failed and no further retries are made. You can inspect failed deliveries and manually replay them from Settings → Webhooks → [Your Endpoint] → Delivery Logs.
Make your webhook handler idempotent — the same event can be delivered more than once if a retry occurs after your server processed the event but before it returned 200. Use the transaction_id or case_id in the payload as a deduplication key.