Webhooks
Notifications delivered to your endpoints when corporate entities change state.
Before You Start
Read the following guides before proceeding:
| Guide | Why |
|---|---|
| Getting Started | The webhook base URL is configured during onboarding |
| Authentication | Understanding what belongs to your company |
Overview
Wirex delivers HTTP POST notifications to the webhook base URL registered for your company. The same
dispatcher serves retail and corporate companies, so the delivery contract and the payload shapes are
shared across both APIs — only the set of entities you receive differs.
Delivery Model
- Method: HTTP POST with a JSON body
- Content-Type:
application/json - Timeout: 10 seconds per request
- Retries: A failed delivery is retried up to 5 times with exponential backoff, then dropped.
Retries can arrive out of order and more than once - Authentication: Every webhook carries an HMAC-SHA256 signature in
X-Webhook-Timestampand
X-Webhook-Signature— see Webhook Signature
Verify the signature on every webhook and implement idempotent handlers — a delivery can repeat.
There is no per-corporation webhook URL. Every corporation registered under your partner_id delivers
to the same base URL; use corporation_address in the payload to route.
Webhook Signature
Every webhook is signed with your client_secret — the same secret you exchange for a bearer token
at POST /api/v1/token (see Authentication). Verify the signature before you trust any field
of the body.
Signature Headers
| Header | Value |
|---|---|
X-Webhook-Timestamp | Unix time in seconds (UTC) at which this delivery attempt was signed |
X-Webhook-Signature | sha256= followed by the lowercase hex HMAC-SHA256 of the signed message |
The signed message is the timestamp, a dot, and the raw request body:
signed_message = X-Webhook-Timestamp + "." + raw_body
signature = "sha256=" + hex(HMAC_SHA256(key = client_secret, message = signed_message))
| Input | Exact value |
|---|---|
client_secret | Your client secret as UTF-8 bytes |
X-Webhook-Timestamp | The header value as received, as a decimal string |
raw_body | The HTTP request body byte for byte, before any JSON parsing or re-serialization |
The HTTP method and the path are not signed. Rely on the body, not the path, to identify the entity.
Verifying a Webhook
- Read the raw body before parsing it. A body that was parsed and re-serialized produces a different
signature even when the JSON is equivalent. - Reject the request if either header is missing.
- Reject the request if
X-Webhook-Timestampis more than 300 seconds away from your current time. - Compute the HMAC over
timestamp + "." + raw_bodyand compare it withX-Webhook-Signaturein
constant time. - Only then parse the JSON and process it.
import crypto from 'node:crypto';
const toleranceSeconds = 300;
function verifyWebhook(rawBody, headers, clientSecret) {
const timestamp = headers['x-webhook-timestamp'];
const signature = headers['x-webhook-signature'];
if (!timestamp || !signature) return false;
const age = Math.abs(Math.floor(Date.now() / 1000) - Number(timestamp));
if (!Number.isFinite(age) || age > toleranceSeconds) return false;
const expected = 'sha256=' + crypto
.createHmac('sha256', clientSecret)
.update(`${timestamp}.`)
.update(rawBody)
.digest('hex');
const a = Buffer.from(expected);
const b = Buffer.from(signature);
return a.length === b.length && crypto.timingSafeEqual(a, b);
}import hashlib
import hmac
import time
TOLERANCE_SECONDS = 300
def verify_webhook(raw_body: bytes, headers, client_secret: str) -> bool:
timestamp = headers.get("X-Webhook-Timestamp")
signature = headers.get("X-Webhook-Signature")
if not timestamp or not signature:
return False
try:
if abs(int(time.time()) - int(timestamp)) > TOLERANCE_SECONDS:
return False
except ValueError:
return False
expected = "sha256=" + hmac.new(
client_secret.encode(),
f"{timestamp}.".encode() + raw_body,
hashlib.sha256,
).hexdigest()
return hmac.compare_digest(expected, signature)import (
"crypto/hmac"
"crypto/sha256"
"encoding/hex"
"net/http"
"strconv"
"time"
)
const toleranceSeconds = 300
func verifyWebhook(rawBody []byte, header http.Header, clientSecret string) bool {
timestamp := header.Get("X-Webhook-Timestamp")
signature := header.Get("X-Webhook-Signature")
if timestamp == "" || signature == "" {
return false
}
sent, err := strconv.ParseInt(timestamp, 10, 64)
if err != nil {
return false
}
age := time.Now().Unix() - sent
if age > toleranceSeconds || age < -toleranceSeconds {
return false
}
mac := hmac.New(sha256.New, []byte(clientSecret))
mac.Write([]byte(timestamp + "."))
mac.Write(rawBody)
expected := "sha256=" + hex.EncodeToString(mac.Sum(nil))
return hmac.Equal([]byte(expected), []byte(signature))
}Test Vector
Use it to check your implementation before connecting it to live traffic.
| Input | Value |
|---|---|
client_secret | test-secret |
X-Webhook-Timestamp | 1762351680 |
raw_body | {"IsMandatory":false,"TransactionReason":"Authorization","LocalAmount":9} |
Expected X-Webhook-Signature | sha256=b794067c6645e3fe9cd8f526fde2d3592bae4226f5662107132c32f4b34482aa |
The timestamp in the vector is in the past — skip the 300-second check when you run it.
Behavior to Plan For
- Signing starts with client credentials. Webhooks are signed for a company that has a
client_secretissued. Once yours is issued, treat a webhook without valid signature headers as not
coming from Wirex and contact support if you receive one. - Each attempt is signed again. A retried delivery carries a new
X-Webhook-Timestampand a new
X-Webhook-Signatureover the same body. - The signature does not make a webhook unique. A copy resent within 300 seconds verifies again,
and retries deliver the same event more than once. Deduplicate on the entity id and its state in the
body — usecorporation_addressand the entity's own id and status to route and deduplicate. - Rotating
client_secretswitches both uses at once. The new secret is used for the token
endpoint and for webhook signatures from the moment the rotation takes effect, with no period in which
both are signed. During a rotation, accept a signature that verifies with either the old or the new
secret, then drop the old one.
Endpoints
| Path | Entity | Delivered when |
|---|---|---|
/v2/webhooks/corporations | Corporation | Corporation profile, status or KYB verification status changes |
/v2/webhooks/wallets | Wallet | A corporation wallet is created or its confirmation status changes |
/v2/webhooks/balances | Balance | A token balance changes on a corporation wallet |
/v2/webhooks/cards | Card | A card is issued or its status or data changes |
/v2/webhooks/card-limits | Card limit | A spending limit or its usage changes |
/v2/webhooks/3ds | 3DS request | A 3D Secure challenge is raised on a card transaction |
/v2/webhooks/activities | Activity | A transaction or activity feed item is created or updated |
/v2/webhooks/recipients | Recipient | A recipient is created or updated |
/v2/webhooks/erc-withdrawals | ERC withdrawal | A withdrawal request awaits on-chain execution |
/v2/webhooks/user and /v2/webhooks/debt-cases carry retail user entities and are not delivered for
corporations.
Corporation Webhook
Endpoint: POST {your_webhook_base_url}/v2/webhooks/corporations
Delivered when the corporation record changes — most importantly when KYB moves through
Applied → InReview → Approved, and when the profile becomes Active.
{
"corporation_address": "0xA7E41d5680dE394EaA2ed417169DFf56840Fb3EE",
"owner_address": "0xA7E41d5680dE394EaA2ed417169DFf56840Fb3EE",
"corporation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"corporation_name": "Acme Inc",
"corporation_type": "LimitedLiability",
"verification_status": "Approved",
"status": "Active",
"registration_number": "12345678",
"corporation_registration_address": {
"line1": "10 Downing Street",
"line2": "Flat 2",
"city": "London",
"state": "",
"country": "GB",
"postal_code": "SW1A 2AA"
},
"corporation_contact_details": {
"name": "Alex Grey",
"email": "[email protected]",
"phone_number": "+447700900123"
},
"freshdesk_id": "1234567890"
}| Field | Type | Description |
|---|---|---|
corporation_address | string | The corporation's wallet address — use it to route the event |
owner_address | string | Address of the corporation owner |
corporation_id | string | Corporation id (UUID) |
corporation_name | string | Registered name |
corporation_type | enum | LimitedLiability, SoleTrader, Partnership, PublicLimitedCompany, JointStockCompany, Charity |
verification_status | enum | Pending, Applied, InReview, Approved, Rejected, Canceled |
status | enum | Pending, Active, Blocked, Deleted |
registration_number | string | Company registration number |
corporation_registration_address | object | Registered address. Omitted until KYB supplies it |
corporation_contact_details | object | Primary contact. Omitted until KYB supplies it |
freshdesk_id | string | Support identifier, when set |
The corporation webhook carries a narrower payload than
GET /api/v1/corporations. It has no
capabilities, noactionsand noverification_levels. Treat it as a signal to re-read the
corporation, not as a replacement for reading it — capability transitions are only visible on the read
endpoint.
Shared Payloads
The wallet, balance, card, card-limit, 3DS, activity, recipient and ERC-withdrawal payloads are produced
by the shared dispatcher and are documented in the retail Webhooks guide. They arrive
unchanged for corporations.
Two differences matter when you map them onto Corporate API responses:
- The card webhook is the retail card shape. It carries
generationandbalances, and itslimit
object carrieslifetime_limitandlifetime_usage— none of which appear in
GET /api/v1/cards. Ignore the extra fields rather than modelling your card record on the webhook. - Wallet and balance events are addressed by wallet address, not corporation id. Resolve the
corporation by matchingwallet_addressagainstGET /api/v1/wallets.
What Is Not Delivered
There is no webhook for employees, roles, bank account activation, FX swaps or bulk transfer approval.
Poll the corresponding endpoint after the call that started the work:
| Change | How to observe it |
|---|---|
| Employee invited, updated, deleted | GET /api/v1/employees |
| Role created, updated, deleted | GET /api/v1/roles |
| Bank account details activated | GET /api/v1/bank/accounts — the details appear once the account status is Active |
| Capability became active | GET /api/v1/corporations — read capabilities[].status |
| FX swap settled | GET /api/v1/activity/feed |
| Bulk transfer executed | GET /api/v1/activity/feed |
Updated 11 days ago

