Core resources


Administration


Booking flow

Book

Perform a booking.

Body

product_idrequireduuid

The identifier of the unit to book.

coupon_codesArray<text>

The coupon codes entered for the booking.

currencytext

The currency to use for the booking. Defaults to the unit's currency. See the widget docs for the allowed values.

form_valuesRecord<uuid, uuid | text | number | boolean>

Values for each of the form fields. The keys are the form field IDs, the values are the values entered by the user.

intervalRequired{ start: string, end: string }

The interval to book.

occupancyRequiredRecord<uuid, integer>

The occupancy for each occupancy group. The keys are the occupancy group IDs, the values are the number of guests for that group.

show_pending_as"CANCELLED" | "TENTATIVE" | "CONFIRMED"

How to interpret pending events when checking if the booking is possible. Defaults to TENTATIVE

Responses

201

Information identifying the booking. If a payment URL is set, the user should be redirected to that URL to complete the booking.

{
  reference: uuid;
  booking_id: uuid;
  payment_url: string | null;
}
POST/book
curl -X POST "https://api.bookingmood.com/v1/book" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"product_id":"00000000-0000-0000-0000-000000000000","interval":{"start":"2024-05-11","end":"2024-05-15"},"occupancy":{"00000000-0000-0000-0000-000000000000":1}}'
Example response
{
"reference": "00000000-0000-0000-0000-000000000000",
"booking_id": "00000000-0000-0000-0000-000000000000",
"payment_url": null
}