Skip to content
Last updated

Bookings

The booking process in the Mozrest API is composed of two main steps:

  1. Creating a Pending Booking: This temporarily holds the selected timeslot, giving the customer time to fill in contact and payment details.
  2. Committing the Pending Booking: Once the contact details and payment (if required) are submitted, the pending booking becomes a Booking.

This section describes the full flow, including how to:

  • Create and commit a pending booking
  • Manage bookings (view, update, cancel, list)
  • Understand both Pending Booking and Booking object structures

If the booking requires payment, please refer to the Payments section for full integration details.


Pending Booking Object

This object represents a pending booking, created to hold a timeslot while the user fills in contact and/or payment details. If not committed in time, it expires and the slot is released.

KeyTypeDescription
idStringPending Booking ID
holdingTimeIntegerTime (in seconds) the booking will be held
venueMessageStringOptional venue message for display during payment

EXAMPLE RESPONSE:

{
  "id": "61bb23a701a5ac259b85e3f3",
  "holdingTime": 420,
  "venueMessage": null
}

Booking Object

This object represents a consolidated booking.

KeyTypeDescription
idStringBooking id
venueIdStringVenue id for booking
bookingChannelIdStringBooking channel id where the customer placed the booking
statusStringBooking status [pending, declined, confirmed, canceled, no-show, completed]
partySizeIntNumber of people
dateDatetimeBooking date and time in Timestamp UTC format (ie. Saturday, 16 October 2021 14:30 is 1634387400 on timestamp)
notesTextUser notes
cancelActorStringWho had canceled the booking
cancelReasonTextWhy the booking has been canceled
canceledAtDatetimeWhen the booking has been canceled (UTC)
bookingTypeStringId of the booking type to book
contact[firstname]TextCustomer's first name
contact[lastname]TextCustomer's last name
contact[email]TextCustomer's email (ie. john.doe@email.com)
contact[telephone]IntCustomer's telephone including country code but NO sign (ie. +44 20 7234 3456 -> 442072343456 )
contact[locale]TextCustomer's language (ISO2 format)
contact[optInConsent]BooleanAllow to receive marketing emails from the Venue and the Partner (default: false)

EXAMPLE JSON:

{
  "id": "60e890aca5f07b6ee5b950b1",
  "venueId": "60e890aca5f07b6ee5b950b1",
  "bookingChannelId": "60e890aca5f07b6ee5b950b3",
  "partySize": 4,
  "status": "confirmed",
  "date": "2021-11-06T12:00:00+02:00",
  "notes": "I'm alergic to peanuts",
  "bookingType": "seti_1Mw0nDEX15g1bGLpsajo6bDE",
  "cancelActor": null,
  "cancelReason": null,
  "canceledAt": null,
  "contact": {
    "id": "60e890aca5f07b6ee5b950b1",
    "firstname": "John",
    "lastname": "Doe",
    "email": "john.doe@gmail.com",
    "telephone": "44344223322",
    "locale": "en",
    "optInConsent": true
  }
}

Create Pending Booking

A pending booking represents a booking during the online reservation process. It holds the seats during the booking process, allowing time to complete contact and payment steps. The pending booking expires after a limited time defined by the Reservation System.

EXAMPLE REQUEST:

curl POST "https://api-sandbox.mozrest.com/v1/bc/pending-booking" \
  -H "Authorization: Bearer {{api_key}}" \ 
  --data-raw '{
    "venueId": "619decd55bf9cb36aaa00dd6",
    "partySize": 4,
    "date": 1642339800,
    "areaId": "619decd55bf9cb36aaa00dd6",
    "bookingType": "64ca5f2cab23a4112a7d2dde",
  }'

EXAMPLE RESPONSE:

{
  "id": "61bb23a701a5ac259b85e3f3",
  "holdingTime": 420,
  "venueMessage": null
}

HTTP Request:
POST /v1/bc/pending-booking

Parameters:

ParameterStatusDescription
venueIdMandatoryVenue ID
partySizeMandatoryNumber of persons
dateMandatoryTimestamp UTC (e.g., 1634387400)
areaIdOptionalArea ID to book in
bookingTypeOptionalBooking type ID

Commit Pending Booking

This endpoint allows to commit a Pending Booking. After a Pending Booking is committed it becomes a Booking and on the response a Booking with a Booking id is returned.

EXAMPLE REQUEST:

curl PUT "https://api-sandbox.mozrest.com/v1/bc/pending-booking/61bb23a701a5ac259b85e3f3" \
  -H "Authorization: Bearer {{api_key}}" \ 
  --data-raw '{
    "notes": "Customer notes or requests",
    "contact": {
        "firstname": "John",
        "lastname": "Doe",
        "email": "john.doe@gmail.com",
        "telephone": "44646673377",
        "locale": "en",
        "address": {
            "country": "GB",
            "city": "London",
            "region": "London",
            "address": "Picadilly Sq. 15",
            "postalCode": "W1J 9LL"
        },
        "optInConsent": "true"
    }'

EXAMPLE JSON:

{
  "id": "61bb24011271104c686f4db5",
  "venueId": "619decd55bf9cb36aaa00dd6",
  "partySize": 4,
  "session": "dinner",
  "status": "confirmed",
  "date": "2022-01-16T13:30:00Z",
  "notes": "Customer notes or requests",
  "cancelActor": null,
  "cancelReason": null,
  "canceledAt": null,
  "bookingType" : "64ca5f2cab23a4112a7d2dde",
  "contact": {
    "id": "61b78753b419978323e22aa3",
    "firstname": "John",
    "lastname": "Doe",
    "email": "john.doe@gmail.com",
    "telephone": "44646673377",
    "locale": "en",
    "optInConsent": true
  }
}

HTTP Request

PUT https://api-sandbox.mozrest.com/v1/bc/pending-booking/{id}

Query Parameters

ParameterStatusDescription
notesOptionalUser notes
contact[firstname]MandatoryContact's firstname
contact[lastname]MandatoryContact's lastname
contact[email]MandatoryContact's email
contact[telephone]OptionalContact's telephone (including country code but NO sign)
contact[locale]MandatoryContact's language (ISO2 format)
contact[optInConsent]OptionalAllow to get marketing emails and reminders (default: false)

Update Booking

This endpoint allows to amend a pending status booking.

EXAMPLE REQUEST:

curl PUT "https://api-sandbox.mozrest.com/v1/bc/booking/{id}" \
  -H "Authorization: Bearer {{api_key}}" \
  --data-raw '{
    "partySize": 4,
    "date": 1634401800
  }'

EXAMPLE JSON:

{
  "id": "60e890aca5f07b6ee5b950b1",
  "venueId": "60e890aca5f07b6ee5b950b1",
  "partySize": 4,
  "status": "confirmed",
  "date": "2021-11-07T12:00:00+02:00",
  "notes": "I'm alergic to peanuts and broccoli",
  "contact": {
    "id": "60e890aca5f07b6ee5b950b1",
    "firstname": "John",
    "lastname": "Doe",
    "email": "john.doe@gmail.com",
    "telephone": "44344223322",
    "locale": "en",
    "optInConsent": true
  }
}

HTTP Request

PUT https://api-sandbox.mozrest.com/v1/bc/booking/{id}

Query Parameters

ParameterStatusDescription
idMandatoryBooking id to amend
partySizeMandatoryNumber of persons
dateMandatoryDate time in Timestamp UTC format (ie. Saturday, 16 October 2021 14:30 is 1634387400 on timestamp)

Cancel Booking

This endpoint allows to cancel a booking.

EXAMPLE REQUEST:

curl PUT "https://api-sandbox.mozrest.com/v1/bc/booking/{id}" \
  -H "Authorization: Bearer {{api_key}}" \  
  --data-raw '{
    "cancelActor": "me"
  }'

EXAMPLE JSON:

{
  "id": "60e890aca5f07b6ee5b950b1",
  "venueId": "60e890aca5f07b6ee5b950b1",
  "partySize": 4,
  "status": "canceled",
  "date": "2021-11-07T12:00:00+02:00",
  "notes": "I'm alergic to peanuts and broccoli",
  "cancelActor": "user",
  "canceledAt": "2021-10-20T12:00:00+02:00",
  "contact": {
    "id": "60e890aca5f07b6ee5b950b1",
    "firstname": "John",
    "lastname": "Doe",
    "email": "john.doe@gmail.com",
    "telephone": "44344223322",
    "locale": "en",
    "optInConsent": true
  }
}

HTTP Request

PUT https://api-sandbox.mozrest.com/v1/bc/booking/{id}/cancel

Query Parameters

ParameterStatusDescription
idMandatoryBooking id to cancel
cancelActorMandatoryWho had canceled the booking

Get a specific booking

This endpoint allows to get a specific booking.

EXAMPLE REQUEST:

curl GET "https://api-sandbox.mozrest.com/v1/bc/booking/{id}" \
  -H "Authorization: Bearer {{api_key}}" 

EXAMPLE JSON:

{
  "id": "60e890aca5f07b6ee5b950b1",
  "venueId": "60e890aca5f07b6ee5b950b1",
  "partySize": 4,
  "status": "confirmed",
  "date": "2021-11-07T12:00:00+02:00",
  "notes": "I'm alergic to peanuts and broccoli",
  "bookingType" : "64ca5f2cab23a4112a7d2dde",
  "contact": {
    "id": "60e890aca5f07b6ee5b950b1",
    "firstname": "John",
    "lastname": "Doe",
    "email": "john.doe@gmail.com",
    "telephone": "44344223322",
    "locale": "en",
    "optInConsent": true
  }
}

HTTP Request

GET https://api-sandbox.mozrest.com/v1/bc/booking/{id}

Query Parameters

ParameterStatusDescription
idMandatoryBooking id to retrieve

Get a list of bookings

This endpoint allows to retrieve a list of bookings.

EXAMPLE REQUEST:

curl GET "https://api-sandbox.mozrest.com/v1/bc/booking" \
  -H "Authorization: Bearer {{api_key}}" \  
  -d "offset=0" \
  -d "limit=10" \
  -d "email='john.doe@gmail.com'" \  
  -d "venueId='60e5a3ed409541da3650bd90'" \  
  -d "date='2021-10-24'" \

EXAMPLE JSON:

{
  "total": 16,
  "data": [
      {
        "id": "60e890aca5f07b6ee5b950b1",
        "venueId": "60e890aca5f07b6ee5b950b1",
        "partySize": 4,
        "status": "confirmed",
        "date": "2021-11-07T12:00:00+02:00",
        "notes": "I'm alergic to peanuts and broccoli",
        "bookingType" : "64ca5f2cab23a4112a7d2dde",
        "contact": {
          "id": "60e890aca5f07b6ee5b950b1",
          "firstname": "John",
          "lastname": "Doe",
          "email": "john.doe@gmail.com",
          "telephone": "44344223322",
          "locale": "en",
          "optInConsent": true
        }
      }
  ]
}

HTTP Request

GET https://api-sandbox.mozrest.com/v1/bc/booking/{id}

Query Parameters

ParameterStatusDescription
emailOptionalUser email that owns the booking
venueIdOptionalVenue id where the booking takes place
dateOptionalDate of the booking (format 2021-10-24)

At least one of the above parameters must be provided.