HolidazeBookings

Bookings

Bookings related to Holidaze

This endpoint allows you to create, read, update and delete bookings.

These endpoints support pagination and sorting. Read more about these features here.

The Booking model

PropTypeDefault
id
string
-
dateFrom
string
-
dateTo
string
-
guests
integer
-
created
string
-
updated
string
-

Query parameters

Not all of the properties of a booking are returned by default. You can use the following optional query parameters to include additional properties in the response.

PropTypeDefault
_customer
boolean
false
_venue
boolean
false
Example with all optional query parameters
{
  "data": {
    "id": "string",
    "dateFrom": "string",
    "dateTo": "string",
    "guests": 0,
    "created": "string",
    "updated": "string",
    "venue": {
      "id": "string",
      "name": "string",
      "description": "string",
      "media": [
        {
          "url": "https://url.com/image.jpg",
          "alt": "string"
        }
      ],
      "price": 0,
      "maxGuests": 0,
      "rating": 0,
      "created": "string",
      "updated": "string",
      "meta": {
        "wifi": true,
        "parking": true,
        "breakfast": true,
        "pets": true
      },
      "location": {
        "address": "string",
        "city": "string",
        "zip": "string",
        "country": "string",
        "continent": "string",
        "lat": 0,
        "lng": 0
      },
      "owner": {
        "name": "string",
        "email": "user@example.com",
        "bio": "string",
        "avatar": {
          "url": "https://url.com/image.jpg",
          "alt": "string"
        },
        "banner": {
          "url": "https://url.com/image.jpg",
          "alt": "string"
        }
      }
    },
    "customer": {
      "name": "string",
      "email": "user@example.com",
      "bio": "string",
      "avatar": {
        "url": "https://url.com/image.jpg",
        "alt": "string"
      },
      "banner": {
        "url": "https://url.com/image.jpg",
        "alt": "string"
      }
    }
  },
  "meta": {}
}

All bookings

GET/holidaze/bookings

Retrieve all bookings.

If you want to get all bookings by a specific profile, you can use the bookings by profile endpoint.

Response
{
  "data": [
    {
      "id": "string",
      "dateFrom": "string",
      "dateTo": "string",
      "guests": 0,
      "created": "string",
      "updated": "string"
    },
    {
      "id": "string",
      "dateFrom": "string",
      "dateTo": "string",
      "guests": 0,
      "created": "string",
      "updated": "string"
    }
    // ...
  ],
  "meta": {
    "isFirstPage": true,
    "isLastPage": true,
    "currentPage": 1,
    "previousPage": null,
    "nextPage": null,
    "pageCount": 1,
    "totalCount": 2
  }
}

Single booking

GET/holidaze/bookings/<id>

Retrieve a single booking based on its id.

Response
{
  "data": {
    "id": "string",
    "dateFrom": "string",
    "dateTo": "string",
    "guests": 0,
    "created": "string",
    "updated": "string"
  },
  "meta": {}
}

Create booking

POST/holidaze/bookings

Create a new booking.

Request
{
  "dateFrom": "string", // Required - Instance of new Date()
  "dateTo": "string", // Required - Instance of new Date()
  "guests": 0, // Required
  "venueId": "string" // Required - The id of the venue to book
}
Response
{
  "data": {
    "id": "string",
    "dateFrom": "string",
    "dateTo": "string",
    "guests": 0,
    "created": "string",
    "updated": "string"
  },
  "meta": {}
}

Update booking

PUT/holidaze/bookings/<id>

Updating a booking.

Request
{
  "dateFrom": "string", // Optional - Instance of new Date()
  "dateTo": "string", // Optional - Instance of new Date()
  "guests": 0 // Optional
}
Response
{
  "data": {
    "id": "string",
    "dateFrom": "string",
    "dateTo": "string",
    "guests": 0,
    "created": "string",
    "updated": "string"
  },
  "meta": {}
}

Delete booking

DELETE/holidaze/bookings/<id>

Delete a booking based on its id.

Returns an empty 204 No Content response on success.