Skip to content
Last updated

Companies

A Company is a legal entity that owns one or more Venues and Brands.

When you create a Venue without specifying a Company, a new Company is automatically generated using the Venue's details. However, if you plan to create multiple Venues under the same Company, you should create the Company first, then link each Venue to it.

This is specially useful when using the Meta Booking Channels (Facebook and Instagram) because will allow the Company to install a Reserve Button if they have one Facebook page or Instagram Profile for the company, allowing to use a Booking Widget with a Venue selector.

Object Definition

KeyTypeMandatoryDescription
idStringYesUnique identifier for the Company.
nameStringYesName of the Company.
legalNameStringNoLegal name of the Company.
addressStringNoFull address of the Company.
postalCodeStringNoPostal code of the Company's address.
cityStringNoCity where the Company is located.
countryCodeStringYesCountry code in ISO2 format.
descriptionStringNoDescription of the Company.
minAdvanceBookingIntegerNoMinimum time (in seconds) before a booking can be made relative to the start of the availability slot.
minAdvanceBookingCancellingIntegerNoMinimum advance notice (in seconds) required to cancel a booking.
fbInstallLinkStringYesURL to install the Meta Business Extension for Facebook and Instagram.
includeSourceInNotesBooleanNoInclude the origin of the booking in the booking notes. Default: true

Get Available Companies

This endpoint retrieves a list of Companies.

Endpoint

GET https://api-sandbox.mozrest.com/v1/rms/company

Example Request:

curl --location 'https://api-sandbox.mozrest.com/v1/rms/company' --header 'Authorization: Bearer adcce721fdf62d1e32ce2ab2d4d0d38ceee5cbcafee40043ae0488922c3d6bd1443ab9b7aafb0472'

Example Response:

{
   "total": 10,
   "data": [
      {
         "id": "6400e7bd72a4c82d20561517",
         "name": "Proident",
         "legalName": "Proident Ltd",
         "address": "29 Corringham Road",
         "postalCode": "HA9 9PX",
         "city": "Wembley",
         "countryCode": "GB",
         "description": "Mozrest Demo Company",
         "minAdvanceBooking": 3600,
         "minAdvanceBookingCancelling": 3600,
         "includeSourceInNotes": true,
         "sdkKey": "02C9846B4E1F43B1B3D747FFC0AC992C",
         "fbInstallLink": "https://facebook.com/dialog/oauth?client_id=1181690592254979..."
      }
   ]
}

Get a Specific Company

This endpoint retrieves a specific Company.

Endpoint

GET https://api-sandbox.mozrest.com/v1/rms/company/{companyId}

Query Parameters

ParameterStatusDescription
companyIdMandatoryId of the Company to retrieve

Example Request:

curl --location 'https://api-sandbox.mozrest.com/v1/rms/company/{companyId}' --header 'Authorization: Bearer adcce721fdf62d1e32ce2ab2d4d0d38ceee5cbcafee40043ae0488922c3d6bd1443ab9b7aafb0472'

Example Response:

{
   "id": "6400e7bd72a4c82d20561517",
   "name": "Proident",
   "legalName": "Proident Ltd",
   "address": "29 Corringham Road",
   "postalCode": "HA9 9PX",
   "city": "Wembley",
   "countryCode": "GB",
   "description": "Mozrest Demo Company",
   "minAdvanceBooking": 3600,
   "minAdvanceBookingCancelling": 3600,
   "includeSourceInNotes": true,
   "sdkKey": "02C9846B4E1F43B1B3D747FFC0AC992C",
   "fbInstallLink": "https://facebook.com/dialog/oauth?client_id=1181690592254979..."
}

Create a Company

This endpoint allows you to create a Company.

Endpoint

POST https://api-sandbox.mozrest.com/v1/rms/company

Body Parameters

ParameterStatusDescription
nameMandatoryCompany's name.
legalNameOptionalCompany's legal name.
addressOptionalCompany's address.
postalCodeOptionalCompany's postal code.
cityMandatoryCompany's city.
countryCodeMandatoryCompany's country code (ISO format).
descriptionOptionalCompany's description.
minAdvanceBookingOptionalThe duration (in seconds) from when the last booking can be made to the start of the availability slot.
minAdvanceBookingCancellingOptionalThe minimum advance notice in seconds required to cancel a booking.
includeSourceInNotesOptionalInclude the origin of the booking in the booking notes. ie: *Tripadvisor* booking

Example Request:

curl --location 'https://api-sandbox.mozrest.com/v1/rms/company' --header 'Authorization: Bearer adcce721fdf62d1e32ce2ab2d4d0d38ceee5cbcafee40043ae0488922c3d6bd1443ab9b7aafb0472' --header 'Content-Type: application/json' --data '{
    "name": "Proident",
    "legalName": "Proident Ltd",
    "address": "29 Corringham Road",
    "postalCode": "HA9 9PX",
    "city": "Wembley",
    "countryCode": "GB",
    "description": "Mozrest Demo Company",
    "minAdvanceBooking": 3600,
    "minAdvanceBookingCancelling": 3600,
    "includeSourceInNotes": true
}'

Example Response:

{
   "id": "6400e7bd72a4c82d20561517",
   "name": "Proident",
   "legalName": "Proident Ltd",
   "address": "29 Corringham Road",
   "postalCode": "HA9 9PX",
   "city": "Wembley",
   "countryCode": "GB",
   "description": "Mozrest Demo Company",
   "minAdvanceBooking": 3600,
   "minAdvanceBookingCancelling": 3600,
   "includeSourceInNotes": true,
   "fbInstallLink": "https://facebook.com/dialog/oauth?client_id=1181690592254979..."
}

Update Company

This endpoint allows you to update a Company.

Endpoint

PUT https://api-sandbox.mozrest.com/v1/rms/company/{companyId}

Query Parameters

ParameterStatusDescription
companyIdMandatoryId of the Company to update

Body Parameters

ParameterStatusDescription
nameOptionalCompany's name.
legalNameOptionalCompany's legal name.
addressOptionalCompany's address.
postalCodeOptionalCompany's postal code.
cityOptionalCompany's city.
countryCodeOptionalCompany's country code (ISO format).
descriptionOptionalCompany's description.
minAdvanceBookingOptionalThe duration (in seconds) from when the last booking can be made to the start of the availability slot.
minAdvanceBookingCancellingOptionalThe minimum advance notice in seconds required to cancel a booking.
includeSourceInNotesOptionalInclude the origin of the booking in the booking notes.