Skip to main content

Payload Structure

interface WebhookEvent {
  event_id: string;
  type: "checkout.hold";
  data: {
    id: string; // id of the checkout you originally created
    type: "withdrawal" // only sent on withdrawals
    charge: {
      id: string;
      status: "held";
      from_status: "created";
      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.hold",
  "data": {
    "id": "chk_SUuEdtXWK3wmui6c4guq5xdLke21uvRt",
    "type": "withdrawal",
    "charge": {
      "id": "ch_96rVNn94oKSRDZ69fQsUQbaigaice9Tx",
      "status": "held",
      "from_status": "created",
      "amount_cents": 100,
      "transaction_type": "debit"
    },
    "customer": {
      "id": "cus_vi57KegYgcRqcGHqip8q6UZiqtrwMT870"
    },
    "line_items": [],
    "line_items_total_amount_cents": null
  }
}

You must respond with status

2xx: if the player has available funds Not 2xx: the player has insufficient funds

Updating Player’s Balance

You can choose to debit the player’s balance immediately or wait until you receive the checkout.succeeded event. It is recommended to debit immediately and then skip the checkout.succeeded event.