Set Cancellation Windows

  • Cancellation windows control when users can cancel bookings, hiding the cancellation option outside the window.

  • You can set cancellation windows at the service level (affecting all slots) or the slot level (affecting individual slots).

  • Service-level windows use rules.min_advance_online_canceling in the Service feed to define the minimum time before the booking start when cancellations are allowed.

  • Slot-level windows use scheduling_rule_overrides.last_online_cancellable_sec in the Availability feed to specify the last time (EPOCH timestamp) a slot can be cancelled.

  • Implementing cancellation windows in feeds doesn't replace handling BookingFailure with OUTSIDE_CANCELLATION_WINDOW for edge cases in your system.

How to Add Cancellation Windows

Cancellation windows define when the cancel and modify buttons are active. This means the cancel and modify functions will be inoperable in user confirmation emails and will disappear from all other surfaces, including the confirmation modal. Confirmation modal with cancel and modify buttons removed

Cancellation windows can be enabled in two ways: service-level and slot-level. The processes for specifying windows at these levels are discussed below.

If both a service-level and a slot-level cancellation window are set, the slot-level window will take effect. If neither are set, the cancellation window defaults to the start of the time slot (i.e. the user can be cancelled at the last minute).

Service level definition

Service-level cancellation windows can be enabled by specifying rules.min_advance_online_canceling in the Service feed. This field should be set to the number of seconds in advance of the reservation start time that the booking needs to be made. For example, if the booking can only be cancelled up until 24h before the start time this field would be set to 86400 (so a booking for 3pm can only be cancelled until 3pm the previous day). This would apply to all slots for that service (unless overridden by slot level definition).

JSON

{
  "service": [
    {
      "rules": {
        "min_advance_online_canceling": 86400
      }
    }
  ]
}

Slot level definition

At the availability slot level the field is called scheduling_rule_overrides.last_online_cancellable_sec. This field is the last time (EPOCH timestamp) that the specific slot can be cancelled. This would apply to each individual slot where this was specified.

JSON

"service_availability": [
  {
    "availability": {
      "scheduling_rule_overrides": {
        "last_online_cancellable_sec": 1468081800
        }
    }
  }
]