### GET /api/apartments - Example API Call Source: https://docs.smoobu.com/index An example of how to make an API call using an access token in the Authorization header. ```APIDOC ## Using Access Token for API Calls ### Description Once you have a valid access token, include it in the `Authorization` header of your API requests to authenticate. ### Method GET ### Endpoint `https://login.smoobu.com/api/apartments` (Example endpoint) ### Parameters #### Request Headers - **Authorization** (string) - Required - The access token prefixed with `Bearer ` (e.g., `Bearer your_access_token`). ### Request Example ```bash curl --location --request GET 'https://login.smoobu.com/api/apartments' \ --header 'Authorization: Bearer 6490e32fad291d54402c5879dee4cd8840936b4c' ``` ### Notes - Replace `6490e32fad291d54402c5879dee4cd8840936b4c` with your actual access token. - The `api_endpoint_here` in the API Key section should be replaced with the actual API endpoint you wish to access. ``` -------------------------------- ### Get All Rates API Request (GET) Source: https://docs.smoobu.com/index Retrieves all rates for specified dates and apartments. Requires start date, end date, and an array of apartment IDs as query parameters. The response contains rate data, including price, min_length_of_stay, and availability for each apartment and date. ```HTTP GET https://login.smoobu.com/api/rates?start_date=yyyy-mm-dd&end_date=yyyy-mm-dd&apartments[]=apartmentId1&apartments[]=apartmentId2 ``` -------------------------------- ### Smoobu API Booking Response Examples Source: https://docs.smoobu.com/index These JSON examples show the expected responses from the Smoobu API after attempting to create a booking. This includes a successful booking confirmation, authentication failure, and various validation error scenarios. ```json { "id": 906 } ``` ```json { "status": 401, "title": "Unauthorized", "detail": "Authentication required" } ``` ```json { "status": 400, "title": "Bad Request", "detail": "Failed validation", "validation_messages": { "error": "There exists already a reservation from 05.09.2019 to 08.09.2019." } } ``` ```json { "status": 400, "title": "Bad Request", "detail": "Failed validation", "validation_messages": { "error": "Channel with id 144 not found for user 7" } } ``` -------------------------------- ### Get Addons API Source: https://docs.smoobu.com/index Retrieves a list of available add-ons. ```APIDOC ## GET /addons ### Description Fetches a list of available add-ons that can be offered to guests. ### Method GET ### Endpoint `/addons` ### Parameters #### Query Parameters - **apartment_id** (integer) - Optional - Filter add-ons relevant to a specific apartment. ### Response #### Success Response (200 OK) - An array of add-on objects, each containing: - **id** (integer) - The unique identifier of the add-on. - **name** (string) - The name of the add-on. - **price** (number) - The price of the add-on. #### Response Example ```json [ { "id": 30, "name": "Welcome Basket", "price": 20.00 }, { "id": 31, "name": "Bike Rental (per day)", "price": 15.00 } ] ``` ``` -------------------------------- ### Install Smoobu Node.js Client Library (Bash) Source: https://docs.smoobu.com/index This command installs the official Smoobu client library for Node.js using NPM (Node Package Manager). This library simplifies integration with the Smoobu API by providing pre-built functions for common operations. ```bash npm install smoobu ``` -------------------------------- ### Get Apartment Details - JSON Response (Success) Source: https://docs.smoobu.com/index Example of a successful JSON response when fetching apartment details. Includes comprehensive information about the apartment's location, rooms, equipment, pricing, and type. This structure is returned with a 200 status code. ```JSON { "location": { "street": "Wönnichstr. 68/70", "zip": "10317", "city": "Berlin", "country": "Germany", "latitude": "52.5200080000000", "longitude": "13.4049540000000" }, "timeZone": "Europe/Berlin", "rooms": { "maxOccupancy": 4, "bedrooms": 4, "bathrooms": 2, "doubleBeds": 1, "singleBeds": 3, "sofaBeds": null, "couches": null, "childBeds": null, "queenSizeBeds": null, "kingSizeBeds": 1 }, "equipments": [ "Internet", "Whirlpool", "Pool", "Heating" ], "currency": "EUR", "price": { "minimal": "10.00", "maximal": "100.00" }, "type": { "id": 2, "name": "Holiday rental" } } ``` -------------------------------- ### Get Placeholders API (Beta) Source: https://docs.smoobu.com/index Retrieves a list of available placeholders (Beta). ```APIDOC ## GET /placeholders ### Description Fetches a list of available placeholders. These are dynamic fields that can be used in templates or communications (Beta). ### Method GET ### Endpoint `/placeholders` ### Response #### Success Response (200 OK) - An array of placeholder objects, each containing: - **id** (string) - The identifier of the placeholder. - **name** (string) - The display name of the placeholder. #### Response Example ```json [ { "id": "guest_first_name", "name": "Guest First Name" }, { "id": "booking_reference", "name": "Booking Reference" } ] ``` ``` -------------------------------- ### Get All Price Elements API Request (cURL) Source: https://docs.smoobu.com/index This cURL command retrieves all price elements for a specific reservation. It uses a GET request and requires the reservation ID and an API key. The response includes a list of price elements or an authentication error. ```bash curl -X GET \ https://login.smoobu.com/api/reservations/291/price-elements \ -H 'Api-Key: secretApiKey' \ -H 'Cache-Control: no-cache' ``` -------------------------------- ### Smoobu API: Get Booking Placeholders Response Example Source: https://docs.smoobu.com/index An example of a successful JSON response when requesting booking placeholders from the Smoobu API. It shows the structure of the 'placeholders' array, with each object containing a 'key' and 'value'. ```json { "placeholders": [ { "key": "luggageHeroUrl", "value": "https://luggagehero.com/?lat=52.5007405000000&lng=13.4449256000000&location=test+property&utm_promo_code=sb2h&utm_source=smoobu" }, { "key": "nannybagUrl", "value": "https://www.nannybag.com/de/luggage-storage?latitude=52.5007405000000&longitude=13.4449256000000&promo=smoobu" }, { "key": "channel", "value": "Direct booking" }, { "key": "offerurl", "value": "https://booking.smoobu.com//9A7/s3dwe3a923" }, { "key": "guestName", "value": "Jhon Doe" } ] } ``` -------------------------------- ### Get Custom Placeholders API (Beta) Source: https://docs.smoobu.com/index Retrieves a list of custom placeholders (Beta). ```APIDOC ## GET /custom-placeholders ### Description Fetches a list of custom placeholders defined by the user. These are user-defined dynamic fields (Beta). ### Method GET ### Endpoint `/custom-placeholders` ### Response #### Success Response (200 OK) - An array of custom placeholder objects, each containing: - **id** (string) - The unique identifier of the custom placeholder. - ``` -------------------------------- ### Get Reservation Messages - JSON Response (Success) Source: https://docs.smoobu.com/index Example of a successful JSON response when fetching reservation messages. Includes pagination information (page_count, page_size, total_items, page) and an array of message objects, each with an ID, subject, message content (plain text and HTML), and type. ```JSON { "page_count": 1, "page_size": 25, "total_items": 2, "page": 1, "messages": [ { "id": 1, "subject": "welcome", "message": "Hello Kim Klaus, Thank you for booking our Apartment Property 3. You have booked the apartment for 1 person. You can email us @ smoobu. Contact us for advance information on how to get there and how to get there. Ideal to inform you about sightseeing opportunities around Apartment 3 or give you tips on where to spend a cozy evening. We are looking forward to hearing from you.", "messageHtml": "
Hello Kim Klaus,
Thank you for booking our Apartment Property 3. You have booked the apartment for 1 person. You can email us @ smoobu. Contact us for advance information on how to get there and how to get there. Ideal to inform you about sightseeing opportunities around Apartment 3 or give you tips on where to spend a cozy evening. We are looking forward to hearing from you.
Please send me exact apartment location
", "type": 1 } ] } ``` -------------------------------- ### Get User Source: https://docs.smoobu.com/index Retrieves information about the current user. ```APIDOC ## GET /users/{id} ### Description Retrieves detailed information about a specific user. ### Method GET ### Endpoint `/users/{id}` ### Parameters #### Path Parameters - **id** (integer) - Required - The unique identifier of the user. ### Response #### Success Response (200) - **id** (integer) - The user's unique identifier. - **username** (string) - The user's username. - **email** (string) - The user's email address. #### Response Example ```json { "id": 123, "username": "smoobu_user", "email": "user@example.com" } ``` ``` -------------------------------- ### Get Rates API Source: https://docs.smoobu.com/index Retrieves a list of rates applicable to apartments. ```APIDOC ## GET /rates ### Description Fetches a list of rates. This API provides information about different pricing rates that can be applied. ### Method GET ### Endpoint `/rates` ### Parameters #### Query Parameters - **apartment_id** (integer) - Optional - Filter rates for a specific apartment ID. ### Response #### Success Response (200 OK) - An array of rate objects, each containing: - **id** (integer) - The unique identifier of the rate. - **name** (string) - The name of the rate. - **price** (number) - The base price for this rate. #### Response Example ```json [ { "id": 10, "name": "Standard Rate", "price": 100.00 }, { "id": 11, "name": "Off-Season Rate", "price": 80.00 } ] ``` ``` -------------------------------- ### Smoobu Webhook Example: priceElementCreated (JSON) Source: https://docs.smoobu.com/index This JSON example demonstrates the 'priceElementCreated' webhook notification, signaling the creation of a new pricing element. It includes details like the type, name, amount, and associated booking. A similar structure is used for 'priceElementUpdated' webhooks. ```json { "action": "priceElementCreated", "user": 7, "data": { "id": 1234, "type": "basePrice", "name": "Base Price", "amount": 1, "quantity": 2300, "tax": 7.00, "currencyCode": "EUR|€", "sortOrder": 51, "priceIncludedInId": 1, "booking": { "id": 234 } } } ``` -------------------------------- ### Get Apartment-IDs API Source: https://docs.smoobu.com/index Retrieves a list of all apartment IDs. ```APIDOC ## GET /apartments/ids ### Description Fetches a list of all available apartment identifiers. ### Method GET ### Endpoint `/apartments/ids` ### Response #### Success Response (200 OK) - An array of integers, where each integer is an apartment ID. #### Response Example ```json [ 789, 790, 791 ] ``` ``` -------------------------------- ### GET /api/guests Source: https://docs.smoobu.com/index Retrieves a list of all guests. Supports pagination and search functionality. ```APIDOC ## GET /api/guests ### Description Retrieves a list of all guests associated with the account. This endpoint supports pagination and basic search functionality. ### Method GET ### Endpoint https://login.smoobu.com/api/guests ### Parameters #### Query Parameters - **page** (int) - Optional - The current page number to retrieve. Defaults to 1. - **pageSize** (int) - Optional - The number of guests to return per page. Maximum value is 100. - **query** (string) - Optional - A search term to filter guests by name or other relevant fields. #### Request Headers - **Api-Key** (string) - Required - Your Smoobu API key - **Cache-Control** (string) - Optional - Cache control header ### Request Example ```bash curl -X GET \ https://login.smoobu.com/api/guests \ -H 'Api-Key: secretApiKey' \ -H 'Cache-Control: no-cache' ``` ### Response #### Success Response (200) - **pageCount** (int) - The total number of pages available. - **pageSize** (int) - The number of guests returned per page. - **totalItems** (int) - The total number of guests found. - **page** (int) - The current page number. - **guests** (array) - An array of guest objects. - Each guest object contains fields like `id`, `firstName`, `lastName`, `emails`, `telephoneNumbers`, `address`, `notes`, and `bookings`. #### Error Response (401) - **status** (int) - HTTP status code, expected to be 401 - **title** (string) - Error message (e.g., "Unauthorized") - **detail** (string) - Error description (e.g., "Authentication required") #### Response Example (Success) ```json { "pageCount": 1, "pageSize": 25, "totalItems": 1, "page": 1, "guests": [ { "id": 17, "firstName": "Harry", "lastName": "Potter", "companyName": null, "emails": ["HarryPotter@hogwarts.com"], "telephoneNumbers": ["+49123456789"], "address": { "street": null, "postalCode": null, "city": null, "country": null }, "notes": null, "bookings": [ { "id": 291, "reference-id": null, "type": "reservation", "arrival": "2018-01-10", "departure": "2018-01-12", "created-at": "2018-01-03 13:51", "apartment": { "id": 50017, "name": "Seaside apartment" }, "channel": { "id": 465614, "name": "Booking.com" }, "guest-name": "Harry Potter", "email": "HarryPotter@hogwarts.com", "phone": "+49123456789", "adults": 3, "children": 2, "check-in": "16:00", "check-out": "10:00", "notice": "", "price": 150, "price-paid": "Yes", "prepayment": 0, "prepayment-paid": "No", "deposit": 0, "deposit-paid": "No", "language": "en", "guest-app-url": "https://guest.smoobu.com/?t=sf7678asd&b=291", "is-blocked-booking" : false, "guestId" : 17 } ] } ] } ``` #### Response Example (Authentication Failed) ```json { "status": 401, "title": "Unauthorized", "detail": "Authentication required" } ``` ``` -------------------------------- ### Get Addons Source: https://docs.smoobu.com/index Retrieves a list of all addons or addons filtered by a specific apartment ID. ```APIDOC ## GET /api/addons ### Description Fetches a list of all available addons. You can also filter this list to retrieve addons associated with a specific apartment. ### Method GET ### Endpoint https://login.smoobu.com/api/addons ### Query Parameters - **apartmentId** (int) - Optional - The ID of the apartment to filter addons for. ### Request Example (Get all addons) ```bash curl -X GET \ https://login.smoobu.com/api/addons \ -H 'Api-Key: secretApiKey' \ -H 'Cache-Control: no-cache' ``` ### Request Example (Get addons for a specific apartment) ```bash curl -X GET \ https://login.smoobu.com/api/addons/123 \ -H 'Api-Key: secretApiKey' \ -H 'Cache-Control: no-cache' ``` ### Response #### Success Response (200) - **addons** (array) - An array of addon objects. - **addons.id** (int) - The unique identifier for the addon. - **addons.name** (string) - The name of the addon. - **addons.apartments** (array) - A list of apartment IDs this addon is associated with. - **addons.amount** (int) - The base amount for the addon. - **addons.usePercentage** (boolean) - Indicates if the amount is a percentage. - **addons.tax** (int) - The tax rate applied to the addon. - **addons.calculationType** (int) - The type of calculation used for the addon. - **addons.optional** (boolean) - Indicates if the addon is optional. - **addons.maxQuantity** (int) - The maximum quantity allowed for the addon. - **addons.whereVisible** (int) - Where the addon is visible. #### Response Example ```json { "addons": [ { "id": 2, "name": "towel", "apartments": [ 4, 54 ], "amount": 2, "usePercentage": true, "tax": 20, "calculationType": 0, "optional": true, "maxQuantity": 5, "whereVisible": 2 }, { "id": 3, "name": "towel", "apartments": [ 7 ], "amount": 1, "usePercentage": true, "tax": 10, "calculationType": 0, "optional": false, "maxQuantity": 1, "whereVisible": null } ] } ``` #### Error Response (401) - **status** (int) - The HTTP status code (401). - **title** (string) - The error title ('Unauthorized'). - **detail** (string) - A description of the error ('Authentication required'). #### Error Response Example ```json { "status": 401, "title": "Unauthorized", "detail": "Authentication required" } ``` ``` -------------------------------- ### Get Price Elements API Source: https://docs.smoobu.com/index Retrieves a list of all price elements associated with an account. ```APIDOC ## GET /price-elements ### Description Fetches a list of all available price elements. These can be used to understand pricing structures. ### Method GET ### Endpoint `/price-elements` ### Response #### Success Response (200 OK) - An array of price element objects, each containing: - **id** (integer) - The unique identifier of the price element. - **name** (string) - The name of the price element. - **type** (string) - The type of price element (e.g., "surcharge", "discount"). #### Response Example ```json [ { "id": 1, "name": "Cleaning Fee", "type": "surcharge" }, { "id": 2, "name": "Weekend Rate", "type": "surcharge" } ] ``` ``` -------------------------------- ### Addons API Response (JSON) Source: https://docs.smoobu.com/index Example of a successful JSON response when retrieving addons. It contains an 'addons' array, where each object details an addon's ID, name, associated apartments, amount, tax, and other configuration properties. ```json { "addons": [ { "id": 2, "name": "towel", "apartments": [ 4, 54 ], "amount": 2, "usePercentage": true, "tax": 20, "calculationType": 0, "optional": true, "maxQuantity": 5, "whereVisible": 2 }, { "id": 3, "name": "towel", "apartments": [ 7 ], "amount": 1, "usePercentage": true, "tax": 10, "calculationType": 0, "optional": false, "maxQuantity": 1, "whereVisible": null } ] } ``` -------------------------------- ### Get Message Threads API Response (JSON) Source: https://docs.smoobu.com/index Example of a successful JSON response when retrieving message threads. It includes pagination details and an array of thread objects, each containing booking, apartment, and the latest message information. ```json { "page_number": 1, "page_size": 10, "page_count": 1, "total_threads": 1, "unread_messages": 0, "threads": [ { "booking": { "id": 1, "guest_name": "Jane" }, "apartment": { "id": 2, "name": "John's Cabin" }, "latest_message": { "id": 1, "subject": "re-welcome", "text_content": "Please send me exact apartment location", "html_content": "Please send me exact apartment location
", "created_at": "2025-09-17 09:31:48" } } ] } ``` -------------------------------- ### Get Addons for Specific Apartment API Request (Shell) Source: https://docs.smoobu.com/index This command fetches addons for a specific apartment by including the apartment ID in the API request URL. It requires an API key for authentication. ```shell curl -X GET \ https://login.smoobu.com/api/addons/