v1

latestOpenAPI 3.0.02026-07-24161215397.4 KB
Bookings

Validate a booking.

Validates a booking and returns a result stating if the booking is valid and any charges, fees, or credits that are going to be used.

Required scopes: flex.space.bookings.validate

post/api/v2/organizations/{orgSlug}/bookings/validate

Path parameters

orgSlugstring required

organization slug

Request body

_idstring

The _id of the existing booking which you'd like to edit. This parameter is used only when validating changes to existing bookings.

resourcestring required

The _id of the resource for which the booking is going to be created.

startstring required

Contains the start date of the booking.

endstring required

Contains the end date of the booking.

memberstring

Contains the _id of the member associated with the booking summary request.

companystring

Contains the _id of the team associated with the booking summary request.

editFromstring

The date from which the booking occurrences are going to be edited. If no value is provided, the start date of the booking is used.

Example request

{
  "_id": "603dfbc260f4054084125d30",
  "resource": "603dfbc260f4054084125d36",
  "start": "2024-10-31T13:00:00.000Z",
  "end": "2024-10-31T13:00:00.000Z",
  "member": "603dfbc260f4054084125d36",
  "company": "603dfbc260f4054084125d36",
  "editFrom": "2024-10-31T13:00:00.000Z"
}

Response

propertiesobject

An object that contains all custom properties that can be applied to the item.

_idstring

The _id of the booking.

timezonestring

The timezone of the booking.

startstring

The start date of the booking.

endstring

The end date of the booking.

seriesStartstring

The start date of the series or standalone booking. For recurring bookings, this refers to the start of the entire series

seriesEndstring

The end date of the series or standalone booking. For recurring bookings, this refers to the end of the last occurrence.

locationstring

The _id of the location of booking.

companystring

Reference to the company.

memberstring

Reference to the member.

resourcestring

Reference to the booked resource.

referencestring

The reference id of the booking.

isCancelledboolean

Whether the booking got canceled or not.

titlestring

Booking title/summary.

ratestring

Reference to the resource rate used for the booking.

descriptionstring

Long description of the booking.

isTentativeboolean

True if the booking is not confirmed. Tentative bookings are not charged.

isFreeboolean

True if the booking is marked as free. If create a booking marked as free, no fees will be added for it.

isAccountedboolean

True if the booking is marked as accounted.

extrasobject[]

Extras that are added to the booking.

visitorsstring[]

An array containg a list of all the ids of external visitors associated with the booking.

membersstring[]

An array containing a list of all the _ids of teammates associated with the booking. This is possible if the member associated with the booking is part of a company - these company members can be added here.

sourcestring

Shows where the booking was created

createdAtstring

The date when the booking has been created.

createdBystring

The user that created the booking.

modifiedAtstring

The date of the last update of the booking.

modifiedBystring

The user that did the last modification to the booking. If no update is made this field will match the createdBy field.

Example response

{
  "properties": {
    "customProperty1": "value1",
    "customProperty2": "value2"
  },
  "_id": "603dfbc260f4054084125d39",
  "timezone": "Europe/London",
  "start": "2024-10-31T13:00:00.000Z",
  "end": "2024-10-31T13:30:00.000Z",
  "recurrence": {
    "rrule": "FREQ=WEEKLY;BYDAY=MO,WE,FR;COUNT=10",
    "exdates": [
      "2024-10-31T13:00:00.000Z"
    ]
  },
  "seriesStart": "2024-10-31T13:00:00.000Z",
  "seriesEnd": "2024-10-31T13:30:00.000Z",
  "location": "603dfbc260f4054084125d39",
  "company": "603dfbc260f4054084125d39",
  "member": "603dfbc260f4054084125d39",
  "resource": "603dfbc260f4054084125d39",
  "fees": [
    {
      "date": "2017-10-31T00:00:00.000Z",
      "extraFees": [],
      "credits": [
        {
          "count": 2,
          "credit": "594932ea518f3f150d306c89"
        }
      ],
      "customPrice": 100
    }
  ],
  "reference": "81LCV6S",
  "title": "Meeting with John",
  "rate": "603dfbc260f4054084125d39",
  "description": "Meeting with John at the office.",
  "isTentative": true,
  "extras": [
    {
      "_id": "603dfbc260f4054084125d39",
      "count": 2
    }
  ],
  "visitors": [
    "603dfbc260f4054084125d36",
    "603dfbc260f4054084125d37"
  ],
  "members": [
    "603dfbc260f4054084125d36",
    "603dfbc260f4054084125d37"
  ],
  "serviceSlots": {
    "before": 10,
    "after": 10
  },
  "source": "admin",
  "createdAt": "2022-02-07T10:03:33.169Z",
  "createdBy": "5bbb155174321f100085eac1",
  "modifiedAt": "2022-02-08T10:03:33.169Z",
  "modifiedBy": "5bbb155174321f100085eac1"
}