Mintcash
ConceptsWebhooks

Payload reference

The JSON shape of the webhook envelope and of each payment, refund, subscription and saved-card payload, with TypeScript types for typed handlers.

Every webhook Mintcash sends shares a common envelope. The variable part is data, whose shape is determined by type.

Envelope

FieldTypeNotes
eventIdstring (UUID)Stable across retries of the same event. Use as your dedupe key.
eventstringThe transition: payment.succeeded, subscription.failed, etc.
typestringDetermines the shape of data: payment, subscription, refund, or payment_method.
apiVersionstringWebhook schema version (2026-05-01).
environmentstringlive or test.
createdAtstring (ISO8601)When the event was emitted.
dataobjectThe entity. Shape depends on type.

Payment payload (type: "payment")

Fires for: payment.pending, payment.authorized, payment.succeeded, payment.failed, payment.voided.

{
  "eventId": "01HXX...",
  "event": "payment.succeeded",
  "type": "payment",
  "apiVersion": "2026-05-01",
  "environment": "live",
  "createdAt": "2026-05-22T14:32:08.412Z",
  "data": {
    "id": "pmt_01HXX...",
    "externalId": "order_123",
    "status": "succeeded",
    "amount": 49.99,
    "currency": "USD",
    "purpose": null,
    "providerTransactionId": "provider_txn_abc",
    "processor": "corefy",
    "processorTransactionId": "processor_txn_abc",
    "processorMerchantId": "processor_mid_abc",
    "processorOrderReference": "pay_abc_xx",
    "instrument": "card",
    "failureCode": null,
    "failureMessage": null,
    "amountRefunded": 0,
    "amountRefundable": 49.99,
    "captureMethod": "automatic",
    "fundsHeld": null,
    "captureBefore": null,
    "captureRequestedAt": null,
    "voidReason": null,
    "customer": {
      "id": "cust_01HXX...",
      "externalId": "cust_42",
      "email": "buyer@example.com",
      "name": "Jane Doe",
      "phone": "+15551234567"
    },
    "billingAddress": {
      "country": "US",
      "postalCode": "10001",
      "name": "Jane Doe",
      "line1": "1 Madison Ave",
      "line2": null,
      "city": "New York",
      "state": "NY"
    },
    "card": {
      "brand": "mastercard",
      "first6": "555544",
      "last4": "0000",
      "mask": "555544******0000",
      "fingerprint": "9f2b1c7e04d8a3f6b5e1c0d9a8b7f6e5d4c3b2a1908f7e6d5c4b3a2918f7e6d5",
      "expMonth": "12",
      "expYear": "2030",
      "saved": true,
      "token": "tok_01HXX...",
      "blocked": false,
      "blockedCode": null
    }
  }
}
type Customer = {
  id: string;
  externalId: string;
  email: string;
  name: string;
  phone: string | null;
};

type Address = {
  country: string;
  postalCode: string;
  name: string | null;
  line1: string | null;
  line2: string | null;
  city: string | null;
  state: string | null;
};

type Card = {
  brand: string;
  first6: string;
  last4: string;
  mask: string;          // already-masked PAN, e.g. 555544******0000
  fingerprint: string | null; // same card → same value within your account; not a credential
  expMonth: string;
  expYear: string;
  saved: boolean;        // true when the customer consented to save this card
  token: string | null;  // reusable card token — non-null only when saved is true
  blocked: boolean;      // true when Mintcash won't charge this card again; see Blocked cards
  blockedCode: string | null; // the decline code that blocked it, null when blocked is false
};

type PaymentData = {
  id: string;
  externalId: string;
  status:
    | "pending"
    | "authorized"
    | "succeeded"
    | "failed"
    | "refunded"
    | "partially_refunded"
    | "voided";
  amount: number;            // major units
  currency: string;
  purpose: "card_verification" | null; // card_verification: a card check, nothing captured
  providerTransactionId: string | null;
  processor: string;         // which payment provider ran the charge
  processorTransactionId: string | null;  // acquirer's own ID for the charge
  processorMerchantId: string | null;     // merchant ID (MID) at the acquirer
  processorOrderReference: string | null; // order ID the acquirer received
  instrument:                // how the customer paid; see Instrument below
    | "card"
    | "apple_pay"
    | "google_pay"
    | "ideal"
    | "bancontact"
    | "blik"
    | "twint"
    | "revolut_bank"
    | null;
  failureCode: string | null;
  failureMessage: string | null;
  amountRefunded: number;
  amountRefundable: number;
  captureMethod: "automatic" | "manual"; // see Manual capture
  fundsHeld: boolean | null;          // manual capture: set once authorized
  captureBefore: string | null;       // manual capture: ISO8601 deadline for capture or void
  captureRequestedAt: string | null;  // manual capture: when you called capture
  voidReason: "merchant" | "expired" | "provider" | null;
  customer: Customer | null;
  billingAddress: Address | null;  // null when no address was captured (Google Pay, card-only checkout)
  card: Card | null;         // null until the PSP confirms the charge, and always null for an APM
};

type PaymentEvent = {
  eventId: string;
  event:
    | "payment.pending"
    | "payment.authorized"
    | "payment.succeeded"
    | "payment.failed"
    | "payment.voided";
  type: "payment";
  apiVersion: string;
  environment: "live" | "test";
  createdAt: string;
  data: PaymentData;
};

Instrument

instrument says how the customer paid: card, apple_pay, google_pay, or the APM used: ideal, bancontact, blik, twint or revolut_bank. New values may be added as more methods are supported, so handle one you don't recognise rather than rejecting the event.

An APM payment charges no card, so card is always null on it.

Card fingerprint

card.fingerprint identifies the card number. The same card produces the same fingerprint across all your payments and customers, so you can use it to spot one card behind several of your accounts, or to avoid storing a card twice when a customer saves it again.

Fingerprints are scoped to your merchant account. The same card has a different fingerprint at any other merchant, so don't compare them across accounts.

It is not a credential and can't be charged, so unlike card.token it is sent whether or not the customer saved the card. For Apple Pay and Google Pay it identifies the wallet's device token, not the physical card, so the same card in a wallet and typed at checkout will have different fingerprints.

Card checks

purpose is card_verification when the payment only checked a card with the bank, as a card update on an active subscription does, and null on every payment that charges. A card check reads succeeded, but nothing was captured, so its amount, amountRefunded and amountRefundable are all 0 and it can't be refunded. Don't book it as a payment. GET /payments/{paymentId} omits the field on a charge.

Manual capture

A payment created with captureMethod: "manual" is authorised at checkout and charged only when you capture it. See Authorise now, capture later for the flow and the events it sends.

These fields are on every payment. On a payment that isn't manual capture, captureMethod is automatic and the rest are null:

  • captureMethod is manual or automatic.
  • fundsHeld is set once the payment is authorised. true means the bank holds the money and your capture collects it; a void gives it back to the customer. false means the card was only verified and saved: your capture is then a new charge, and the bank can still decline it for reasons such as insufficient_funds.
  • captureBefore is set once the payment is authorised, two minutes later. Capture is refused from that moment, and the payment is voided with voidReason: "expired".
  • captureRequestedAt is when you called capture. With status: "authorized" it means the capture is still in flight. On payment.failed it tells a capture the bank declined apart from a decline at checkout.
  • voidReason is set once the payment is voided: merchant (you voided it), expired (no capture or void before captureBefore) or provider (the provider cancelled the hold).

While a manual-capture payment isn't captured yet, amountRefundable is 0 and card.token is null, even if the customer ticked "save this card". After capture, card.token follows the usual rule. providerTransactionId, processorTransactionId and processorOrderReference describe the card verification while the payment is authorized, and the charge once you've captured it. With fundsHeld: true there's one charge throughout, so providerTransactionId doesn't change.

GET /payments/{paymentId} omits fundsHeld, captureBefore, captureRequestedAt and voidReason when they're null.

The fields are additive and the API version doesn't change, but a strict schema needs to allow them.

Blocked cards

card.blocked is true when Mintcash won't charge the card again for a subscription, because it was declined with a hard decline such as an expired, lost or stolen card. card.blockedCode is the decline code that blocked it, the same value that payment carried as failureCode. When blocked is false, blockedCode is null. Both fields are on every card object: data.card on payment events, data.payment.card and data.paymentMethod on subscription events, and data.card on payment_method.updated.

They describe the card when the event was sent, not when the payment was made. A block lifts when a charge or card check on the card succeeds, or, for an expired card, when the card network reports its new expiry date. For a saved card, payment_method.updated tells you when a block is set or lifted.

Use them to show customers which stored card needs replacing. Key on blocked rather than keeping your own list of codes.

What to tell the customer

Say the card "has expired" or "can't be charged, please update it". Don't pass on a lost, stolen or fraud code: telling whoever holds a stolen card that it was reported tips them off.

Refund payload (type: "refund")

Fires for: payment.refund_created, payment.refund_processing, payment.partially_refunded, payment.refunded, payment.refund_failed. The envelope type is "refund": data is the refund, and the payment it was issued against is nested at data.payment (the full payment shape from above).

{
  "eventId": "01HXX...",
  "event": "payment.refunded",
  "type": "refund",
  "apiVersion": "2026-05-01",
  "environment": "live",
  "createdAt": "2026-05-22T16:10:11.000Z",
  "data": {
    "id": "rfd_01HXX...",
    "externalId": "refund_order_123_full",
    "status": "succeeded",
    "amount": 49.99,
    "currency": "USD",
    "providerRefundId": "provider_rfn_abc",
    "failureCode": null,
    "failureMessage": null,
    "payment": {
      "id": "pmt_01HXX...",
      "externalId": "order_123",
      "status": "refunded",
      "amount": 49.99,
      "currency": "USD",
      "purpose": null,
      "providerTransactionId": "provider_txn_abc",
      "processor": "corefy",
      "processorTransactionId": "processor_txn_abc",
      "processorMerchantId": "processor_mid_abc",
      "processorOrderReference": "pay_abc_xx",
      "instrument": "card",
      "failureCode": null,
      "failureMessage": null,
      "amountRefunded": 49.99,
      "amountRefundable": 0,
      "customer": {
        "id": "cust_01HXX...",
        "externalId": "cust_42",
        "email": "buyer@example.com",
        "name": "Jane Doe",
        "phone": "+15551234567"
      },
      "billingAddress": {
        "country": "US",
        "postalCode": "10001",
        "name": "Jane Doe",
        "line1": "1 Madison Ave",
        "line2": null,
        "city": "New York",
        "state": "NY"
      },
      "card": {
        "brand": "mastercard",
        "first6": "555544",
        "last4": "0000",
        "mask": "555544******0000",
        "fingerprint": "9f2b1c7e04d8a3f6b5e1c0d9a8b7f6e5d4c3b2a1908f7e6d5c4b3a2918f7e6d5",
        "expMonth": "12",
        "expYear": "2030",
        "saved": false,
        "token": null,
        "blocked": false,
        "blockedCode": null
      }
    }
  }
}

The refund object carries providerRefundId, failureCode, and failureMessage; on a payment.refund_failed event the failure fields describe the refund (the nested payment keeps its own status). There is no reason or createdAt field on the webhook refund object.

data.status is the refund's status when the webhook was sent: pending, processing, succeeded, failed, or cancelled. A cancelled refund is delivered as payment.refund_failed.

Subscription payload (type: "subscription")

Fires for: subscription.succeeded, subscription.failed, subscription.cancelled, subscription.payment_method_updated. The customer, billing address, and card live on the nested payment object — not at the subscription root. The billing schedule (phases) is returned by the REST API, not on the webhook.

{
  "eventId": "01HXX...",
  "event": "subscription.succeeded",
  "type": "subscription",
  "apiVersion": "2026-05-01",
  "environment": "live",
  "createdAt": "2026-05-22T08:00:00.000Z",
  "data": {
    "id": "sub_01HXX...",
    "externalId": "sub_cust42_plan_pro",
    "status": "active",
    "amount": 19.99,
    "currency": "USD",
    "billingIntervalDays": 30,
    "currentPeriodStart": "2026-05-22T08:00:00.000Z",
    "currentPeriodEnd": "2026-06-21T08:00:00.000Z",
    "cancelledAt": null,
    "paymentMethod": null,
    "payment": {
      "id": "pmt_01HXX...",
      "externalId": "sub_initial_sub_cust42_plan_pro",
      "status": "succeeded",
      "amount": 19.99,
      "currency": "USD",
      "purpose": null,
      "providerTransactionId": "provider_txn_abc",
      "processor": "corefy",
      "processorTransactionId": "processor_txn_abc",
      "processorMerchantId": "processor_mid_abc",
      "processorOrderReference": "pay_abc_xx",
      "instrument": "card",
      "failureCode": null,
      "failureMessage": null,
      "amountRefunded": 0,
      "amountRefundable": 19.99,
      "customer": {
        "id": "cust_01HXX...",
        "externalId": "cust_42",
        "email": "buyer@example.com",
        "name": "Jane Doe",
        "phone": "+15551234567"
      },
      "billingAddress": {
        "country": "US",
        "postalCode": "10001",
        "name": "Jane Doe",
        "line1": "1 Madison Ave",
        "line2": null,
        "city": "New York",
        "state": "NY"
      },
      "card": {
        "brand": "mastercard",
        "first6": "555544",
        "last4": "0000",
        "mask": "555544******0000",
        "fingerprint": "9f2b1c7e04d8a3f6b5e1c0d9a8b7f6e5d4c3b2a1908f7e6d5c4b3a2918f7e6d5",
        "expMonth": "12",
        "expYear": "2030",
        "saved": true,
        "token": "a1b2c3d4-...",
        "blocked": false,
        "blockedCode": null
      }
    }
  }
}

cancelledAt is null until the subscription is cancelled, then an ISO 8601 timestamp. status reflects the subscription's own state (created, pending, active, past_due, cancelled, or failed), independent of the nested payment's status.

After a hard decline, subscription.failed has data.status: "past_due", the hard failureCode and data.payment.card.blocked: true. The subscription follows the usual retry schedule, but the blocked card isn't charged again, and the steps that skip it send no event. If nothing is paid by the end, subscription.cancelled follows.

If the customer updates their card while a renewal on the old card is still in flight, a decline of that renewal sends no subscription.failed: the new card is charged straight away, and you get subscription.pending and then its outcome.

If you send your own customer emails, see Send your own subscription emails for what to send on each event.

A renewal on a blocked card

If a subscription renews on a card that's already blocked, Mintcash doesn't send the charge to the processor. You still receive subscription.failed, and its payment records the renewal that wasn't charged:

{
  "event": "subscription.failed",
  "type": "subscription",
  "data": {
    "id": "sub_01HXX...",
    "status": "past_due",
    "payment": {
      "id": "pmt_01HXX...",
      "status": "failed",
      "providerTransactionId": null,
      "failureCode": "card_expired",
      "failureMessage": "card_blocked",
      "card": {
        "brand": "mastercard",
        "last4": "0000",
        "saved": true,
        "token": "a1b2c3d4-...",
        "blocked": true,
        "blockedCode": "card_expired"
      }
    }
  }
}

failureMessage: "card_blocked" means the charge was never sent, because the card had already been declined for failureCode. providerTransactionId is null because no processor saw it. Don't tell the customer a charge was attempted. The subscription is now past_due and follows the hard decline schedule.

paymentMethod (on subscription.payment_method_updated only)

Every other subscription event carries paymentMethod: null. When a customer replaces the card through a card-update link, the subscription moves onto the new card and this object describes the swap. data.payment is the payment that changed the card: the charge that settled a failed renewal, or, on an active subscription, the card check with amount: 0.

{
  "event": "subscription.payment_method_updated",
  "type": "subscription",
  "data": {
    "id": "sub_01HXX...",
    "status": "active",
    "paymentMethod": {
      "brand": "visa",
      "first6": "411111",
      "last4": "1111",
      "mask": "411111******1111",
      "fingerprint": "c7df64536470547ef1b9a16358f4f58c62cfb89d6c25dc876610bc7402429f0d",
      "expMonth": "04",
      "expYear": "2031",
      "saved": true,
      "token": "e5f6g7h8-...",
      "previousToken": "a1b2c3d4-...",
      "blocked": false,
      "blockedCode": null
    }
  }
}

token is the new card, previousToken the one the subscription billed before the swap — match on it to update your own stored copy. previousToken is null when the card being replaced had no token you were ever given — the customer never consented to saving it. The whole object is null while the new card is still unconfirmed.

The old card is not deleted: payment methods are shared across the customer's other subscriptions and saved-card charges, so only this subscription moves.

currentPeriodStart / currentPeriodEnd describe the period the customer has paid for — the entitlement they currently hold — not the next scheduled charge. On a renewal event, currentPeriodEnd is when the next renewal is due.

Payment method payload (type: "payment_method")

Fires for: payment_method.updated, and only for cards the customer saved. data is the stored card. customer, billingAddress and card have the same shapes as on a payment. See Event types for when it's sent.

{
  "eventId": "01HXX...",
  "event": "payment_method.updated",
  "type": "payment_method",
  "apiVersion": "2026-05-01",
  "environment": "live",
  "createdAt": "2026-06-21T08:00:05.000Z",
  "data": {
    "id": "9d3e5f71-...",
    "customer": {
      "id": "cust_01HXX...",
      "externalId": "cust_42",
      "email": "buyer@example.com",
      "name": "Jane Doe",
      "phone": "+15551234567"
    },
    "billingAddress": {
      "country": "US",
      "postalCode": "10001",
      "name": "Jane Doe",
      "line1": "1 Madison Ave",
      "line2": null,
      "city": "New York",
      "state": "NY"
    },
    "card": {
      "brand": "mastercard",
      "first6": "555544",
      "last4": "0000",
      "mask": "555544******0000",
      "fingerprint": "9f2b1c7e04d8a3f6b5e1c0d9a8b7f6e5d4c3b2a1908f7e6d5c4b3a2918f7e6d5",
      "expMonth": "12",
      "expYear": "2030",
      "saved": true,
      "token": "a1b2c3d4-...",
      "blocked": true,
      "blockedCode": "card_expired"
    }
  }
}

data.id is Mintcash's own ID for the stored card. Match on data.card.token, the token you charge it with. Each event carries the card's current state, so overwrite your copy with it.