checkout-status-changed

Sent as a checkout is charged, paid, fails or expires.

checkout-status-changed follows a checkout from the first charge attempt to its outcome. Use it to fulfil an order when the buyer has paid.

When it fires

For checkouts you create with Create Checkout:

  • A charge attempt starts, whether the buyer pays or you charge with Charge Checkout.
  • The checkout moves to PROCESSING, PAID, FAILED or UNKNOWN.
  • The checkout expires (EXPIRED).

A single charge attempt usually sends several deliveries, and some carry the same status. Always act on data.status.

Every charge attempt sends its own deliveries. Retries are optional for each merchant account and are off by default. If retries are on for your account, one checkout can send FAILED and later PAID. See When a checkout is charged again.

It does not fire for the checkouts that bill a subscription. Follow those with subscription-status-changed and subscription-payment-status-changed.

What to do

data.statusSuggested action
PENDINGNo action. A charge attempt has started or the checkout is waiting for the buyer.
PROCESSINGNo action. The charge is in progress.
PAIDFulfil the order. chargedAmount is what the buyer paid. Keep succeededTransactionId: you need it to refund.
FAILEDThe latest charge attempt failed; errorTransaction says why. With retries off (the default), this is final. With retries on, it is not final while remainingChargeAttempts is above 0 and expiresAt has not passed: the buyer or you can charge it again, and a later delivery can show PROCESSING and then PAID. Keep the order open until then.
EXPIREDThe checkout can no longer be paid. Create a new one if the buyer still wants to pay.
UNKNOWNThe outcome could not be determined, and the checkout cannot be paid again. Contact Payment Labs support before you fulfil.

New statuses may be added. If you see a value you do not recognise, fetch the checkout with Get Checkout.

When a checkout is charged again

Retries are optional, and they are set for each merchant account:

  • Retries off (the default). Each checkout accepts one charge attempt. A decline is final: the checkout stays FAILED and you never receive PAID for it after a FAILED. To let the buyer try again, create a new checkout.
  • Retries on. Payment Labs sets the number of charge attempts per checkout for your account when you ask your Payment Labs contact. A FAILED checkout can then be charged again, by the buyer in the Payin SDK or by you with Charge Checkout. See Charging a failed checkout again.

If you are not sure whether retries are on for your account, ask your Payment Labs contact, and build your handler for retries anyway: the rules below also work when retries are off.

With retries on, each attempt sends its own deliveries, so you receive events for every attempt, not one event for the checkout. A buyer whose first card is declined and whose second card is approved can produce this sequence:

StepWhat happensdata.status you can receive
1The first attempt starts.PROCESSING
2The first card is declined.FAILED
3The buyer pays again with another card.PROCESSING
4The second attempt is approved.PAID

The same checkout can also send FAILED several times, once for each declined attempt, and then PAID, or end with FAILED when no attempts are left.

Handle these deliveries as follows:

  • Do not treat FAILED as the end of the order. It describes the latest attempt only. Do not cancel the order, release stock or tell the buyer that the payment failed for good on a FAILED delivery. A FAILED checkout is finally unpaid only when remainingChargeAttempts is 0 or expiresAt has passed. With retries off, every FAILED checkout shows remainingChargeAttempts: 0, so the same check works for both settings. PROCESSING and PAID checkouts also show 0, so read the field only together with status: "FAILED". If the field is absent, it could not be determined: keep the order open and call Get Checkout again later.
  • Accept PAID after FAILED. A retried checkout moves from FAILED to PROCESSING and then to PAID. This is a move forward, not a step back. If your handler ignores status changes that look like a step back, treat PENDING, PROCESSING and FAILED as one open state that can change in any direction, and PAID, EXPIRED and UNKNOWN as final.
  • Never leave PAID. Once you have recorded PAID, ignore every later delivery for that checkout that shows another status. Such a delivery is late or resent: Resend Webhook sends the original data, which can be an older FAILED.
  • Expect at most one success. Only one attempt can succeed, and a PAID checkout cannot be charged again. Fulfil once, keyed on the checkout id, and keep succeededTransactionId for refunds.
  • Do not count on seeing every status. Deliveries can arrive in any order, and data is read when the delivery is created. The delivery for a decline can already show the next attempt's PROCESSING or PAID, so you may never receive a FAILED for it, and two deliveries can show the same status.
  • Tell attempts apart by transaction ID. errorTransaction.transactionId names the failed attempt and is set only while status is FAILED. succeededTransactionId names the attempt that paid. A checkout that was paid after a decline keeps lastErroredAt.

A handler that follows these rules:

const FINAL = new Set(["PAID", "EXPIRED", "UNKNOWN"]);

type Checkout = {
  id: string;
  status: string;
  expiresAt: string;
  remainingChargeAttempts?: number;
  succeededTransactionId?: string;
};

async function onCheckoutStatusChanged(checkout: Checkout) {
  const order = await orders.findByCheckoutId(checkout.id);
  if (FINAL.has(order.checkoutStatus)) return; // a final status never changes, for example PAID after a late FAILED

  await orders.update(order.id, { checkoutStatus: checkout.status });

  if (checkout.status === "PAID") {
    await fulfilOnce(order.id, checkout.succeededTransactionId); // once per checkout, in the same database transaction
  }

  if (checkout.status === "FAILED") {
    const expired = new Date(checkout.expiresAt) <= new Date();
    if (checkout.remainingChargeAttempts === 0 || expired) {
      await closeUnpaidOnce(order.id); // no further charge can succeed
    }
    // Otherwise another attempt can still succeed: show the decline and keep the order open.
  }
}

Payload

data is the checkout as Get Checkout describes it, read when the webhook is sent. Fields with no value are omitted. Amounts use the Money object. payableAmount is never included in this payload. Call Get Checkout if you need it.

FieldTypeDescription
idstringCheckout ID, for example S-01JD3K5N7P9R1T3V5X7Z9B1D3F.
statusstringCheckout status: PENDING, PROCESSING, PAID, FAILED, EXPIRED or UNKNOWN. See the table above.
merchantIdstringYour merchant ID.
merchantNamestringYour business name as the buyer sees it.
buyerIdstringID of the buyer.
buyerEmailstringBuyer's email address.
aliasstringShort name for the checkout, shown to the buyer.
descriptionstringLonger description of what the buyer is paying for.
referenceIdstringYour own reference for the checkout, for example your order number.
statementAliasstringText shown on the buyer's card statement after your account's statement prefix, as sent at creation. Omitted when not set.
amountMoneyAmount the checkout asks for.
chargedAmountMoneyAmount actually charged to the buyer. Set once the checkout is paid; read it, not amount, when you reconcile. It can be missing on some older paid checkouts, so use status to know whether a payment happened.
isMerchantInitiatedbooleantrue if you charged the checkout with Charge Checkout rather than the buyer paying.
hasRefundsbooleantrue once a refund has been created for the checkout.
succeededTransactionIdstringID of the charge attempt that paid the checkout. Use it to create a refund.
succeededCheckoutInstrumentIdstringID of the card or account that paid the checkout.
lastSucceededAtstringWhen the checkout was paid, in ISO 8601 UTC.
lastErroredAtstringWhen the latest charge attempt failed, in ISO 8601 UTC.
remainingChargeAttemptsnumberHow many more times the checkout can be charged, when the delivery was created. A FAILED checkout with 0 is finally unpaid; with retries off, every FAILED checkout shows 0. PROCESSING and PAID also show 0, so read it with status. Omitted when it could not be determined. See When a checkout is charged again.
errorTransactionobjectDetails of the latest failed charge attempt. Set when status is FAILED. See the table below.
errorReasonstringDeprecated. Use errorTransaction.errorReason.
expiresAtstringWhen the checkout stops accepting payment, in ISO 8601 UTC.
enabledCheckoutInstrumentsstring[]Instrument types the buyer may pay with. Card types are payment-card-1, payment-card-2, payment-card-3; bank types are bank-transfer-2, bank-transfer-3; third-party wallet tokens are third-party-token-1, third-party-token-3; an in-person card on a terminal is payment-card-present-3.
authenticationOptionsstringHow the buyer must identify: GUEST_ONLY, AUTHENTICATED_ONLY (signed in), or ALL (either).
linksobjectcheckout: a link you can send to the buyer. embeddable: a URL to load in an iframe.
redirectLinksobjectWhere the buyer is sent after paying: successRedirectUrl, failureRedirectUrl and expiredRedirectUrl.
termsOfServiceUrlstringYour terms of service, shown to the buyer.
privacyPolicyUrlstringYour privacy policy, shown to the buyer.
auditInfoobjectcreatedAt, updatedAt (ISO 8601 UTC), createdBy and updatedBy.

errorTransaction object:

FieldTypeDescription
transactionIdstringID of the failed charge attempt.
checkoutInstrumentIdstringID of the card or account that was charged.
instrumentTypestringType of that instrument, from the list in enabledCheckoutInstruments.
errorReasonstringBroad cause. MISSING_INSTRUMENT: no instrument was given; the buyer must add one. INVALID_INSTRUMENT: the instrument is not valid; the buyer must check it. CHARGE_INSTRUMENT_ERROR: the charge was declined; the buyer should try another instrument. APPLICATION_ERROR: the checkout could not be processed.
extendedErrorReasonstringPrecise decline reason, when the card network gives one: INSUFFICIENT_FUNDS, EXPIRED_CARD, INVALID_CVV, DO_NOT_HONOR, TRANSACTION_NOT_PERMITTED, RESTRICTED_CARD, DUPLICATE_TRANSACTION, INVALID_ACCOUNT_NUMBER, INVALID_AMOUNT, INVALID_CURRENCY, CALL_ISSUER, ADDRESS_VERIFICATION_FAILED, MERCHANT_RULE_VALIDATION, THREE_D_SECURE_REQUIRED, THREE_D_SECURE_FAILED, THREE_D_SECURE_EXPIRED, NEW_ACCOUNT_INFO_AVAILABLE, PAYMENT_CANCELLED_BY_CARDHOLDER, RETRY_LATER, PROCESSOR_UNAVAILABLE, UNKNOWN_ERROR.

Example

The full request body Payment Labs sends:

{
  "payorId": "C-01JBX2Q8F4H6K8M0N2P4R6T8VW",
  "event": "checkout-status-changed",
  "timestamp": "2026-04-02T18:31:09.442Z",
  "data": {
    "id": "S-01JD3K5N7P9R1T3V5X7Z9B1D3F",
    "buyerEmail": "[email protected]",
    "alias": "Order 5521",
    "description": "Annual membership",
    "referenceId": "order-5521",
    "statementAlias": "ORDER 5521",
    "amount": {
      "value": 89.99,
      "wholeValue": 8999,
      "currency": "USD",
      "formattedValue": "$89.99",
      "digits": 2
    },
    "chargedAmount": {
      "value": 89.99,
      "wholeValue": 8999,
      "currency": "USD",
      "formattedValue": "$89.99",
      "digits": 2
    },
    "status": "PAID",
    "succeededTransactionId": "ST-01JD3K8Q2S4U6W8Y0A2C4E6G8J",
    "succeededCheckoutInstrumentId": "SI-01JD3K7M9P1R3T5V7X9Z1B3D5F",
    "expiresAt": "2026-04-09T18:00:00.000Z",
    "auditInfo": {
      "createdAt": "2026-04-02T18:00:00.000Z",
      "updatedAt": "2026-04-02T18:31:08.910Z",
      "createdBy": "[email protected]",
      "updatedBy": "[email protected]"
    },
    "lastSucceededAt": "2026-04-02T18:31:08.000Z",
    "termsOfServiceUrl": "https://shop.example.com/terms",
    "privacyPolicyUrl": "https://shop.example.com/privacy",
    "enabledCheckoutInstruments": ["payment-card-3", "bank-transfer-3"],
    "buyerId": "U-01JBX5K7M9P1Q3R5S7T9V1W3X5",
    "merchantId": "C-01JBX2Q8F4H6K8M0N2P4R6T8VW",
    "merchantName": "Example Fitness Club",
    "redirectLinks": {
      "successRedirectUrl": "https://shop.example.com/orders/5521/thanks"
    },
    "links": {
      "embeddable": "https://checkout.example.com/embed/S-01JD3K5N7P9R1T3V5X7Z9B1D3F",
      "checkout": "https://checkout.example.com/S-01JD3K5N7P9R1T3V5X7Z9B1D3F"
    },
    "authenticationOptions": "ALL",
    "hasRefunds": false,
    "isMerchantInitiated": false
  }
}