Skip to main content

Payload Structure

interface WebhookEvent {
  event_id: string;
  type: "checkout.release_hold";
  data: {
    id: string; // id of the checkout you originally created
    type: "withdrawal"; // only sent on withdrawals
    charge: {
      id: string;
      status: "failed";
      from_status: "held";
      amount_cents: number;
      transaction_type: "debit";
    };
    customer: {
      id: string;
    };
    line_items: Array<{
      product_id: string;
      quantity: number;
    }>;
    line_items_total_amount_cents: number | null;
  }
}

Example Payload

{
  "event_id": "ev_tDaWu5aTVa2kbvDjGe55rxZpaMEmVFWB",
  "type": "checkout.release_hold",
  "data": {
    "id": "chk_SUuEdtXWK3wmui6c4guq5xdLke21uvRt",
    "type": "withdrawal",
    "charge": {
      "id": "ch_96rVNn94oKSRDZ69fQsUQbaigaice9Tx",
      "status": "failed",
      "from_status": "held",
      "amount_cents": 100,
      "transaction_type": "debit"
    },
    "customer": {
      "id": "cus_vi57KegYgcRqcGHqip8q6UZiqtrwMT870"
    },
    "line_items": [],
    "line_items_total_amount_cents": null
  }
}

Updating Player’s Balance

If you debited the player’s balance when you received the checkout.hold event, you should credit it back, otherwise you can ignore this event.