### Pagination Example Source: https://documenter.getpostman.com/view/3308304/SzzehLGp?version=latest#intro Example of how to use skip and limit query parameters for pagination. ```APIDOC ## Pagination ### Description Some list endpoints support pagination using skip and limit query variables. ### Query Parameters - **skip** (integer) - Optional - Defines the number of records to skip in the result. Defaults to 0. - **limit** (integer) - Optional - Defines the number of records to return. Defaults to 100. Maximum is 100. ### Example To get 10 records at a time, getting records from 20 to 30: `/bookings?skip=20&limit=10` ``` -------------------------------- ### Authentication Example Source: https://documenter.getpostman.com/view/3308304/SzzehLGp?version=latest#intro Example of how to authenticate requests using an API key with HTTP Basic Auth. ```APIDOC ## Authentication ### Description API key authentication is done by providing one of your private API keys in the request. ### Method All requests require authentication. ### Endpoint All API endpoints. ### Request Headers - **Authorization** (string) - Required - The API key base64 encoded with a trailing colon. Example for a private key `aIcCpRKQqKPg9zVL0a7-RJt2_zx8jPq8jR20XWp_pZN`: `Authorization: Basic YUljQ3BSS1FxS1BnOXpWTDBhNy1SSnQyX3p4OGpQcThqUjIwWFdwX3BaTjo=` ``` -------------------------------- ### Example Response for Getting a Booking Source: https://documenter.getpostman.com/view/3308304/SzzehLGp?version=latest#afd2438f-749e-4440-8b32-d4cdb3dd6925 This JSON object represents a single booking retrieved by its ID. It includes all details about the reservation, guest, and associated restaurant. ```json { "_id": "sBaiAnt8QmFPahpjy", "date": "2020-06-02", "time": "19:00", "dateTime": "2020-06-02T17:00:00.000Z", "people": 2, "tables": [ { "_id": "65LfSehi5M6auMhiA", "name": "103", "seatsMin": 1, "seatsMax": 3, "internalNote": "", "area": { "_id": "ALmEi4S8fbK3wchpH", "name": "Restaurant", "internalNote": "" } } ], "duration": 105, "status": "canceled", "source": "phone", "languageCode": "en", "endDateTime": "2020-06-02T18:45:00.000Z", "internalId": "d87705e4-9d48-4954-8224-71e427238dc4", "restaurantId": "ELxwGTxds3TjniePe", "createdBy": "nKJnWZRHi6gDTa7Zf", "createdAt": "2020-06-02T08:20:24.765Z", "sendNotification": true, "updatedAt": "2020-06-02T09:22:42.673Z", "updatedBy": "nKJnWZRHi6gDTa7Zf", "activityAt": "2020-06-10T11:52:02.684Z", "guest": { "name": "Bob", "phone": "+", "email": "", "notificationSms": false, "notificationEmail": false }, "restaurant": { "name": "Eatie Plus (Test)", "address": { "address1": "Strandlodsvej 44, 3.", "address2": "", "address3": "", "city": "København S", "postalCode": 2300, "countryCode": "DK", "country": "Denmark" }, "email": "mlj@eatie.dk", "phone": "+4591531400", "slug": "eatie-plus-test-amager" } } ``` -------------------------------- ### Pagination Example Source: https://documenter.getpostman.com/view/3308304/SzzehLGp?version=latest#c08b5ef8-0b4c-4cee-a8e6-0817cbea1f45 Illustrates how to use skip and limit query parameters for paginating list endpoints. This example retrieves 10 records, skipping the first 20. ```url /bookings?skip=20&limit=10 ``` -------------------------------- ### Example Response for Listing Bookings Source: https://documenter.getpostman.com/view/3308304/SzzehLGp?version=latest#afd2438f-749e-4440-8b32-d4cdb3dd6925 This is an example of a successful response when listing bookings. It returns an array of booking objects, each containing detailed information. ```json [ { "_id": "jTW8s9PvK2FMaQP3Y", "restaurantId": "gd2cZJZuP3SZPknAX", "date": "2021-02-25", "time": "11:45", "people": 2, "guest": { "name": "Morpheus", "email": "neo@resos.com", "phone": "+4500000000", "notificationEmail": true, "notificationSms": false }, "languageCode": "en", "status": "approved", "openingHourId": "PXDCXmgg2XyfRC4AT", "referrer": "", "source": "website", "dateTime": "2021-02-25T10:45:00.000+0000", "createdAt": "2021-02-25T10:24:26.187+0000", "activityAt": "2021-02-25T10:24:26.187+0000", "sendNotification": true, "seenByRestaurant": false, "restaurant": { "name": "1 2", "address": { "countryCode": "DK", "country": "Denmark", "address1": "1", "address2": "1", "city": "11", "postalCode": 2000 }, "slug": "1-2-frederiksberg", "email": "neo@resos.com", "phone": "+4500000000", "languageCode": "en" }, "duration": 120, "endDateTime": "2021-02-25T12:45:00.000+0000", "tables": [ { "_id": "spekLuDbQY6X3ZnS8", "name": "bord 2", "seatsMin": 1, "seatsMax": 5, "area": { "_id": "gEwNJnuubXprz2i3B", "name": "d", "internalNote": "", "bookingPriority": 5 } } ] } ] ``` -------------------------------- ### Example API Key for Base64 Encoding Source: https://documenter.getpostman.com/view/3308304/SzzehLGp?version=latest#afd2438f-749e-4440-8b32-d4cdb3dd6925 An example of a private API key that can be used for testing base64 encoding. ```text aIcCpRKQqKPg9zVL0a7-RJt2_zx8jPq8jR20XWp_pZN ``` -------------------------------- ### Example Base64 Encoded Key Source: https://documenter.getpostman.com/view/3308304/SzzehLGp?version=latest#afd2438f-749e-4440-8b32-d4cdb3dd6925 The result of base64 encoding the example API key with a trailing colon, used in the Authorization header. ```text YUljQ3BSS1FxS1BnOXpWTDBhNy1SSnQyX3p4OGpQcThqUjIwWFdwX3BaTjo= ``` -------------------------------- ### Example Custom Field Response Source: https://documenter.getpostman.com/view/3308304/SzzehLGp?version=latest#c08b5ef8-0b4c-4cee-a8e6-0817cbea1f45 This is a sample JSON response body for a successful request to get a custom field. It includes details such as the field's ID, name, type, and configuration. ```json { "_id": "tqZhoWtva48cKPLkE", "name": "Internal name text field", "type": "string", "isRequired": true, "defaultOnAllOpeningHours": true, "showAsBadge": true, "restaurantId": "7rXSfhxHfLD5AYDD9", "createdAt": "2025-03-07T11:11:35.735Z", "activeFlows": [ "booking" ], "createdBy": "33P5EPKycx5tTkTLz", "badgeColor": "yellow", "label": "Label text field", "helptext": "This is a label for a text field", "multipleChoiceSelections": [ { "_id": "WPx2pMgA2Tz7WvEj6", "name": "" } ], "sortIndex": 0 } ``` -------------------------------- ### Update Booking with Full Details Source: https://documenter.getpostman.com/view/3308304/SzzehLGp?version=latest#auth-info-938f6793-7f93-44c5-b082-c88924d28041 This example shows a complete request body for updating a booking, including guest information, metadata, and status. Note that `date` and `time` should be in the local timezone, while `dateTime` should be in UTC. ```json { "dateTime": "2024-06-04 14:00", "people": 2, "duration": 120, "guest": { "name": "A. Anderson", "email": "neo@resos.com", "phone": "+000000000" }, "metadata":{"metadata1":1}, "status": "approved", "source": "website", "referrer": "https://www.some-website.com" } ``` -------------------------------- ### Customer Data Response Source: https://documenter.getpostman.com/view/3308304/SzzehLGp?version=latest#c08b5ef8-0b4c-4cee-a8e6-0817cbea1f45 Example JSON response when listing customers, showing customer details like ID, name, and emails. ```json [ { "_id": "b141131616-e418c1-41a0e-b230ac-04a42d064b24c", "restaurantId": "PT4Mphga312zdoTwH6eJ", "name": "Neo Matrix", "emails": [ "neo@matrix.com" ] }, { "_id": "b141211616-e84c1-4a01e-b0ac-0a2342d064b24c", "restaurantId": "PT4Mphga312zdoTwH6eJ", "name": "Matrix Neo", "emails": [ "neo@matrix.com" ] } ] ``` -------------------------------- ### Single Customer Data Response Source: https://documenter.getpostman.com/view/3308304/SzzehLGp?version=latest#c08b5ef8-0b4c-4cee-a8e6-0817cbea1f45 Example JSON response for a single customer, detailing their information. ```json { "_id": "b141131616-e418c1-41a0e-b230ac-04a42d064b24c", "restaurantId": "PT4Mphga312zdoTwH6eJ", "name": "Neo Matrix", "emails": [ "neo@matrix.com" ] } ``` -------------------------------- ### Get Customer Source: https://documenter.getpostman.com/view/3308304/SzzehLGp?version=latest#auth-info-938f6793-7f93-44c5-b082-c88924d28041 Retrieves details for a specific customer using their ID. Supports basic authentication. ```APIDOC ## GET /v1/customers/{id} ### Description Retrieves a specific customer's details by their ID. Requires Basic Authentication. ### Method GET ### Endpoint https://api.resos.com/v1/customers/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the customer to retrieve. ### Request Example ```bash curl --location 'https://api.resos.com/v1/customers/b141211616-e84c1-4a01e-b0ac-0a2342d064b24c' ``` ### Response #### Success Response (200) - **body** (object) - The customer object. - **_id** (string) - The unique identifier for the customer. - **restaurantId** (string) - The ID of the restaurant associated with the customer. - **name** (string) - The name of the customer. - **emails** (array) - An array of email addresses for the customer. #### Response Example ```json { "_id": "b141131616-e418c1-41a0e-b230ac-04a42d064b24c", "restaurantId": "PT4Mphga312zdoTwH6eJ", "name": "Neo Matrix", "emails": [ "neo@matrix.com" ] } ``` ``` -------------------------------- ### Get customer Source: https://documenter.getpostman.com/view/3308304/SzzehLGp?version=latest#c08b5ef8-0b4c-4cee-a8e6-0817cbea1f45 Retrieves a specific customer by their unique ID. ```APIDOC ## GET /v1/customers/{id} ### Description Retrieves a specific customer using their unique identifier. ### Method GET ### Endpoint https://api.resos.com/v1/customers/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the customer. ### Request Example ```curl curl --location 'https://api.resos.com/v1/customers/b141211616-e84c1-4a01e-b0ac-0a2342d064b24c' ``` ### Response #### Success Response (200) - **_id** (string) - Unique identifier for the customer. - **restaurantId** (string) - Identifier for the associated restaurant. - **name** (string) - The name of the customer. - **emails** (array of strings) - A list of email addresses for the customer. #### Response Example ```json { "_id": "b141131616-e418c1-41a0e-b230ac-04a42d064b24c", "restaurantId": "PT4Mphga312zdoTwH6eJ", "name": "Neo Matrix", "emails": [ "neo@matrix.com" ] } ``` ``` -------------------------------- ### Example Custom Fields Response Source: https://documenter.getpostman.com/view/3308304/SzzehLGp?version=latest#c08b5ef8-0b4c-4cee-a8e6-0817cbea1f45 This JSON structure represents the response when fetching custom fields. It includes details like field ID, name, type, and configuration options. ```json [ { "_id": "tqZhoWtva48cKPLkE", "name": "Internal name text field", "type": "string", "isRequired": true, "defaultOnAllOpeningHours": true, "showAsBadge": true, "restaurantId": "7rXSfhxHfLD5AYDD9", "createdAt": "2025-03-07T11:11:35.735Z", "activeFlows": [ "booking" ], "createdBy": "33P5EPKycx5tTkTLz", "badgeColor": "yellow", "label": "Label text field", "helptext": "This is a label for a text field", "multipleChoiceSelections": [ { "_id": "WPx2pMgA2Tz7WvEj6", "name": "" } ], "sortIndex": 0 }, { "_id": "wMWTRFQeZgdoDoKvX", "name": "Internal name number field", "type": "number", "isRequired": true, "defaultOnAllOpeningHours": false, "showAsBadge": true, "restaurantId": "7rXSfhxHfLD5AYDD9", "createdAt": "2025-03-07T11:12:07.587Z", "activeFlows": [ "booking" ], "createdBy": "33P5EPKycx5tTkTLz", "badgeColor": "purple", "label": "Label number field", "helptext": "This is a label for a number field", "multipleChoiceSelections": [ { "_id": "bozNeET6m8PKfxr6Y", "name": "" } ], "sortIndex": 1 }, { "_id": "7A6MEXJXKvwKiHQQC", "name": "Internal name multiple choice checkboxes", "type": "checkbox", "isRequired": false, "defaultOnAllOpeningHours": false, "showAsBadge": true, "restaurantId": "7rXSfhxHfLD5AYDD9", "createdAt": "2025-03-07T11:12:51.350Z", "activeFlows": [ "booking" ], "createdBy": "33P5EPKycx5tTkTLz", "badgeColor": "black", "label": "Label for multiple choice checkboxes", "helptext": "Help text for multiple choice", "multipleChoiceSelections": [ { "_id": "JEL35LoHBN7hosrhv", "name": "Option 1" }, { "_id": "yGXwWH8JyAXeQg8uw", "name": "Option 2" }, { "_id": "2Xo6qRgXcnxsfwWHr", "name": "Option 3" } ], "sortIndex": 2 }, { "_id": "Bzeb7ErdBAJuLWZQ5", "name": "Internal name single choice radio ", "type": "radio", "isRequired": false, "defaultOnAllOpeningHours": false, "showAsBadge": true, "restaurantId": "7rXSfhxHfLD5AYDD9", "createdAt": "2025-03-07T11:13:39.657Z", "activeFlows": [ "booking" ], "createdBy": "33P5EPKycx5tTkTLz", "badgeColor": "turquoise", "label": "Label single choice radio buttons", "helptext": "Help text for single choice radio buttons", "multipleChoiceSelections": [ { "_id": "sH8EHEbH9PZxLnAsd", "name": "Radio 1" }, { "_id": "2RP8NbfoNXpL3w4Pu", "name": "Radio 2" }, { "_id": "iSDmDNr56zHPMiueP", "name": "Radio 3" } ], "sortIndex": 3 }, { "_id": "eGozPT7oKkds8Xgmo", "name": "Internal name dropdown options", "type": "selector", "isRequired": true, "defaultOnAllOpeningHours": true, "showAsBadge": true, "restaurantId": "7rXSfhxHfLD5AYDD9", "createdAt": "2025-03-07T11:14:12.638Z", "activeFlows": [ "booking" ], "createdBy": "33P5EPKycx5tTkTLz", "badgeColor": "yellow", "label": "Label dropdown options", "helptext": "Help text for dropdown options", "multipleChoiceSelections": [ { "_id": "MvwKK2SuPDW47S3pv", "name": "Dropdown 1" }, { "_id": "hDTYK8rZwk2KPYSqA", "name": "Dropdown 2" }, { "_id": "F2ENkg4Y7G6cKvejD", "name": "Dropdown 3" } ], "sortIndex": 4 } ] ``` -------------------------------- ### Get booking Source: https://documenter.getpostman.com/view/3308304/SzzehLGp?version=latest#afd2438f-749e-4440-8b32-d4cdb3dd6925 Retrieves details for a specific booking using its unique identifier. ```APIDOC ## GET /v1/bookings/{id} ### Description Retrieves the details of a specific booking by its ID. ### Method GET ### Endpoint https://api.resos.com/v1/bookings/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the booking. ### Request Example ```bash curl --location 'https://api.resos.com/v1/bookings/sBaiAnt8QmFPahpjy' ``` ### Response #### Success Response (200) - **_id** (string) - Unique identifier for the booking. - **date** (string) - Date of the booking. - **time** (string) - Time of the booking. - **dateTime** (string) - Full date and time of the booking. - **people** (integer) - Number of people for the booking. - **tables** (array) - List of tables assigned to the booking. - **duration** (integer) - Duration of the booking in minutes. - **status** (string) - Status of the booking. - **source** (string) - Source of the booking. - **languageCode** (string) - Language code for the booking. - **endDateTime** (string) - Full date and time when the booking ends. - **internalId** (string) - Internal identifier for the booking. - **restaurantId** (string) - Identifier for the restaurant. - **createdBy** (string) - Identifier of the user who created the booking. - **createdAt** (string) - Timestamp when the booking was created. - **sendNotification** (boolean) - Whether notifications are sent. - **updatedAt** (string) - Timestamp when the booking was last updated. - **updatedBy** (string) - Identifier of the user who last updated the booking. - **activityAt** (string) - Timestamp of the last activity on the booking. - **guest** (object) - Information about the guest. - **restaurant** (object) - Details of the restaurant. #### Response Example ```json { "_id": "sBaiAnt8QmFPahpjy", "date": "2020-06-02", "time": "19:00", "dateTime": "2020-06-02T17:00:00.000Z", "people": 2, "tables": [ { "_id": "65LfSehi5M6auMhiA", "name": "103", "seatsMin": 1, "seatsMax": 3, "internalNote": "", "area": { "_id": "ALmEi4S8fbK3wchpH", "name": "Restaurant", "internalNote": "" } } ], "duration": 105, "status": "canceled", "source": "phone", "languageCode": "en", "endDateTime": "2020-06-02T18:45:00.000Z", "internalId": "d87705e4-9d48-4954-8224-71e427238dc4", "restaurantId": "ELxwGTxds3TjniePe", "createdBy": "nKJnWZRHi6gDTa7Zf", "createdAt": "2020-06-02T08:20:24.765Z", "sendNotification": true, "updatedAt": "2020-06-02T09:22:42.673Z", "updatedBy": "nKJnWZRHi6gDTa7Zf", "activityAt": "2020-06-10T11:52:02.684Z", "guest": { "name": "Bob", "phone": "+", "email": "", "notificationSms": false, "notificationEmail": false }, "restaurant": { "name": "Eatie Plus (Test)", "address": { "address1": "Strandlodsvej 44, 3.", "address2": "", "address3": "", "city": "København S", "postalCode": 2300, "countryCode": "DK", "country": "Denmark" }, "email": "mlj@eatie.dk", "phone": "+4591531400", "slug": "eatie-plus-test-amager" } } ``` ``` -------------------------------- ### Booking Object Fields Source: https://documenter.getpostman.com/view/3308304/SzzehLGp?version=latest#afd2438f-749e-4440-8b32-d4cdb3dd6925 This section details the fields available within the booking object, their data types, whether they are required, and provides example values and specific formatting requirements. ```APIDOC ## Booking Object Fields This section details the fields available within the booking object, their data types, whether they are required, and provides example values and specific formatting requirements. ### Fields Key | Value | Example | Required | Format ---|---|---|---|--- date | String | "2021-09-18" | Required | YYYY-MM-DD time | String | "21:00" | Required | HH:mm people | Integer | 4 | Required | Amount of people assigned for booking. duration | Integer | 120 | Required | In minutes status | String | "request" | Optional | One of: "request", "declined", "approved", "arrived", "seated", "left", "no_show", "canceled", "waitlist". Default: "request". tables | Array | | Optional | Contains an array of IDs of the tables allocated for the booking. metadata | Object | {"key": "value"} | Optional | Contains any arbitrary metadata. Max length is 2000 characters. comments | Array | | Optional | Contains all comments made on the booking. guest | Object | | Required | Object with customer data (listed below) guest.name | String | "Thomas A. Anderson" | Required | guest.email | String | "neo@resos.com" | Optional | guest.phone | String | "+13115552368" | Optional | Including countrycode with "+" prefix and then numbers only guest.notificationSms | Boolean | false | Optional | True if customer should get booking confirmation and updates via SMS text messsages on the phone number defined above. Default: false. guest.notificationEmail | Boolean | false | Optional | True if customer should get booking confirmation and updates via E-mail on the e-mail address defined above. Default: false. source | String | "website" | Optional | One of: "api", "email", "facebook", "google", "import", "instagram", "message", "other", "phone", "walkin", "website". Default: "other" openingHourId | String | | Required | ID of the opening hour the booking is set for. createdAt | DateTime | "2021-02-25T11:54:09.823+0000" | Required | Time and date the booking was created at. activityAt | DateTime | "2021-02-25T11:54:09.823+0000" | Required | Time and date the booking was last updated at. sendNotification | Boolean | True | Required | If this booking should raise a notification for the restaurant. payment | Object | | Optional | Contains payment information if the booking has prepayment or no-show fee enabled. comment | String | "No peanuts, thanks" | Optional | Comment written by guest. Visible to both the guest and the restaurant. note | String | "Remember not peanuts!" | Optional | Internal note only visible to the restaurant. noteAuthor | String | "Morpheus" | Optional | Name of the author of the internal note. Default: "API" referrer | String | "example.com" | Optional | URL of website that referred the booking languageCode | String | "en" | Optional | Language code that booking notification, booking status page etc. sent to the guest should be in. One of: "en", "es", "de", "da", "sv". Default: "en" ``` -------------------------------- ### Get Specific Customer by ID Source: https://documenter.getpostman.com/view/3308304/SzzehLGp?version=latest#c08b5ef8-0b4c-4cee-a8e6-0817cbea1f45 Retrieves details for a specific customer using their unique ID. The request uses Basic Authentication. ```curl curl --location 'https://api.resos.com/v1/customers/b141211616-e84c1-4a01e-b0ac-0a2342d064b24c' ``` -------------------------------- ### POST Create booking Source: https://documenter.getpostman.com/view/3308304/SzzehLGp?version=latest#auth-info-938f6793-7f93-44c5-b082-c88924d28041 Creates a new booking. Supports passing tables by an array of IDs or an area ID. If no available tables are found with the specified area, an error will be returned. You can also specify which opening hour the booking should belong to. If not specified, our system will automatically add it. In case of overlapping opening hours, it will attempt to find the best fitting one. Bookings with the DateTime field must be in UTC format. If adding as separate date and time fields, these must be in the restaurants' local timezone. Supports the waitlist feature by setting the `status` field to `waitlist`. Supports custom fields if enabled for the restaurant. ```APIDOC ## POST /v1/bookings ### Description Creates a new booking with specified details. ### Method POST ### Endpoint https://api.resos.com/v1/bookings ### Parameters #### Request Body - **date** (string) - Required - The date of the booking (UTC or local timezone depending on usage). - **time** (string) - Required - The time of the booking (UTC or local timezone depending on usage). - **people** (integer) - Required - The number of people for the booking. - **duration** (integer) - Optional - The duration of the booking in minutes. - **openingHourId** (string) - Optional - The ID of the specific opening hour for the booking. - **tables** (array of strings) - Optional - An array of table IDs to reserve. - **areaId** (string) - Optional - The ID of the area to book a table in. - **metadata** (object) - Optional - Custom metadata for the booking. - **guest** (object) - Required - Guest information. - **name** (string) - Required - Guest's full name. - **email** (string) - Required - Guest's email address. - **phone** (string) - Required - Guest's phone number. - **notificationSms** (boolean) - Optional - Whether to send SMS notifications. - **notificationEmail** (boolean) - Optional - Whether to send email notifications. - **status** (string) - Optional - The status of the booking (e.g., "request", "waitlist"). - **source** (string) - Optional - The source of the booking (e.g., "website"). - **comment** (string) - Optional - A comment from the guest. - **note** (string) - Optional - An internal note for the restaurant. - **noteAuthor** (string) - Optional - The author of the internal note. - **referrer** (string) - Optional - The referrer URL. - **languageCode** (string) - Optional - The language code for the booking. ### Request Example ```json { "date": "2021-09-18", "time": "21:00", "people": 4, "duration": 120, "openingHourId": "jdjqueACWq", "tables": [ "NJioneCC7BoWC6j5x" ], "areaId": "Fu7CzGKfmiRdvY79j", "metadata" : { "example metadata": "value" }, "guest": { "name": "Thomas A. Anderson", "email": "neo@resos.com", "phone": "+13115552368", "notificationSms": false, "notificationEmail": true }, "status": "request", "source": "website", "comment": "This is a comment written by the guest regarding this booking, visible to both the guest and the restaurant", "note": "This is an internal note regarding this booking only visible to the restaurant", "noteAuthor": "Morpheus", "referrer": "https://www.some-website.com", "languageCode": "en" } ``` ### Response #### Success Response (200) - **string** - The ID of the created booking. #### Response Example ```json "XKsyPGsbBwdmfGq3h" ``` ``` -------------------------------- ### Healthcheck Source: https://documenter.getpostman.com/view/3308304/SzzehLGp?version=latest#c08b5ef8-0b4c-4cee-a8e6-0817cbea1f45 A GET request to check the health status of the API. ```APIDOC ## GET Healthcheck ### Description Checks the health status of the resOS API. ### Method GET ### Endpoint /healthcheck ``` -------------------------------- ### Base64 Encoding API Key for Basic Auth Source: https://documenter.getpostman.com/view/3308304/SzzehLGp?version=latest#c08b5ef8-0b4c-4cee-a8e6-0817cbea1f45 Demonstrates how to base64 encode your private API key for use in the Authorization header with Basic Auth. Ensure your API key is kept secret and handled server-side. ```bash echo -n 'YOUR_API_KEY:' | base64 ``` ```bash echo 'YUljQ3BSS1FxS1BnOXpWTDBhNy1SSnQyX3p4OGpQcThqUjIwWFdwX3BaTjo=' ``` -------------------------------- ### Base64 Encoding for API Key Source: https://documenter.getpostman.com/view/3308304/SzzehLGp?version=latest#intro Demonstrates how to base64 encode your private API key for use in the Authorization header. The API key is appended with a colon before encoding. ```bash echo -n 'YOUR_API_KEY:' | base64 ``` -------------------------------- ### Get Booking by ID Source: https://documenter.getpostman.com/view/3308304/SzzehLGp?version=latest#auth-info-938f6793-7f93-44c5-b082-c88924d28041 Retrieves a specific booking using its unique identifier. ```APIDOC ## GET /v1/bookings/{id} ### Description Retrieves the details of a specific booking using its unique ID. ### Method GET ### Endpoint https://api.resos.com/v1/bookings/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the booking. ### Request Example ```bash curl --location 'https://api.resos.com/v1/bookings/sBaiAnt8QmFPahpjy' ``` ### Response #### Success Response (200) Returns a single booking object. #### Response Example ```json { "_id": "sBaiAnt8QmFPahpjy", "date": "2020-06-02", "time": "19:00", "dateTime": "2020-06-02T17:00:00.000Z", "people": 2, "tables": [ { "_id": "65LfSehi5M6auMhiA", "name": "103", "seatsMin": 1, "seatsMax": 3, "internalNote": "", "area": { "_id": "ALmEi4S8fbK3wchpH", "name": "Restaurant", "internalNote": "" } } ], "duration": 105, "status": "canceled", "source": "phone", "languageCode": "en", "endDateTime": "2020-06-02T18:45:00.000Z", "internalId": "d87705e4-9d48-4954-8224-71e427238dc4", "restaurantId": "ELxwGTxds3TjniePe", "createdBy": "nKJnWZRHi6gDTa7Zf", "createdAt": "2020-06-02T08:20:24.765Z", "sendNotification": true, "updatedAt": "2020-06-02T09:22:42.673Z", "updatedBy": "nKJnWZRHi6gDTa7Zf", "activityAt": "2020-06-10T11:52:02.684Z", "guest": { "name": "Bob", "phone": "+", "email": "", "notificationSms": false, "notificationEmail": false }, "restaurant": { "name": "Eatie Plus (Test)", "address": { "address1": "Strandlodsvej 44, 3.", "address2": "", "address3": "", "city": "København S", "postalCode": 2300, "countryCode": "DK", "country": "Denmark" }, "email": "mlj@eatie.dk", "phone": "+4591531400", "slug": "eatie-plus-test-amager" } } ``` ``` -------------------------------- ### Create Booking Request using cURL Source: https://documenter.getpostman.com/view/3308304/SzzehLGp?version=latest#afd2438f-749e-4440-8b32-d4cdb3dd6925 This cURL command demonstrates how to send a POST request to create a booking. It includes the necessary headers and the JSON payload for the booking details. Ensure the --location flag is used to follow redirects. ```curl curl --location 'https://api.resos.com/v1/bookings' \ --data-raw '{ "date": "2021-09-18", "time": "21:00", "people": 4, "duration": 120, "tables": [ "NJioneCC7BoWC6j5x" ], "guest": { "name": "Thomas A. Anderson", "email": "neo@resos.com", "phone": "+13115552368", "notificationSms": false, "notificationEmail": true }, "status": "request", "source": "website", "comment": "This is a comment written by the guest regarding this booking, visible to both the guest and the restaurant", "note": "This is an internal note regarding this booking only visible to the restaurant", "noteAuthor": "Morpheus", "referrer": "https://www.some-website.com", "languageCode": "en" }' ``` -------------------------------- ### Authentication with API Key Source: https://documenter.getpostman.com/view/3308304/SzzehLGp?version=latest#auth-info-938f6793-7f93-44c5-b082-c88924d28041 Demonstrates how to authenticate API requests using a private API key via HTTP Basic Auth. The API key should be used as the username, with no password. The key needs to be base64 encoded with a trailing colon. ```APIDOC ## Authentication Authentication to the resOS API is done using a private API key. ### Finding your API key 1. Enable the API app from sidebar -> **Apps**. 2. Navigate to **Settings** -> **API credentials** under the **Apps** category. 3. Generate a new key if none exist. **Security Note:** Keep your API key secret. Do not include it in front-end code. If compromised, delete and regenerate it. ### Using the API Key The API key must be provided as the HTTP Basic Auth username. No password should be provided. **Example Private Key:** `aIcCpRKQqKPg9zVL0a7-RJt2_zx8jPq8jR20XWp_pZN` **Base64 Encoded Value:** `YUljQ3BSS1FxS1BnOXpWTDBhNy1SSnQyX3p4OGpQcThqUjIwWFdwX3BaTjo=` **Authorization Header:** `Authorization: Basic YUljQ3BSS1FxS1BnOXpWTDBhNy1SSnQyX3p4OGpQcThqUjIwWFdwX3BaTjo=` **Note for Postman Users:** If using Postman's Authorization tab, enter the API key directly; Postman will handle the base64 encoding. ``` -------------------------------- ### Get a single custom field Source: https://documenter.getpostman.com/view/3308304/SzzehLGp?version=latest#c08b5ef8-0b4c-4cee-a8e6-0817cbea1f45 Retrieves a single custom field by its unique identifier. This endpoint requires Basic Authentication. ```APIDOC ## GET /v1/customFields/{id} ### Description Get a single custom field by its ID. ### Method GET ### Endpoint https://api.resos.com/v1/customFields/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the custom field. ### Request Example ```curl curl --location 'https://api.resos.com/v1/customFields/tqZhoWtva48cKPLkE' ``` ### Response #### Success Response (200) - **_id** (string) - The unique identifier of the custom field. - **name** (string) - The internal name of the custom field. - **type** (string) - The data type of the custom field (e.g., 'string'). - **isRequired** (boolean) - Indicates if the field is mandatory. - **defaultOnAllOpeningHours** (boolean) - Indicates if the field is defaulted on all opening hours. - **showAsBadge** (boolean) - Indicates if the field should be displayed as a badge. - **restaurantId** (string) - The ID of the restaurant associated with the custom field. - **createdAt** (string) - The timestamp when the custom field was created. - **activeFlows** (array) - A list of active flows associated with the custom field (e.g., ['booking']). - **createdBy** (string) - The ID of the user who created the custom field. - **badgeColor** (string) - The color of the badge if `showAsBadge` is true. - **label** (string) - The user-facing label for the custom field. - **helptext** (string) - Help text displayed for the custom field. - **multipleChoiceSelections** (array) - An array of possible selections if the field type is multiple choice. - **_id** (string) - The ID of the selection. - **name** (string) - The name of the selection. - **sortIndex** (integer) - The order in which the custom field should be displayed. #### Response Example ```json { "_id": "tqZhoWtva48cKPLkE", "name": "Internal name text field", "type": "string", "isRequired": true, "defaultOnAllOpeningHours": true, "showAsBadge": true, "restaurantId": "7rXSfhxHfLD5AYDD9", "createdAt": "2025-03-07T11:11:35.735Z", "activeFlows": [ "booking" ], "createdBy": "33P5EPKycx5tTkTLz", "badgeColor": "yellow", "label": "Label text field", "helptext": "This is a label for a text field", "multipleChoiceSelections": [ { "_id": "WPx2pMgA2Tz7WvEj6", "name": "" } ], "sortIndex": 0 } ``` ``` -------------------------------- ### Fetch All Custom Fields (cURL) Source: https://documenter.getpostman.com/view/3308304/SzzehLGp?version=latest#c08b5ef8-0b4c-4cee-a8e6-0817cbea1f45 Use this cURL command to retrieve a list of all custom fields configured for your restaurant. Authentication is required. ```bash curl --location 'https://api.resos.com/v1/customFields/' ``` -------------------------------- ### List Customers with Search Source: https://documenter.getpostman.com/view/3308304/SzzehLGp?version=latest#c08b5ef8-0b4c-4cee-a8e6-0817cbea1f45 Lists customers with specified limit, skip, and custom search query. The custom query `name;Neo` filters for customers whose name contains 'Neo'. ```curl curl --location 'https://api.resos.com/v1/customers?limit=10&skip=1&customQuery=name%3BNeo' ``` -------------------------------- ### Pagination Source: https://documenter.getpostman.com/view/3308304/SzzehLGp?version=latest#auth-info-938f6793-7f93-44c5-b082-c88924d28041 Details on how to use skip and limit query parameters for paginating list endpoints. ```APIDOC ## Pagination Some list endpoints support pagination using `skip` and `limit` query parameters. - `skip`: Defines the number of records to skip. - `limit`: Defines the number of records to return (default is 100, maximum is typically 100). **Example:** To get 10 records starting from the 20th record: `/bookings?skip=20&limit=10` ``` -------------------------------- ### Get Specific Booking by ID Source: https://documenter.getpostman.com/view/3308304/SzzehLGp?version=latest#afd2438f-749e-4440-8b32-d4cdb3dd6925 Retrieve details for a single booking using its unique ID. This is useful for fetching the most up-to-date information for a specific reservation. ```curl curl --location 'https://api.resos.com/v1/bookings/sBaiAnt8QmFPahpjy' ``` -------------------------------- ### List Bookings with Query Parameters Source: https://documenter.getpostman.com/view/3308304/SzzehLGp?version=latest#afd2438f-749e-4440-8b32-d4cdb3dd6925 Use this endpoint to retrieve a list of bookings. You can filter, sort, and paginate the results using query parameters. Ensure proper ISO date format for date parameters. ```curl curl --location 'https://api.resos.com/v1/bookings?fromDateTime=2021-04-17&toDateTime=2021-04-18&limit=10&skip=1&sort=createdAt%3A1&customQuery=people%3E1%2Cduration%3E60' ``` -------------------------------- ### Get Custom Field by ID Source: https://documenter.getpostman.com/view/3308304/SzzehLGp?version=latest#c08b5ef8-0b4c-4cee-a8e6-0817cbea1f45 Use this cURL command to retrieve a single custom field from the API by specifying its unique ID in the URL. Requires Basic Authentication. ```curl curl --location 'https://api.resos.com/v1/customFields/tqZhoWtva48cKPLkE' ``` -------------------------------- ### Making Requests Source: https://documenter.getpostman.com/view/3308304/SzzehLGp?version=latest#auth-info-938f6793-7f93-44c5-b082-c88924d28041 Guidelines for making requests to the resOS API, including the requirement for HTTPS and how to format request data. ```APIDOC ## Making requests ### HTTPS All requests must be made using HTTPS. ### Request data - For POST and PUT requests, use `application/json` content-type, defined in the HTTP header. - For GET requests, use query parameters for data like pagination. ```