Skip to content

Scheduling infrastructure for absolutely everyone.

fix: platform decrease usage when cancelling booking (#18241)

Lauris Skraucise6a7ae7da33e
diff --git a/apps/api/v2/src/ee/bookings/2024-08-13/services/bookings.service.ts b/apps/api/v2/src/ee/bookings/2024-08-13/services/bookings.service.ts
index 2f2c9b303d8..b737c7e3eb1 100644
--- a/apps/api/v2/src/ee/bookings/2024-08-13/services/bookings.service.ts
+++ b/apps/api/v2/src/ee/bookings/2024-08-13/services/bookings.service.ts
@@ -340,7 +340,10 @@ export class BookingsService_2024_08_13 {
}
const bookingRequest = await this.inputService.createCancelBookingRequest(request, bookingUid, body);
- await handleCancelBooking(bookingRequest);
+ const res = await handleCancelBooking(bookingRequest);
+ if (!res.onlyRemovedAttendee) {
+ await this.billingService.cancelUsageByBookingUid(res.bookingUid);
+ }
if ("cancelSubsequentBookings" in body && body.cancelSubsequentBookings) {
return this.getAllRecurringBookingsByIndividualUid(bookingUid);
diff --git a/docs/platform/faq.mdx b/docs/platform/faq.mdx
index 267f276e677..ba4ee663535 100644
--- a/docs/platform/faq.mdx
+++ b/docs/platform/faq.mdx
@@ -44,3 +44,11 @@ description: Answers to the most common questions about the Platform API and ato
Either of the two:
- Setting `Authorization: Bearer <token>` header where `<token>` is access token of the managed user.
- Setting `x-cal-client-id: <client-id>` and `x-cal-secret-key: <client-secret>` where `<client-id>` is OAuth client id and `<client-secret>` is OAuth client secret. Both can be copied from the dashboard.
+
+### 10. When am I charged and not charged ?
+- You are charged for scheduled booking only when the booking starts.
+- If a booking is rescheduled you are still charged once.
+- If a booking is cancelled then you are not charged for it.
+
+### 11. What happens if there are more bookings than in my plan?
+- You have to pay overage for each booking that exceeds the amount in your plan.
\ No newline at end of file