### 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.

", "type": 2 }, { "id": 2, "subject": "re-welcome", "message": "", "messageHtml": "

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/ \ -H 'Api-Key: secretApiKey' \ -H 'Cache-Control: no-cache' ``` -------------------------------- ### Get All Price Elements API Response (JSON) Source: https://docs.smoobu.com/index Example JSON responses for fetching all price elements of a reservation. A successful response (status code 200) returns an array of price element objects. An unauthorized response (status code 401) indicates an authentication problem. ```json { "priceElements": [ { "id": 10, "type": "basePrice", "name": "Base price", "amount": 40, "quantity": null, "tax": null, "currencyCode": "EUR", "sortOrder": 1, "priceIncludedInId": null }, { "id": 11, "type": "cleaningFee", "name": "Cleaning fee", "amount": 10, "quantity": null, "tax": null, "currencyCode": "EUR", "sortOrder": 4, "priceIncludedInId": null } ] } ``` ```json { "status": 401, "title": "Unauthorized", "detail": "Authentication required" } ``` -------------------------------- ### Get Single Price Element API Response (JSON) Source: https://docs.smoobu.com/index Example JSON responses for retrieving a single price element. A successful request (status code 200) returns the details of the specified price element. An unauthorized response (status code 401) indicates an authentication failure. ```json { "id": 10, "type": "basePrice", "name": "Base price", "amount": 40, "quantity": null, "tax": null, "currencyCode": "EUR", "sortOrder": 1, "priceIncludedInId": null } ``` ```json { "status": 401, "title": "Unauthorized", "detail": "Authentication required" } ``` -------------------------------- ### Smoobu API GET Request with Bearer Token Authentication Source: https://docs.smoobu.com/index This cURL command demonstrates how to make a GET request to the Smoobu API using an access token for authentication. The token is provided in the Authorization header. ```shell curl --location --request GET 'https://login.smoobu.com/api/apartments' \ --header 'Authorization: Bearer 6490e32fad291d54402c5879dee4cd8840936b4c' ``` -------------------------------- ### Create Price Element API Source: https://docs.smoobu.com/index Creates a new price element. ```APIDOC ## POST /price-elements ### Description Creates a new price element that can be applied to bookings. ### Method POST ### Endpoint `/price-elements` ### Parameters #### Request Body - **name** (string) - Required - The name of the price element. - **type** (string) - Required - The type of the price element (e.g., "surcharge", "discount"). - **value** (number) - Required - The value of the price element. ### Request Example ```json { "name": "Late Check-out Fee", "type": "surcharge", "value": 25.00 } ``` ### Response #### Success Response (201 Created) - **id** (integer) - The unique identifier of the newly created price element. - **message** (string) - Confirmation message. #### Response Example ```json { "id": 3, "message": "Price element created successfully." } ``` ``` -------------------------------- ### Create Custom Placeholder API (Beta) Source: https://docs.smoobu.com/index Creates a new custom placeholder. This endpoint accepts a JSON payload with placeholder details and requires an API key. It returns a success message with the new placeholder's ID or an authentication/validation error. ```curl curl -X POST \ https://login.smoobu.com/api/custom-placeholders \ -H 'Api-Key: secretApiKey' \ -H 'Cache-Control: no-cache' \ -H 'Content-Type: application/json' \ -d '{ "key": "exampleKey", "defaultValue": "example text", "type": 1, "foreignId": 185 }' ``` ```json { "status": 201, "title": "Resource created successfully", "detail": { "id": 1 } } ``` ```json { "status": 401, "title": "Unauthorized", "detail": "Authentication required" } ``` ```json { "status": 400, "title": "Bad Request", "detail": "Failed validation", "validation_messages": { "key": { "isEmpty": "Value is required and can't be empty" } } } ``` -------------------------------- ### Get All Apartments API Request (GET) Source: https://docs.smoobu.com/index Retrieves a list of all apartments associated with the user's account. The response includes an array of apartment objects, each containing an 'id' and 'name'. This is useful for obtaining apartment IDs required for other API calls. ```cURL curl -X GET \ https://login.smoobu.com/api/apartments \ -H 'Api-Key: secretApiKey' \ -H 'Cache-Control: no-cache' ``` -------------------------------- ### Fetch All Bookings (cURL) Source: https://docs.smoobu.com/index This code snippet demonstrates how to retrieve all bookings using a cURL command. It requires an API key for authentication and specifies the endpoint for fetching reservations. The output is a JSON object containing booking details. ```bash curl -X GET \ https://login.smoobu.com/api/reservations \ -H 'Api-Key: secretApiKey' \ -H 'Cache-Control: no-cache' ``` -------------------------------- ### Example Booking JSON Response (Status 200) Source: https://docs.smoobu.com/index This JSON object represents a successful response (Status Code 200) when retrieving a specific booking. It includes detailed information about the reservation, apartment, channel, guest, and pricing. ```json { "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" : 155 } ``` -------------------------------- ### Create Smoobu Booking with All Fields (cURL) Source: https://docs.smoobu.com/index This cURL command shows how to create a booking in Smoobu with all available fields, including guest details, times, pricing, and price elements. It sends a POST request to the Smoobu API with a comprehensive JSON payload. ```curl curl -X POST \ https://login.smoobu.com/api/reservations \ -H 'Api-Key: secretApiKey' \ -H 'Cache-Control: no-cache' \ -H 'Content-Type: application/json' \ -d '{ "arrivalDate": "2019-09-05", "departureDate": "2019-09-08", "channelId": 63, "apartmentId": 7, "arrivalTime": "12:00", "departureTime": "15:00", "firstName": "Max", "lastName": "Mustermann", "email": "ma@muster.de", "phone": "0177123456789", "notice": "Breakfast, one dog", "adults": 2, "children": 3, "price": 150.20, "priceStatus": 1, "deposit": 50, "depositStatus": 1, "language": "en", "priceElements" : [ { "type": "basePrice", "name": "Base price", "amount": 100.20, "quantity": null, "tax": null, "currencyCode": "EUR", "sortOrder": 1 }, { "type": "cleaningFee", "name": "Cleaning fee", "amount": 50, "quantity": null, "tax": null, "currencyCode": "EUR", "sortOrder": 4 } ] }' ``` -------------------------------- ### Other Endpoints & Features Source: https://docs.smoobu.com/index Documentation for various other endpoints and API features including addons, placeholders, authentication, and webhooks. ```APIDOC ## GET /api/addons ### Description Retrieves a list of available addons. ### Method GET ### Endpoint /api/addons ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **addons** (array) - A list of addon objects. - **addonId** (string) - The unique identifier for the addon. - **name** (string) - The name of the addon. - **price** (number) - The price of the addon. #### Response Example ```json { "addons": [ { "addonId": "addon_001", "name": "Breakfast", "price": 15.00 } ] } ``` ## GET /api/bookings/placeholders ### Description Retrieves a list of available placeholders that can be used in messages or other communications. ### Method GET ### Endpoint /api/bookings/placeholders ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **placeholders** (array) - A list of placeholder objects. - **key** (string) - The placeholder key (e.g., "[GUEST_NAME]"). - **description** (string) - A description of what the placeholder represents. #### Response Example ```json { "placeholders": [ { "key": "[GUEST_NAME]", "description": "The name of the guest." }, { "key": "[CHECK_IN_DATE]", "description": "The date of check-in." } ] } ``` ## POST /oauth/token ### Description Obtains an OAuth 2.0 access token for authenticating API requests. ### Method POST ### Endpoint /oauth/token #### Request Body - **grant_type** (string) - Required - The grant type for the request (e.g., "client_credentials", "password"). - **client_id** (string) - Required - Your application's client ID. - **client_secret** (string) - Required - Your application's client secret. - **username** (string) - Optional - The user's username (for password grant type). - **password** (string) - Optional - The user's password (for password grant type). ### Request Example ```json { "grant_type": "client_credentials", "client_id": "YOUR_CLIENT_ID", "client_secret": "YOUR_CLIENT_SECRET" } ``` ### Response #### Success Response (200) - **access_token** (string) - The obtained access token. - **token_type** (string) - The type of token (e.g., "Bearer"). - **expires_in** (integer) - The token's expiration time in seconds. #### Response Example ```json { "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "token_type": "Bearer", "expires_in": 3600 } ``` ## Webhooks ### Description Smoobu supports webhooks for real-time notifications on events like reservation creation or updates. Contact api@smoobu.com to set up webhooks. ### Method N/A (Configuration via email) ### Endpoint N/A ### Details - **Reservation Webhooks**: Notifications for new reservations or updates to existing ones. - **GetRates Updates Webhooks**: Notifications when rates are updated. ### Contact api@smoobu.com to configure webhook subscriptions. ``` -------------------------------- ### POST /api/custom-placeholders Source: https://docs.smoobu.com/index Creates a new custom placeholder. This endpoint is used to add new placeholder configurations. ```APIDOC ## POST /api/custom-placeholders ### Description Creates a new custom placeholder. This endpoint is used to add new placeholder configurations. ### Method POST ### Endpoint `https://login.smoobu.com/api/custom-placeholders` ### Parameters #### Request Body - **key** (string) - Required - The placeholder key. - **defaultValue** (string) - Optional - Default value if no translation is found. - **type** (string) - Optional - See types table below. - **foreignId** (int) - Optional - Depends on type (e.g., booking ID). #### Types - **1**: Booking - **2**: Apartment ### Request Example ```json { "key": "exampleKey", "defaultValue": "example text", "type": 1, "foreignId": 185 } ``` ### Response #### Success Response (201) - **status** (int) - HTTP status code 201. - **title** (string) - Success message, "Resource created successfully". - **detail** (object) - Contains the ID of the newly created placeholder. - **id** (int) - The ID of the newly created placeholder. #### Response Example (201) ```json { "status": 201, "title": "Resource created successfully", "detail": { "id": 1 } } ``` #### Error Response (401) - **status** (int) - HTTP status code 401. - **title** (string) - Error title, "Unauthorized". - **detail** (string) - Error details, "Authentication required". #### Error Response Example (401) ```json { "status": 401, "title": "Unauthorized", "detail": "Authentication required" } ``` #### Error Response (400) - **status** (int) - HTTP status code 400. - **title** (string) - Error title, "Bad Request". - **detail** (string) - Error details, "Failed validation". - **validation_messages** (object) - Contains details about validation errors. #### Error Response Example (400) ```json { "status": 400, "title": "Bad Request", "detail": "Failed validation", "validation_messages": { "key": { "isEmpty": "Value is required and can't be empty" } } } ``` ``` -------------------------------- ### Get Single Price Element API Request (cURL) Source: https://docs.smoobu.com/index This cURL command fetches a specific price element for a reservation using its ID. It employs a GET request and requires both the reservation ID, price element ID, and an API key. Responses include the price element details or an authentication error. ```bash curl -X GET \ https://login.smoobu.com/api/reservations/291/price-elements/10 \ -H 'Api-Key: secretApiKey' \ -H 'Cache-Control: no-cache' ``` -------------------------------- ### Get Messages API Source: https://docs.smoobu.com/index Retrieves messages associated with a booking or apartment. ```APIDOC ## GET /messages ### Description Fetches messages. You can filter messages by apartment ID or booking ID. ### Method GET ### Endpoint `/messages` ### Parameters #### Query Parameters - **apartment_id** (integer) - Optional - Filter messages for a specific apartment. - **booking_id** (integer) - Optional - Filter messages for a specific booking. ### Response #### Success Response (200 OK) - An array of message objects, each containing: - **message_id** (integer) - The unique identifier of the message. - **booking_id** (integer) - The ID of the associated booking. - **sender** (string) - The sender of the message (e.g., "guest", "host"). - **content** (string) - The content of the message. - **timestamp** (string) - The date and time the message was sent. #### Response Example ```json [ { "message_id": 501, "booking_id": 1001, "sender": "guest", "content": "Hello, when is check-in time?", "timestamp": "2023-02-10T10:00:00Z" } ] ``` ``` -------------------------------- ### GET /api/rates Source: https://docs.smoobu.com/index Retrieves rates and availability for specified apartments within a given date range. Requires an API key for authentication. ```APIDOC ## GET /api/rates ### Description Retrieves rates and availability for specified apartments within a given date range. Requires an API key for authentication. ### Method GET ### Endpoint `https://login.smoobu.com/api/rates` ### Parameters #### Query Parameters - **apartments[]** (integer) - Required - The IDs of the apartments to retrieve rates for. Can be specified multiple times. - **start_date** (string) - Required - The start date for the rate retrieval in `YYYY-MM-DD` format. - **end_date** (string) - Required - The end date for the rate retrieval in `YYYY-MM-DD` format. ### Request Headers - **Api-Key** (string) - Required - Your Smoobu API key. - **Cache-Control** (string) - Optional - Specifies caching directives. ### Request Example ```curl curl -X GET 'https://login.smoobu.com/api/rates?apartments[]=398&apartments[]=401&start_date=2019-01-15&end_date=2019-01-30' \ -H 'Api-Key: secretApiKey' \ -H 'Cache-Control: no-cache' ``` ### Response #### Success Response (200) - **data** (object) - Contains the rates and availability information, keyed by apartment ID. - **[apartment_id]** (object) - Rates and availability for a specific apartment. - **[date]** (object) - Information for a specific date. - **price** (number) - The price for the given date. Can be null. - **min_length_of_stay** (integer) - The minimum length of stay required for the given date. Can be null. - **available** (integer) - Indicates if the apartment is available (1 for available, 0 for unavailable). #### Response Example ```json { "data": { "398": { "2019-01-15": { "price": 444, "min_length_of_stay": 2, "available": 1 }, "2019-01-16": { "price": 444, "min_length_of_stay": 2, "available": 1 } }, "401": { "2019-01-15": { "price": 170, "min_length_of_stay": null, "available": 1 } } } } ``` ``` -------------------------------- ### Get Apartment API Source: https://docs.smoobu.com/index Retrieves details for a specific apartment by its ID. ```APIDOC ## GET /apartments/{id} ### Description Retrieves detailed information about a specific apartment using its unique identifier. ### Method GET ### Endpoint `/apartments/{id}` ### Parameters #### Path Parameters - **id** (integer) - Required - The unique identifier of the apartment. ### Response #### Success Response (200 OK) - **id** (integer) - The unique identifier of the apartment. - **name** (string) - The name of the apartment. - **description** (string) - A description of the apartment. - **capacity** (integer) - The maximum number of guests. #### Response Example ```json { "id": 789, "name": "Cozy Beachfront Studio", "description": "A lovely studio apartment with sea views.", "capacity": 2 } ``` ```