Bỏ qua để đến nội dung

Check-out Booking Room

API cho đối tácAdd-on
POST
/properties/{tenant_id}/bookings/{booking_id}/rooms/{room_id}/checkout

Check out one room of a booking (status checked_in → checked_out). When the last active room is checked out, the booking becomes finished.

Scope Required: bookings:write

URL Parameters:

  • booking_id (required): The booking code. A group booking (master) code is accepted — the room may belong to one of its child bookings.
  • room_id (required): The booking room UUID (booking_rooms[].id from Get Booking)

Body Parameters (JSON):

  • departure_hour (optional): Actual departure time, format H:i. Example: 11:30

Important Notes:

  • Only a room with status checked_in can be checked out. Other statuses → HTTP 422 BOOKING_ROOM_INVALID_STATUS.
  • Retry-safe: checking out a room that is already checked_out returns 200 without changes.
  • Payments are NOT part of this request — record them first with POST /bookings/{booking_id}/payments.
  • If the property requires full payment at check-out and the booking balance is not zero (balance is evaluated on the group booking when the room belongs to a merged child), the request fails with HTTP 422 BOOKING_CHECKOUT_UNBALANCED and a numeric balance (> 0: amount still due, < 0: overpaid).
  • Early check-out (before checkout_date) keeps the room’s dates and price unchanged.
  • Partner webhook booking.checked_out is sent for the booking that owns the room (the child booking for a group booking).

Response (200): same shape as Get Booking Detail (GET /bookings/{booking_id}), for the booking_id in the URL — including booking_rooms[].guests and booking_rooms[].services. Only the main fields are listed below.

Error codes: BOOKING_ROOM_INVALID_STATUS (422, with checkin_status and booking_status), BOOKING_CHECKOUT_UNBALANCED (422, with balance), BOOKING_001 (400/500). Invalid room_id (not a UUID, or not in this booking) → HTTP 422 with errors.room_id.

tenant_id
required
string
booking_id
required
string
room_id
required
string
CheckoutBookingRoomRequest

Check-out một phòng — POST /bookings/{booking_id}/rooms/{room_id}/checkout.

object
booking_id
required
string
<= 8 characters
room_id
required
string format: uuid
departure_hour

Giờ trả phòng thực tế (tuỳ chọn), định dạng H:i. Example: 11:30

string | null
object
success
required
boolean
data
required
object
id
required
string
status
required
string
amount
required
number
service_fee
required
number
service_discount
required
number
service_charge
required
number
booking_rooms
required
Array<object>
object
id
required
string
checkin_status
required
string
departure_hour
required
string
room_fee
required
number
room_discount
required
number
room_charge
required
number
service_fee
required
number
service_discount
required
number
service_charge
required
number
days_breakdown
required
Array<object>
object
day
required
string
price
required
number
services
required
Array<object>
object
id
required
string | null
name
required
string
quantity
required
number
price_per_unit
required
number
discount
required
number
total_price
required
number
currency
required
string | null
service_used_date
required
string | null

Validation error

object
message
required

Errors overview.

string
errors
required

A detailed description of each field that failed validation.

object
key
additional properties
Array<string>
Bài này có giúp được bạn không?