Zum Hauptinhalt springen

Diese Seite ist nur auf Englisch verfügbar.Auf Englisch öffnen

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.

Webhooks before the first endpoint.
  1. Business panel → Webhooks → Add endpoint.
  2. Endpoint URL: an https address with a domain name. No IP address, localhost or port. Up to 300 characters.
  3. Save endpoint. The window Signing secret shows the secret, whsec_ followed by 64 characters. Keep it in your system.
Add endpoint: the https address of your system.
Signing secret, shown after you save. The secret in this image is an example.
ButtonWhat it does
RevealShows the secret again
Send test eventSends a test.ping, one every 5 seconds
Change URLEvents start going to the new address right away. The secret stays the same
Rotate secretCreates a new secret, valid right away. Retries of events already on their way keep the previous secret
RemoveStops 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.

Webhooks: the endpoint, the signing secret and the recent deliveries.
Recent deliveries: each event with its status, the attempts and the answer of your system. The list in this image is an example.

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.
How to use, in the Webhooks page: the same rules, with the headers and an example.

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​

typeWhendata
card.createdThe card request arrived from the network. The card is requested: the card issuer has not created it yetcardId, userId, status, name, last4, cardRef, loadId, firstLoad
card.activated, card.failedThe new card is ready, or support closed its request. A card that takes longer than usual sends no event while it waitscardId, 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.canceledThe state of the card changedcardId, userId, status, name, last4. A card.canceled from a card rule also has reason: low_balance or repeated_declines
card.request.rejected, card.request.canceledThe card request fell throughcardId, userId, loadId, transactionId, amount, reason
top_up.completed, top_up.failedThe top-up went in, or its request was closed, by support or because the card can no longer receive itcardId, 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.canceledThe top-up request fell throughThe same, with reason
card.transaction.authorized, .declined, .refunded, .reversed, .feeA purchase, once per statetransactionId, cardId, userId, amount, currency, merchant, reason, test
card.otpA purchase code arrivedcardId, 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.completedA deposit or a withdrawal in the vaulttransactionId, userId (null for a wallet without an account), wallet, amount, tx
user.createdAn account was born from an inviteuserId, inviteId, externalRef, mode
user.kyc.updatedThe identity was approved or declineduserId, status (approved or declined), externalRef
user.cardholder.updatedThe answer of a card issuer about the personuserId, label, issuerNumber, status (active, needs_resubmission, blocked, rejected), externalRef
invite.created, .paused, .resumed, .revoked, .expiredAn invite changedinviteId, status, externalRef
test.pingSend test eventmessage

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 purchaseEventWhen
sentcard.transaction.authorizedThe purchase was authorized
declinedcard.transaction.declinedThe purchase was declined, with reason
confirmedNoneThe purchase settled. In the simulator, the action settle
cancelledcard.transaction.reversedThe authorization was undone. The reversal has its own transaction
Does not changecard.transaction.refundedA refund: a transaction of its own, of the type refund
Does not changecard.transaction.feeA 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:

reasonMeaning
kycThe identity is not approved
account_paused, account_revokedThe invite of the account is paused or revoked
cardholderThe card issuer has not approved the person yet
program, program_stage, program_pausedThe program does not take requests now
program_mismatch, kind_mismatchThe request went out for a program or a card different from the reservation
card_stateThe card is not in the right state, such as a top-up of a canceled card
productThe card does not allow top-ups
amount_out_of_range, amount_not_integerThe amount is outside the limits of the card, or has cents on a card of whole dollars
account_card_quotaThe person reached the limit of cards at the card issuer
reservation_expiredThe 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.