Cette page est disponible uniquement en anglais.Ouvrir en anglais
Webhooks
The platform sends a POST to your system for each event of your program: a new card, a purchase, a top-up, a deposit, a verified identity. Each event is signed, so your system can confirm it came from the platform.
Set up the endpoint
Only the owner of the company. Each action asks for the code from your authenticator app.
- Business panel → Webhooks → Add endpoint.
- Endpoint URL: an
httpsaddress with a domain name. No IP address, localhost or port. Up to 300 characters. - Save endpoint. The window Signing secret shows the secret,
whsec_followed by 64 characters. Keep it in your system.
| Button | What it does |
|---|---|
| Reveal | Shows the secret again |
| Send test event | Sends a test.ping, one every 5 seconds |
| Change URL | Events start going to the new address right away. The secret stays the same |
| Rotate secret | Creates a new secret, valid right away. Retries of events already on their way keep the previous secret |
| Remove | Stops sending. The events stay in GET /v2/events for 30 days |
Recent deliveries shows the last 20 deliveries: Event, Status (Pending, Sent, Retrying, Delivered, Failed), Attempts, Response and Last attempt.
The event
{
"id": "evt_3T9KQ2M7XB4AP",
"type": "card.transaction.authorized",
"createdAt": "2026-11-16T14:25:00Z",
"livemode": false,
"data": {
"transactionId": "tx_9B2KQ7M4XT8AP",
"cardId": "card_7KQ2M9XF3TB1A",
"userId": "user_4M8T2KX9PQ7AB",
"amount": 15.99,
"currency": "USD",
"merchant": "Amazon",
"reason": null,
"test": false
}
}
livemode is true in production and false in the sandbox. data brings the public ids and the essential; read the rest with GET.
The headers: X-W3C-Event-Id, X-W3C-Event-Type, X-W3C-Timestamp (Unix seconds) and X-W3C-Signature, with Content-Type: application/json.
Your company has one endpoint per environment: one in production and one in the sandbox, each with its own secret.
externalRef, the id of the person in your system, comes in the user.* and invite.* events. The card and purchase events bring userId: keep the pair from user.created, or read GET /v2/users/{id}. In the purchase events merchant is the name of the store, as text.
Check the signature
X-W3C-Signature is v1= followed by the HMAC SHA-256, in hexadecimal, of X-W3C-Timestamp, a dot and the raw body, made with your signing secret. It is the same design as the webhook signature of Stripe.
import crypto from "node:crypto";
import express from "express";
const app = express();
app.post("/webhooks/web3card", express.raw({ type: "application/json" }), (req, res) => {
const raw = req.body.toString("utf8"); // the raw body, exactly as it arrived
const timestamp = req.header("X-W3C-Timestamp");
const received = (req.header("X-W3C-Signature") || "").replace(/^v1=/, "");
const expected = crypto.createHmac("sha256", WEBHOOK_SECRET).update(`${timestamp}.${raw}`).digest("hex");
const ok = received.length === expected.length && crypto.timingSafeEqual(Buffer.from(received), Buffer.from(expected));
if (!ok || Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return res.sendStatus(400);
const event = JSON.parse(raw);
// skip repeats by event.id, then handle event.type
res.sendStatus(200);
});
- Use the raw body, before any JSON parsing.
- The key of the HMAC is the whole secret, with the
whsec_prefix, as text. The result is in lowercase hexadecimal. - Each attempt carries its own timestamp and its own signature.
- After Rotate secret, accept the two secrets for about 3 days, while the retries of older events end.
- Refuse the event if the signature does not match or if the timestamp is more than 5 minutes old.
- The same event can arrive more than once: skip repeats by
id. - Events come from the addresses of our platform network, not from a fixed IP. The signature is what proves an event is ours.
Deliveries
Answer with a 2xx status within 10 seconds. Otherwise the event is sent again after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h, 24 h and 24 h: 9 attempts, about 3 days. A redirect counts as a failure. Missed an event? GET /v2/events lists the last 30 days, and accepts type, like card.*.
Event types
type | When | data |
|---|---|---|
card.created | The card request arrived from the network. The card is requested: the card issuer has not created it yet | cardId, userId, status, name, last4, cardRef, loadId, firstLoad |
card.activated, card.failed | The new card is ready, or support closed its request. A card that takes longer than usual sends no event while it waits | cardId, userId, status, name, last4. In failed, also the amount, everything the request paid, recorded as credit in the account of the person (credit of the user). To use it or get it back, talk to support |
card.frozen, card.unfrozen, card.canceled | The state of the card changed | cardId, userId, status, name, last4. A card.canceled from a card rule also has reason: low_balance or repeated_declines |
card.request.rejected, card.request.canceled | The card request fell through | cardId, userId, loadId, transactionId, amount, reason |
top_up.completed, top_up.failed | The top-up went in, or its request was closed, by support or because the card can no longer receive it | cardId, userId, loadId, transactionId, amount. In failed, everything the top-up paid, including the fee, is recorded as credit (credit of the user) |
top_up.rejected, top_up.canceled | The top-up request fell through | The same, with reason |
card.transaction.authorized, .declined, .refunded, .reversed, .fee | A purchase, once per state | transactionId, cardId, userId, amount, currency, merchant, reason, test |
card.otp | A purchase code arrived | cardId, userId, status, name, last4, kind (code or link), amount, currency, merchant, expiresAt, test. code and url only for embedded accounts; null for the others. Read with a read-only key in GET /v2/events, it comes without code and url |
vault.deposit.completed, vault.withdrawal.completed | A deposit or a withdrawal in the vault | transactionId, userId (null for a wallet without an account), wallet, amount, tx |
user.created | An account was born from an invite | userId, inviteId, externalRef, mode |
user.kyc.updated | The identity was approved or declined | userId, status (approved or declined), externalRef |
user.cardholder.updated | The answer of a card issuer about the person | userId, label, issuerNumber, status (active, needs_resubmission, blocked, rejected), externalRef |
invite.created, .paused, .resumed, .revoked, .expired | An invite changed | inviteId, status, externalRef |
test.ping | Send test event | message |
The purchase code goes in the event only for embedded accounts, because there your company answers for the authentication of the person. For the other accounts the event tells you a code arrived, without the code. The email with the code to the cardholder is always sent, in every mode.
Purchases: the transaction and the events
status of the purchase | Event | When |
|---|---|---|
sent | card.transaction.authorized | The purchase was authorized |
declined | card.transaction.declined | The purchase was declined, with reason |
confirmed | None | The purchase settled. In the simulator, the action settle |
cancelled | card.transaction.reversed | The authorization was undone. The reversal has its own transaction |
| Does not change | card.transaction.refunded | A refund: a transaction of its own, of the type refund |
| Does not change | card.transaction.fee | A penalty fee of the card issuer: a transaction of its own, of the type fee. The fee that comes inside a purchase sends no event |
Refused requests
card.request.rejected and top_up.rejected mean the request was refused on the network and the amount went back to the balance of the wallet in the contract. The reason:
reason | Meaning |
|---|---|
kyc | The identity is not approved |
account_paused, account_revoked | The invite of the account is paused or revoked |
cardholder | The card issuer has not approved the person yet |
program, program_stage, program_paused | The program does not take requests now |
program_mismatch, kind_mismatch | The request went out for a program or a card different from the reservation |
card_state | The card is not in the right state, such as a top-up of a canceled card |
product | The card does not allow top-ups |
amount_out_of_range, amount_not_integer | The amount is outside the limits of the card, or has cents on a card of whole dollars |
account_card_quota | The person reached the limit of cards at the card issuer |
reservation_expired | The card request was paid after its reservation expired. In the app the transaction says: The request arrived after the reservation expired. The amount is back in your balance. |
card.request.canceled and top_up.canceled come with reason null: the wallet itself canceled the pending request. A reservation that expires without payment sends no event, because nothing was paid and no card exists. A request with a cardRef the platform does not know is refused on the network and sends no event either.