Webhooks
Webhooks tell your server about card activity as it happens, so you don't have to poll. There are two kinds, set up differently:
| Card webhooks | eSIM webhooks | |
|---|---|---|
| Events | Transactions, card status changes, 3-D Secure codes, identity verification, profile errors | eSIM ready or failed |
| Set up by | Obsidian support, one URL per company or sub-account | You, through POST /v1/esim/webhooks |
| Signature header | X-Webhook-Signature |
X-Obsidian-Signature |
Your endpoint must use HTTPS, answer within 10 seconds with any 2xx
status, and do any slow work after responding.
Card webhooks
Setup
Send support the HTTPS URL that should receive events. Support gives you a signing secret once; store it securely. A sub-account can have its own URL, and then receives the events for its own orders.
Request
POST <your URL>
Content-Type: application/json
X-Webhook-Signature: 5d41402abc4b2a76b9719d911017c592...
X-Webhook-Timestamp: 1794714603
X-Webhook-Id: whk_9f8e7d...
User-Agent: ObsidianCards-Webhook/1.0
Verifying the signature
The signature is the hex HMAC-SHA256 of the timestamp, a dot, and the raw request body, keyed with your secret:
signature = hex(HMAC_SHA256(secret, X-Webhook-Timestamp + "." + raw_body))
Compute it over the raw body bytes before parsing the JSON, compare it in constant time, and reject requests whose timestamp is more than five minutes old.
const crypto = require('crypto');
function isValid(rawBody, headers, secret) {
const timestamp = headers['x-webhook-timestamp'];
const expected = crypto
.createHmac('sha256', secret)
.update(`${timestamp}.${rawBody}`)
.digest('hex');
const fresh = Math.abs(Date.now() / 1000 - Number(timestamp)) < 300;
return fresh && crypto.timingSafeEqual(
Buffer.from(expected), Buffer.from(headers['x-webhook-signature'])
);
}
$expected = hash_hmac('sha256', $timestamp . '.' . $rawBody, $secret);
$valid = hash_equals($expected, $signature) && abs(time() - (int) $timestamp) < 300;
Retries
- A
2xxresponse counts as delivered. - A
4xxresponse is not retried. - A
5xxresponse, a timeout or a connection error is retried, up to 5 attempts in total, waiting 10 seconds, 30 seconds, 1 minute and 5 minutes between them.
Events aren't guaranteed to arrive in order, and the same event can arrive
more than once. Make your handling idempotent: for transactions, use
transaction_id together with status; for card status changes, compare
timestamp with the last update you stored.
transaction
Sent when a card is used: approvals, declines, refunds and reversals.
{
"event": "transaction",
"transaction_id": "txn_7c9e6679",
"original_transaction_id": null,
"card_uuid": "3f6c1d9e-0a7b-4c55-9d2e-6b8f1a2c3d4e",
"merchant_name": "ACME STORE",
"amount": 42.5,
"currency": "USD",
"local_amount": 39.1,
"local_currency": "EUR",
"status": "approved",
"type": "purchase",
"is_international": true,
"country": "FR",
"timestamp": "2026-11-15T22:41:07+00:00",
"decline_reason": null,
"fee_charged": 0.5,
"fee_source": "card"
}
| Field | Notes |
|---|---|
amount |
USD, as a number |
status |
approved, declined or reversed |
type |
purchase, refund or reversal. Some card programs send the authorization stage as authorization or auth and the settlement as expense. |
original_transaction_id |
On a settlement or reversal, the transaction it relates to |
decline_reason |
Set when status is declined |
fee_charged |
Our fee for this transaction, in USD. Always 0 for products whose requirements include identity_document until transaction fees launch for them |
fee_source |
card if the fee was taken from the card, partner_balance if it was taken from your company balance |
card.status_updated
Sent when a card's state changes.
{
"event": "card.status_updated",
"card_id": "3f6c1d9e-0a7b-4c55-9d2e-6b8f1a2c3d4e",
"order_id": 104921,
"status": "closed",
"created_at": "2026-10-02T14:11:52+00:00",
"updated_at": "2026-11-15T22:40:01+00:00",
"timestamp": "2026-11-15T22:40:01+00:00",
"balance_returned": 12.4,
"reserve_balance": 0
}
card_id is the card's uuid. status is one of:
| Status | Meaning |
|---|---|
waiting |
The card is being issued |
loaded |
The card was issued and funded (the order is completed) |
reloaded |
A load finished |
unloaded |
An unload finished |
active |
The card was re-activated |
disabled |
The card was frozen |
closed |
The card was closed. balance_returned is the amount credited back to your balance; reserve_balance is any amount still held and returned later |
error |
Issuance or funding failed |
card.3ds
Sent when a purchase needs a 3-D Secure one-time code and your program delivers those codes to you rather than to the cardholder. Pass the code to the cardholder straight away.
{
"event": "card.3ds",
"card_uuid": "3f6c1d9e-0a7b-4c55-9d2e-6b8f1a2c3d4e",
"otp": "482913",
"amount": 42.5,
"currency": "USD",
"merchant_name": "ACME STORE",
"merchant_country": "FR",
"trade_no": null,
"expiration_time": null,
"timestamp": "2026-11-15T22:41:02+00:00"
}
merchant_country, trade_no and expiration_time are only filled in for
some card programs. When expiration_time is null, assume the code is valid
for a few minutes.
profile.validation_failed
Sent when a cardholder profile you submitted is refused during issuance. Fix the fields listed and contact support to resubmit.
For products that need an identity document, identity outcomes are reported
with identity.status_updated, not this event.
identity.status_updated
Sent only for orders of products with identity_document_required: true, as
the cardholder moves through identity verification. It never contains the
document itself.
{
"event": "identity.status_updated",
"order_id": 104921,
"status": "resubmission_required",
"source": "upload",
"partner_reference": "kyc-applicant-42",
"reason": "The photo is blurry.",
"errors": { "document": ["The photo is blurry."] },
"timestamp": "2026-11-25T19:40:02+00:00"
}
| Status | Meaning | What to do |
|---|---|---|
required |
The order is waiting for the cardholder's identity document | Send it with POST /v1/profiles/identity-document |
in_review |
The document was received and is being reviewed | Wait |
approved |
The cardholder is verified; the card is being issued | Wait for card.status_updated |
resubmission_required |
The review needs a new or clearer document; reason / errors say what |
Send a new document for the same order |
rejected |
Verification failed, or the document was refused; the order is now failed |
Place a new order if the cardholder can provide a different document |
source is upload (you or the cardholder sent the document) or
connected_verification (we retrieved it from your connected identity
verification account). partner_reference is the reference you gave, or the
applicant ID for a connected account. reason and errors appear only when
there is something to fix.
eSIM webhooks
Setup
Subscribe with POST /v1/esim/webhooks, choosing esim.provisioned,
esim.failed or both. The response includes the subscription's secret,
shown only once. You can have several subscriptions.
Request
POST <your URL>
Content-Type: application/json
X-Obsidian-Signature: sha256=8d969eef6ecad3c29a3a629280e686cf...
X-Obsidian-Webhook-Id: <subscription id>
X-Obsidian-Event-Id: 6f1c2b9a-...
X-Obsidian-Event-Type: esim.provisioned
{
"id": "6f1c2b9a-4d7e-4a63-9b5e-2f1c0d8e7a61",
"type": "esim.provisioned",
"created_at": "2026-11-15T22:41:02+00:00",
"data": {
"order_id": 104930,
"metadata": { "your_reference": "A-1001" },
"esim": { "id": "…", "status": "released", "iccid": "…", "qr_code_text": "LPA:1$…", "smdp_address": "…", "matching_id": "…" }
}
}
data.esim has the same fields as GET /v1/esim/{uuid}.
Verifying the signature
X-Obsidian-Signature = "sha256=" + hex(HMAC_SHA256(secret, raw_body))
Use the secret exactly as returned (as text, not hex-decoded).
Retries
Any non-2xx response, timeout or connection error is retried, up to
6 attempts, waiting 1 minute, 5 minutes, 30 minutes, 2 hours and
12 hours. X-Obsidian-Event-Id stays the same across retries; use it to
ignore duplicates.
Events
| Event | When |
|---|---|
esim.provisioned |
The eSIM is ready to install |
esim.failed |
The eSIM couldn't be prepared |