Payload Structure
interface WebhookEvent {
event_id: string;
data: {
id: string; // id of the checkout you originally created
line_items: Array<{
product_id: string;
quantity: number;
total_amount_cents: number;
product_name: string;
product_url: string;
product_price_cents: number;
sku: string;
}>;
line_items_total_amount_cents: number | null;
type: "withdrawal"; // only sent on withdrawals
charge: {
id: string;
amount_cents: number;
transaction_type: "debit";
status: "failed";
from_status: "held";
failure_code: string | null;
failure_message: string | null;
};
customer: {
id: string;
};
subscription: {
id: string;
interval: "day" | "week" | "month" | "year";
interval_count: number;
line_items: Array<{
product_id: string;
sku: string;
product_name: string;
product_url: string;
quantity: number;
price_cents: number;
total_amount_cents: number;
}>;
line_items_total_amount_cents: number | null;
} | null; // null for non-subscription checkouts
};
type: "checkout.release_hold";
}
Example Payload
{
"event_id": "ev_tDaWu5aTVa2kbvDjGe55rxZpaMEmVFWB",
"data": {
"id": "chk_SUuEdtXWK3wmui6c4guq5xdLke21uvRt",
"line_items": [],
"line_items_total_amount_cents": null,
"type": "withdrawal",
"charge": {
"id": "ch_96rVNn94oKSRDZ69fQsUQbaigaice9Tx",
"amount_cents": 100,
"transaction_type": "debit",
"status": "failed",
"from_status": "held",
"failure_code": "processor_error",
"failure_message": "The withdrawal could not be processed by the payment processor."
},
"customer": {
"id": "cus_vi57KegYgcRqcGHqip8q6UZiqtrwMT870"
},
"subscription": null
},
"type": "checkout.release_hold"
}
Updating Your Internal Ledger
If you debited the customer’s balance when you received thecheckout.hold event, you should credit it back. Otherwise, you can ignore this event.
