# 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 | Key | Type | Mandatory | Description | | --- | --- | --- | --- | | id | String | Yes | Unique identifier for the Company. | | name | String | Yes | Name of the Company. | | legalName | String | No | Legal name of the Company. | | address | String | No | Full address of the Company. | | postalCode | String | No | Postal code of the Company's address. | | city | String | No | City where the Company is located. | | countryCode | String | Yes | Country code in [ISO2](https://en.wikipedia.org/wiki/ISO_4217) format. | | description | String | No | Description of the Company. | | minAdvanceBooking | Integer | No | Minimum time (in seconds) before a booking can be made relative to the start of the availability slot. | | minAdvanceBookingCancelling | Integer | No | Minimum advance notice (in seconds) required to cancel a booking. | | fbInstallLink | String | Yes | URL to install the Meta Business Extension for Facebook and Instagram. | | includeSourceInNotes | Boolean | No | Include 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: ```shell curl --location 'https://api-sandbox.mozrest.com/v1/rms/company' --header 'Authorization: Bearer adcce721fdf62d1e32ce2ab2d4d0d38ceee5cbcafee40043ae0488922c3d6bd1443ab9b7aafb0472' ``` #### Example Response: ```json { "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 | Parameter | Status | Description | | --- | --- | --- | | companyId | **Mandatory** | Id of the Company to retrieve | #### Example Request: ```shell curl --location 'https://api-sandbox.mozrest.com/v1/rms/company/{companyId}' --header 'Authorization: Bearer adcce721fdf62d1e32ce2ab2d4d0d38ceee5cbcafee40043ae0488922c3d6bd1443ab9b7aafb0472' ``` #### Example Response: ```json { "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 | Parameter | Status | Description | | --- | --- | --- | | name | **Mandatory** | Company's name. | | legalName | **Optional** | Company's legal name. | | address | **Optional** | Company's address. | | postalCode | **Optional** | Company's postal code. | | city | **Mandatory** | Company's city. | | countryCode | **Mandatory** | Company's country code (ISO format). | | description | **Optional** | Company's description. | | minAdvanceBooking | **Optional** | The duration (in seconds) from when the last booking can be made to the start of the availability slot. | | minAdvanceBookingCancelling | **Optional** | The minimum advance notice in seconds required to cancel a booking. | | includeSourceInNotes | **Optional** | Include the origin of the booking in the booking notes. `ie: *Tripadvisor* booking` | #### Example Request: ```shell 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: ```json { "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 | Parameter | Status | Description | | --- | --- | --- | | companyId | **Mandatory** | Id of the Company to update | #### Body Parameters | Parameter | Status | Description | | --- | --- | --- | | name | **Optional** | Company's name. | | legalName | **Optional** | Company's legal name. | | address | **Optional** | Company's address. | | postalCode | **Optional** | Company's postal code. | | city | **Optional** | Company's city. | | countryCode | **Optional** | Company's country code (ISO format). | | description | **Optional** | Company's description. | | minAdvanceBooking | **Optional** | The duration (in seconds) from when the last booking can be made to the start of the availability slot. | | minAdvanceBookingCancelling | **Optional** | The minimum advance notice in seconds required to cancel a booking. | | includeSourceInNotes | **Optional** | Include the origin of the booking in the booking notes. |