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,FAILEDorUNKNOWN. - 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.status | Suggested action |
|---|---|
PENDING | No action. A charge attempt has started or the checkout is waiting for the buyer. |
PROCESSING | No action. The charge is in progress. |
PAID | Fulfil the order. chargedAmount is what the buyer paid. Keep succeededTransactionId: you need it to refund. |
FAILED | The 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. |
EXPIRED | The checkout can no longer be paid. Create a new one if the buyer still wants to pay. |
UNKNOWN | The 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
FAILEDand you never receivePAIDfor it after aFAILED. 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
FAILEDcheckout 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:
| Step | What happens | data.status you can receive |
|---|---|---|
| 1 | The first attempt starts. | PROCESSING |
| 2 | The first card is declined. | FAILED |
| 3 | The buyer pays again with another card. | PROCESSING |
| 4 | The 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
FAILEDas 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 aFAILEDdelivery. AFAILEDcheckout is finally unpaid only whenremainingChargeAttemptsis0orexpiresAthas passed. With retries off, everyFAILEDcheckout showsremainingChargeAttempts: 0, so the same check works for both settings.PROCESSINGandPAIDcheckouts also show0, so read the field only together withstatus: "FAILED". If the field is absent, it could not be determined: keep the order open and call Get Checkout again later. - Accept
PAIDafterFAILED. A retried checkout moves fromFAILEDtoPROCESSINGand then toPAID. This is a move forward, not a step back. If your handler ignores status changes that look like a step back, treatPENDING,PROCESSINGandFAILEDas one open state that can change in any direction, andPAID,EXPIREDandUNKNOWNas final. - Never leave
PAID. Once you have recordedPAID, ignore every later delivery for that checkout that shows another status. Such a delivery is late or resent: Resend Webhook sends the originaldata, which can be an olderFAILED. - Expect at most one success. Only one attempt can succeed, and a
PAIDcheckout cannot be charged again. Fulfil once, keyed on the checkoutid, and keepsucceededTransactionIdfor refunds. - Do not count on seeing every status. Deliveries can arrive in any order, and
datais read when the delivery is created. The delivery for a decline can already show the next attempt'sPROCESSINGorPAID, so you may never receive aFAILEDfor it, and two deliveries can show the same status. - Tell attempts apart by transaction ID.
errorTransaction.transactionIdnames the failed attempt and is set only whilestatusisFAILED.succeededTransactionIdnames the attempt that paid. A checkout that was paid after a decline keepslastErroredAt.
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.
| Field | Type | Description |
|---|---|---|
id | string | Checkout ID, for example S-01JD3K5N7P9R1T3V5X7Z9B1D3F. |
status | string | Checkout status: PENDING, PROCESSING, PAID, FAILED, EXPIRED or UNKNOWN. See the table above. |
merchantId | string | Your merchant ID. |
merchantName | string | Your business name as the buyer sees it. |
buyerId | string | ID of the buyer. |
buyerEmail | string | Buyer's email address. |
alias | string | Short name for the checkout, shown to the buyer. |
description | string | Longer description of what the buyer is paying for. |
referenceId | string | Your own reference for the checkout, for example your order number. |
statementAlias | string | Text shown on the buyer's card statement after your account's statement prefix, as sent at creation. Omitted when not set. |
amount | Money | Amount the checkout asks for. |
chargedAmount | Money | Amount 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. |
isMerchantInitiated | boolean | true if you charged the checkout with Charge Checkout rather than the buyer paying. |
hasRefunds | boolean | true once a refund has been created for the checkout. |
succeededTransactionId | string | ID of the charge attempt that paid the checkout. Use it to create a refund. |
succeededCheckoutInstrumentId | string | ID of the card or account that paid the checkout. |
lastSucceededAt | string | When the checkout was paid, in ISO 8601 UTC. |
lastErroredAt | string | When the latest charge attempt failed, in ISO 8601 UTC. |
remainingChargeAttempts | number | How 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. |
errorTransaction | object | Details of the latest failed charge attempt. Set when status is FAILED. See the table below. |
errorReason | string | Deprecated. Use errorTransaction.errorReason. |
expiresAt | string | When the checkout stops accepting payment, in ISO 8601 UTC. |
enabledCheckoutInstruments | string[] | 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. |
authenticationOptions | string | How the buyer must identify: GUEST_ONLY, AUTHENTICATED_ONLY (signed in), or ALL (either). |
links | object | checkout: a link you can send to the buyer. embeddable: a URL to load in an iframe. |
redirectLinks | object | Where the buyer is sent after paying: successRedirectUrl, failureRedirectUrl and expiredRedirectUrl. |
termsOfServiceUrl | string | Your terms of service, shown to the buyer. |
privacyPolicyUrl | string | Your privacy policy, shown to the buyer. |
auditInfo | object | createdAt, updatedAt (ISO 8601 UTC), createdBy and updatedBy. |
errorTransaction object:
| Field | Type | Description |
|---|---|---|
transactionId | string | ID of the failed charge attempt. |
checkoutInstrumentId | string | ID of the card or account that was charged. |
instrumentType | string | Type of that instrument, from the list in enabledCheckoutInstruments. |
errorReason | string | Broad 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. |
extendedErrorReason | string | Precise 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
}
}