Skip to main content
What you’ll build:
  • Create a transaction subscription for one or more wallets
  • Handle and parse incoming webhook payloads
  • Verify webhook signatures for security
  • Manage (list, update, delete) your subscriptions
Time: ~15 minutes

Prerequisites

  • A Zerion API key (get one here)
  • A publicly accessible callback URL to receive webhook notifications (you can use webhook.site for testing)
For production use, contact api@zerion.io to whitelist your callback URL. See Webhooks for plan limits and delivery guarantees.

Steps

1

Create a subscription

Subscribe to transactions for one or more wallet addresses using the create subscription endpoint.
  • chain_ids is optional. Omit it to subscribe to all supported chains
  • Save the subscription id from the response for management later
2

Handle incoming webhooks

When a transaction occurs, Zerion sends a POST request to your callback URL. Here’s what the payload looks like and how to process it.
Express.js
Transaction prices in webhook notifications are always null. To get USD values, fetch the full transaction using the wallet transactions endpoint after receiving the notification:
3

Verify webhook signatures

The Express handler above already includes full signature verification. The key points:
  • Each webhook includes three headers: x-timestamp, x-signature, and x-certificate-url
  • Build the signed message as `${timestamp}\n${rawBody}\n`. Use the raw request body, not JSON.stringify(req.body)
  • Verify using crypto.createVerify("SHA256") with the certificate’s public key
  • Cache fetched certificates to avoid re-downloading on every request
Always validate the x-certificate-url domain before fetching. Ensure it points to a trusted Zerion domain to prevent SSRF attacks.
4

Manage your subscription

List, update, or delete subscriptions as needed: list subscriptions, update wallets, or delete a subscription.

Important notes

See Delivery guarantees and Subscription limits on the Webhooks reference page.

Next steps

  • Combine with the transaction history recipe to fetch full details (including prices) for flagged transactions
  • Use chain_ids to focus on specific chains and reduce noise
  • Build a notification service that forwards alerts to Slack, Discord, email, or push notifications