/ Developers API v1Open workspace

Reliable integrations

Signed webhooks

Verify signatures, deduplicate events and process deliveries safely.

Register your HTTPS endpoint

From an owner or administrator session, create a webhook destination in the company workspace or through POST /webhooks. Your endpoint must be a public HTTPS address. Save the returned signing secret immediately; it is not returned by list requests.

Each destination receives company-scoped events. The same event may be delivered several times. Return a 2xx response only after signature verification and durable acceptance. Redirects are not followed.

Delivery headers and envelope

The POST body is JSON with id, type, createdAt, programId and data. Financial event data includes operationId, cardId, recipientId, amount and currency.

HeaderValue
X-DigitalCard-EventDurable event identifier; also present in body.id.
X-DigitalCard-TimestampDelivery timestamp as Unix seconds.
X-DigitalCard-SignatureBase64url HMAC-SHA256 digest of timestamp + "." + raw body.
Content-Typeapplication/json

Verify the raw body

Read the exact request-body bytes before a JSON parser changes them. Compute HMAC-SHA256 with the endpoint signing secret and compare the digest in constant time. Apply a delivery timestamp tolerance appropriate to your infrastructure; the function below uses five minutes.

Node.js signature verification
import { createHmac, timingSafeEqual } from 'node:crypto';

export function verifyDigitalCardWebhook(rawBody, headers, secret) {
  const timestamp = headers.get('x-digitalcard-timestamp') ?? '';
  const signature = headers.get('x-digitalcard-signature') ?? '';
  const eventId = headers.get('x-digitalcard-event') ?? '';
  if (!/^\d+$/.test(timestamp) || !/^[A-Za-z0-9_-]{43}$/.test(signature)) {
    throw new Error('Invalid webhook headers');
  }
  const now = Math.floor(Date.now() / 1000);
  if (Math.abs(now - Number(timestamp)) > 300) {
    throw new Error('Webhook timestamp outside tolerance');
  }
  const expected = createHmac('sha256', secret)
    .update(timestamp + '.')
    .update(rawBody)
    .digest();
  const received = Buffer.from(signature, 'base64url');
  if (received.length !== expected.length || !timingSafeEqual(expected, received)) {
    throw new Error('Invalid webhook signature');
  }
  const event = JSON.parse(Buffer.from(rawBody).toString('utf8'));
  if (!eventId || event.id !== eventId) throw new Error('Event identifier mismatch');
  return event;
}

Deduplicate and acknowledge

  1. Verify the signature and timestamp using the correct endpoint secret.
  2. Atomically persist the event with a unique constraint on its id.
  3. Acknowledge already accepted duplicate events with a 2xx response.
  4. Queue your business processing after durable acceptance.

DigitalCard attempts delivery up to eight times with increasing delay. The endpoint has a ten-second request timeout. A timeout or a non-2xx response schedules another attempt. Keep your acceptance path short and perform business processing asynchronously.

Events include transaction.updated, recipient.identity.updated, card.updated, funding.reversed, provider-confirmed transfer reversal events and funding.settled, card.loaded, card.unloaded and provider-confirmed card control events such as card.pause, card.resume, card.close and card.limits.

Continue building

Pagination & exports ↗

Read scoped collections with cursors and download CSV pages.

Search documentation

Use ↑ ↓ to navigate · Enter to open