NAV Navbar
shell

Introduction

Our REST based APIs allow you to get access to the Smoobu Application. We have different APIs for different usecases. On this page we explain you a little bit more detailled what you need for your usecase as a host.

Please contact us before you start coding. We send you the necessary keys and all further information you need to know. Tell us a few words about your ideas and plans. We are always happy to help our customers and our partners to build a perfect integrated and easy to use solution.

Send us an email to api@smoobu.com to join our mailing list and keep updated about all issues, developer news and API updates.

Authentication

To authorize, use this code:

# With shell, you can just pass the correct header with each request
curl "api_endpoint_here"
  -H "Api-Key: secretApiKey"

Make sure to replace secretApiKey with your API key.

If you want to develop an API for a single Smoobu user you will find all necessary IDs and Keys in settings for developers.
Please add API-key in the header in each request. If your API-Key is ABCDEFGH Your header should look like: ‘API-key: ABCDEFGH’

If you are a developer of a third party tool which is relevant for more than one Smoobu user please read the part at the end of the documentation.

OAuth 2 Authentication

Currently OAuth 2 only supported for Smoobu partners.

Send a registration request to Smoobu for your application. You will get a Client Id and Client Secret. A redirect URL will be required which will be called after a host authorize your application. The URL is invoked with a query string containing a special authorization code that you can use to retrieve access tokens required for all Smoobu API calls.

Authorization

The authorization URL will be :

https://login.smoobu.com/{locale}/oauth/authorize?client_id={client_id}&redirect_uri={redirect_uri}&response_type=code&state={state}

URL Parameters

Parameter Description
locale Locale of Smoobu supported languages (i.e en, de, fr, it, es)
client_id Provided from Smoobu
redirect_uri Redirect Url provided at registration.
state Random number/string

i.e

https://login.smoobu.com/de/oauth/authorize?client_id=10&redirect_uri=https://yourdomain.com/&response_type=code&state=20464541

After a host grants or denies your application access, your server must handle the authorization response. This response contains a code field which you can use to get an initial access token. The authorization code expired in 2 minutes after is is issued.

Example of success redirect.

https://yourdomain.com/?code=eef1b91d549f7c8fd4ccbfb6d96c32122e53b25e&state=20464541

In case of error, it will be like this.

https://yourdomain.com/?error=access_denied&error_description=The user denied access to your application&state=20464541 (The URL will be encoded)

Obtaining Access Token

Once you have authorization code, you can get the access token which can be used for other API calls.

To obtain access token, use this code:

curl --location --request POST 'https://login.smoobu.com/oauth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=authorization_code' \
--data-urlencode 'code=db9dba495938124bdd0e8635212280bf3cc76721' \
--data-urlencode 'redirect_uri=https://yourdomain.com/' \
--data-urlencode 'client_id=10' \
--data-urlencode 'client_secret=1dde36bc0f25c842079e90871d55f019c331e29055'

The above command returns JSON structured like this (HTTP status code 200):

{ 
   "access_token":"c8c02e8af18fa10ff4388ebf9bcaa15a522b6cfe",
   "expires_in":3600,
   "token_type":"Bearer",
   "scope":null,
   "refresh_token":"610b630034a85d1805faca0d495f89ffc44e9a92"
}

Response if it failed (HTTP status code 400):

{ 
   "error":"invalid_grant",
   "error_description":"Authorization code doesn\u0027t exist or is invalid for the client"
}

POST Parameters

Parameter Description
grant_type authorization_code
code Authorization code
redirect_uri Redirect Url provided at registration.
client_id Provided from Smoobu
client_secret Provided from Smoobu

Refresh Token

If a access token expires, you can send a refresh token request in order to get new access token.

To get new access token, use this command:

curl --location --request POST 'https://login.smoobu.com/oauth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=refresh_token' \
--data-urlencode 'refresh_token=2c3bb89326e5bc3a7e953b9eff72b2463b11b393' \
--data-urlencode 'client_id=10' \
--data-urlencode 'client_secret=1dde36bc0f25c842079e90871d55f019c331e29055'

The above command returns JSON structured like this (HTTP status code 200):

{ 
   "access_token":"6490e32fad291d54402c5879dee4cd8840936b4c",
   "expires_in":3600,
   "token_type":"Bearer",
   "scope":null
}

Response if it failed (HTTP status code 400):

{ 
   "error":"invalid_grant",
   "error_description":"Invalid refresh token"
}

POST Parameters

Parameter Description
grant_type refresh_token
refresh_token Refresh token.
client_id Provided from Smoobu
client_secret Provided from Smoobu

Using Access Token

Use of access token:

curl --location --request GET 'https://login.smoobu.com/api/apartments' \
--header 'Authorization: Bearer  6490e32fad291d54402c5879dee4cd8840936b4c'

Instead of Api-Key, an authorization header is required.

Get User Api

Below command will return profile data of the current user based on Api-Key:

curl -X GET \
  https://login.smoobu.com/api/me \
  -H 'Api-Key: secretApiKey' \
  -H 'Cache-Control: no-cache'

The above command returns JSON structured like this with Status code 200:

{
    "id": 7,
    "firstName": "John",
    "lastName": "Doe",
    "email": "jhon@example.com"
}

Response if authentication failed Status code 401:

{
    "status": 401,
    "title": "Unauthorized",
    "detail": "Authentication required"
}

Get profile data of the current user based on Api-Key

HTTP Request

GET https://login.smoobu.com/api/me

Json Response

Parameter Format Description
id int user Id.
firstName string First name of the user.
lastName string Last name of the user.
email string Email of the user.

Smoobu Availability API

curl -X POST \
  https://login.smoobu.com/booking/checkApartmentAvailability \
  -H 'Api-Key: secretApiKey' \
  -H 'cache-control: no-cache' \
  -d '{
    "arrivalDate" : "2017-11-01",
    "departureDate":  "2017-12-03",
    "apartments": [2, 3, 14],
    "customerId": 9
}'

The above command returns JSON structured like this:

{
    "availableApartments": [
        2,
        3,
        14

    ],
    "prices": {
        "3": {
            "price": 36560,
            "currency": "IDR"
        },
        "14": {
            "price": 4415,
            "currency": "IDR"
        }
    },
    "errorMessages": {
        "2": {
            "errorCode": 401,
            "message": "The duration of the booking is too short.",
            "minimumLengthOfStay": 50
        }
    }
}

If the authentication failed it return this jason:

{
    "title": "Error occurred",
    "detail": "verification error"
}

Partners and customers of Smoobu can check their availability of properties and dates. For that you send a request with arrival and departure date and the property ID.

HTTP Request

POST https://login.smoobu.com/booking/checkApartmentAvailability

Json Request Body

Parameter Format Description
arrivalDate yyyy-mm-dd Start date of the booking.
departureDate yyyy-mm-dd End date of the booking.
apartments array Check availability in the given apartments. If apartments is empty it check all apartments.
customerId int Id of the customer/user with the given apartment and the api key.

Json Response

We send you more than available or unavailable. If it is available we send you the price for that period. If you have restrictions which don't allow this reservation we show the reason for disapproval.

Parameter Format Description
availableApartments array All available apartments from request.
prices object The Key of the price object match with the apartment id. The price object contain the price and the currency.
prices.price int price for the range and for the apartment.
prices.currency string Currency of the price.
errorMessages object The Key of the error message object match with the apartment id. The error message object contain all unavailable apartments with reason why it not available.
errorMessages.errorCode int Error id.
errorMessages.message string Error message.
errorMessages.minimumLengthOfStay int Number of required days. Occur only if the booking is to short.
errorMessages.numberOfGuest int Max number of guests. Occur only if the number of guests is to high.
errorMessages.leadTime int Number of days before a booking. Occur Only if the number of days before is to small.
errorMessages.minimumLengthBetweenBookings int Number of days between bookings. Occur only if the Distance between bookings is to short.
errorMessages.arrivalDays int Allowed arrival dates. Occur only if the arrival day is not in the list of allowed days.

Errors

Error Code Message
400 The number of guests exceeds the limit of the apartment.
401 The duration of the booking is too short.
402 The chosen day of arrival is not available
403 Arrival day is too short term.
404 Minimum between bookings is too short.

Create Booking Api

The above command create a booking only with the mandatory fields:

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": "01.09.2019",
  "departureDate": "03.09.2019",
  "channelId": 63,
  "apartmentId": 7,
}'

The above command returns JSON structured like this with Status code 200:

{
    "id": 906
}

The above comand create a booking with all fields:

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": "05.09.2019",
  "departureDate": "08.09.2019",
  "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"
}'

Response if authentication failed Status code 401:

{
    "status": 401,
    "title": "Unauthorized",
    "detail": "Authentication required"
}

Response if there is an validation error code 400:

{
    "status": 400,
    "title": "Bad Request",
    "detail": "Failed validation",
    "validation_messages": {
        "error": "There exists already a reservation from 05.09.2019 to 08.09.2019."
    }
}

Partners and customers of Smoobu can send bookings to Smoobu. Our application receives them like a booking from a booking channel and synchronizes it into every other channel.

HTTP Request

POST https://login.smoobu.com/api/reservations

Json Request Body

Parameter Format Mandatory Description
arrivalDate yyyy-mm-dd Yes Start date of the booking.
departureDate yyyy-mm-dd Yes End date of the booking.
channelId int Yes Id of the channel. Smoobu provide the id.
apartmentId int Yes Id of the apartment
arrivalTime string * Time when the guest will arrive. In the Format "HH:ii"
departureTime string No Time when the guest will departs. In the Format "HH:ii"
firstName string * First name of the guest
lastName string * First name of the guest
notice string * Notes. Free text field for you information.
adults int No Number of adults
children int No Number of children
price float No Total price of the booking.
priceStatus int No 1 or 0 . See table below.
prepayment float No Prepayment of the booking.
prepaymentStatus int No 1 or 0 . See table below.
deposit float No Deposit of the booking.
depositStatus int No 1 or 0 . See table below.
address object * address of the guest
address.street string * street of the address
address.postalCode string * postal code of the address
address.location string * location of the address
country string * country of the address
email string * Email of the guest
phone string * Phone Number of the guest
language string No Guest language i.e en, de, es

* depend on the user settings which can be found in the booking-tool settings in "Form Content"

Price/Prepayment/Deposit Status

Id Description
0 open/not payed
1 complete payment

Json Response

Parameter Format Description
id int If booking successful entered it return the booking id

Update Booking Api

The below command update booking with provided fields:

curl -X PUT \
  https://login.smoobu.com/api/reservations/12 \
  -H 'Api-Key: secretApiKey' \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -d '{
        "departureTime": "11:00",
        "arrivalTime": "18:00",
        "price": 50.10,
        "priceStatus": 1,
        "prepayment": 10,
        "prepaymentStatus": 0,
        "deposit": 40,
        "depositStatus": 1,
        "notice": "",
        "assistantNotice": "",
        "guestName": "Jhon Doe",
        "guestEmail": "example@domain.com",
        "guestPhone": "04545451",
        "adults": 1,
        "children": 3,
        "language" : "de"
      }'

The above command returns JSON structured like this with Status code 200:

{
    "status": 200,
    "title": "Resource updated successfully",
    "detail": ""
}

Response if authentication failed Status code 401:

{
    "status": 401,
    "title": "Unauthorized",
    "detail": "Authentication required"
}

Response if there is an validation error code 400:

{
    "status": 400,
    "title": "Bad Request",
    "detail": "Failed validation",
    "validation_messages": {
        "arrivalTime": {
            "wrongFormat": "Please enter a valid time for check-in and check-out. Use the 24 hour format, for example 16:00."
        }
    }
}

Partners and customers of Smoobu can update existing bookings to Smoobu.

HTTP Request

PUT https://login.smoobu.com/api/reservations/<reservationId>

URL Parameters

Parameter Description
reservationId Reservation / Booking Id

Json Request Body

Parameter Format Mandatory Description
arrivalTime string * Time when the guest will arrive. In the Format "HH:ii"
departureTime string No Time when the guest will departs. In the Format "HH:ii"
price float No Total price of the booking.
priceStatus int No 1 or 0 . See table below.
prepayment float No Prepayment of the booking.
prepaymentStatus int No 1 or 0 . See table below.
deposit float No Deposit of the booking.
depositStatus int No 1 or 0 . See table below.
guestName string * Guest name.
guestEmail string * Email of the guest
guestPhone string * Phone Number of the guest
notice string * Notes. Free text field for you information.
assistantNotice string * Assistant instructions.
adults int No Number of adults
children int No Number of children
language string No Guest language i.e en, de, es

* depend on the user settings which can be found in the booking-tool settings in "Form Content"

Price/Prepayment/Deposit Status

Id Description
0 open/not payed
1 complete payment

Json Response

Parameter Format Description
status int 200
title string Resource updated successfully
detail string

Get Bookings Api

The above command get all bookings:

curl -X GET \
  https://login.smoobu.com/api/reservations \
  -H 'Api-Key: secretApiKey' \
  -H 'Cache-Control: no-cache''

The above command returns JSON structured like this with Status code 200:

{
 "page_count": 1,
 "page_size": 25,
 "total_items": 3,
 "page": 1,
 "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"
 },
 {
  "id": 292,
  "reference-id": "4545dS4254",
  "type": "reservation",
  "arrival": "2018-01-22",
  "departure": "2018-01-25",
  "created-at": "2018-01-03 13:51",
  "apartment": {
   "id": 50017,
   "name": "Seaside apartment"
  },
  "channel": {
   "id": 465885,
   "name": "Airbnb"
  },
  "guest-name": "Hermine Granger",
  "email": "Hermine@hogwarts.com",
  "phone": "+49123456789",
  "adults": 1,
  "children": 0,
  "check-in": "18:00",
  "check-out": "",
  "notice": "she arrives by plane and is maybe a little bit late",
  "price": 200,
  "price-paid": "YES",
  "deposit": 0,
  "deposit-paid": "No",
  "language": "en",
  "guest-app-url": "https://guest.smoobu.com/?t=sf7678asd&b=292"
  }
 ]
}

Response if authentication failed Status code 401:

{
    "status": 401,
    "title": "Unauthorized",
    "detail": "Authentication required"
}

With this Call you can get all your existing reservations with all information.

HTTP Request

GET https://login.smoobu.com/api/reservations

URL Query Parameters

Parameter Format Mandatory Description
created_from yyyy-mm-dd No show all bookings with the created at in the range
created_to yyyy-mm-dd No show all bookings with the created at in the range
from yyyy-mm-dd No show all bookings in the range
to yyyy-mm-dd No show all bookings in the range
showCancellation boolean No show canceled bookings too
page int No current page
apartmentId int No Id of the apartment

Json Response

Parameter Format Description
page_count int number of all pages
page_size int max number of bookings on one page
total_items int number of all bookings
page int number of current page
bookings array contain all booking objects
bookings.id int id of the booking
bookings.reference-id int Channel reference Id (AirBNB or Booking.com reference Id)
bookings.type string see types in the table below
bookings.arrival string start date of the booking
bookings.departure string end date of the booking
bookings.created-at string create date of the booking
bookings.apartment object apartment of the booking
bookings.apartment.id int id of the apartment
bookings.apartment.name string name of the apartment
bookings.channel object channel of the booking
bookings.channel.id int id of the channel
bookings.channel.name int name of the channel
bookings.guest-name string name of the guest
bookings.email string email of the guest
bookings.phone string phone number of the guest
bookings.adults int number of adults
bookings.children int number of children
bookings.check-in string check in time of the guests
bookings.check-out string check in time of the guests
bookings.notice string notice from the guests
bookings.price int price of the booking
bookings.price-paid bool price already paid ("yes"/"no")
bookings.prepayment int prepayment of the booking
bookings.prepayment-paid bool prepayment paid ("yes"/"no")
bookings.deposit int deposit of the booking
bookings.deposit-paid bool deposit already paid ("yes"/"no")
language string language(locale) of the guest
guest-app-url string guest app URL for the booking.
is-blocked-booking bool indicate if booking was created for blocking period purpose.

booking type

booking type
reservation
modification of booking
cancellation

Get Booking Api

The below command will return booking:

curl -X GET \
  https://login.smoobu.com/api/reservations/291 \
  -H 'Api-Key: secretApiKey' \
  -H 'Cache-Control: no-cache''

The above command returns JSON structured like this with Status code 200:

{
  "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"
 }

Response if authentication failed Status code 401:

{
    "status": 401,
    "title": "Unauthorized",
    "detail": "Authentication required"
}

With this Call you can get all your existing reservations with all information.

HTTP Request

GET https://login.smoobu.com/api/reservations/<reservationId>

URL Parameters

Parameter Description
reservationId Reservation / Booking Id

Json Response

Parameter Format Description
id int id of the booking
reference-id int Channel reference Id (AirBNB or Booking.com reference Id)
type string see types in the table below
arrival string start date of the booking
departure string end date of the booking
created-at string create date of the booking
apartment object apartment of the booking
apartment.id int id of the apartment
apartment.name string name of the apartment
channel object channel of the booking
channel.id int id of the channel
channel.name int name of the channel
guest-name string name of the guest
email string email of the guest
phone string phone number of the guest
adults int number of adults
children int number of children
check-in string check in time of the guests
check-out string check in time of the guests
notice string notice from the guests
price int price of the booking
price-paid bool price already paid ("yes"/"no")
prepayment int prepayment of the booking
prepayment-paid bool prepayment paid ("yes"/"no")
deposit int deposit of the booking
deposit-paid bool deposit already paid ("yes"/"no")
language string language(locale) of the guest
guest-app-url string guest app URL for the booking.
is-blocked-booking bool indicate if booking was created for blocking period purpose.

booking type

booking type
reservation
modification of booking
cancellation

Cancel Reservation Api

The below command cancel a reservation:

curl -X DELETE \
  https://login.smoobu.com/api/reservations/54 \
  -H 'Api-Key: secretApiKey' \
  -H 'Cache-Control: no-cache''

The above command returns JSON structured like this with Status code 200:

{
 "success": true
}

Response if authentication failed Status code 401:

{
    "status": 401,
    "title": "Unauthorized",
    "detail": "Authentication required"
}

With this call you can cancel a existing reservation. The booking is still in the system as a cancelled booking.

HTTP Request

DELETE https://login.smoobu.com/api/reservations/<reservationId>

URL Parameters

Parameter Description
reservationId Reservation / Booking Id

Get Price Elements Api (Beta)

The command get all price elements:

curl -X GET \
  https://login.smoobu.com/api/reservations/291/price-elements \
  -H 'Api-Key: secretApiKey' \
  -H 'Cache-Control: no-cache''

The above command returns JSON structured like this with Status code 200:

{
 "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
      }
 ]
}

Response if authentication failed Status code 401:

{
    "status": 401,
    "title": "Unauthorized",
    "detail": "Authentication required"
}

With this Call you can get all your price elements for the booking.

HTTP Request

GET https://login.smoobu.com/api/reservations/<reservationId>/price-elements

URL Parameters

Parameter Description
reservationId Reservation / Booking Id

Json Response

Parameter Format Description
priceElements array contain all booking objects
priceElements.id int
priceElements.type string see types in the table below
priceElements.name string
priceElements.amount float
priceElements.quantity int
priceElements.tax float
priceElements.currencyCode string ISO 4217 currency code
priceElements.sortOrder int sorting order to display price elements in reservation detail page. The direction of sorting is ascending
priceElements.priceIncludedInId int Id of price element which cover the price of this element.
Types
basePrice
cleaningFee
addon
longStayDiscount
coupon

Get Price Element Api (Beta)

The below command will return booking:

curl -X GET \
  https://login.smoobu.com/api/reservations/291/price-elements/10 \
  -H 'Api-Key: secretApiKey' \
  -H 'Cache-Control: no-cache''

The above command returns JSON structured like this with Status code 200:

{
  "id": 10,
  "type": "basePrice",
  "name": "Base price",
  "amount": 40,
  "quantity": null,
  "tax": null,
  "currencyCode": "EUR",
  "sortOrder": 1,
  "priceIncludedInId": null
 }

Response if authentication failed Status code 401:

{
    "status": 401,
    "title": "Unauthorized",
    "detail": "Authentication required"
}

HTTP Request

GET https://login.smoobu.com/api/reservations/<reservationId>/price-elements/<priceElementId>

URL Parameters

Parameter Description
reservationId Reservation / Booking Id
priceElementId Price Element Id

Json Response

Parameter Format Description
id int
type string see types in the table below
name string
amount float
quantity int
tax float
currencyCode string ISO 4217 currency code
sortOrder int sorting order to display price elements in reservation detail page. The direction of sorting is ascending
priceIncludedInId int Id of price element which cover the price of this element.
Types
basePrice
cleaningFee
addon
longStayDiscount
coupon

Create Price Element Api (Beta)

The below command create a price element for the booking:

curl -X POST \
  https://login.smoobu.com/api/reservations/291/price-elements \
  -H 'Api-Key: secretApiKey' \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -d '{
      "type": "",
      "name": "example name",
      "amount": 50,
      "quantity": 1,
      "tax": 5.5,
      "currencyCode": "EUR",
      "sortOrder": 110,
      "priceIncludedInId": null
}'

The above command returns JSON structured like this with Status code 201:

{
    "status": 201,
    "title": "Resource created successfully",
    "detail": {
        "id": 62
    }
}

Response if authentication failed Status code 401:

{
    "status": 401,
    "title": "Unauthorized",
    "detail": "Authentication required"
}

Response if there is an validation error code 400:

{
    "status": 400,
    "title": "Bad Request",
    "detail": "Failed validation",
    "validation_messages": {
          "amount":{"isEmpty":"Value is required and can't be empty"}
    }
}

HTTP Request

POST https://login.smoobu.com/api/reservations/<reservationId>/price-elements

Json Request Body

Parameter Format Mandatory Description
type string No See below types table.
name string Yes Name of price element.
amount float Yes
quantity int No Depend on price element.
tax float No Tax if applicable
currencyCode string Yes ISO 4217 currency code
sortOrder int No sorting order to display price elements in reservation detail page. The direction of sorting is ascending
priceIncludedInId int No Id of price element which cover the price of this element.
Types
basePrice
cleaningFee
addon
longStayDiscount
coupon

Json Response

Parameter Format Description
status int 201
title string Resource updated successfully
detail array
detail.id int Id of newly created price element

Update Price Element Api (Beta)

The below command create a price element for the booking:

curl -X POST \
  https://login.smoobu.com/api/reservations/291/price-elements/10 \
  -H 'Api-Key: secretApiKey' \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -d '{
      "type": "",
      "name": "example name",
      "amount": 50,
      "quantity": 1,
      "tax": 5.5,
      "currencyCode": "EUR",
      "sortOrder": 110,
      "priceIncludedInId": null
}'

The above command returns JSON structured like this with Status code 200:

{
    "status": 200,
    "title": "Resource updated successfully",
    "detail": ""
}

Response if authentication failed Status code 401:

{
    "status": 401,
    "title": "Unauthorized",
    "detail": "Authentication required"
}

Response if there is an validation error code 400:

{
    "status": 400,
    "title": "Bad Request",
    "detail": "Failed validation",
    "validation_messages": {
      "amount":{"isEmpty":"Value is required and can't be empty"}
    }
}

HTTP Request

POST https://login.smoobu.com/api/reservations/<reservationId>/price-elements/<priceElementId>

URL Parameters

Parameter Description
reservationId Reservation / Booking Id
priceElementId Price element id

Json Request Body

Parameter Format Mandatory Description
type string No See below types table.
name string Yes Name of price element.
amount float Yes
quantity int No Depend on price element.
tax float No Tax if applicable
currencyCode string Yes ISO 4217 currency code
sortOrder int No sorting order to display price elements in reservation detail page. The direction of sorting is ascending
priceIncludedInId int No Id of price element which cover the price of this element.
Types
basePrice
cleaningFee
addon
longStayDiscount
coupon

Json Response

Parameter Format Description
status int 200
title string Resource updated successfully
detail string

Delete Price Element Api (Beta)

The below command delete a price element:

curl -X DELETE \
  https://login.smoobu.com/api/reservations/54/price-elements/10 \
  -H 'Api-Key: secretApiKey' \
  -H 'Cache-Control: no-cache''

The above command returns JSON structured like this with Status code 200:

{
    "status": 200,
    "title": "Resource deleted successfully",
    "detail": ""
}

Response if authentication failed Status code 401:

{
    "status": 401,
    "title": "Unauthorized",
    "detail": "Authentication required"
}

HTTP Request

DELETE https://login.smoobu.com/api/reservations/<reservationId>/price-elements/<priceElementId>

URL Parameters

Parameter Description
reservationId Reservation / Booking Id
priceElementId Price element id

Get Rates Api

The above command get all dates:

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''

The above command returns JSON structured like this with Status code 200:

{
    "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
            },
            "2019-01-17": {
                "price": 444,
                "min_length_of_stay": 2,
                "available": 1
            },
            "2019-01-18": {
                "price": 444,
                "min_length_of_stay": 2,
                "available": 1
            },
            "2019-01-19": {
                "price": 444,
                "min_length_of_stay": 2,
                "available": 1
            },
            "2019-01-20": {
                "price": 200,
                "min_length_of_stay": null,
                "available": 1
            },
            "2019-01-21": {
                "price": 200,
                "min_length_of_stay": null,
                "available": 1
            },
            "2019-01-22": {
                "price": 200,
                "min_length_of_stay": null,
                "available": 1
            },
            "2019-01-23": {
                "price": 200,
                "min_length_of_stay": null,
                "available": 1
            },
            "2019-01-24": {
                "price": 200,
                "min_length_of_stay": 3,
                "available": 1
            },
            "2019-01-25": {
                "price": null,
                "min_length_of_stay": null,
                "available": 1
            },
            "2019-01-26": {
                "price": 444,
                "min_length_of_stay": 2,
                "available": 1
            },
            "2019-01-27": {
                "price": null,
                "min_length_of_stay": null,
                "available": 1
            },
            "2019-01-28": {
                "price": 45,
                "min_length_of_stay": 5,
                "available": 1
            },
            "2019-01-29": {
                "price": null,
                "min_length_of_stay": null,
                "available": 1
            },
            "2019-01-30": {
                "price": null,
                "min_length_of_stay": null,
                "available": 1
            }
        },
        "401": {
            "2019-01-15": {
                "price": 170,
                "min_length_of_stay": null,
                "available": 1
            },
            "2019-01-16": {
                "price": 170,
                "min_length_of_stay": null,
                "available": 1
            },
            "2019-01-17": {
                "price": 170,
                "min_length_of_stay": null,
                "available": 1
            },
            "2019-01-18": {
                "price": 170,
                "min_length_of_stay": null,
                "available": 1
            },
            "2019-01-19": {
                "price": 170,
                "min_length_of_stay": null,
                "available": 1
            },
            "2019-01-20": {
                "price": null,
                "min_length_of_stay": null,
                "available": 1
            },
            "2019-01-21": {
                "price": null,
                "min_length_of_stay": null,
                "available": 1
            },
            "2019-01-22": {
                "price": null,
                "min_length_of_stay": null,
                "available": 1
            },
            "2019-01-23": {
                "price": null,
                "min_length_of_stay": null,
                "available": 1
            },
            "2019-01-24": {
                "price": 200,
                "min_length_of_stay": 3,
                "available": 1
            },
            "2019-01-25": {
                "price": null,
                "min_length_of_stay": null,
                "available": 1
            },
            "2019-01-26": {
                "price": null,
                "min_length_of_stay": null,
                "available": 1
            },
            "2019-01-27": {
                "price": null,
                "min_length_of_stay": null,
                "available": 1
            },
            "2019-01-28": {
                "price": null,
                "min_length_of_stay": null,
                "available": 1
            },
            "2019-01-29": {
                "price": null,
                "min_length_of_stay": null,
                "available": 1
            },
            "2019-01-30": {
                "price": null,
                "min_length_of_stay": null,
                "available": 1
            }
        }
    }
}

Response if authentication failed Status code 401:

{
    "status": 401,
    "title": "Unauthorized",
    "detail": "Authentication required"
}

Example Response for validation error error code 500: json { "status": 500, "title": "Internal Server Error", "detail": "Apartment not found for this user" }

With this Call you can get all your rates

HTTP Request

GET https://login.smoobu.com/api/rates

URL Query Parameters

Parameter Format Mandatory Description
start_date yyyy-mm-dd Yes show all dates in the range
end_date yyyy-mm-dd Yes show all dates in the range
apartments array Yes array of apartment ids

Json Response

Parameter Format Description
data array include all dates departed in apartments. Array key is the apartment id
data.date object Array key is date in form y yyyy-mm-dd
date.price double price of this date. Null if there is no price
date.min_length_of_stay int min length of stay for this date. Null if there is no value
date.available int say how often the apartment is available 0 for not available

Post Rates Api

The above command create/update a rate:

curl -X POST \
  https://login.smoobu.com/api/rates \
  -H 'Api-Key: secretApiKey' \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -d '{
  "apartments": [apartmentId1, apartmentId2],
  "operations": [
    {
        "dates": [
            "2019-01-24:2019-01-27",
            "2019-01-29",
            "2019-02-01:2019-02-05"
        ],
        "daily_price": 140,
        "min_length_of_stay": 2
    },

    {
            "dates": [
                "2019-02-29"               
            ],
            "daily_price": 200,
            "min_length_of_stay": 4
        }
  ]
}'

The above command returns JSON structured like this with Status code 200:

{
    "success": true
}

Response if authentication failed Status code 401:

{
    "status": 401,
    "title": "Unauthorized",
    "detail": "Authentication required"
}

Response if you send only min length of stay but there is no price error code 500:

{
    "status": 500,
    "title": "Internal Server Error",
    "detail": "Price is required"
}

Example Response for validation error error code 500:

{
    "status": 500,
    "title": "Internal Server Error",
    "detail": "invalid Date format 22\/01\/19"
}

Partners and customers of Smoobu can send rates to Smoobu. Our application synchronizes it into other channels which has enabled the price sync.

HTTP Request

POST https://login.smoobu.com/api/rates

Json Request Body

Parameter Format Mandatory Description
apartments array Yes Array with apartment ids
operations objects Yes array with all operations
operation.dates array Yes Dates for the operation you can add a single dates with format "yyyy-mm-dd" or a ranges with format "yyyy-mm-dd:yyyy-mm-dd".
operation.daily_price double * Price of the operation
operation.min_length_of_stay int * Min length of booking. Can only set if this date has a price or set together with price

* operation need minimum one of this values but not all

Json Response

Parameter Format Description
success boolean response is true or validation error response with message in detail

Get Apartment-IDs Api

The above command get all apartments

curl -X GET \
  https://login.smoobu.com/api/apartments \
  -H 'Api-Key: secretApiKey' \
  -H 'Cache-Control: no-cache''

The above command returns JSON structured like this with Status code 200:

{
 "apartments": [
  {
    "id": 1,
    "name": "Property 1"
  },
  {
    "id": 2,
    "name": "Property 2"
  }
 ]
}

Response if authentication failed Status code 401:

{
    "status": 401,
    "title": "Unauthorized",
    "detail": "Authentication required"
}

With this Call you can get all your properties.

HTTP Request

GET https://login.smoobu.com/api/apartments

Json Response

Parameter Format Description
apartments array contain all apartment objects
apartments.id int id of the apartment
apartments.name string name of the apartment

Get Apartment Api

The above command get more details for a specific listing

curl -X GET \
  https://login.smoobu.com/api/apartments/1 \
  -H 'Api-Key: secretApiKey' \
  -H 'Cache-Control: no-cache''

The above command returns JSON structured like this with Status code 200:


{
    "location": {
        "street": "Wönnichstr. 68/70",
        "zip": "10317",
        "city": "Berlin",
        "country": "Germany",
        "latitude": "52.5200080000000",
        "longitude": "13.4049540000000"
    },
    "rooms": {
        "bedrooms": 4,
        "bathrooms": 2,
        "maxOccupancy": 4
    },
    "equipments": [
        "Internet",
        "Whirlpool",
        "Pool",
        "Heating"
    ],
    "currency": "EUR",
    "price": {
            "minimal": "10.00",
            "maximal": "100.00"
    }
}

Response if authentication failed Status code 401:

{
    "status": 401,
    "title": "Unauthorized",
    "detail": "Authentication required"
}

With this call you can get more information about one property. Especially the information which are relevant to calculate competitive rates. You can create and edit this content in the Smoobu website builder even if you don't use our website or the website isn't online.

HTTP Request

GET https://login.smoobu.com/api/apartments/<apartmentId>

URL Parameters

Parameter Description
apartmentId Id of the apartment // you can fin the apartment id in getApartmentsApi

Json Response

Parameter Format Description
location object group all location information of the apartment
location.street string street of the apartment
location.zip string zip of the apartment
location.city string city of the apartment
location.country string country of the apartment
location.latitude string latitude of the apartment
location.longitude string longitude of the apartment
rooms object group all room information of the apartment
rooms.bedrooms integer number of bedrooms
rooms.bathrooms integer number of bathrooms
rooms.maxOccupancy integer max number of persons
amenities array list of amenities
currency string Currency of the user e.g. ("EUR")
price object
price.minimal string minimum price per night
price.maximal string maximum price per night

Get Message Api

Below command to get all messages:

curl -X GET \
  https://login.smoobu.com/api/reservations/1/messages \
  -H 'Api-Key: secretApiKey' \
  -H 'Cache-Control: no-cache''

The above command returns JSON structured like this with Status code 200:

{
 "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": "<p>Hello Kim Klaus, <br />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.</p>",
  "type": 2
 },
 {
  "id": 2,
  "subject": "re-welcome",
  "message": "",
  "messageHtml": "<p>Please send me exact apartment location</p>",
  "type": 1
  }
 ]
}

Response if authentication failed Status code 401:

{
    "status": 401,
    "title": "Unauthorized",
    "detail": "Authentication required"
}

With this call you can get all messages and the complete conversation for a reservation.

HTTP Request

GET https://login.smoobu.com/api/reservations/<reservationId>/messages

URL Parameters

Parameter Description
reservationId Id of the booking

URL Query Parameters

Parameter Format Mandatory Description
page int No current page
onlyRelatedToGuest boolean No get messages only related to guest. Setting this parameter to false will fetch all messages for the booking.

Json Response

Parameter Format Description
page_count int number of all pages
page_size int max number of messages on one page
total_items int number of all messages
page int number of current page
messages array contain all message objects
messages.id int id of the booking
messages.subject string message subject
messages.message string plain-text message
messages.htmlMessage string message in html
messages.type int 1 = inbox, 2 = outbox

Get Addons Api

The command get all addons:

curl -X GET \
  https://login.smoobu.com/api/addons \
  -H 'Api-Key: secretApiKey' \
  -H 'Cache-Control: no-cache''

The command get all addons for one apartment:

curl -X GET \
  https://login.smoobu.com/api/addons/<apartmentId> \
  -H 'Api-Key: secretApiKey' \
  -H 'Cache-Control: no-cache''

URL Parameters

Parameter Description
apartmentId Apartment id

The above command returns JSON structured like this with Status code 200:

{
 "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
         }
 ]
}

Response if authentication failed Status code 401:

{
    "status": 401,
    "title": "Unauthorized",
    "detail": "Authentication required"
}

With this Call you can get all your existing addons.

HTTP Request

GET https://login.smoobu.com/api/addons

URL Parameters

Parameter Format Mandatory Description
apartmentId int No filter addons for single apartment

Json Response

Parameter Format Description
addons array contain all booking objects
addons.id int id of the addon
addons.name string name of the addon
addons.apartments array list os apartment ids
addons.amount float value of the amount
addons.usePercentage boolean amount will be calculate by percentage or as fix value
addons.tax float tax amount
addons.calculationType int tax calculation type
addons.optional boolean if the addon is optional
addons.maxQuantity int max number of this item for one booking
addons.whereVisible int

booking type

calculation type description
0 per booking
1 per person
2 per night
3 per person and night

whereVisible type

calculation type description
null All
0 All
1 booking-tool
2 guest-app

Send message to guest

Below command send a message to guest for the given booking:

curl -X POST \
  'https://login.smoobu.com/api/reservations/1/messages/send-message-to-guest' \
  -H 'Api-Key: _5ybL0NssHvDT3WL4AlWUtfcYHup~-vw' \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -d '{
    "subject" : "Test subject",
    "messageBody" : "test"
}'

The above command returns JSON structured like this with Status code 201:

{
    "status": 201,
    "title": "Resource created successfully",
    "detail": ""
}

Response if authentication failed Status code 401:

{
    "status": 401,
    "title": "Unauthorized",
    "detail": "Authentication required"
}

Response if there is an validation error code 400:

{
    "status": 400,
    "title": "Bad Request",
    "detail": "Failed validation",
    "validation_messages": {
        "messageBody": {
            "isEmpty": "Value is required and can't be empty"
        }
    }
}

Partners and customers of Smoobu can send message to guests of a reservation.

HTTP Request

POST https://login.smoobu.com/api/reservations/<reservationId>/messages/send-message-to-guest

URL Parameters

Parameter Description
reservationId Id of the booking

Json Request Body

Parameter Format Mandatory Description
subject string No Message subject
messageBody string Yes Message content in HTML or plain-text.

Send message to host

Below command send a message to host for the given booking:

curl -X POST \
  'https://login.smoobu.com/api/reservations/1/messages/send-message-to-host' \
  -H 'Api-Key: _5ybL0NssHvDT3WL4AlWUtfcYHup~-vw' \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -d '{
    "subject" : "Test subject",
    "messageBody" : "test"
}'

The above command returns JSON structured like this with Status code 201:

{
    "status": 201,
    "title": "Resource created successfully",
    "detail": ""
}

Response if authentication failed Status code 401:

{
    "status": 401,
    "title": "Unauthorized",
    "detail": "Authentication required"
}

Response if there is an validation error code 400:

{
    "status": 400,
    "title": "Bad Request",
    "detail": "Failed validation",
    "validation_messages": {
        "messageBody": {
            "isEmpty": "Value is required and can't be empty"
        }
    }
}

Partners and customers of Smoobu can send messages to the Smoobu user as a host.

HTTP Request

POST https://login.smoobu.com/api/reservations/<reservationId>/messages/send-message-to-host

URL Parameters

Parameter Description
reservationId Id of the booking

Json Request Body

Parameter Format Mandatory Description
subject string No Message subject
messageBody string Yes Message content in HTML or plain-text.

Get Custom Placeholders Api (Beta)

The command get all custom placeholders:

curl -X GET \
  https://login.smoobu.com/api/custom-placeholders \
  -H 'Api-Key: secretApiKey' \
  -H 'Cache-Control: no-cache''

The above command returns JSON structured like this with Status code 200:

{
    "customPlaceholders": [
        {
            "id": 1,
            "key": "exampleKey",
            "defaultValue": "example text",
            "type": 1,
            "foreignId": 185
        },
        {
            "id": 2,
            "key": "globalPlaceholder",
            "defaultValue": "example text2",
            "type": null,
            "foreignId": null
        }
    ]
}

Response if authentication failed Status code 401:

{
    "status": 401,
    "title": "Unauthorized",
    "detail": "Authentication required"
}

With this Call you can get all your custom placeholders.

HTTP Request

GET https://login.smoobu.com/api/custom-placeholders

Json Response

Parameter Format Description
customPlaceholders array contain all objects
customPlaceholders.id int
customPlaceholders.key string The placeholder key.
customPlaceholders.defaultValue string Default value if no translation available.
customPlaceholders.type string see types in the table below
customPlaceholders.foreignId int Depend on type. i.e if type is booking, then it is booking id.

Types

Type Description
1 Booking
2 Apartment

Get Custom Placeholder Api (Beta)

The below command will return custom placeholder:

curl -X GET \
  https://login.smoobu.com/api/custom-placeholders/2 \
  -H 'Api-Key: secretApiKey' \
  -H 'Cache-Control: no-cache''

The above command returns JSON structured like this with Status code 200:

{
   "id": 1,
   "key": "exampleKey",
   "defaultValue": "example text",
   "type": 1,
   "foreignId": 185
 }

Response if authentication failed Status code 401:

{
    "status": 401,
    "title": "Unauthorized",
    "detail": "Authentication required"
}

HTTP Request

GET https://login.smoobu.com/api/custom-placeholders/<customPlaceHolderId>

URL Parameters

Parameter Description
customPlaceHolderId Custom placeholder Id.

Json Response

Parameter Format Description
id int
key string The placeholder key.
defaultValue string Default value if no translation available.
type string see types in the table below
foreignId int Depend on type. i.e if type is booking, then it is booking id.

Types

Type Description
1 Booking
2 Apartment

Create Custom Placeholder Api (Beta)

The below command create a price element for the booking:

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
}'

The above command returns JSON structured like this with Status code 201:

{
    "status": 201,
    "title": "Resource created successfully",
    "detail": {
        "id": 1
    }
}

Response if authentication failed Status code 401:

{
    "status": 401,
    "title": "Unauthorized",
    "detail": "Authentication required"
}

Response if there is an validation error code 400:

{
    "status": 400,
    "title": "Bad Request",
    "detail": "Failed validation",
    "validation_messages": {
          "key": {
                      "isEmpty": "Value is required and can't be empty"
           }
    }
}

HTTP Request

POST https://login.smoobu.com/api/custom-placeholders

Json Request Body

Parameter Format Mandatory Description
key string Yes Placeholder key.
defaultValue string No Default value if no translation found.
type string No See below types table.
foreignId int No Depend on type. i.e. if type is booking, then it is booking id.

Types

Type Description
1 Booking
2 Apartment

Json Response

Parameter Format Description
status int 201
title string Resource updated successfully
detail array
detail.id int Id of newly created placeholder

Update Custom Placeholder Api (Beta)

The below command create a custom placeholder:

curl -X POST \
  https://login.smoobu.com/api/custom-placeholders/1 \
  -H 'Api-Key: secretApiKey' \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -d '{
      "key": "newKey",
      "type": 1,
      "foreignId": 185,
      "defaultValue": "updated text"
}'

The above command returns JSON structured like this with Status code 200:

{
    "status": 200,
    "title": "Resource updated successfully",
    "detail": ""
}

Response if authentication failed Status code 401:

{
    "status": 401,
    "title": "Unauthorized",
    "detail": "Authentication required"
}

Response if there is an validation error code 400:

{
    "status": 400,
    "title": "Bad Request",
    "detail": "Failed validation",
    "validation_messages": {
      "key": {
                            "isEmpty": "Value is required and can't be empty"
                 }
    }
}

HTTP Request

POST https://login.smoobu.com/api/custom-placeholders/<customPlaceHolderId>

URL Parameters

Parameter Description
customPlaceHolderId Id of the placeholder

Json Request Body

Parameter Format Mandatory Description
key string Yes Placeholder key.
defaultValue string No Default value if no translation found.
type string No See below types table.
foreignId int No Depend on type. i.e. if type is booking, then it is booking id.

Types

Type Description
1 Booking
2 Apartment

Json Response

Parameter Format Description
status int 200
title string Resource updated successfully
detail string

Delete Custom Placeholder Api (Beta)

The below command delete a custom placeholder:

curl -X DELETE \
  https://login.smoobu.com/api/custom-placeholders/1 \
  -H 'Api-Key: secretApiKey' \
  -H 'Cache-Control: no-cache''

The above command returns JSON structured like this with Status code 200:

{
    "status": 200,
    "title": "Resource deleted successfully",
    "detail": ""
}

Response if authentication failed Status code 401:

{
    "status": 401,
    "title": "Unauthorized",
    "detail": "Authentication required"
}

HTTP Request

DELETE https://login.smoobu.com/api/custom-placeholders/<customPlaceHolderId>

URL Parameters

Parameter Description
customPlaceHolderId Placeholder id

Get Custom Placeholder Translations Api (Beta)

The command get all translations for the custom placeholder:

curl -X GET \
  https://login.smoobu.com/api/custom-placeholders/1/translations \
  -H 'Api-Key: secretApiKey' \
  -H 'Cache-Control: no-cache''

The above command returns JSON structured like this with Status code 200:

{
    "translations": [
            {
                "id": 1,
                "locale": "de",
                "value": "german text"
            }
        ]
}

Response if authentication failed Status code 401:

{
    "status": 401,
    "title": "Unauthorized",
    "detail": "Authentication required"
}

With this Call you can get all translations for the placeholder.

HTTP Request

GET https://login.smoobu.com/api/custom-placeholders/<customPlaceHolderId>/translations

URL Parameters

Parameter Description
customPlaceHolderId Custom placeholder Id.

Json Response

Parameter Format Description
translations array contain all objects
translations.id int
translations.locale string The locale of the language.
translations.value string Text for the language

Supported Languages

Language Locale
Arabic ar
Azerbaijani az
Bulgarian bg
Catalan ca
Czech cs
Danish da
German de
Greek el
English en
Spanish es
Estonian et
French fr
Finnish fi
Hebrew he
Hindi hi
Croatian hr
Hungarian hu
Indonesian id
Icelandic is
Italian it
Japanese ja
Khmer km
Korean ko
Lao lo
Lithuanian lt
Latvian lv
Malay ms
Dutch nl
Norwegian no
Polish pl
Portuguese pt
Romanian ro
Russian ru
Slovak sk
Slovenian sl
Serbian sr
Swedish sv
Tagalog tl
Thai th
Turkish tr
Ukrainian uk
Vietnamese vi
Chinese zh

Get Custom Placeholder Translation Api (Beta)

The below command will return translation for custom placeholder:

curl -X GET \
  https://login.smoobu.com/api/custom-placeholders/2/translations/1 \
  -H 'Api-Key: secretApiKey' \
  -H 'Cache-Control: no-cache''

The above command returns JSON structured like this with Status code 200:

{
   "id": 1,
   "locale": "de",
   "value": "german text"
 }

Response if authentication failed Status code 401:

{
    "status": 401,
    "title": "Unauthorized",
    "detail": "Authentication required"
}

HTTP Request

GET https://login.smoobu.com/api/custom-placeholders/<customPlaceHolderId>/translations/<customPlaceHolderTranslationId>

URL Parameters

URL Parameters

Parameter Description
customPlaceHolderId Id of the placeholder
customPlaceHolderTranslationId Id of the translation

Json Response

Parameter Format Description

Json Response

Parameter Format Description
id int
locale string The locale of the language.
value string Text for the language

Supported Languages

Language Locale
Arabic ar
Azerbaijani az
Bulgarian bg
Catalan ca
Czech cs
Danish da
German de
Greek el
English en
Spanish es
Estonian et
French fr
Finnish fi
Hebrew he
Hindi hi
Croatian hr
Hungarian hu
Indonesian id
Icelandic is
Italian it
Japanese ja
Khmer km
Korean ko
Lao lo
Lithuanian lt
Latvian lv
Malay ms
Dutch nl
Norwegian no
Polish pl
Portuguese pt
Romanian ro
Russian ru
Slovak sk
Slovenian sl
Serbian sr
Swedish sv
Tagalog tl
Thai th
Turkish tr
Ukrainian uk
Vietnamese vi
Chinese zh

Create Custom Placeholder Translation Api (Beta)

The below command create a translation for the custom placeholder:

curl -X POST \
  https://login.smoobu.com/api/custom-placeholders/1/translations \
  -H 'Api-Key: secretApiKey' \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -d '{
      "locale": "de",
      "value": "german text"
}'

The above command returns JSON structured like this with Status code 201:

{
    "status": 201,
    "title": "Resource created successfully",
    "detail": {
        "id": 1
    }
}

Response if authentication failed Status code 401:

{
    "status": 401,
    "title": "Unauthorized",
    "detail": "Authentication required"
}

Response if there is an validation error code 400:

{
    "status": 400,
    "title": "Bad Request",
    "detail": "Failed validation",
    "validation_messages": {
            "value": {
                "isEmpty": "Value is required and can't be empty"
            },
            "locale": {
                "isEmpty": "Value is required and can't be empty"
            }
        }
}

HTTP Request

POST https://login.smoobu.com/api/custom-placeholders

Json Request Body

Parameter Format Mandatory Description
locale string Yes Locale of the language. see below table.
value string Yes Translation in given locale.

Supported Languages

Language Locale
Arabic ar
Azerbaijani az
Bulgarian bg
Catalan ca
Czech cs
Danish da
German de
Greek el
English en
Spanish es
Estonian et
French fr
Finnish fi
Hebrew he
Hindi hi
Croatian hr
Hungarian hu
Indonesian id
Icelandic is
Italian it
Japanese ja
Khmer km
Korean ko
Lao lo
Lithuanian lt
Latvian lv
Malay ms
Dutch nl
Norwegian no
Polish pl
Portuguese pt
Romanian ro
Russian ru
Slovak sk
Slovenian sl
Serbian sr
Swedish sv
Tagalog tl
Thai th
Turkish tr
Ukrainian uk
Vietnamese vi
Chinese zh

Json Response

Parameter Format Description
status int 201
title string Resource created successfully
detail array
detail.id int Id of newly created translation

Update Custom Placeholder Api (Beta)

The below command create a custom placeholder:

curl -X POST \
  https://login.smoobu.com/api/custom-placeholders/1/translations/1 \
  -H 'Api-Key: secretApiKey' \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -d '{
      "locale": "fr",
      "value": "French text"
}'

The above command returns JSON structured like this with Status code 200:

{
    "status": 200,
    "title": "Resource updated successfully",
    "detail": ""
}

Response if authentication failed Status code 401:

{
    "status": 401,
    "title": "Unauthorized",
    "detail": "Authentication required"
}

Response if there is an validation error code 400:

{
    "status": 400,
    "title": "Bad Request",
    "detail": "Failed validation",
    "validation_messages": {
                "value": {
                    "isEmpty": "Value is required and can't be empty"
                },
                "locale": {
                    "isEmpty": "Value is required and can't be empty"
                }
     }
}

HTTP Request

POST https://login.smoobu.com/api/custom-placeholders/<customPlaceHolderId>/translations/<customPlaceHolderTranslationId>

URL Parameters

Parameter Description
customPlaceHolderId Id of the placeholder
customPlaceHolderTranslationId Id of the translation

Json Request Body

Parameter Format Mandatory Description
locale string Yes Locale of the language. see below table.
value string Yes Translation in given locale.

Supported Languages

Language Locale
Arabic ar
Azerbaijani az
Bulgarian bg
Catalan ca
Czech cs
Danish da
German de
Greek el
English en
Spanish es
Estonian et
French fr
Finnish fi
Hebrew he
Hindi hi
Croatian hr
Hungarian hu
Indonesian id
Icelandic is
Italian it
Japanese ja
Khmer km
Korean ko
Lao lo
Lithuanian lt
Latvian lv
Malay ms
Dutch nl
Norwegian no
Polish pl
Portuguese pt
Romanian ro
Russian ru
Slovak sk
Slovenian sl
Serbian sr
Swedish sv
Tagalog tl
Thai th
Turkish tr
Ukrainian uk
Vietnamese vi
Chinese zh

Json Response

Parameter Format Description
status int 200
title string Resource updated successfully
detail string

Delete Custom Placeholder Translation Api (Beta)

The below command delete the translation of a custom placeholder:

curl -X DELETE \
  https://login.smoobu.com/api/custom-placeholders/1/translations/1 \
  -H 'Api-Key: secretApiKey' \
  -H 'Cache-Control: no-cache''

The above command returns JSON structured like this with Status code 200:

{
    "status": 200,
    "title": "Resource deleted successfully",
    "detail": ""
}

Response if authentication failed Status code 401:

{
    "status": 401,
    "title": "Unauthorized",
    "detail": "Authentication required"
}

HTTP Request

DELETE https://login.smoobu.com/api/custom-placeholders/<customPlaceHolderId>/translations/<customPlaceHolderTranslationId>

URL Parameters

Parameter Description
customPlaceHolderId Id of the placeholder
customPlaceHolderTranslationId Id of the translation

Third Party Providers

We have a different authorization process for third party providers that have solutions for more than one Smoobu user. Please contact us and tell us more about your product and business model. We can list you as a third party provider that our users get easy access to your system and you get all the rights you need for your product. Third party providers can be smart pricing tools, booking portals, accounting software, smartlock systems and many more.

Webhooks

example for updateRates webhook:

{
   "action":"updateRates",
   "user":"7",
   "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
         },
         "2019-01-17":{
            "price":444,
            "min_length_of_stay":2,
            "available":1
         }
      }
   }
}

example for newReservation webhook:

{
 "action": "newReservation",
 "user": 7,
 "data": {
   "id": 292,
   "type": "modification of booking",
   "arrival": "2019-08-11",
   "departure": "2019-08-13",
   "created-at": "2019-08-08 15:25",
   "apartment": {
     "id": 38,
     "name": "Apartment 1"
   },
   "channel": {
     "id": 3,
     "name": "API"
   },
   "guest-name": "Steffen Hansen",
   "email": "steffen@smoobu.com",
   "phone": null,
   "adults": 1,
   "children": 0,
   "check-in": null,
   "check-out": null,
   "notice": "Zahlungsmethode: Rechnung (Überweisung)",
   "price": 444,
   "price-paid": "No",
   "deposit": null,
   "deposit-paid": "No"
 }
}

It is very important that calendars and rates are always up to date. If you use cron jobs you can never guarantee correct data in real time. So we provide a webhook functionality that notificates you if there are any updates. Every Smoobu user can enter a webhook URL in the API settings. Then we send a webhook containing a json file to this URL if there are any changes in the calendar regarding rates or availabilities.

For third party providers we send webhooks for all connected users that allow you to receive rates and availabilities.

Json

Parameter Format Description
action string action of the webhook (updateRates, newReservation, cancelReservation, updateReservation)
user integer user id
data object contain the data of the webhook. For the detailed information for single webhook look in the documentation of regarding request

Client Libraries

Node.js

Smoobu by Cliff Stanford

The library can be installed using NPM

npm install smoobu

Change Log

2020-05-15

Client libraries.

2020-05-13

Flag is-blocked-booking is added to booking response.

2020-05-11

Custom Placeholders

2020-04-27

Price Elements (Financials) Price in apartment detail

2020-03-23

Add new api to get addons

2020-03-11

Guest app URL in the booking response.

2020-01-30

OAuth 2 support.

2020-01-23

Old Urls New Urls
[GET] /api/apartment /api/apartments
[GET] /api/apartment/ /api/apartments/
[GET] /api/apartment/{{apartmentId}}/booking /api/reservations?apartmentId={{apartmentId}}
[POST] /api/apartment/{{apartmentId}}/booking /api/reservations
[PUT] /api/apartment/{{apartmentId}}/booking/{{bookingId}} /api/reservations/{{reservationId}}
[DELETE] /api/apartment/{{apartmentId}}/booking/{{bookingId}} /api/reservations/{{reservationId}}
[GET] /api/apartment/{{apartmentId}}/booking/{{bookingId}}/message /api/reservations/{{reservationId}}/messages
[POST] /api/apartment/{{apartmentId}}/booking/{{bookingId}}/send-message-to-host /api/reservations/{{reservationId}}/messages/send-message-to-host
[POST] /api/apartment/{{apartmentId}}/booking/{{bookingId}}/send-message-to-guest /api/reservations/{{reservationId}}/messages/send-message-to-guest

2019-12-05

Api Urls from 'http' to 'https' and get rates api url fix

2019-10-29

Update create and update booking for prepayment and prepayment status

2019-10-22

Add update booking Add get user (user profile)

2019-09-16

Messaging APIs: sending messages to guests or hosts and receiving the whole conversation

2019-08-11

Add webhook for reservations

2019-06-28

Add language attribute to create booking request

2019-06-24

Add webhook for getRates updates

2019-06-17

Add availability to getRates response

2019-04-24

Add user currency to apartment detail page

2019-04-03

New endpoint for listing details

New process and authentification for third party providers

2019-03-28

New endpoint to cancel reservations and add Get Apartment IDs

2019-01-18

Starting newsletter for Api users. Join by sending an email to api@smoobu.com

2019-01-08

Add Get/Post Rates Api

2018-11-13

Add missing address in createBooking call. And add correct mandatory fields for some fields in createBooking call

2018-10-23

Added getReservations. Clarifying functions, fixing typos, cleaning up. Added changelog