Webhooks

Notifications delivered to your endpoints when corporate entities change state.

Before You Start

Read the following guides before proceeding:

GuideWhy
Getting StartedThe webhook base URL is configured during onboarding
AuthenticationUnderstanding 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-Timestamp and
    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

HeaderValue
X-Webhook-TimestampUnix time in seconds (UTC) at which this delivery attempt was signed
X-Webhook-Signaturesha256= 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))
InputExact value
client_secretYour client secret as UTF-8 bytes
X-Webhook-TimestampThe header value as received, as a decimal string
raw_bodyThe 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

  1. 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.
  2. Reject the request if either header is missing.
  3. Reject the request if X-Webhook-Timestamp is more than 300 seconds away from your current time.
  4. Compute the HMAC over timestamp + "." + raw_body and compare it with X-Webhook-Signature in
    constant time.
  5. 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.

InputValue
client_secrettest-secret
X-Webhook-Timestamp1762351680
raw_body{"IsMandatory":false,"TransactionReason":"Authorization","LocalAmount":9}
Expected X-Webhook-Signaturesha256=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_secret issued. 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-Timestamp and a new
    X-Webhook-Signature over 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 — use corporation_address and the entity's own id and status to route and deduplicate.
  • Rotating client_secret switches 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

PathEntityDelivered when
/v2/webhooks/corporationsCorporationCorporation profile, status or KYB verification status changes
/v2/webhooks/walletsWalletA corporation wallet is created or its confirmation status changes
/v2/webhooks/balancesBalanceA token balance changes on a corporation wallet
/v2/webhooks/cardsCardA card is issued or its status or data changes
/v2/webhooks/card-limitsCard limitA spending limit or its usage changes
/v2/webhooks/3ds3DS requestA 3D Secure challenge is raised on a card transaction
/v2/webhooks/activitiesActivityA transaction or activity feed item is created or updated
/v2/webhooks/recipientsRecipientA recipient is created or updated
/v2/webhooks/erc-withdrawalsERC withdrawalA 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"
}
FieldTypeDescription
corporation_addressstringThe corporation's wallet address — use it to route the event
owner_addressstringAddress of the corporation owner
corporation_idstringCorporation id (UUID)
corporation_namestringRegistered name
corporation_typeenumLimitedLiability, SoleTrader, Partnership, PublicLimitedCompany, JointStockCompany, Charity
verification_statusenumPending, Applied, InReview, Approved, Rejected, Canceled
statusenumPending, Active, Blocked, Deleted
registration_numberstringCompany registration number
corporation_registration_addressobjectRegistered address. Omitted until KYB supplies it
corporation_contact_detailsobjectPrimary contact. Omitted until KYB supplies it
freshdesk_idstringSupport identifier, when set

The corporation webhook carries a narrower payload than GET /api/v1/corporations. It has no
capabilities, no actions and no verification_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 generation and balances, and its limit
    object carries lifetime_limit and lifetime_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 matching wallet_address against GET /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:

ChangeHow to observe it
Employee invited, updated, deletedGET /api/v1/employees
Role created, updated, deletedGET /api/v1/roles
Bank account details activatedGET /api/v1/bank/accounts — the details appear once the account status is Active
Capability became activeGET /api/v1/corporations — read capabilities[].status
FX swap settledGET /api/v1/activity/feed
Bulk transfer executedGET /api/v1/activity/feed

Did this page help you?