Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Cách thêm khoảng thời gian huỷ
Cửa sổ huỷ xác định thời điểm nút huỷ và sửa đổi hoạt động. Điều này có nghĩa là các chức năng huỷ và sửa đổi sẽ không hoạt động trong email xác nhận của người dùng và sẽ biến mất khỏi tất cả các nền tảng khác, bao gồm cả cửa sổ xác nhận.
Bạn có thể bật khoảng thời gian huỷ theo hai cách: cấp dịch vụ và cấp khung giờ. Quy trình chỉ định cửa sổ ở các cấp này sẽ được thảo luận bên dưới.
Nếu bạn đặt cả khung giờ huỷ ở cấp dịch vụ và khung giờ huỷ ở cấp khung giờ, thì khung giờ huỷ ở cấp khung giờ sẽ có hiệu lực. Nếu bạn không đặt cả hai, thì khoảng thời gian huỷ sẽ mặc định là thời điểm bắt đầu khung giờ (tức là người dùng có thể huỷ vào phút cuối).
Định nghĩa về mức dịch vụ
Bạn có thể bật khoảng thời gian huỷ ở cấp dịch vụ bằng cách chỉ định rules.min_advance_online_canceling trong nguồn cấp dữ liệu Dịch vụ. Bạn nên đặt trường này thành số giây trước thời điểm bắt đầu đặt phòng mà bạn cần đặt phòng. Ví dụ: nếu bạn chỉ có thể huỷ đặt phòng trước 24 giờ trước thời gian bắt đầu, thì trường này sẽ được đặt thành 86400 (vì vậy, bạn chỉ có thể huỷ đặt phòng lúc 3 giờ chiều trước 3 giờ chiều ngày hôm trước).
Điều này sẽ áp dụng cho tất cả các khung giờ của dịch vụ đó (trừ phi bị ghi đè bởi định nghĩa cấp khung giờ).
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[[["\u003cp\u003eCancellation windows control when users can cancel bookings, hiding the cancellation option outside the window.\u003c/p\u003e\n"],["\u003cp\u003eYou can set cancellation windows at the service level (affecting all slots) or the slot level (affecting individual slots).\u003c/p\u003e\n"],["\u003cp\u003eService-level windows use \u003ccode\u003erules.min_advance_online_canceling\u003c/code\u003e in the Service feed to define the minimum time before the booking start when cancellations are allowed.\u003c/p\u003e\n"],["\u003cp\u003eSlot-level windows use \u003ccode\u003escheduling_rule_overrides.last_online_cancellable_sec\u003c/code\u003e in the Availability feed to specify the last time (EPOCH timestamp) a slot can be cancelled.\u003c/p\u003e\n"],["\u003cp\u003eImplementing cancellation windows in feeds doesn't replace handling \u003ccode\u003eBookingFailure\u003c/code\u003e with \u003ccode\u003eOUTSIDE_CANCELLATION_WINDOW\u003c/code\u003e for edge cases in your system.\u003c/p\u003e\n"]]],["Cancellation windows control when cancellations are allowed. They can be set at the service level using `rules.min_advance_online_canceling` in the Service feed (specifying seconds before the reservation start) or at the slot level using `scheduling_rule_overrides.last_online_cancellable_sec` in the availability feed (specifying an EPOCH timestamp). Slot-level settings override service-level settings. If neither is set, cancellations are allowed up until the slot's start. Implementations must handle `OUTSIDE_CANCELLATION_WINDOW` errors for edge cases.\n"],null,["# Set Cancellation Windows\n\nHow to Add Cancellation Windows\n-------------------------------\n\n\nCancellation windows define when the cancel and modify buttons are active. This\nmeans the cancel and modify functions will be inoperable in user confirmation\nemails and will disappear from all other surfaces, including the confirmation modal.\n\n\nCancellation windows can be enabled in two ways: service-level and\nslot-level. The processes for specifying windows at these levels are\ndiscussed below.\n\nIf both a service-level and a slot-level cancellation window are set, the\nslot-level window will take effect. If neither are set, the cancellation window\ndefaults to the start of the time slot (i.e. the user can be cancelled at the\nlast minute).\n\n### Service level definition\n\nService-level cancellation windows can be enabled by specifying\n`rules.min_advance_online_canceling` in the\n[Service](/actions-center/verticals/reservations/e2e/reference/feeds/services-feed#SchedulingRules-definition)\nfeed. This field\nshould be set to the number of seconds in advance of the reservation start\ntime that the booking needs to be made. For example, if the booking can only be cancelled up\nuntil 24h before the start time this field would be set to\n86400 (so a booking for 3pm can only be cancelled until 3pm the previous day).\nThis would apply to all slots for that service\n(unless overridden by [slot level definition](#slot-level)). \n\n### JSON\n\n```json\n{\n \"service\": [\n {\n \"rules\": {\n \"min_advance_online_canceling\": 86400\n }\n }\n ]\n}\n```\n\n### Slot level definition\n\nAt the\n[availability slot level the field is called\n`scheduling_rule_overrides.last_online_cancellable_sec`](/actions-center/verticals/reservations/e2e/reference/feeds/availability-feed#Availability-definition). This\nfield is the last time (EPOCH timestamp) that the specific slot can be cancelled.\nThis would apply to each individual slot where this was specified. \n\n### JSON\n\n```json\n\"service_availability\": [\n {\n \"availability\": {\n \"scheduling_rule_overrides\": {\n \"last_online_cancellable_sec\": 1468081800\n }\n }\n }\n]\n```\n| **Warning** : Implementing cancellation window in feeds does not prevent you from having to implement and handle the [`BookingFailure`](/actions-center/verticals/reservations/e2e/reference/booking-server-api-rest/e2e-difinitions/bookingfailure-definition) `OUTSIDE_CANCELLATION_WINDOW`. There might be edge cases (such as a stall browser tab) where an [UpdateBooking](/actions-center/verticals/reservations/e2e/reference/booking-server-api-rest/e2e-methods/updatebooking-method) might be sent outside of the specified cancellation window. Upon receiving an [UpdateBooking](/actions-center/verticals/reservations/e2e/reference/booking-server-api-rest/e2e-methods/updatebooking-method), your system must confirm that the change occurs within the specified cancellation window and, if it's not, respond with `UpdateBookingResponse.booking_failure = OUTSIDE_CANCELLATION_WINDOW`."]]