Cal.com Sandbox

Concepts

Credit-based bookings

Architecture pattern for gating Cal.com bookings on your own credit or billing system, then settling the charge via webhook.

Yours
Your app & credits gateUser clicks ‘Book’; you check your own credits or billing logic.
Sufficient credits — render the booker
Cal.com
Drop-in booker<Cal calLink=…/>
Cal.com
Custom bookerGET /v2/slots → your UI
Booking confirmed
Cal.com
Cal.com webhooktriggerEvent: BOOKING_CREATED
POST /api/webhooks/cal
Yours
Your webhook handlerVerify signature, deduct 1 credit, send a receipt.
Webhook handlerPOST /api/webhooks/cal
// Your billing webhook handler
app.post("/api/webhooks/cal", async (req, res) => {
  const { triggerEvent, payload } = req.body;

  if (triggerEvent === "BOOKING_CREATED") {
    await deductCredit(payload.attendees[0].email);
  }

  res.json({ ok: true });
});