Webhook API Concepts
Understand webhook registration, event types, delivery mechanics, and security — how mCards notifies partners of real-time events.
Webhook API Concepts
The Webhook API allows partners to register HTTP endpoints that receive real-time event notifications from the mCards platform. Webhooks are used for transaction events, card lifecycle changes, location updates, offer claims, and payment authorization.
Webhook Registration
Identity verification resolution
Distributor API partners can subscribe to identity_verification.resolved to learn
when a pending issuance check finishes. Register the subscription before calling
issue_card. This event is scoped to the requesting partner and its current
access to the distributor card; it can arrive before any card has been created.
{
"event_uuid": "a0000000-0000-4000-8000-000000000001",
"event_type": "identity_verification.resolved",
"occurred_at": "2026-11-17T18:00:00.000Z",
"webhook_event_type": "identity_verification.resolved",
"idempotency_key": "a0000000-0000-4000-8000-000000000001",
"data": {
"verification_uuid": "b0000000-0000-4000-8000-000000000002",
"cardholder_uuid": "c0000000-0000-4000-8000-000000000003",
"distributor_card_uuid": "d0000000-0000-4000-8000-000000000004",
"status": "passed",
"retry_required": true,
"resolved_at": "2026-11-17T17:59:59.000Z"
}
}status is passed or failed. retry_required: true means retry issue_card
with the original cardholder details and distributor card, using a new
Idempotency-Key. The remaining checks still run. retry_required: false means
this check failed; correct inaccurate identity details or contact support.
Resolution of one check does not issue a card. After a successful issuance retry,
continue tracking provisioning with card_status.
Use the standard webhook signature verification and acknowledge delivery quickly.
Deliveries can be retried: deduplicate with event_uuid / idempotency_key.
The payload contains outcome and correlation identifiers; provider decision
details are not part of this contract. See Issue a Card.
Registration fields
Each webhook registration includes:
| Field | Description |
|---|---|
webhook_url | The HTTPS endpoint that will receive events |
webhook_name | A human-readable name for the webhook |
webhook_event_type | The type of event this webhook receives |
basic_auth_username | Username for Basic Authentication on delivery |
basic_auth_secret | Password for Basic Authentication on delivery |
hmac_secret | Secret used for HMAC signature verification |
originator_identifier | Optional identifier for the originator |
status | active or inactive |
Each webhook registration is scoped to a single event type. To receive multiple event types, register multiple webhooks.
Event Types
Standard Events
| Event Type | Description | Typical Use |
|---|---|---|
transaction | Card transaction occurred (purchase, refund, etc.) | Loyalty earning, transaction tracking |
location | Location data update | Geofencing, location-based offers |
claimed_offer | Cardholder claimed an offer | Offer fulfillment, engagement tracking |
card_status | A cardholder card's lifecycle state changed | Issuance outcomes, activation state tracking |
payment_account.status_changed | An existing payment account changed status | Account availability and collection recovery tracking |
Payment Events
Payment events are used for real-time authorization with payment gateway integrations:
| Event Type | Description |
|---|---|
payment | General payment event |
payment.hold | Authorization hold — reserve funds |
payment.capture | Capture — finalize a held transaction |
payment.release_hold | Release a previous authorization hold |
payment.hold_and_capture | Combined hold and capture in a single message |
payment.get_balance | Balance inquiry from the platform |
See Payment API Concepts for the full authorization flow.
Event Type Availability
Not all event types are available to all partners. Availability depends on your integration type:
| Event Type | Card Distribution Partners | Currency Providers | Payment Gateway Providers | Full Webhook Access |
|---|---|---|---|---|
transaction | Yes | Yes | — | Yes |
location | — | Yes | — | Yes |
claimed_offer | — | Yes | — | Yes |
card_status | Yes | — | — | Yes |
payment_account.status_changed | Yes | — | — | — |
payment | — | — | Yes | Yes |
payment.hold | — | — | Yes | Yes |
payment.capture | — | — | Yes | Yes |
payment.release_hold | — | — | Yes | Yes |
payment.hold_and_capture | — | — | Yes | Yes |
payment.get_balance | — | — | Yes | Yes |
Partners with access to multiple APIs receive the union of all event types across their integration types. See API Scoping and Permissions for full details.
payment_account.status_changed additionally requires association with the payment account's webhook card program. Accounts without an associated card do not produce a delivery; general webhook access alone does not grant payment-account event access.
Webhook Payload Examples
All webhook deliveries are HTTP POST requests with a JSON body. Every payload includes a webhook_event_type field indicating the event type.
Charge and recurring schedule event envelopes
For charge.succeeded, charge.failed, charge.reversed, task.recurring.created,
task.recurring.paused_on_failure, and task.recurring.completed, deliveries include:
| Key | Meaning |
|---|---|
event_uuid | Recommended de-dupe key; the event log UUID, stable across retries and circuit-probe replays of the same event |
event_type | The dotted event name listed above |
occurred_at | ISO-8601 UTC event creation timestamp, not the delivery attempt time |
data | The same serialized object sent under charge or recurring_charge |
These fields are additive. webhook_event_type, idempotency_key, and the legacy
charge / recurring_charge object remain unchanged. idempotency_key is retained
for existing consumers; new consumers should de-dupe on event_uuid.
The object is serialized at delivery time; stable event metadata does not imply a
frozen object snapshot across retries.
Payment Account Status Event Payload
payment_account.status_changed reports a committed status change on an existing payment account. It is available to Cards API and Distributor API partners associated with the account's webhook card program.
Examples include:
suspendedafter a failed collection or ACH returnactivewhen a suspended account is re-enabled, including after successful collectionexpiredwhen bank login is required or bank access permission is revoked- Status changes made manually by an administrator
Account creation, saves without a status change, and rolled-back changes do not trigger this event.
The envelope contains webhook_event_type, idempotency_key, payment_account, event_uuid, event_type, occurred_at, and data. event_type and webhook_event_type both equal payment_account.status_changed; data repeats payment_account unchanged. As with charge and recurring events, event_uuid is the recommended de-duplication key, stable across retries and circuit-probe replays of the same event-log occurrence. occurred_at is the event-log creation time in ISO8601 UTC, not the delivery time or necessarily the status-change time.
Unlike the charge/recurring object serialization described above, normal payment-account deliveries carry the captured transition even if the account changes again before delivery.
Field in payment_account / data | Type | Meaning |
|---|---|---|
payment_account_uuid | string (UUID) | Payment account identifier |
cardholder_uuid | string (UUID) | Account owner's identifier |
cardholder_card_uuid | string (UUID), nullable | Card associated with the webhook event |
previous_status | string, nullable | Immediately preceding saved status; null on replay |
status | string | inactive, active, pending, error, expired, suspended, or waiting_for_kyc |
status_reason | string, nullable | One of the reason values below, or null |
uncollected_amount | number, nullable | Uncollected amount in dollars, rounded to two decimal places—not cents |
status_changed_at | string (ISO8601 timestamp), nullable | Status-change time with millisecond precision; may be null for legacy rows |
status_reason is one of:
collection_failed_insufficient_fundscollection_failedach_returnedbank_login_requiredpermission_revokedmanualcollection_succeeded
The reason may be null for legacy or unknown causes, including expiry caused by Plaid NO_AUTH_ACCOUNTS. A null reason does not invalidate the event. uncollected_amount is null when no amount applies, including re-enable transitions.
{
"webhook_event_type": "payment_account.status_changed",
"idempotency_key": "02cf6565-b646-4967-955f-918d393a016a:status_changed:80330dbc-502b-41da-b1d2-19a636172e66",
"payment_account": {
"payment_account_uuid": "02cf6565-b646-4967-955f-918d393a016a",
"cardholder_uuid": "94ee9655-18a4-4354-938c-c2814bd91089",
"cardholder_card_uuid": "85257d46-8fd8-447c-b3e8-82113ec02348",
"previous_status": "active",
"status": "suspended",
"status_reason": "collection_failed_insufficient_funds",
"uncollected_amount": 25.12,
"status_changed_at": "2026-11-16T12:00:00.123Z"
},
"event_uuid": "7fe93cf0-50c7-43a5-9b77-9b5d2633ac53",
"event_type": "payment_account.status_changed",
"occurred_at": "2026-11-16T12:00:01.000Z",
"data": {
"payment_account_uuid": "02cf6565-b646-4967-955f-918d393a016a",
"cardholder_uuid": "94ee9655-18a4-4354-938c-c2814bd91089",
"cardholder_card_uuid": "85257d46-8fd8-447c-b3e8-82113ec02348",
"previous_status": "active",
"status": "suspended",
"status_reason": "collection_failed_insufficient_funds",
"uncollected_amount": 25.12,
"status_changed_at": "2026-11-16T12:00:00.123Z"
}
}Idempotency, replay, and transaction coalescing
The idempotency_key is {payment_account_uuid}:status_changed:{transition_event_id}. The transition ID is minted when the status change is committed and remains unchanged across retries. Separate transitions receive separate IDs, including when an account returns to a previously delivered status.
Circuit-probe replays reconstruct the account's current persisted status metadata, with previous_status: null; they do not reconstruct the original historical transition. Replay transition IDs are derived deterministically from the event-log UUID using UUID v5. A replay key can differ from the original delivery key; de-duplicate across both paths using event_uuid.
Multiple status writes inside one database transaction coalesce into one event for the final saved transition. Its previous_status is the immediately preceding saved status, which may be an intermediate status within that transaction—not necessarily the status before the transaction began. Separate commits produce separate events.
This event and its envelope are additive. Consumers should ignore unknown event types and tolerate additional fields.
Transaction Event Payload
{
"webhook_event_type": "transaction",
"card_transaction_uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"amount": 42.50,
"currency_code": "USD",
"created_at": "2025-03-15T14:22:31.000Z",
"updated_at": "2025-03-15T14:22:31.000Z",
"cardholder_card_uuid": "f9e8d7c6-b5a4-3210-fedc-ba0987654321",
"location": {
"location_uuid": "11223344-5566-7788-99aa-bbccddeeff00",
"name": "Corner Coffee Shop",
"full_address": "123 Main St, Anytown, US 12345",
"latitude": 40.7128,
"longitude": -74.0060
},
"claimed_offer": {
"claimed_offer_uuid": null,
"title": null,
"amount": null,
"offer_uuid": null,
"offer_reward": {
"title": null,
"subtitle": null,
"summary": null,
"amount_type": null,
"amount_currency": null
},
"created_at": null,
"updated_at": null
}
}The claimed_offer object is always present but its fields are null when no offer was redeemed during the transaction.
Authorization decline reasons
Declined card transactions can include decline_reason. mCards-recorded processing error reasons take precedence over fallback issuer wording, including reasons recorded on the associated authorization request. The field is omitted when no reason is available.
A declined authorization payload keyed on authorization_request_uuid instead of card_transaction_uuid carries decline_reason and decline_message from its first recorded processing error. Its outcome and transaction_state are declined.
For card authorization declines, the funding-related decline_reason values include:
| Value | Meaning |
|---|---|
no_active_payment_account | The cardholder has linked payment accounts but none is currently active (for example suspended, expired or inactive), and card balances could not cover the purchase |
insufficient_funds | There were not enough available funds, including when the cardholder never linked a payment account or an active account lacked funds |
no_active_payment_account is additive; existing values retain their meanings. Other platform and issuer reasons may also be returned. The human-readable message for no_active_payment_account remains No active funding sources. These authorization reasons do not change charge decline_code values.
Location Event Payload
{
"webhook_event_type": "location",
"event": "location",
"source": "gps",
"user_uuid": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
"timestamp": "2025-03-15T14:30:00Z",
"data": {
"latitude": 40.7128,
"longitude": -74.0060,
"accuracy": 10.0,
"altitude": 15.2,
"speed": 0.0
}
}Card Status Event Payload
card_status reports card lifecycle progress. It matters most for issuing a card: identity verification runs inline and its results come back in the POST .../issue_card response, but issuer provisioning does not. The 201 means the identity checks completed and a card record exists in the pending state — it is not a guarantee that the card was provisioned or is usable. Without a card_status subscription there is no way to learn the outcome.
{
"webhook_event_type": "card_status",
"event_type": "card_status",
"event_id": "8f3c1e0a-6d1b-4f0e-9a2c-1d0f5b8e7c31",
"previous_status": "issued",
"status": "active",
"timestamp": "2026-05-21T14:35:00Z",
"cardholder": {
"cardholder_uuid": "3f20731f-3cf5-4bf1-80da-0a20a057bcec",
"first_name": "Jane",
"last_name": "Smith",
"email": "[email protected]",
"phone": "+12025551234"
},
"cardholder_card": {
"cardholder_card_uuid": "f9e8d7c6-b5a4-3210-fedc-ba0987654321",
"last_four": "4242"
},
"originator_identifier": "ORD-48213"
}Every delivery carries both webhook_event_type and event_type, each set to card_status.
The event describes a single transition, from previous_status to status:
| Field | Meaning |
|---|---|
event_id | Identifier of the transition, minted when the status changed and unchanged across redeliveries. Use it as your idempotency key |
previous_status | The status the card moved from. null when the card had no previous status, i.e. its first status on creation |
status | The status the card moved to. This is the state as of the transition, not the card's current state — a later transition may already have occurred by the time the delivery arrives |
timestamp | When the card reached this status. Unchanged by a retried delivery |
originator_identifier echoes the reference you supplied on the send_card request that produced this card, so you can tie the card back to your own order or member record without a lookup. It is null for cards that did not come from a send, or when no identifier was supplied.
cardholder_card carries identity only (cardholder_card_uuid, last_four), so that a historical event never contradicts itself. For the card's current activation state, card type and distributor card program, look the card up through the Distributor API.
The status values are:
| Status | Meaning |
|---|---|
pending | Card record created; the issuer has not yet confirmed provisioning |
issued | Provisioned but not activated — reached when the card was issued with auto_activate disabled |
active | Usable. Only active cards can transact |
inactive | Deactivated (locked); can be re-enabled |
issuer_error | The issuer could not provision the card. Carries an error object |
link_failed | Card linking failed (card-linked programs only) |
terminated | Permanently ended — for example the old card of a reissue |
On issuer_error only, an error object is included:
{
"webhook_event_type": "card_status",
"event_type": "card_status",
"event_id": "5c7d2b91-4e83-4a17-b0f2-9c6e1a4d8b30",
"previous_status": "pending",
"status": "issuer_error",
"timestamp": "2026-05-21T14:36:12Z",
"cardholder": {
"cardholder_uuid": "3f20731f-3cf5-4bf1-80da-0a20a057bcec",
"first_name": "Jane",
"last_name": "Smith",
"email": "[email protected]",
"phone": "+12025551234"
},
"cardholder_card": {
"cardholder_card_uuid": "f9e8d7c6-b5a4-3210-fedc-ba0987654321",
"last_four": null
},
"error": {
"message": "Card issuer did not respond within the expected timeframe",
"retryable": false
}
}retryable is false for issuance errors: the card cannot be recovered and needs a new issue request.
Lifecycle paths to expect
These are the paths a card normally takes. Drive your logic off the status value in each delivery rather than off an assumed sequence.
| Scenario | Path |
|---|---|
Issue with auto_activate: true | pending → active |
Issue with auto_activate: false | pending → issued → active (activate via Enable a Card) |
| Deactivate / re-enable | active → inactive → active |
| Issuer failure | pending → issuer_error |
| Card-link failure | pending → link_failed |
| Reissue or closure | any → terminated (permanent) |
Subscription and delivery notes
- One subscription covers every card status change. There is no per-status subscription or filter; a single
card_statuswebhook receives all of them. - Handle deliveries idempotently. Deduplicate on
event_id, which is stable across redeliveries of the same transition, and treat the card's current status from the Distributor API as the source of truth when you need certainty. - You may receive cards you did not just issue. Card lifecycle events are not narrowed to cards you created in the current session: replacement/reissue records under your card programs produce their own deliveries, including
terminatedfor the card being replaced. - Keep your endpoint healthy. Repeated delivery failures pause delivery to that endpoint for a cooldown period. Reconcile card statuses against the Distributor API after any outage of your endpoint.
Claimed Offer Event Payload
{
"webhook_event_type": "claimed_offer",
"card_transaction_uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"transaction_amount": 42.50,
"created_at": "2025-03-15T14:22:31.000Z",
"updated_at": "2025-03-15T14:22:31.000Z",
"cardholder_card_uuid": "f9e8d7c6-b5a4-3210-fedc-ba0987654321",
"claimed_offer_state": "hold",
"claimed_offers": [
{
"claimed_offer_uuid": "cc112233-4455-6677-8899-aabbccddeeff",
"title": "10% Off Your Next Purchase",
"amount": 4.25,
"offer_uuid": "dd112233-4455-6677-8899-aabbccddeeff",
"offer_reward": {
"title": "10% Cashback",
"subtitle": "Earn cashback on qualifying purchases",
"summary": "10% cashback reward",
"amount_type": "percentage",
"amount_currency": "USD"
},
"created_at": "2025-03-15T14:22:31.000Z",
"updated_at": "2025-03-15T14:22:31.000Z"
}
],
"location": {
"location_uuid": "11223344-5566-7788-99aa-bbccddeeff00",
"name": "Corner Coffee Shop",
"full_address": "123 Main St, Anytown, US 12345",
"latitude": 40.7128,
"longitude": -74.0060
}
}The claimed_offer_state reflects the transaction lifecycle:
| State | Meaning |
|---|---|
hold | Transaction is authorized (funds held) |
clear | Transaction is posted/cleared (funds moved) |
hold_release | Authorization was reversed or cancelled |
Payment Event Payload
Payment events (payment.hold, payment.capture, etc.) are delivered to payment gateway providers during real-time authorization. See Payment API Concepts for the full authorization flow and expected response format.
Delivery Security
mCards secures webhook deliveries using two mechanisms:
Basic Authentication
Every webhook delivery includes a Basic authorization header using the basic_auth_username and basic_auth_secret you provide during registration. Your endpoint should validate these credentials on every request.
HMAC Signature Verification
Each delivery also includes an HMAC signature computed from the request body using the hmac_secret you provide. To verify:
- Read the raw request body
- Compute
HMAC-SHA256(hmac_secret, request_body) - Compare the computed signature with the one in the
Authorizationheader, which has the formHMAC_SHA256 <webhook_uuid>;<hex-signature> - Reject the request if signatures do not match
This ensures the payload has not been tampered with and originated from mCards.
Delivery Behavior
- Webhooks are delivered as HTTP POST requests to your registered URL
- Your endpoint should respond with a
2xxstatus code to acknowledge receipt - Non-
2xxresponses or timeouts may trigger retries (see Error Handling and Reliability) - Payment authorization webhooks (
payment.*) require a timely response — the cardholder is waiting at the point of sale
Best Practices
- Respond quickly — Especially for payment events, minimize processing time before returning a response
- Validate signatures — Always verify HMAC signatures to ensure request authenticity
- Handle duplicates — Design your handler to be idempotent in case of retried deliveries
- Use HTTPS — All webhook URLs must use HTTPS for secure transport
- Monitor availability — Webhook failures may result in missed events; monitor your endpoint health
Related Guides
- Payment API Concepts — Payment gateway authorization flow
- API Scoping and Permissions — Webhook entitlements by integration type
- API Authentication and Credentials — HMAC authentication for API requests
- Webhook API Reference — Full endpoint documentation
Updated 13 days ago