BOOKINGS API OVERVIEW
Bookings Hypermedia API is designed to give you complete control over the Booking’s process, being able to move a reservation from a request to the booking itself. API calls use the standard HTTP methods (GET, POST, PUT, DELETE) to perform operations on resources. Responses follow the hypermedia JSON format HAL.
BOOKING JOURNEY
*Booking Intention: The Booking Journey starts with this entity that captures a user intention to book after they land to the booking form (even before completing the booking lead).
Booking Lead: a Tenant interested in booking a property, which is identified by the system at the moment that she fills up the form with her personal information in addition to a short questionary.
Booking Request: In the next step the Tenant must enter a valid Payment Method. A request can have different stages depending on its type: post paid, bank transfer, instant, pre paid.
Booking: If the Booking Request is successfully charged it turns into a Booking. A Booking means that the property is set as occupied for the selected dates.
BOOKING REQUEST TYPES
Post Paid: No money is charged at the moment of the request but once it is accepted by the landlord.
Pre Paid: A fee plus the first month rent is held at the moment of the request and it is captured once the request is accepted by the Landlord.
Bank Transfer: They money is sent by the Tenant through the bank so it will take longer until reach our account. The Booking Request process does not start until the money reaches our bank account.
Instant: No acceptance by landlord is required. Therefore, money is charged as soon as a valid Payment Method is introduced by the Tenant.
PRICING FORMAT
All the pricing details are represented in cents.
REQUESTS AND RESPONSES
AUTHENTICATION
All requests are performed via HTTPS and use a JWT token in an Authorization header for each request.
Authorization: aa.bb.cc
There are two different roles supported by the system:
-
ACCOMMODATION_PROVIDER_ROLE: Landlords can list their own bookings. -
BOOKING_AGENT: Can operate with all the endpoints.
REQUEST FORMAT
The only supported content type is JSON.
Content-Type: application/json
RESPONSE FORMAT
The response content type is HAL JSON.
Accept: application/hal+json
ERROR FORMAT
Errors will use the most appropriate HTTP status code contained in an API Problem response.
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616"
}
Booking Intention ¶
Create Booking Intention ¶
Create Booking IntentionPOST/booking-intentions
Authorization: protected for uai_tenant role.
Example URI
Headers
Content-Type: application/json
Authorization: aa.bb.ccBody
{
"listingId": "12345",
"checkIn": "yyyy-mm-dd",
"checkOut": "yyyy-mm-dd",
"platformSource": "spotahome",
"deviceInfoType": "native",
"deviceInfoOs": "Android"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"listingId": {
"type": "string"
},
"checkIn": {
"type": "string"
},
"checkOut": {
"type": "string"
},
"platformSource": {
"type": "string",
"enum": [
"spotahome",
"erasmusu"
]
},
"deviceInfoType": {
"type": "string",
"enum": [
"native",
"smartphone",
"tablet",
"desktop"
]
},
"deviceInfoOs": {
"type": "string"
}
}
}201400Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be understood by the server due to malformed syntax",
"status": 400,
"title": "Bad Request",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}403Headers
Content-Type: application/problem+jsonBody
{
"detail": "Forbidden",
"status": 403,
"title": "Forbidden",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Booking Lead ¶
Create Booking Lead ¶
Create Booking LeadPOST/booking-leads
Authorization: protected for uai_tenant role in authorization header.
Example URI
Headers
Content-Type: application/jsonBody
{
"platformSource": "spotahome",
"tenantName": "Tenant Name",
"tenantEmail": "tenant@email.com",
"tenantPhone": "666999000",
"tenantBirthday": "yyyy-mm-dd",
"tenantGender": "female",
"tenantCountry": "ES",
"checkIn": "yyyy-mm-dd",
"checkOut": "yyyy-mm-dd",
"listing": "12345",
"pricingId": "98593aed-57f5-4d84-95a2-76c28dfe57d9",
"deviceInfoType": "native",
"deviceInfoOs": "Android"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"platformSource": {
"type": "string",
"enum": [
"spotahome",
"erasmusu"
]
},
"tenantName": {
"type": "string"
},
"tenantEmail": {
"type": "string"
},
"tenantPhone": {
"type": "string"
},
"tenantBirthday": {
"type": "string"
},
"tenantGender": {
"type": "string",
"enum": [
"female",
"male"
],
"description": "Tenant Gender"
},
"tenantCountry": {
"type": "string"
},
"checkIn": {
"type": "string"
},
"checkOut": {
"type": "string"
},
"listing": {
"type": "string"
},
"pricingId": {
"type": "string"
},
"deviceInfoType": {
"type": "string",
"enum": [
"native",
"smartphone",
"tablet",
"desktop"
]
},
"deviceInfoOs": {
"type": "string"
}
},
"required": [
"tenantGender"
]
}201Headers
Location: /booking-leads/8f2dbe69-b68f-4423-bc93-b8b036727a032403Headers
Content-Type: application/problem+jsonBody
{
"detail": "Forbidden",
"status": 403,
"title": "Forbidden",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}409Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be completed due to a conflict with the current state of the resource",
"status": 409,
"title": "Conflict",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}422Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request was well formed but was unable to be followed due to semantic errors",
"status": 422,
"title": "Unprocessable Entity",
"type": "`http://www.w3.org/Protocols/rfc2616/rfc2616",
"validationMessages": {
"field": {
"stringLength": "The input is less than 6 characters long"
}
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string",
"description": "sec10.html (string, required)"
},
"validationMessages": {
"type": "object",
"properties": {
"field": {
"type": "object",
"properties": {
"stringLength": {
"type": "string"
}
},
"required": [
"stringLength"
]
}
},
"description": "Contains a property for each field that failed validation."
}
},
"required": [
"detail",
"status",
"title"
]
}Get Booking Lead ¶
Get Booking LeadGET/booking-leads/{id}
This endpoint returns the information of a booking lead
Example URI
- id
string(required)Id of a Booking Lead.
Headers
Content-Type: application/json200Headers
Content-Type: application/hal+jsonBody
{
"_links": {
"self": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
}
},
"id": "305e7971-4006-4554-a962-17278a136ba3",
"locator": "305E7",
"listing": "123456",
"tenantName": "The Name",
"tenantEmail": "test@email.com",
"tenantPhone": "+34650213569",
"tenantBirthday": "2000-03-26",
"tenantGender": "male",
"tenantCountry": "ES",
"checkIn": "2017-01-01",
"checkOut": "2010-06-01",
"couple": true,
"message": "text message",
"houseRulesChecked": true,
"houseRulesPassed": false,
"houseRulesSuitability": {
"genderSuitable": true,
"coupleSuitable": false,
"occupationSuitable": true
},
"converted": true,
"pricingId": "2875083a-2b12-4ffd-b248-a18911411213",
"userId": "2b12083a-2875-a189-1213-4ffd1141b248",
"platformSource": "spotahome",
"exclusivityType": "basic",
"creationDate": "2021-01-21T14:19:34+00:00",
"preAcceptedAt": "2021-01-21T14:19:34+00:00"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"_links": {
"type": "object",
"properties": {
"self": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
}
}
},
"id": {
"type": "string"
},
"locator": {
"type": "string"
},
"listing": {
"type": "string"
},
"tenantName": {
"type": "string"
},
"tenantEmail": {
"type": "string"
},
"tenantPhone": {
"type": "string"
},
"tenantBirthday": {
"type": "string"
},
"tenantGender": {
"type": "string"
},
"tenantCountry": {
"type": "string"
},
"checkIn": {
"type": "string"
},
"checkOut": {
"type": "string"
},
"couple": {
"type": "boolean"
},
"message": {
"type": "string"
},
"houseRulesChecked": {
"type": "boolean"
},
"houseRulesPassed": {
"type": "boolean"
},
"houseRulesSuitability": {
"type": "object",
"properties": {
"genderSuitable": {
"type": "boolean"
},
"coupleSuitable": {
"type": "boolean"
},
"occupationSuitable": {
"type": "boolean"
}
}
},
"converted": {
"type": "boolean"
},
"pricingId": {
"type": "string"
},
"userId": {
"type": "string"
},
"platformSource": {
"type": "string"
},
"exclusivityType": {
"type": "string"
},
"creationDate": {
"type": "string"
},
"preAcceptedAt": {
"type": [
"string",
"null"
]
}
}
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Get all Booking Leads by query params ¶
Get all Booking Leads by query paramsGET/booking-leads{?page,itemsPerPage}
This endpoint returns a list of Booking Leads that satisfy query params
Example URI
- listingIds
array[string](optional) Example: 8BA4E- converted
boolean(optional) Example: true- creationDateFrom
string(optional) Example: 1985-02-12- creationDateTo
string(optional) Example: 1985-02-12- page
number(optional) Example: 1- itemsPerPage
number(optional) Example: 1
Headers
Content-Type: application/json200Headers
Content-Type: application/hal+json
Content-Type: application/hal+jsonBody
{
"count": 1,
"total": 20,
"_links": {
"first": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"prev": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"next": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"last": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"self": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
}
},
"_embedded": {
"sah:booking-leads": [
{
"_links": {
"self": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
}
},
"id": "305e7971-4006-4554-a962-17278a136ba3",
"locator": "305E7",
"listing": "123456",
"tenantName": "The Name",
"tenantEmail": "test@email.com",
"tenantPhone": "+34650213569",
"tenantBirthday": "2000-03-26",
"tenantGender": "male",
"tenantCountry": "ES",
"checkIn": "2017-01-01",
"checkOut": "2010-06-01",
"couple": true,
"message": "text message",
"houseRulesChecked": true,
"houseRulesPassed": false,
"houseRulesSuitability": {
"genderSuitable": true,
"coupleSuitable": false,
"occupationSuitable": true
},
"converted": true,
"pricingId": "2875083a-2b12-4ffd-b248-a18911411213",
"userId": "2b12083a-2875-a189-1213-4ffd1141b248",
"platformSource": "spotahome",
"exclusivityType": "basic",
"creationDate": "2021-01-21T14:19:34+00:00",
"preAcceptedAt": "2021-01-21T14:19:34+00:00"
}
]
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"count": {
"type": "number",
"description": "Number of listed items"
},
"total": {
"type": "number",
"description": "Total number of items"
},
"_links": {
"type": "object",
"properties": {
"first": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"prev": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"next": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"last": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"self": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
}
}
},
"_embedded": {
"type": "object",
"properties": {
"sah:booking-leads": {
"type": "array",
"description": "A list of Booking Leads"
}
}
}
}
}403Headers
Content-Type: application/problem+jsonBody
{
"detail": "Forbidden",
"status": 403,
"title": "Forbidden",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}View booking lead converted status ¶
View booking lead converted statusGET/booking-leads/{bookingLeadId}/converted
Example URI
- bookingLeadId
string(required) Example: test-id-0Id of a Booking Lead.
Headers
Content-Type: application/json200Body
{
"converted": false
}Schema
{
"type": "object",
"properties": {
"converted": {
"type": "boolean",
"description": "Tenant travelling with couple"
}
},
"$schema": "http://json-schema.org/draft-04/schema#"
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Tenant booking leads ¶
Tenant booking leadsGET/tenant/me/booking-leads?converted,creationDateFrom,creationDateTo
Example URI
- converted
boolean(optional) Example: true- creationDateFrom
string(optional) Example: 1985-02-12- creationDateTo
string(optional) Example: 2019-10-10
Headers
Content-Type: application/json
Authorization: aa.bb.cc200Headers
Content-Type: application/hal+jsonBody
{
"count": 1,
"total": 20,
"_links": {
"first": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"prev": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"next": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"last": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"self": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
}
},
"_embedded": {
"sah:booking-leads": [
{
"_links": {
"self": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
}
},
"id": "305e7971-4006-4554-a962-17278a136ba3",
"locator": "305E7",
"listing": "123456",
"tenantName": "The Name",
"tenantEmail": "test@email.com",
"tenantPhone": "+34650213569",
"tenantBirthday": "2000-03-26",
"tenantGender": "male",
"tenantCountry": "ES",
"checkIn": "2017-01-01",
"checkOut": "2010-06-01",
"couple": true,
"message": "text message",
"houseRulesChecked": true,
"houseRulesPassed": false,
"houseRulesSuitability": {
"genderSuitable": true,
"coupleSuitable": false,
"occupationSuitable": true
},
"converted": true,
"pricingId": "2875083a-2b12-4ffd-b248-a18911411213",
"userId": "2b12083a-2875-a189-1213-4ffd1141b248",
"platformSource": "spotahome",
"exclusivityType": "basic",
"creationDate": "2021-01-21T14:19:34+00:00",
"preAcceptedAt": "2021-01-21T14:19:34+00:00"
}
]
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"count": {
"type": "number",
"description": "Number of listed items"
},
"total": {
"type": "number",
"description": "Total number of items"
},
"_links": {
"type": "object",
"properties": {
"first": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"prev": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"next": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"last": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"self": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
}
}
},
"_embedded": {
"type": "object",
"properties": {
"sah:booking-leads": {
"type": "array",
"description": "A list of Booking Leads"
}
}
}
}
}400Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be understood by the server due to malformed syntax",
"status": 400,
"title": "Bad Request",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}403Headers
Content-Type: application/problem+jsonBody
{
"detail": "Forbidden",
"status": 403,
"title": "Forbidden",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Landlord booking leads ¶
Landlord booking leadsGET/landlord/me/booking-leads?converted,creationDateFrom,creationDateTo,listingIds
Example URI
- converted
boolean(optional) Example: false- creationDateFrom
string(optional) Example: 1985-02-12- creationDateTo
string(optional) Example: 2019-10-10- listingIds
array[string](required) Example: 79950
Headers
Content-Type: application/json
Authorization: aa.bb.cc200Headers
Content-Type: application/hal+jsonBody
{
"count": 1,
"total": 20,
"_links": {
"first": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"prev": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"next": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"last": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"self": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
}
},
"_embedded": {
"sah:booking-leads": [
{
"_links": {
"self": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
}
},
"id": "305e7971-4006-4554-a962-17278a136ba3",
"locator": "305E7",
"listing": "123456",
"tenantName": "The Name",
"tenantEmail": "test@email.com",
"tenantPhone": "+34650213569",
"tenantBirthday": "2000-03-26",
"tenantGender": "male",
"tenantCountry": "ES",
"checkIn": "2017-01-01",
"checkOut": "2010-06-01",
"couple": true,
"message": "text message",
"houseRulesChecked": true,
"houseRulesPassed": false,
"houseRulesSuitability": {
"genderSuitable": true,
"coupleSuitable": false,
"occupationSuitable": true
},
"converted": true,
"pricingId": "2875083a-2b12-4ffd-b248-a18911411213",
"userId": "2b12083a-2875-a189-1213-4ffd1141b248",
"platformSource": "spotahome",
"exclusivityType": "basic",
"creationDate": "2021-01-21T14:19:34+00:00",
"preAcceptedAt": "2021-01-21T14:19:34+00:00"
}
]
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"count": {
"type": "number",
"description": "Number of listed items"
},
"total": {
"type": "number",
"description": "Total number of items"
},
"_links": {
"type": "object",
"properties": {
"first": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"prev": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"next": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"last": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"self": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
}
}
},
"_embedded": {
"type": "object",
"properties": {
"sah:booking-leads": {
"type": "array",
"description": "A list of Booking Leads"
}
}
}
}
}400Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be understood by the server due to malformed syntax",
"status": 400,
"title": "Bad Request",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}403Headers
Content-Type: application/problem+jsonBody
{
"detail": "Forbidden",
"status": 403,
"title": "Forbidden",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Pre-accept Booking Lead ¶
Pre-accept Booking LeadPUT/landlords/me/booking-leads/{bookingLeadId}/pre-accept
Example URI
- bookingLeadId
string(required) Example: 0a496f80-fbd8-46f2-8dce-3127fa289e41booking lead id
Headers
Content-Type: application/json
Authorization: aa.bb.cc204400Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be understood by the server due to malformed syntax",
"status": 400,
"title": "Bad Request",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}403Headers
Content-Type: application/problem+jsonBody
{
"detail": "Forbidden",
"status": 403,
"title": "Forbidden",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Create Booking Request from Lead ¶
Create Booking Request from LeadPUT/booking-leads/{bookingLeadId}/booking-request
Authorization: protected for uai_admin and uai_tenant roles.
Example URI
- bookingLeadId
string(required) Example: test-id-0Id of a Booking Lead.
Headers
Content-Type: application/json
Authorization: aa.bb.ccBody
{
"paymentMethodNonce": "123123",
"paymentProvider": "braintree",
"promoCode": "DOUBLEBOOKING",
"userId": "12345678",
"paymentDeviceData": "Json_Generated_By_Braintree_Dropin",
"feeCollectionType": "upfront",
"rentCollectionType": "none",
"pricingId": "aa-bb-cc-dd",
"savePaymentMethod": false,
"deviceInfoType": "desktop",
"deviceInfoOs": "GNU/Linux"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"paymentMethodNonce": {
"type": "string"
},
"paymentProvider": {
"type": "string",
"enum": [
"braintree",
"postponed"
]
},
"promoCode": {
"type": "string"
},
"userId": {
"type": "string"
},
"paymentDeviceData": {
"type": "string"
},
"feeCollectionType": {
"type": "string",
"enum": [
"upfront",
"monthly"
]
},
"rentCollectionType": {
"type": "string",
"enum": [
"none",
"monthly"
]
},
"pricingId": {
"type": "string"
},
"savePaymentMethod": {
"type": "boolean",
"description": "To store the tenant's payment method"
},
"deviceInfoType": {
"type": "string",
"description": "Device type in which the booking request was converted"
},
"deviceInfoOs": {
"type": "string",
"description": "Device OS in which the booking request was converted"
}
},
"required": [
"paymentMethodNonce",
"paymentProvider",
"feeCollectionType",
"rentCollectionType"
]
}201Headers
Location: /booking-requests/8f2dbe69-b68f-4423-bc93-b8b036727a032402Headers
Content-Type: application/problem+jsonBody
{
"detail": "The payment is required and could not be performed",
"status": 402,
"title": "Payment Required",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html",
"providerError": "payment_method_generic_error",
"vendorErrorCode": 1
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
},
"providerError": {
"type": "string",
"enum": [
"payment_method_generic_error",
"payment_method_declined_error",
"payment_method_cvv_error",
"payment_method_account_error",
"payment_method_expired_error"
]
},
"vendorErrorCode": {
"type": "number",
"description": "Code from Braintree: Validation Errors (https://developers.braintreepayments.com/reference/general/validation-errors/all/php) or Authorization errors (https://articles.braintreepayments.com/control-panel/transactions/declines#authorization-decline-codes) since we are doing 2 things: creating a customer and authorizing a payment."
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}409Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be completed due to a conflict with the current state of the resource",
"status": 409,
"title": "Conflict",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}422Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request was well formed but was unable to be followed due to semantic errors",
"status": 422,
"title": "Unprocessable Entity",
"type": "`http://www.w3.org/Protocols/rfc2616/rfc2616",
"validationMessages": {
"field": {
"stringLength": "The input is less than 6 characters long"
}
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string",
"description": "sec10.html (string, required)"
},
"validationMessages": {
"type": "object",
"properties": {
"field": {
"type": "object",
"properties": {
"stringLength": {
"type": "string"
}
},
"required": [
"stringLength"
]
}
},
"description": "Contains a property for each field that failed validation."
}
},
"required": [
"detail",
"status",
"title"
]
}Booking Request ¶
A Booking Request is created at the moment the Tenant introduces a valid Payment Method.
Booking Request Collection ¶
Create Booking RequestPOST/booking-requests
This endpoint allows users with a specific role to create a BookingRequest without a Booking Lead
Example URI
Headers
Content-Type: application/json
Authorization: aa.bb.ccBody
{
"platformSource": "spotahome",
"listingId": "11111",
"checkIn": "2018-02-01",
"checkOut": "2018-07-31",
"tenantName": "Jane Doe",
"tenantEmail": "jane.doe@email.com",
"tenantPhone": "666999000",
"tenantGender": "female",
"tenantBirthday": "yyyy-mm-dd",
"tenantCountry": "ES",
"isCouple": false,
"message": "Message",
"promoCode": "DOUBLEBOOKING",
"paymentMethod": "paypal",
"funnelType": "instant"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"platformSource": {
"type": "string",
"enum": [
"spotahome",
"erasmusu"
]
},
"listingId": {
"type": "string"
},
"checkIn": {
"type": "string"
},
"checkOut": {
"type": "string"
},
"tenantName": {
"type": "string"
},
"tenantEmail": {
"type": "string"
},
"tenantPhone": {
"type": "string"
},
"tenantGender": {
"type": "string",
"enum": [
"female",
"male"
],
"description": "Tenant Gender"
},
"tenantBirthday": {
"type": "string"
},
"tenantCountry": {
"type": "string"
},
"isCouple": {
"type": "boolean"
},
"message": {
"type": "string"
},
"promoCode": {
"type": "string"
},
"paymentMethod": {
"type": "string",
"enum": [
"paypal",
"bank_transfer",
"credit_card"
],
"description": "Payment method chosen for the Booking Request"
},
"funnelType": {
"type": "string",
"enum": [
"instant",
"partner",
"post_paid",
"pre_paid",
"relocation"
],
"description": "Type of funnel chosen for the Booking Request"
}
},
"required": [
"listingId",
"checkIn",
"checkOut",
"tenantName",
"tenantEmail",
"tenantPhone",
"tenantGender",
"tenantBirthday",
"tenantCountry",
"isCouple",
"promoCode",
"paymentMethod",
"funnelType"
]
}201Headers
Location: /booking-requests/110594401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}409Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be completed due to a conflict with the current state of the resource",
"status": 409,
"title": "Conflict",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}422Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request was well formed but was unable to be followed due to semantic errors",
"status": 422,
"title": "Unprocessable Entity",
"type": "`http://www.w3.org/Protocols/rfc2616/rfc2616",
"validationMessages": {
"field": {
"stringLength": "The input is less than 6 characters long"
}
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string",
"description": "sec10.html (string, required)"
},
"validationMessages": {
"type": "object",
"properties": {
"field": {
"type": "object",
"properties": {
"stringLength": {
"type": "string"
}
},
"required": [
"stringLength"
]
}
},
"description": "Contains a property for each field that failed validation."
}
},
"required": [
"detail",
"status",
"title"
]
}Search Booking RequestsGET/booking-requests{?secret,locator,ric,email,cities,agents,states,listings,checkInFrom,checkInTo,checkOutFrom,checkOutTo,creationDateFrom,creationDateTo,closedDateFrom,closedDateTo,page,itemsPerPage,sortBy,sortType}
Example URI
string(optional) Example: test@test.com- cities
array[string](optional) Example: madrid- agents
array[string](optional) Example: 593a803d422ff6f3068b4567- states
array[string](optional) Example: BookingChargeWasAuthorized- listings
array[string](optional) Example: 12345678- secret
string(optional) Example: abcd- locator
string(optional) Example: 54DA2- ric
string(optional) Example: H3- viewed
boolean(optional) Example: true- checkInFrom
string(optional) Example: 2017-01-01- checkInTo
string(optional) Example: 2017-10-01- checkOutFrom
string(optional) Example: 2017-07-01- checkOutTo
string(optional) Example: 2017-10-01- landlord
string(optional) Example: 12345- creationDateFrom
string(optional) Example: 2018-01-01- creationDateTo
string(optional) Example: 2018-02-01- closedDateFrom
string(optional) Example: 2018-02-01- closedDateTo
string(optional) Example: 2018-02-01- itemsPerPage
number(optional) Example: 1- page
number(optional) Example: 1- sortBy
enum [string](optional) Example: moveInDate-
city -
tenantEmail -
moveInDate -
creationDate
-
- sortType
enum [string](optional) Example: asc-
asc -
desc
-
Headers
Content-Type: application/json
Authorization: aa.bb.cc200Headers
Content-Type: application/hal+jsonBody
{
"count": 1,
"total": 20,
"_links": {
"first": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"prev": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"next": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"last": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"self": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
}
},
"_embedded": {
"bookingRequests": [
{
"_links": {
"self": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
}
},
"id": "7980",
"bookingProcessId": "a4cdee-3fe6aab-bc34",
"locator": "A4CDE",
"ric": "H3",
"referenceCode": "A4CDE-H3",
"tenantFullName": "Luis Alfredo González",
"tenantEmail": "test@test.com",
"city": "madrid",
"checkIn": "2010-01-01",
"checkOut": "2010-01-01",
"reservationPrice": 12000,
"listing": "123",
"promoCode": "PROMO",
"promoPercentage": 50,
"vat": 2100,
"currencyCode": "EUR",
"contractConditions": {
"monthlyPrice": 45000,
"downpayment": 25000,
"seasonalPrice": [
"10000",
"10000",
"5000",
"5000",
"5000",
"5000",
"5000",
"5000",
"5000",
"8000",
"8000",
"8000"
],
"contractDateStart": "2010-01-01",
"contractDateEnd": "2010-01-01",
"tenantPayments": [
"0",
"49000",
"49000",
"49000"
],
"securityDeposit": 56000,
"adminFee": 30000,
"downpaymentMaxCapType": "weekly",
"downpaymentMaxCapValue": 1
},
"tenantFeeDiscountPercentage": 25.1,
"tenantFeeDiscount": 12000,
"landlordTransferDueDate": "2017-01-01",
"landlordTransfer": 180000,
"landlordCommission": {
"commission": 10.5,
"type": "percentage"
},
"tenantFeeNet": 12000,
"tenantFeeGross": 12000,
"landlordFeeNet": 12000,
"landlordFeeGross": 12000,
"landlordNoCapFeeNet": 24000,
"landlordNoCapFeeGross": 24000,
"landlordFeeOwed": 12000,
"landlordId": "12000",
"secret": "356fgh453v653v",
"tenantPhone": "+34620000000",
"tenantGender": "male",
"tenantBirthday": "1980-01-01",
"tenantCountry": "Spain",
"couple": true,
"message": "this is a test",
"contractDays": 180,
"contractValue": 180000,
"pricePerDay": 1200,
"revenue": 24000,
"isPaymentMethodRegistered": true,
"bookingProcess": "'post_paid'",
"agent": "687687",
"payments": [
{
"instrument": "paypal_account"
}
],
"state": "'BookingRequestWasCreated'",
"remark": "'agent comments'",
"rating": 4,
"landlordRejectionReason": 1,
"landlordRejectionMessage": "reason",
"tenantCancellationReason": 5,
"originalBrId": "7989",
"creationDate": "2011-01-01",
"closedAt": "2019-08-16T13:38:44+0000",
"notifications": [
{
"creation": true,
"alternative": true,
"chargeAuthorization": true,
"landlordConfirmationRequest": true
}
],
"listingType": "Guaranteed",
"pricingId": "c524a423-510a-454b-8615-6ab201843335",
"assignationConfirmed": false,
"autoAssigned": false,
"isInstantBooking": false,
"feeCollectionType": "upfront",
"rentCollectionType": "none",
"transactionId": "aabbccdd",
"paymentProvider": "braintree",
"exclusivityType": "basic"
}
]
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"count": {
"type": "number",
"description": "Number of listed items"
},
"total": {
"type": "number",
"description": "Total number of items"
},
"_links": {
"type": "object",
"properties": {
"first": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"prev": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"next": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"last": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"self": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
}
}
},
"_embedded": {
"type": "object",
"properties": {
"bookingRequests": {
"type": "array",
"description": "A list of Booking Requests"
}
}
}
}
}Tenant Booking Request Collection ¶
Get Tenant Booking RequestsGET/tenant/me/booking-requests
Return the list of Booking Requests from an authenticated tenant
Example URI
Headers
Content-Type: application/json
Authorization: aa.bb.cc200Headers
Content-Type: application/hal+jsonBody
{
"count": 1,
"total": 20,
"_links": {
"first": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"prev": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"next": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"last": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"self": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
}
},
"_embedded": {
"bookingRequests": [
{
"id": "7980",
"bookingProcessId": "a4cdee-3fe6aab-bc34",
"secret": "a4cdee3fe6bc34",
"locator": "A4CDE",
"ric": "H3",
"referenceCode": "A4CDE-H3",
"city": "madrid",
"listing": "123",
"tenantEmail": "test@test.com",
"currencyCode": "EUR",
"checkIn": "2010-01-01",
"checkOut": "2010-01-01",
"contractConditions": {
"monthlyPrice": 49000,
"securityDeposit": 56000,
"adminFee": 30000
},
"state": "'BookingRequestWasCreated'",
"pricingId": "1a6fbe69-b68f-4423-bc93-b8b036727a014",
"plan": "standard"
}
]
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"count": {
"type": "number",
"description": "Number of listed items"
},
"total": {
"type": "number",
"description": "Total number of items"
},
"_links": {
"type": "object",
"properties": {
"first": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"prev": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"next": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"last": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"self": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
}
}
},
"_embedded": {
"type": "object",
"properties": {
"bookingRequests": {
"type": "array",
"description": "A list of Booking Requests"
}
}
}
}
}401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}403Headers
Content-Type: application/problem+jsonBody
{
"detail": "Forbidden",
"status": 403,
"title": "Forbidden",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Booking Request Admin ¶
This endpoint returns sensitive and non-sensitive data related with the booking request, for admins due to it requires authentication
Get Booking Request AdminGET/admin/booking-requests/{id}
Depending on the stage that the Booking Request is the list of _links can vary, showing the allowed actions at the moment.
Example URI
- id
string(required)Id of a Booking Request.
Headers
Content-Type: application/json
Authorization: aa.bb.cc200Headers
Content-Type: application/hal+jsonBody
{
"_links": {
"self": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
}
},
"id": "7980",
"bookingProcessId": "a4cdee-3fe6aab-bc34",
"locator": "A4CDE",
"ric": "H3",
"referenceCode": "A4CDE-H3",
"tenantFullName": "Luis Alfredo González",
"tenantEmail": "test@test.com",
"city": "madrid",
"checkIn": "2010-01-01",
"checkOut": "2010-01-01",
"reservationPrice": 12000,
"listing": "123",
"promoCode": "PROMO",
"promoPercentage": 50,
"vat": 2100,
"currencyCode": "EUR",
"contractConditions": {
"monthlyPrice": 45000,
"downpayment": 25000,
"seasonalPrice": [
"10000",
"10000",
"5000",
"5000",
"5000",
"5000",
"5000",
"5000",
"5000",
"8000",
"8000",
"8000"
],
"contractDateStart": "2010-01-01",
"contractDateEnd": "2010-01-01",
"tenantPayments": [
"0",
"49000",
"49000",
"49000"
],
"securityDeposit": 56000,
"adminFee": 30000,
"downpaymentMaxCapType": "weekly",
"downpaymentMaxCapValue": 1
},
"tenantFeeDiscountPercentage": 25.1,
"tenantFeeDiscount": 12000,
"landlordTransferDueDate": "2017-01-01",
"landlordTransfer": 180000,
"landlordCommission": {
"commission": 10.5,
"type": "percentage"
},
"tenantFeeNet": 12000,
"tenantFeeGross": 12000,
"landlordFeeNet": 12000,
"landlordFeeGross": 12000,
"landlordNoCapFeeNet": 24000,
"landlordNoCapFeeGross": 24000,
"landlordFeeOwed": 12000,
"landlordId": "12000",
"secret": "356fgh453v653v",
"tenantPhone": "+34620000000",
"tenantGender": "male",
"tenantBirthday": "1980-01-01",
"tenantCountry": "Spain",
"couple": true,
"message": "this is a test",
"contractDays": 180,
"contractValue": 180000,
"pricePerDay": 1200,
"revenue": 24000,
"isPaymentMethodRegistered": true,
"bookingProcess": "'post_paid'",
"agent": "687687",
"payments": [
{
"instrument": "paypal_account"
}
],
"state": "'BookingRequestWasCreated'",
"remark": "'agent comments'",
"rating": 4,
"landlordRejectionReason": 1,
"landlordRejectionMessage": "reason",
"tenantCancellationReason": 5,
"originalBrId": "7989",
"creationDate": "2011-01-01",
"closedAt": "2019-08-16T13:38:44+0000",
"notifications": [
{
"creation": true,
"alternative": true,
"chargeAuthorization": true,
"landlordConfirmationRequest": true
}
],
"listingType": "Guaranteed",
"pricingId": "c524a423-510a-454b-8615-6ab201843335",
"assignationConfirmed": false,
"autoAssigned": false,
"isInstantBooking": false,
"feeCollectionType": "upfront",
"rentCollectionType": "none",
"transactionId": "aabbccdd",
"paymentProvider": "braintree",
"exclusivityType": "basic"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"_links": {
"type": "object",
"properties": {
"self": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
}
}
},
"id": {
"type": "string"
},
"bookingProcessId": {
"type": "string"
},
"locator": {
"type": "string"
},
"ric": {
"type": "string"
},
"referenceCode": {
"type": "string"
},
"tenantFullName": {
"type": "string"
},
"tenantEmail": {
"type": "string",
"description": "Unique"
},
"city": {
"type": "string"
},
"checkIn": {
"type": "string"
},
"checkOut": {
"type": "string"
},
"reservationPrice": {
"type": "number"
},
"listing": {
"type": "string"
},
"promoCode": {
"type": "string"
},
"promoPercentage": {
"type": "number"
},
"vat": {
"type": "number"
},
"currencyCode": {
"type": "string"
},
"contractConditions": {
"type": "object",
"properties": {
"monthlyPrice": {
"type": "number"
},
"downpayment": {
"type": "number"
},
"seasonalPrice": {
"type": "array"
},
"contractDateStart": {
"type": "string"
},
"contractDateEnd": {
"type": "string"
},
"tenantPayments": {
"type": "array"
},
"securityDeposit": {
"type": "number"
},
"adminFee": {
"type": "number"
},
"downpaymentMaxCapType": {
"type": "string"
},
"downpaymentMaxCapValue": {
"type": "number"
}
}
},
"tenantFeeDiscountPercentage": {
"type": "number"
},
"tenantFeeDiscount": {
"type": "number"
},
"landlordTransferDueDate": {
"type": "string"
},
"landlordTransfer": {
"type": "number"
},
"landlordCommission": {
"type": "object",
"properties": {
"commission": {
"type": "number"
},
"type": {
"type": "string"
}
}
},
"tenantFeeNet": {
"type": "number"
},
"tenantFeeGross": {
"type": "number"
},
"landlordFeeNet": {
"type": "number"
},
"landlordFeeGross": {
"type": "number"
},
"landlordNoCapFeeNet": {
"type": [
"number",
"null"
]
},
"landlordNoCapFeeGross": {
"type": [
"number",
"null"
]
},
"landlordFeeOwed": {
"type": [
"number",
"null"
]
},
"landlordId": {
"type": "string"
},
"secret": {
"type": "string"
},
"tenantPhone": {
"type": "string"
},
"tenantGender": {
"type": "string",
"enum": [
"male",
"female"
]
},
"tenantBirthday": {
"type": "string"
},
"tenantCountry": {
"type": "string"
},
"couple": {
"type": "boolean"
},
"message": {
"type": "string"
},
"contractDays": {
"type": "number"
},
"contractValue": {
"type": "number"
},
"pricePerDay": {
"type": "number"
},
"revenue": {
"type": "number"
},
"isPaymentMethodRegistered": {
"type": "boolean"
},
"bookingProcess": {
"type": "string"
},
"agent": {
"type": "string"
},
"payments": {
"type": "array"
},
"state": {
"type": "string"
},
"remark": {
"type": "string"
},
"rating": {
"type": "number"
},
"landlordRejectionReason": {
"type": "number"
},
"landlordRejectionMessage": {
"type": "string"
},
"tenantCancellationReason": {
"type": "number"
},
"originalBrId": {
"type": "string"
},
"creationDate": {
"type": "string"
},
"closedAt": {
"type": "string"
},
"notifications": {
"type": "array"
},
"listingType": {
"type": "string"
},
"pricingId": {
"type": "string"
},
"assignationConfirmed": {
"type": "boolean"
},
"autoAssigned": {
"type": "boolean"
},
"isInstantBooking": {
"type": "boolean"
},
"feeCollectionType": {
"type": "string",
"enum": [
"upfront",
"monthly"
]
},
"rentCollectionType": {
"type": "string",
"enum": [
"none",
"monthly"
]
},
"transactionId": {
"type": "string"
},
"paymentProvider": {
"type": "string"
},
"exclusivityType": {
"type": "string"
}
},
"required": [
"feeCollectionType",
"rentCollectionType"
]
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Booking Request Public ¶
This endpoint returns the minimum amount of public data related with the booking request, it does not requires authentication
Get Booking Request PublicGET/booking-requests/{id}
Show the public information for Booking Request
Example URI
- id
string(required)Id of a Booking Request.
Headers
Content-Type: application/json200Headers
Content-Type: application/hal+jsonBody
{
"_links": {
"self": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
}
},
"id": "7980",
"bookingProcessId": "a4cdee-3fe6aab-bc34",
"locator": "A4CDE",
"ric": "H3",
"referenceCode": "A4CDE-H3",
"city": "madrid",
"checkIn": "2010-01-01",
"checkOut": "2010-01-01",
"reservationPrice": 12000,
"listing": "123",
"promoCode": "PROMO",
"promoPercentage": 50,
"currencyCode": "EUR",
"contractConditions": {
"monthlyPrice": 49000,
"downpayment": 44000,
"seasonalPrice": [
"10000",
"10000",
"5000",
"5000",
"5000",
"5000",
"5000",
"5000",
"5000",
"8000",
"8000",
"8000"
],
"tenantPayments": [
"0",
"49000",
"49000",
"49000"
],
"securityDeposit": 56000,
"adminFee": 30000
},
"tenantFeeDiscountPercentage": 25.1,
"tenantFeeDiscount": 12000,
"tenantFeeGross": 12000,
"platformSource": "spotahome",
"tenantEmail": "test@test.com",
"isInstantBooking": true,
"userId": "some-user-id",
"plan": "select",
"exclusivityType": "basic"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"_links": {
"type": "object",
"properties": {
"self": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
}
}
},
"id": {
"type": "string"
},
"bookingProcessId": {
"type": "string"
},
"locator": {
"type": "string"
},
"ric": {
"type": "string"
},
"referenceCode": {
"type": "string"
},
"city": {
"type": "string"
},
"checkIn": {
"type": "string"
},
"checkOut": {
"type": "string"
},
"reservationPrice": {
"type": "number"
},
"listing": {
"type": "string"
},
"promoCode": {
"type": "string"
},
"promoPercentage": {
"type": "number"
},
"currencyCode": {
"type": "string"
},
"contractConditions": {
"type": "object",
"properties": {
"monthlyPrice": {
"type": "number"
},
"downpayment": {
"type": "number"
},
"seasonalPrice": {
"type": "array"
},
"tenantPayments": {
"type": "array"
},
"securityDeposit": {
"type": "number"
},
"adminFee": {
"type": "number"
}
}
},
"tenantFeeDiscountPercentage": {
"type": "number"
},
"tenantFeeDiscount": {
"type": "number"
},
"tenantFeeGross": {
"type": "number"
},
"platformSource": {
"type": "string"
},
"tenantEmail": {
"type": "string"
},
"isInstantBooking": {
"type": "boolean"
},
"userId": {
"type": "string"
},
"plan": {
"type": "string"
},
"exclusivityType": {
"type": "string"
}
}
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Booking Request Public By Secret ¶
This endpoint returns the minimum amount of public data related with the booking request, it does not requires authentication
Get Booking Request Public By SecretGET/public/booking-requests/secret/{secret}
Show the public information for Booking Request
Example URI
- secret
string(required)Secret of a Booking Request.
Headers
Content-Type: application/json200Headers
Content-Type: application/hal+jsonBody
{
"id": "7980",
"state": "'BookingRequestWasCreated'"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"state": {
"type": "string"
}
}
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}funnel types ¶
List the funnel typesGET/booking-requests/funnel-types
Return all available funnel types
Example URI
Headers
Content-Type: application/json
Authorization: aa.bb.cc200Headers
Content-Type: application/jsonBody
{
"types": [
"instant",
"partner",
"post_paid",
"pre_paid",
"relocation"
]
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"types": {
"type": "array",
"items": [
{
"type": "string",
"enum": [
"instant"
]
},
{
"type": "string",
"enum": [
"partner"
]
},
{
"type": "string",
"enum": [
"post_paid"
]
},
{
"type": "string",
"enum": [
"pre_paid"
]
},
{
"type": "string",
"enum": [
"relocation"
]
}
]
}
},
"required": [
"types"
]
}401Headers
Content-Type: application/jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Countries with their ISOs ¶
List the countries with their ISOsGET/countries
Return all available countries with their associated ISOs
Example URI
Headers
Content-Type: application/json
Authorization: aa.bb.cc200Headers
Content-Type: application/jsonBody
{
"countries": [
{
"name": "Jersey",
"alpha2": "JE"
}
]
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"countries": {
"type": "array"
}
}
}401Headers
Content-Type: application/jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Instant Payment ¶
Pay With Different Payment MethodPUT/booking-requests/{id}/instant-payment
Allows to pay the request with a different method than the one introduced at the beginning of the process.
Example URI
- id
number(required)Id of a Booking Request.
Headers
Content-Type: application/json
Authorization: aa.bb.ccBody
{
"paymentMethodNonce": "aa.bb.cc",
"paymentProvider": "stripe"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"paymentMethodNonce": {
"type": "string"
},
"paymentProvider": {
"type": "string"
}
},
"required": [
"paymentMethodNonce"
]
}204401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}409Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be completed due to a conflict with the current state of the resource",
"status": 409,
"title": "Conflict",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}422Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request was well formed but was unable to be followed due to semantic errors",
"status": 422,
"title": "Unprocessable Entity",
"type": "`http://www.w3.org/Protocols/rfc2616/rfc2616",
"validationMessages": {
"field": {
"stringLength": "The input is less than 6 characters long"
}
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string",
"description": "sec10.html (string, required)"
},
"validationMessages": {
"type": "object",
"properties": {
"field": {
"type": "object",
"properties": {
"stringLength": {
"type": "string"
}
},
"required": [
"stringLength"
]
}
},
"description": "Contains a property for each field that failed validation."
}
},
"required": [
"detail",
"status",
"title"
]
}Landlord Rejection ¶
Landlord RejectsPUT/booking-requests/{id}/landlord-rejection
Set the Booking Request as rejected by the Landlord.
Example URI
- id
number(required)Id of a Booking Request.
Headers
Content-Type: application/json
Authorization: aa.bb.ccBody
{
"reason": 3,
"message": "A message"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"reason": {
"type": "number"
},
"message": {
"type": "string"
}
},
"required": [
"reason",
"message"
]
}204404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}409Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be completed due to a conflict with the current state of the resource",
"status": 409,
"title": "Conflict",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}422Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request was well formed but was unable to be followed due to semantic errors",
"status": 422,
"title": "Unprocessable Entity",
"type": "`http://www.w3.org/Protocols/rfc2616/rfc2616",
"validationMessages": {
"field": {
"stringLength": "The input is less than 6 characters long"
}
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string",
"description": "sec10.html (string, required)"
},
"validationMessages": {
"type": "object",
"properties": {
"field": {
"type": "object",
"properties": {
"stringLength": {
"type": "string"
}
},
"required": [
"stringLength"
]
}
},
"description": "Contains a property for each field that failed validation."
}
},
"required": [
"detail",
"status",
"title"
]
}DEPRECATED Landlord Rejection Reasons ¶
DEPRECATED Landlord Rejection ReasonsGET/booking-requests/rejection-reasons
Return all valid rejection reasons.
Example URI
Headers
Content-Type: application/json
Authorization: aa.bb.cc200Headers
Content-Type: application/jsonBody
{
"count": 1,
"total": 20,
"_links": {
"first": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"prev": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"next": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"last": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"self": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
}
},
"_embedded": {
"rejection-reasons": [
"1: aaaa",
"2: bbbbb"
]
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"count": {
"type": "number",
"description": "Number of listed items"
},
"total": {
"type": "number",
"description": "Total number of items"
},
"_links": {
"type": "object",
"properties": {
"first": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"prev": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"next": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"last": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"self": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
}
}
},
"_embedded": {
"type": "object",
"properties": {
"rejection-reasons": {
"type": "array"
}
}
}
}
}Landlord Rejection Reasons ¶
Landlord Rejection ReasonsGET/v2/booking-requests/rejection-reasons{?category}
Return all valid rejection reasons.
Example URI
- category
string(optional) Example: 1Rejection category
Headers
Content-Type: application/json
Authorization: aa.bb.cc200Headers
Content-Type: application/jsonBody
{
"count": 1,
"total": 20,
"_links": {
"first": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"prev": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"next": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"last": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"self": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
}
},
"_embedded": {
"rejection-reasons": [
{
"id": "1",
"reason": "IncorrectAvailability",
"requireAvailabilityUpdate": true,
"enabled": true
}
]
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"count": {
"type": "number",
"description": "Number of listed items"
},
"total": {
"type": "number",
"description": "Total number of items"
},
"_links": {
"type": "object",
"properties": {
"first": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"prev": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"next": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"last": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"self": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
}
}
},
"_embedded": {
"type": "object",
"properties": {
"rejection-reasons": {
"type": "array"
}
}
}
}
}Landlord Rejection Reasons Categories ¶
Landlord Rejection Reasons CategoriesGET/booking-requests/rejection-reasons-categories
Return all valid rejection reasons categories.
Example URI
Headers
Content-Type: application/json
Authorization: aa.bb.cc200Headers
Content-Type: application/jsonBody
{
"count": 1,
"total": 20,
"_links": {
"first": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"prev": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"next": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"last": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"self": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
}
},
"_embedded": {
"landlord-rejection-reasons-categories": [
{
"id": "1",
"name": "IncorrectAvailability"
}
]
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"count": {
"type": "number",
"description": "Number of listed items"
},
"total": {
"type": "number",
"description": "Total number of items"
},
"_links": {
"type": "object",
"properties": {
"first": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"prev": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"next": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"last": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"self": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
}
}
},
"_embedded": {
"type": "object",
"properties": {
"landlord-rejection-reasons-categories": {
"type": "array"
}
}
}
}
}Tenant cancellation ¶
Tenant cancellationPUT/booking-requests/{id}/tenant-cancellation
Set the Booking Request as cancel by the Tenant.
Example URI
- id
number(required)Id of a Booking Request.
Headers
Content-Type: application/json
Authorization: aa.bb.ccBody
{
"reason": 5,
"message": "A message"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"reason": {
"type": "number"
},
"message": {
"type": "string"
}
},
"required": [
"reason",
"message"
]
}204404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}409Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be completed due to a conflict with the current state of the resource",
"status": 409,
"title": "Conflict",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}422Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request was well formed but was unable to be followed due to semantic errors",
"status": 422,
"title": "Unprocessable Entity",
"type": "`http://www.w3.org/Protocols/rfc2616/rfc2616",
"validationMessages": {
"field": {
"stringLength": "The input is less than 6 characters long"
}
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string",
"description": "sec10.html (string, required)"
},
"validationMessages": {
"type": "object",
"properties": {
"field": {
"type": "object",
"properties": {
"stringLength": {
"type": "string"
}
},
"required": [
"stringLength"
]
}
},
"description": "Contains a property for each field that failed validation."
}
},
"required": [
"detail",
"status",
"title"
]
}Tenant Cancellation Reasons ¶
Tenant Cancellation ReasonsGET/booking-requests/cancellation-reasons{?restrictedToTenants}
Return all valid cancellation reasons.
Example URI
- restrictedToTenants
string(optional) Example: trueCriteria by restricted to tenants filter.
-
true
-
false
-
Headers
Content-Type: application/json
Authorization: aa.bb.cc200Headers
Content-Type: application/jsonBody
{
"count": 1,
"total": 20,
"_links": {
"first": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"prev": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"next": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"last": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"self": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
}
},
"_embedded": {
"cancellation-reasons": [
"1: aaaa",
"2: bbbbb"
]
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"count": {
"type": "number",
"description": "Number of listed items"
},
"total": {
"type": "number",
"description": "Total number of items"
},
"_links": {
"type": "object",
"properties": {
"first": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"prev": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"next": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"last": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"self": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
}
}
},
"_embedded": {
"type": "object",
"properties": {
"cancellation-reasons": {
"type": "array"
}
}
}
}
}Charge cancellation penalty ¶
Cancellation penaltyPOST/booking-requests/{id}/penalties
Charge a penalty to the Tenant of the Booking Request.
Example URI
- id
number(required)Id of a Booking Request.
Headers
Content-Type: application/json
Authorization: aa.bb.ccBody
{
"amount": 10000,
"instrumentType": "paypal",
"isManualCharge": true
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"amount": {
"type": "number"
},
"instrumentType": {
"type": "string",
"enum": [
"paypal",
"bank_transfer",
"credit_card"
]
},
"isManualCharge": {
"type": "boolean"
}
},
"required": [
"amount",
"instrumentType",
"isManualCharge"
]
}204401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}409Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be completed due to a conflict with the current state of the resource",
"status": 409,
"title": "Conflict",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}422Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request was well formed but was unable to be followed due to semantic errors",
"status": 422,
"title": "Unprocessable Entity",
"type": "`http://www.w3.org/Protocols/rfc2616/rfc2616",
"validationMessages": {
"field": {
"stringLength": "The input is less than 6 characters long"
}
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string",
"description": "sec10.html (string, required)"
},
"validationMessages": {
"type": "object",
"properties": {
"field": {
"type": "object",
"properties": {
"stringLength": {
"type": "string"
}
},
"required": [
"stringLength"
]
}
},
"description": "Contains a property for each field that failed validation."
}
},
"required": [
"detail",
"status",
"title"
]
}Cancellation policies ¶
Cancellation penaltyGET/booking-requests/{id}/cancellation-policies
Return the cancellation policies of a Booking Request.
Example URI
- id
number(required)Id of a Booking Request.
Headers
Content-Type: application/json
Authorization: aa.bb.cc200Body
{
"cancellationPolicies": [
{
"tenantPenalty": 50,
"downpaymentPercentageRefund": 100,
"reservationFeePercentageRefund": 100,
"deadlineDaysToMoveIn": 60
}
]
}Schema
{
"type": "object",
"properties": {
"cancellationPolicies": {
"type": "array",
"items": {
"type": "object",
"properties": {
"tenantPenalty": {
"type": "number"
},
"downpaymentPercentageRefund": {
"type": "number"
},
"reservationFeePercentageRefund": {
"type": "number"
},
"deadlineDaysToMoveIn": {
"type": "number"
}
}
}
}
},
"$schema": "http://json-schema.org/draft-04/schema#"
}401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Charge booking request ¶
Charge booking requestPUT/booking-requests/{id}/charge
Charge a booking request to the Tenant of the Booking Request. If it is not a manual charge, instrumentType is ignored.
Example URI
- id
number(required)Id of a Booking Request.
Headers
Content-Type: application/json
Authorization: aa.bb.ccBody
{
"isManualCharge": true,
"instrumentType": "paypal"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"isManualCharge": {
"type": "boolean"
},
"instrumentType": {
"type": "string",
"enum": [
"paypal",
"bank_transfer",
"credit_card"
]
}
},
"required": [
"isManualCharge",
"instrumentType"
]
}204401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}402Headers
Content-Type: application/problem+jsonBody
{
"detail": "The payment is required and could not be performed",
"status": 402,
"title": "Payment Required",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}409Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be completed due to a conflict with the current state of the resource",
"status": 409,
"title": "Conflict",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html",
"validationMessages": {
"errorCode": "errorValue"
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
},
"validationMessages": {
"type": "object",
"properties": {
"errorCode": {
"type": "string"
}
}
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}422Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request was well formed but was unable to be followed due to semantic errors",
"status": 422,
"title": "Unprocessable Entity",
"type": "`http://www.w3.org/Protocols/rfc2616/rfc2616",
"validationMessages": {
"field": {
"stringLength": "The input is less than 6 characters long"
}
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string",
"description": "sec10.html (string, required)"
},
"validationMessages": {
"type": "object",
"properties": {
"field": {
"type": "object",
"properties": {
"stringLength": {
"type": "string"
}
},
"required": [
"stringLength"
]
}
},
"description": "Contains a property for each field that failed validation."
}
},
"required": [
"detail",
"status",
"title"
]
}Assign Agent ¶
Assign AgentPUT/booking-requests/{id}/agent
Assign an agent to a Booking Request.
Example URI
- id
string(required)Id of a Booking Request.
Headers
Content-Type: application/json
Authorization: aa.bb.ccBody
{
"id": "Agent's id to assign"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "string"
}
},
"required": [
"id"
]
}204404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}422Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request was well formed but was unable to be followed due to semantic errors",
"status": 422,
"title": "Unprocessable Entity",
"type": "`http://www.w3.org/Protocols/rfc2616/rfc2616",
"validationMessages": {
"field": {
"stringLength": "The input is less than 6 characters long"
}
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string",
"description": "sec10.html (string, required)"
},
"validationMessages": {
"type": "object",
"properties": {
"field": {
"type": "object",
"properties": {
"stringLength": {
"type": "string"
}
},
"required": [
"stringLength"
]
}
},
"description": "Contains a property for each field that failed validation."
}
},
"required": [
"detail",
"status",
"title"
]
}Unassign Agent ¶
Unassign AgentDELETE/booking-requests/{id}/agent
Unassign an agent from a Booking Request.
Example URI
- id
string(required)Id of a Booking Request.
Headers
Content-Type: application/json
Authorization: aa.bb.cc204404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Confirm agent assignation ¶
Confirm agent assignationPUT/booking-requests/{id}/agent/{agentId}/confirmation
Example URI
- id
string(required)Id of a Booking Request.
- agentId
string(required)Id of an agent.
Headers
Content-Type: application/json
Authorization: aa.bb.cc204400Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be understood by the server due to malformed syntax",
"status": 400,
"title": "Bad Request",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}409Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be completed due to a conflict with the current state of the resource",
"status": 409,
"title": "Conflict",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}422Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request was well formed but was unable to be followed due to semantic errors",
"status": 422,
"title": "Unprocessable Entity",
"type": "`http://www.w3.org/Protocols/rfc2616/rfc2616",
"validationMessages": {
"field": {
"stringLength": "The input is less than 6 characters long"
}
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string",
"description": "sec10.html (string, required)"
},
"validationMessages": {
"type": "object",
"properties": {
"field": {
"type": "object",
"properties": {
"stringLength": {
"type": "string"
}
},
"required": [
"stringLength"
]
}
},
"description": "Contains a property for each field that failed validation."
}
},
"required": [
"detail",
"status",
"title"
]
}Booking Request States ¶
Booking Request StatesGET/booking-requests/states
Return all booking request states.
Example URI
Headers
Content-Type: application/json
Authorization: aa.bb.cc200Headers
Content-Type: application/jsonBody
{
"count": 1,
"total": 20,
"_links": {
"first": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"prev": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"next": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"last": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"self": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
}
},
"_embedded": {
"states": [
"first state",
"second state"
]
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"count": {
"type": "number",
"description": "Number of listed items"
},
"total": {
"type": "number",
"description": "Total number of items"
},
"_links": {
"type": "object",
"properties": {
"first": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"prev": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"next": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"last": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"self": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
}
}
},
"_embedded": {
"type": "object",
"properties": {
"states": {
"type": "array"
}
}
}
}
}Update contract's conditions ¶
Update contract's conditionsPUT/booking-requests/{id}/contract-conditions
Modifies the contract conditions according to negotiation with landlord
Example URI
- id
number(required)Id of a Booking Request.
Headers
Content-Type: application/json
Authorization: aa.bb.ccBody
{
"seasonalPrice": [
"10000",
"10000",
"5000",
"5000",
"5000",
"5000",
"5000",
"5000",
"5000",
"8000",
"8000",
"8000"
],
"contractDateStart": "2010-01-01",
"contractDateEnd": "2010-02-30",
"checkIn": "2010-01-01",
"checkOut": "2010-02-30"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"seasonalPrice": {
"type": "array"
},
"contractDateStart": {
"type": "string",
"description": "Date of contract start"
},
"contractDateEnd": {
"type": "string",
"description": "Date of contract end"
},
"checkIn": {
"type": "string",
"description": "Check in date"
},
"checkOut": {
"type": "string",
"description": "Check out date"
}
}
}204404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}409Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be completed due to a conflict with the current state of the resource",
"status": 409,
"title": "Conflict",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}422Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request was well formed but was unable to be followed due to semantic errors",
"status": 422,
"title": "Unprocessable Entity",
"type": "`http://www.w3.org/Protocols/rfc2616/rfc2616",
"validationMessages": {
"field": {
"stringLength": "The input is less than 6 characters long"
}
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string",
"description": "sec10.html (string, required)"
},
"validationMessages": {
"type": "object",
"properties": {
"field": {
"type": "object",
"properties": {
"stringLength": {
"type": "string"
}
},
"required": [
"stringLength"
]
}
},
"description": "Contains a property for each field that failed validation."
}
},
"required": [
"detail",
"status",
"title"
]
}Update moving dates ¶
Update moving datesPUT/booking-requests/{id}/moving-dates
Modify the moving dates for a booking request
Example URI
- id
number(required)Id of a Booking Request.
Headers
Content-Type: application/json
Authorization: aa.bb.ccBody
{
"checkIn": "2010-01-01",
"checkOut": "2010-02-30"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"checkIn": {
"type": "string",
"description": "Check in date"
},
"checkOut": {
"type": "string",
"description": "Check out date"
}
},
"required": [
"checkIn",
"checkOut"
]
}204404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}409Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be completed due to a conflict with the current state of the resource",
"status": 409,
"title": "Conflict",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}422Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request was well formed but was unable to be followed due to semantic errors",
"status": 422,
"title": "Unprocessable Entity",
"type": "`http://www.w3.org/Protocols/rfc2616/rfc2616",
"validationMessages": {
"field": {
"stringLength": "The input is less than 6 characters long"
}
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string",
"description": "sec10.html (string, required)"
},
"validationMessages": {
"type": "object",
"properties": {
"field": {
"type": "object",
"properties": {
"stringLength": {
"type": "string"
}
},
"required": [
"stringLength"
]
}
},
"description": "Contains a property for each field that failed validation."
}
},
"required": [
"detail",
"status",
"title"
]
}Update tenant fee discount ¶
Update tenant fee discountPUT/booking-requests/{id}/tenant-fee-discount
Modifies the discount for a tenant fee
Example URI
- id
number(required)Id of a Booking Request.
Headers
Content-Type: application/json
Authorization: aa.bb.ccBody
{
"percentage": "10"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"percentage": {
"type": "string",
"description": "percentage of discount"
}
}
}204404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}409Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be completed due to a conflict with the current state of the resource",
"status": 409,
"title": "Conflict",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}422Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request was well formed but was unable to be followed due to semantic errors",
"status": 422,
"title": "Unprocessable Entity",
"type": "`http://www.w3.org/Protocols/rfc2616/rfc2616",
"validationMessages": {
"field": {
"stringLength": "The input is less than 6 characters long"
}
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string",
"description": "sec10.html (string, required)"
},
"validationMessages": {
"type": "object",
"properties": {
"field": {
"type": "object",
"properties": {
"stringLength": {
"type": "string"
}
},
"required": [
"stringLength"
]
}
},
"description": "Contains a property for each field that failed validation."
}
},
"required": [
"detail",
"status",
"title"
]
}Update landlord's commission ¶
Update landlord's commissionPUT/booking-requests/{id}/landlord-commission
Modifies the commission applied to the landlord
Example URI
- id
number(required)Id of a Booking Request.
Headers
Content-Type: application/json
Authorization: aa.bb.ccBody
{
"commission": 15.3,
"type": "fixed"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"commission": {
"type": "number",
"description": "commission value"
},
"type": {
"type": "string",
"enum": [
"fixed",
"percentage"
]
}
}
}204404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}409Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be completed due to a conflict with the current state of the resource",
"status": 409,
"title": "Conflict",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}422Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request was well formed but was unable to be followed due to semantic errors",
"status": 422,
"title": "Unprocessable Entity",
"type": "`http://www.w3.org/Protocols/rfc2616/rfc2616",
"validationMessages": {
"field": {
"stringLength": "The input is less than 6 characters long"
}
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string",
"description": "sec10.html (string, required)"
},
"validationMessages": {
"type": "object",
"properties": {
"field": {
"type": "object",
"properties": {
"stringLength": {
"type": "string"
}
},
"required": [
"stringLength"
]
}
},
"description": "Contains a property for each field that failed validation."
}
},
"required": [
"detail",
"status",
"title"
]
}Update landlord's transfer due date ¶
Update landlord's transfer due datePUT/booking-requests/{id}/landlord-transfer-due-date
Modifies the date when the bank transfer should be sent to the landlord
Example URI
- id
number(required)Id of a Booking Request.
Headers
Content-Type: application/json
Authorization: aa.bb.ccBody
{
"transferDueDate": "2010-02-30"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"transferDueDate": {
"type": "string",
"description": "due date for making the bank transfer"
}
}
}204404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}409Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be completed due to a conflict with the current state of the resource",
"status": 409,
"title": "Conflict",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}422Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request was well formed but was unable to be followed due to semantic errors",
"status": 422,
"title": "Unprocessable Entity",
"type": "`http://www.w3.org/Protocols/rfc2616/rfc2616",
"validationMessages": {
"field": {
"stringLength": "The input is less than 6 characters long"
}
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string",
"description": "sec10.html (string, required)"
},
"validationMessages": {
"type": "object",
"properties": {
"field": {
"type": "object",
"properties": {
"stringLength": {
"type": "string"
}
},
"required": [
"stringLength"
]
}
},
"description": "Contains a property for each field that failed validation."
}
},
"required": [
"detail",
"status",
"title"
]
}Update landlord's confirmation ¶
Update landlord's confirmationPUT/booking-requests/{id}/landlord-confirmation
Mark the booking request as confirmed by landlord
Example URI
- id
number(required)Id of a Booking Request.
Headers
Content-Type: application/json
Authorization: aa.bb.cc204401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}409Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be completed due to a conflict with the current state of the resource",
"status": 409,
"title": "Conflict",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Alternative Booking Request ¶
Alternative Booking RequestPOST/booking-requests/{id}/alternative
Update Booking Request with new listing, new moving dates and recalculate price.
Example URI
- id
string(required)Id of a Booking Request.
Headers
Content-Type: application/json
Authorization: aa.bb.ccBody
{
"listing": "124",
"checkIn": "2017-01-01",
"checkOut": "2017-05-01"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"listing": {
"type": "string",
"description": "New listing id"
},
"checkIn": {
"type": "string",
"description": "New check in date"
},
"checkOut": {
"type": "string",
"description": "New check out date"
}
},
"required": [
"listing",
"checkIn",
"checkOut"
]
}201Headers
Location: /booking-requests/8f2dbe69-b68f-4423-bc93-b8b036727a032401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}409Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be completed due to a conflict with the current state of the resource",
"status": 409,
"title": "Conflict",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}422Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request was well formed but was unable to be followed due to semantic errors",
"status": 422,
"title": "Unprocessable Entity",
"type": "`http://www.w3.org/Protocols/rfc2616/rfc2616",
"validationMessages": {
"field": {
"stringLength": "The input is less than 6 characters long"
}
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string",
"description": "sec10.html (string, required)"
},
"validationMessages": {
"type": "object",
"properties": {
"field": {
"type": "object",
"properties": {
"stringLength": {
"type": "string"
}
},
"required": [
"stringLength"
]
}
},
"description": "Contains a property for each field that failed validation."
}
},
"required": [
"detail",
"status",
"title"
]
}Update tenant details ¶
Update tenant detailsPUT/booking-requests/{id}/tenant
Modifies the details of the tenant for a booking request
Example URI
- id
number(required)Id of a Booking Request.
Headers
Content-Type: application/json
Authorization: aa.bb.ccBody
{
"tenantEmail": "test@test.com",
"userId": "new-user-if"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"tenantEmail": {
"type": "string",
"description": "New tenant email"
},
"userId": {
"type": "string",
"description": "New user id"
}
}
}204404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}409Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be completed due to a conflict with the current state of the resource",
"status": 409,
"title": "Conflict",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}422Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request was well formed but was unable to be followed due to semantic errors",
"status": 422,
"title": "Unprocessable Entity",
"type": "`http://www.w3.org/Protocols/rfc2616/rfc2616",
"validationMessages": {
"field": {
"stringLength": "The input is less than 6 characters long"
}
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string",
"description": "sec10.html (string, required)"
},
"validationMessages": {
"type": "object",
"properties": {
"field": {
"type": "object",
"properties": {
"stringLength": {
"type": "string"
}
},
"required": [
"stringLength"
]
}
},
"description": "Contains a property for each field that failed validation."
}
},
"required": [
"detail",
"status",
"title"
]
}Update agent remark ¶
DEPRECATED Update agent remarkPUT/booking-requests/{id}/remark
Updates the remark that agents use for adding notes about the booking request
Example URI
- id
number(required)Id of a Booking Request.
Headers
Content-Type: application/json
Authorization: aa.bb.ccBody
{
"remark": "random text"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"remark": {
"type": "string"
}
}
}204401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Get list of booking request's remarks ¶
Get Remarks of a booking requestGET/booking-requests/{id}/remarks
Get the list of remarks that agents add to the booking request
Example URI
- id
number(required) Example: 123456Id of a Booking Request.
Headers
Content-Type: application/json
Authorization: aa.bb.cc200Headers
Content-Type: application/jsonBody
{
"remarks": [
{
"id": "tag799-tyeh",
"createdAt": "2010-01-01T22:50:21",
"userId": "fgha72-aujl",
"message": "this is a remark"
}
]
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"remarks": {
"type": "array"
}
}
}401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Add a remark to a booking request ¶
Add a Remark to a booking requestPOST/booking-requests/{id}/remarks
Adds a new remark to a specific booking request
Example URI
- id
number(required) Example: 123456Id of a Booking Request.
Headers
Content-Type: application/json
Authorization: aa.bb.ccBody
{
"message": "this is a remark"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
]
}201401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}422Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request was well formed but was unable to be followed due to semantic errors",
"status": 422,
"title": "Unprocessable Entity",
"type": "`http://www.w3.org/Protocols/rfc2616/rfc2616",
"validationMessages": {
"field": {
"stringLength": "The input is less than 6 characters long"
}
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string",
"description": "sec10.html (string, required)"
},
"validationMessages": {
"type": "object",
"properties": {
"field": {
"type": "object",
"properties": {
"stringLength": {
"type": "string"
}
},
"required": [
"stringLength"
]
}
},
"description": "Contains a property for each field that failed validation."
}
},
"required": [
"detail",
"status",
"title"
]
}Update booking request rating ¶
Update booking request ratingPUT/booking-requests/{id}/rating
Updates the rating that agents use to value the booking request process
Example URI
- id
number(required)Id of a Booking Request.
Headers
Content-Type: application/json
Authorization: aa.bb.ccBody
{
"rating": 4
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"rating": {
"type": "number",
"description": "Value must be from 0 to 5"
}
},
"required": [
"rating"
]
}204401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}422Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request was well formed but was unable to be followed due to semantic errors",
"status": 422,
"title": "Unprocessable Entity",
"type": "`http://www.w3.org/Protocols/rfc2616/rfc2616",
"validationMessages": {
"field": {
"stringLength": "The input is less than 6 characters long"
}
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string",
"description": "sec10.html (string, required)"
},
"validationMessages": {
"type": "object",
"properties": {
"field": {
"type": "object",
"properties": {
"stringLength": {
"type": "string"
}
},
"required": [
"stringLength"
]
}
},
"description": "Contains a property for each field that failed validation."
}
},
"required": [
"detail",
"status",
"title"
]
}Penalties ¶
Booking Request PenaltiesGET/booking-requests/{id}/penalties
Return all penalties charged to a Booking Request
Example URI
- id
number(required)Id of a Booking Request.
Headers
Content-Type: application/json
Authorization: aa.bb.cc200Headers
Content-Type: application/jsonBody
{
"penalties": [
{
"amount": 15050
}
],
"maxCancellationPenaltyAllowed": 43200
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"penalties": {
"type": "array"
},
"maxCancellationPenaltyAllowed": {
"type": "number"
}
}
}Mark as viewed ¶
Mark viewedPUT/booking-requests/{id}/viewed
Mark Booking Request as viewed by the assigned agent
Example URI
- id
number(required)Id of a Booking Request.
Headers
Content-Type: application/json
Authorization: aa.bb.ccBody
{
"agent": "Agent's id that viewed the Booking Request"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"agent": {
"type": "string"
}
},
"required": [
"agent"
]
}204401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}409Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be completed due to a conflict with the current state of the resource",
"status": 409,
"title": "Conflict",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}422Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request was well formed but was unable to be followed due to semantic errors",
"status": 422,
"title": "Unprocessable Entity",
"type": "`http://www.w3.org/Protocols/rfc2616/rfc2616",
"validationMessages": {
"field": {
"stringLength": "The input is less than 6 characters long"
}
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string",
"description": "sec10.html (string, required)"
},
"validationMessages": {
"type": "object",
"properties": {
"field": {
"type": "object",
"properties": {
"stringLength": {
"type": "string"
}
},
"required": [
"stringLength"
]
}
},
"description": "Contains a property for each field that failed validation."
}
},
"required": [
"detail",
"status",
"title"
]
}Renegotiation request ¶
renegotiation-request
Renegotiation requestPOST/booking-requests/{id}/landlord-request-renegotiation
Creates a Renegotiation Request made by the Landlord
Example URI
- id
string(required)Id of a Booking Request.
Headers
Content-Type: application/json
Authorization: aa.bb.ccBody
{
"message": "A message"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
]
}201404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}409Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be completed due to a conflict with the current state of the resource",
"status": 409,
"title": "Conflict",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}422Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request was well formed but was unable to be followed due to semantic errors",
"status": 422,
"title": "Unprocessable Entity",
"type": "`http://www.w3.org/Protocols/rfc2616/rfc2616",
"validationMessages": {
"field": {
"stringLength": "The input is less than 6 characters long"
}
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string",
"description": "sec10.html (string, required)"
},
"validationMessages": {
"type": "object",
"properties": {
"field": {
"type": "object",
"properties": {
"stringLength": {
"type": "string"
}
},
"required": [
"stringLength"
]
}
},
"description": "Contains a property for each field that failed validation."
}
},
"required": [
"detail",
"status",
"title"
]
}Resource Group ¶
Update payment Payment ¶
Update payment methodPUT/tenant/me/booking-requests/{id}/payment-method
Allow user to update the payment method of a booking request.
Example URI
- id
number(required)Id of a Booking Request.
Headers
Content-Type: application/json
Authorization: aa.bb.ccBody
{
"paymentMethodNonce": "aa.bb.cc",
"paymentProvider": "stripe",
"paymentDeviceData": "aa.bb.cc",
"savePaymentMethod": false,
"promoCode": "DOUBLEBOOKING"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"paymentMethodNonce": {
"type": "string"
},
"paymentProvider": {
"type": "string"
},
"paymentDeviceData": {
"type": "string"
},
"savePaymentMethod": {
"type": "boolean"
},
"promoCode": {
"type": "string"
}
},
"required": [
"paymentMethodNonce"
]
}204401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}403Headers
Content-Type: application/problem+jsonBody
{
"detail": "Forbidden",
"status": 403,
"title": "Forbidden",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}409Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be completed due to a conflict with the current state of the resource",
"status": 409,
"title": "Conflict",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}422Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request was well formed but was unable to be followed due to semantic errors",
"status": 422,
"title": "Unprocessable Entity",
"type": "`http://www.w3.org/Protocols/rfc2616/rfc2616",
"validationMessages": {
"field": {
"stringLength": "The input is less than 6 characters long"
}
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string",
"description": "sec10.html (string, required)"
},
"validationMessages": {
"type": "object",
"properties": {
"field": {
"type": "object",
"properties": {
"stringLength": {
"type": "string"
}
},
"required": [
"stringLength"
]
}
},
"description": "Contains a property for each field that failed validation."
}
},
"required": [
"detail",
"status",
"title"
]
}Booking ¶
Get all Bookings by query params ¶
Get all Bookings by query paramsGET/bookings{?locator,checkInFrom,checkInTo,checkOutFrom,checkOutTo,page,itemsPerPage}
This endpoint returns a list of Bookings that satisfy query params
Example URI
- locator
string(optional) Example: 8BA4ELocator of a Booking.
- checkInFrom
string(optional) Example: 2018-02-01Specific booking checkIn start
- checkInTo
string(optional) Example: 2018-07-31Specific booking checkIn end
- checkOutFrom
string(optional) Example: 2018-02-01Specific booking checkOut start
- checkOutTo
string(optional) Example: 2018-07-31Specific booking checkOut end
- bookingRequestIds
array[string](optional) Example: 50100Collection of Booking Request IDs referenced by Bookings.
- page
number(optional) Example: 1- itemsPerPage
number(optional) Example: 1
Headers
Content-Type: application/json
Authorization: aa.bb.cc200Headers
Content-Type: application/hal+json
Content-Type: application/jsonBody
{
"count": 1,
"total": 20,
"_links": {
"first": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"prev": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"next": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"last": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"self": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
}
},
"_embedded": {
"bookings": [
{
"_links": {
"self": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
}
},
"id": "305e7971-4006-4554-a962-17278a136ba3",
"locator": "305E7",
"ric": "GM",
"bookingRequestId": "12345",
"tenantEmail": "tenant@spotahome.com",
"tenantPhone": "987654321",
"listingId": "123456",
"city": "madrid",
"checkIn": "2010-01-01",
"checkOut": "2010-01-01",
"feeCollectionType": "upfront",
"rentCollectionType": "none",
"billCollectionType": "none",
"state": "Ongoing",
"platformSource": "spotahome",
"plan": "standard",
"userId": "305e79234-6345-0901-a738-17278a136ba3",
"expirationDate": "2025-03-03T12:00:00+00:00"
}
]
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"count": {
"type": "number",
"description": "Number of listed items"
},
"total": {
"type": "number",
"description": "Total number of items"
},
"_links": {
"type": "object",
"properties": {
"first": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"prev": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"next": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"last": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"self": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
}
}
},
"_embedded": {
"type": "object",
"properties": {
"bookings": {
"type": "array",
"description": "A list of Bookings"
}
}
}
}
}400Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be understood by the server due to malformed syntax",
"status": 400,
"title": "Bad Request",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Booking ¶
Get a Booking by IdGET/bookings/{id}
The endpoint returns the Booking identified by Id
Example URI
- id
string(required)Id of a Booking.
Headers
Content-Type: application/json
Authorization: aa.bb.cc200Headers
Content-Type: application/hal+jsonBody
{
"_links": {
"self": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
}
},
"id": "305e7971-4006-4554-a962-17278a136ba3",
"locator": "305E7",
"ric": "GM",
"bookingRequestId": "12345",
"tenantEmail": "tenant@spotahome.com",
"tenantPhone": "987654321",
"listingId": "123456",
"city": "madrid",
"checkIn": "2010-01-01",
"checkOut": "2010-01-01",
"feeCollectionType": "upfront",
"rentCollectionType": "none",
"billCollectionType": "none",
"state": "Ongoing",
"platformSource": "spotahome",
"plan": "standard",
"userId": "305e79234-6345-0901-a738-17278a136ba3",
"expirationDate": "2025-03-03T12:00:00+00:00"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"_links": {
"type": "object",
"properties": {
"self": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
}
}
},
"id": {
"type": "string"
},
"locator": {
"type": "string"
},
"ric": {
"type": "string"
},
"bookingRequestId": {
"type": "string"
},
"tenantEmail": {
"type": "string"
},
"tenantPhone": {
"type": "string"
},
"listingId": {
"type": "string"
},
"city": {
"type": "string"
},
"checkIn": {
"type": "string"
},
"checkOut": {
"type": "string"
},
"feeCollectionType": {
"type": "string"
},
"rentCollectionType": {
"type": "string"
},
"billCollectionType": {
"type": "string"
},
"state": {
"type": "string"
},
"platformSource": {
"type": "string"
},
"plan": {
"type": "string"
},
"userId": {
"type": "string"
},
"expirationDate": {
"type": "string"
}
}
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Booking From Booking Request ¶
Get a Booking by bookingRequestIdGET/bookings/booking-request/{bookingRequestId}
This endpoint returns the Booking identified by BookingRequestId
Example URI
- bookingRequestId
string(required)Id of a Booking Request.
Headers
Content-Type: application/json
Authorization: aa.bb.cc200Headers
Content-Type: application/hal+jsonBody
{
"_links": {
"self": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
}
},
"id": "305e7971-4006-4554-a962-17278a136ba3",
"locator": "305E7",
"ric": "GM",
"bookingRequestId": "12345",
"tenantEmail": "tenant@spotahome.com",
"tenantPhone": "987654321",
"listingId": "123456",
"city": "madrid",
"checkIn": "2010-01-01",
"checkOut": "2010-01-01",
"feeCollectionType": "upfront",
"rentCollectionType": "none",
"billCollectionType": "none",
"state": "Ongoing",
"platformSource": "spotahome",
"plan": "standard",
"userId": "305e79234-6345-0901-a738-17278a136ba3",
"expirationDate": "2025-03-03T12:00:00+00:00"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"_links": {
"type": "object",
"properties": {
"self": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
}
}
},
"id": {
"type": "string"
},
"locator": {
"type": "string"
},
"ric": {
"type": "string"
},
"bookingRequestId": {
"type": "string"
},
"tenantEmail": {
"type": "string"
},
"tenantPhone": {
"type": "string"
},
"listingId": {
"type": "string"
},
"city": {
"type": "string"
},
"checkIn": {
"type": "string"
},
"checkOut": {
"type": "string"
},
"feeCollectionType": {
"type": "string"
},
"rentCollectionType": {
"type": "string"
},
"billCollectionType": {
"type": "string"
},
"state": {
"type": "string"
},
"platformSource": {
"type": "string"
},
"plan": {
"type": "string"
},
"userId": {
"type": "string"
},
"expirationDate": {
"type": "string"
}
}
}401Headers
Content-Type: application/jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Landlord's Booking Collection ¶
Get Landlord's BookingsGET/landlord/me/bookings{?states,sortBy,sortType,page,itemsPerPage}
This endpoint returns a list of landlord’s bookings
Example URI
- states
array[string](optional) Example: BookingRequestWasConvertedIntoBooking- bookingStates
array[string](optional) Example: finished- moveInFrom
string(optional) Example: 2019-01-01- moveInTo
string(optional) Example: 2019-01-07- moveOutFrom
string(optional) Example: 2019-07-01- moveOutTo
string(optional) Example: 2019-07-07- creationDateFrom
string(optional) Example: 2019-07-01- creationDateTo
string(optional) Example: 2019-07-07- listingId
string(optional) Example: '12345'- excludeBookingIds
array[string](optional) Example: 50100Collection of Booking IDs to exclude
- itemsPerPage
number(optional) Example: 1- page
number(optional) Example: 1- sortBy
enum [string](optional) Example: moveInDate-
moveInDate -
moveOutDate
-
- sortType
enum [string](optional) Example: asc-
asc -
desc
-
Headers
Content-Type: application/json
Authorization: aa.bb.cc200Headers
Content-Type: application/hal+json
Content-Type: application/jsonBody
{
"count": 1,
"total": 20,
"_links": {
"first": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"prev": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"next": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"last": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"self": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
}
},
"_embedded": {
"landlord-bookings": [
{
"bookingId": "305e7971-4006-4554-a962-17278a136ba3",
"bookingRequestId": "12345",
"locator": "A4CDE",
"ric": "4A",
"referenceCode": "A4CDE-4A",
"listingId": "12345",
"pricingId": "12345",
"tenantEmail": "test@test.com",
"tenantFullName": "John Doe",
"tenantPhone": "``+34620000000`",
"checkInDate": "2010-01-01",
"checkOutDate": "2010-01-01",
"bookingRequestState": "BookingRequestWasCreated",
"state": "Ongoing",
"platformSource": "spotahome"
}
]
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"count": {
"type": "number",
"description": "Number of listed items"
},
"total": {
"type": "number",
"description": "Total number of items"
},
"_links": {
"type": "object",
"properties": {
"first": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"prev": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"next": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"last": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"self": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
}
}
},
"_embedded": {
"type": "object",
"properties": {
"landlord-bookings": {
"type": "array",
"description": "A list of Booking"
}
}
}
}
}401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Booking Cancellation Policy ¶
Get Landlord's BookingsGET/api/bookings/cancellation-policy{?cancellationDate}
This endpoint returns a list of landlord’s bookings
Example URI
- cancellationDate
string(optional) Example: 2019-01-01
Headers
Content-Type: application/json
Authorization: aa.bb.cc200Headers
Content-Type: application/hal+json
Content-Type: application/jsonBody
{
"tenantPenalty": 50,
"downpaymentPercentageRefund": 100,
"reservationFeePercentageRefund": 100,
"deadlineDaysToMoveIn": 60
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"tenantPenalty": {
"type": "number"
},
"downpaymentPercentageRefund": {
"type": "number"
},
"reservationFeePercentageRefund": {
"type": "number"
},
"deadlineDaysToMoveIn": {
"type": "number"
}
}
}401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}409Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be completed due to a conflict with the current state of the resource",
"status": 409,
"title": "Conflict",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Instant Booking ¶
Check if Instant Booking is eligible ¶
Check if Instant Booking is eligiblePOST/instant-booking-eligibility
This endpoint check if an Instant Booking can be created based on the given conditions
Example URI
Headers
Content-Type: application/jsonBody
{
"listingId": "1234456",
"birthDate": "1998-12-30",
"isCouple": true,
"checkIn": "2018-06-04",
"checkOut": "2018-12-15",
"startContractDate": "2018-06-01",
"endContractDate": "2018-12-31",
"gender": "male"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"listingId": {
"type": "string",
"description": "Id of a Listing."
},
"birthDate": {
"type": "string",
"description": "Tenant's birth date"
},
"isCouple": {
"type": "boolean",
"description": "Tenant is a couple."
},
"checkIn": {
"type": "string",
"description": "Date of check-in."
},
"checkOut": {
"type": "string",
"description": "Date of check-out."
},
"startContractDate": {
"type": "string",
"description": "Date of contract start."
},
"endContractDate": {
"type": "string",
"description": "Date of contract end."
},
"gender": {
"type": "string",
"enum": [
"male",
"female"
]
}
},
"required": [
"listingId",
"birthDate",
"isCouple",
"checkIn",
"checkOut",
"startContractDate",
"endContractDate",
"gender"
]
}200Headers
Content-Type: application/jsonBody
{
"instantBooking": true
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"instantBooking": {
"type": "boolean",
"description": "indicates if an instant booking can be created or not"
}
}
}Get Instant Booking Conditions for a listing ¶
Get Instant Booking Conditions for a listingGET/instant-booking-conditions/{listingId}
This endpoint returns the Instant Booking Conditions for a given listing ID
Example URI
- listingId
string(required) Example: 123456Id of a Listing.
Headers
Content-Type: application/json
Authorization: aa.bb.cc200Headers
Content-Type: application/hal+json
Content-Type: application/jsonBody
{
"listingId": "1234456",
"isInstantBookingEnabled": true,
"areCouplesAllowed": false,
"ageRangeAllowed": [
18,
99
],
"maxDaysBeforeCheckIn": 50,
"monthlyMinStay": [
2,
4,
5,
5,
5,
5,
5,
3,
3,
2,
2,
2
],
"genderAllowed": "male"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"listingId": {
"type": "string"
},
"isInstantBookingEnabled": {
"type": "boolean"
},
"areCouplesAllowed": {
"type": [
"boolean",
"null"
]
},
"ageRangeAllowed": {
"type": [
"array",
"null"
]
},
"maxDaysBeforeCheckIn": {
"type": [
"number",
"null"
]
},
"monthlyMinStay": {
"type": [
"array",
"null"
]
},
"genderAllowed": {
"type": [
"string",
"null"
],
"enum": [
"male",
"female",
null
]
}
}
}401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Set Instant Booking Conditions for a list of listings ¶
Set Instant Booking Conditions for a list of listingsPUT/instant-booking-conditions
This endpoint sets the Instant Booking Conditions for a given list of listings.
Example URI
Headers
Content-Type: application/json
Authorization: aa.bb.ccBody
{
"conditions": [
{
"listingId": "1234456",
"isInstantBookingEnabled": true,
"areCouplesAllowed": false,
"ageRangeAllowed": [
18,
99
],
"maxDaysBeforeCheckIn": 50,
"monthlyMinStay": [
2,
4,
5,
5,
5,
5,
5,
3,
3,
2,
2,
2
],
"genderAllowed": "male"
},
{
"listingId": "1234456",
"isInstantBookingEnabled": true,
"areCouplesAllowed": false,
"ageRangeAllowed": [
18,
99
],
"maxDaysBeforeCheckIn": 50,
"monthlyMinStay": [
2,
4,
5,
5,
5,
5,
5,
3,
3,
2,
2,
2
],
"genderAllowed": "male"
}
]
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"conditions": {
"type": "array",
"items": [
{
"type": "object",
"properties": {
"listingId": {
"type": "string",
"enum": [
"1234456"
]
},
"isInstantBookingEnabled": {
"type": "boolean",
"enum": [
true
]
},
"areCouplesAllowed": {
"type": [
"boolean",
"null"
],
"enum": [
false,
null
]
},
"ageRangeAllowed": {
"type": [
"array",
"null"
],
"items": [
{
"type": "number",
"enum": [
18
]
},
{
"type": "number",
"enum": [
99
]
}
]
},
"maxDaysBeforeCheckIn": {
"type": [
"number",
"null"
],
"enum": [
50,
null
]
},
"monthlyMinStay": {
"type": [
"array",
"null"
],
"items": [
{
"type": "number",
"enum": [
2
]
},
{
"type": "number",
"enum": [
4
]
},
{
"type": "number",
"enum": [
5
]
},
{
"type": "number",
"enum": [
5
]
},
{
"type": "number",
"enum": [
5
]
},
{
"type": "number",
"enum": [
5
]
},
{
"type": "number",
"enum": [
5
]
},
{
"type": "number",
"enum": [
3
]
},
{
"type": "number",
"enum": [
3
]
},
{
"type": "number",
"enum": [
2
]
},
{
"type": "number",
"enum": [
2
]
},
{
"type": "number",
"enum": [
2
]
}
]
},
"genderAllowed": {
"type": [
"string",
"null"
],
"enum": [
"male",
"female",
null
]
}
},
"required": [
"listingId",
"isInstantBookingEnabled",
"areCouplesAllowed",
"ageRangeAllowed",
"maxDaysBeforeCheckIn",
"monthlyMinStay",
"genderAllowed"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"listingId": {
"type": "string",
"enum": [
"1234456"
]
},
"isInstantBookingEnabled": {
"type": "boolean",
"enum": [
true
]
},
"areCouplesAllowed": {
"type": [
"boolean",
"null"
],
"enum": [
false,
null
]
},
"ageRangeAllowed": {
"type": [
"array",
"null"
],
"items": [
{
"type": "number",
"enum": [
18
]
},
{
"type": "number",
"enum": [
99
]
}
]
},
"maxDaysBeforeCheckIn": {
"type": [
"number",
"null"
],
"enum": [
50,
null
]
},
"monthlyMinStay": {
"type": [
"array",
"null"
],
"items": [
{
"type": "number",
"enum": [
2
]
},
{
"type": "number",
"enum": [
4
]
},
{
"type": "number",
"enum": [
5
]
},
{
"type": "number",
"enum": [
5
]
},
{
"type": "number",
"enum": [
5
]
},
{
"type": "number",
"enum": [
5
]
},
{
"type": "number",
"enum": [
5
]
},
{
"type": "number",
"enum": [
3
]
},
{
"type": "number",
"enum": [
3
]
},
{
"type": "number",
"enum": [
2
]
},
{
"type": "number",
"enum": [
2
]
},
{
"type": "number",
"enum": [
2
]
}
]
},
"genderAllowed": {
"type": [
"string",
"null"
],
"enum": [
"male",
"female",
null
]
}
},
"required": [
"listingId",
"isInstantBookingEnabled",
"areCouplesAllowed",
"ageRangeAllowed",
"maxDaysBeforeCheckIn",
"monthlyMinStay",
"genderAllowed"
],
"additionalProperties": false
}
]
}
},
"required": [
"conditions"
]
}204Headers
Content-Type: application/hal+json
Content-Type: application/json401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}422Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request was well formed but was unable to be followed due to semantic errors",
"status": 422,
"title": "Unprocessable Entity",
"type": "`http://www.w3.org/Protocols/rfc2616/rfc2616",
"validationMessages": {
"field": {
"stringLength": "The input is less than 6 characters long"
}
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string",
"description": "sec10.html (string, required)"
},
"validationMessages": {
"type": "object",
"properties": {
"field": {
"type": "object",
"properties": {
"stringLength": {
"type": "string"
}
},
"required": [
"stringLength"
]
}
},
"description": "Contains a property for each field that failed validation."
}
},
"required": [
"detail",
"status",
"title"
]
}Booking Agent ¶
Get all Booking Agents ¶
Get all Booking AgentsGET/agents{?page,itemsPerPage,enabled,sortBy,sortType}
This endpoint returns a list of Booking Agents
Example URI
- page
number(optional) Example: 1- itemsPerPage
number(optional) Example: 1- enabled
boolean(optional) Example: true- sortBy
enum [string](optional) Example: fullName-
fullName -
ongoing -
startTime
-
- sortType
enum [string](optional) Example: asc-
asc -
desc
-
Headers
Content-Type: application/json
Authorization: aa.bb.cc200Headers
Content-Type: application/hal+json
Content-Type: application/jsonBody
{
"count": 1,
"total": 20,
"_links": {
"first": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"prev": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"next": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"last": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"self": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
}
},
"_embedded": {
"bookingAgents": [
{
"id": "305e7971-4006-4554-a962-17278a136ba3",
"email": "test@email.com",
"fullName": "John Snow",
"languages": [
"es",
"en",
"fr"
],
"cities": [
"madrid",
"barcelona"
],
"ongoingBookingRequestsCount": 6,
"day": "2018-12-31",
"hours": [
[
"09:00",
"14:00"
],
[
"15:00",
"18:00"
]
]
}
]
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"count": {
"type": "number",
"description": "Number of listed items"
},
"total": {
"type": "number",
"description": "Total number of items"
},
"_links": {
"type": "object",
"properties": {
"first": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"prev": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"next": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"last": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"self": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
}
}
},
"_embedded": {
"type": "object",
"properties": {
"bookingAgents": {
"type": "array",
"description": "A list of Agents"
}
}
}
}
}401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Get a Booking Agent by ID ¶
Get a Booking Agent by IDGET/agents/{id}
This endpoint returns Booking Agent identified by Id
Example URI
- id
string(required)Id of a Booking Agent.
Headers
Content-Type: application/json
Authorization: aa.bb.cc200Headers
Content-Type: application/hal+json
Content-Type: application/jsonBody
{
"id": "305e7971-4006-4554-a962-17278a136ba3",
"email": "test@email.com",
"fullName": "John Snow",
"languages": [
"es",
"en",
"fr"
],
"cities": [
"madrid",
"barcelona"
],
"ongoingBookingRequestsCount": 6,
"day": "2018-12-31",
"hours": [
[
"09:00",
"14:00"
],
[
"15:00",
"18:00"
]
]
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"email": {
"type": "string"
},
"fullName": {
"type": "string"
},
"languages": {
"type": "array"
},
"cities": {
"type": "array"
},
"ongoingBookingRequestsCount": {
"type": "number"
},
"day": {
"type": "string"
},
"hours": {
"type": "array"
}
}
}401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Get all languages for booking agents ¶
Get all languages for booking agentsGET/agents/languages
This endpoint returns a list of ISO code languages
Example URI
Headers
Content-Type: application/json
Authorization: aa.bb.cc200Headers
Content-Type: application/hal+json
Content-Type: application/jsonBody
{
"languages": [
"es",
"en",
"fr"
]
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"languages": {
"type": "array"
}
}
}401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Set languages for a booking agent ¶
Set languages for a booking agentPUT/agents/{id}/languages
Set the list of languages (ISO code) associated to a booking agent
Example URI
- id
string(required)ID of an agent.
Headers
Content-Type: application/json
Authorization: aa.bb.ccBody
{
"languages": [
"es",
"en"
]
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"languages": {
"type": "array"
}
}
}204401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}422Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request was well formed but was unable to be followed due to semantic errors",
"status": 422,
"title": "Unprocessable Entity",
"type": "`http://www.w3.org/Protocols/rfc2616/rfc2616",
"validationMessages": {
"field": {
"stringLength": "The input is less than 6 characters long"
}
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string",
"description": "sec10.html (string, required)"
},
"validationMessages": {
"type": "object",
"properties": {
"field": {
"type": "object",
"properties": {
"stringLength": {
"type": "string"
}
},
"required": [
"stringLength"
]
}
},
"description": "Contains a property for each field that failed validation."
}
},
"required": [
"detail",
"status",
"title"
]
}Set cities for a booking agent ¶
Set cities for a booking agentPUT/agents/{id}/cities
Set the list of cities associated to a booking agent
Example URI
- id
string(required)ID of an agent.
Headers
Content-Type: application/json
Authorization: aa.bb.ccBody
{
"cities": [
"madrid",
"barcelona"
]
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"cities": {
"type": "array"
}
}
}204401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}422Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request was well formed but was unable to be followed due to semantic errors",
"status": 422,
"title": "Unprocessable Entity",
"type": "`http://www.w3.org/Protocols/rfc2616/rfc2616",
"validationMessages": {
"field": {
"stringLength": "The input is less than 6 characters long"
}
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string",
"description": "sec10.html (string, required)"
},
"validationMessages": {
"type": "object",
"properties": {
"field": {
"type": "object",
"properties": {
"stringLength": {
"type": "string"
}
},
"required": [
"stringLength"
]
}
},
"description": "Contains a property for each field that failed validation."
}
},
"required": [
"detail",
"status",
"title"
]
}Get agent schedule for a day ¶
Get agent schedule for a dayGET/agents/{id}/schedules/{day}
Get the working hours (in UTC) for a given agent on a given day
Example URI
- id
string(required) Example: aa-bb-ccID of an agent.
- day
string(required) Example: 2018-01-01
Headers
Content-Type: application/json
Authorization: aa.bb.cc200Headers
Content-Type: application/hal+json
Content-Type: application/jsonBody
{
"id": "305e7971-4006-4554-a962-17278a136ba3",
"agentId": "aa-bb-cc-dd",
"day": "2018-12-31",
"hours": [
[
"09:00",
"14:00"
],
[
"15:00",
"18:00"
]
]
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"agentId": {
"type": "string"
},
"day": {
"type": "string"
},
"hours": {
"type": "array"
}
}
}401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}400Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be understood by the server due to malformed syntax",
"status": 400,
"title": "Bad Request",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Get agent schedule for a day range ¶
Get agent schedule for a day rangeGET/agents/{id}/schedules/{fromDate}/{toDate}
Get the working hours for a given agent on a given day range
Example URI
- id
string(required) Example: aa-bb-ccID of an agent.
- fromDate
string(required) Example: 2018-01-01- toDate
string(required) Example: 2018-01-05
Headers
Content-Type: application/json
Authorization: aa.bb.cc200Headers
Content-Type: application/hal+json
Content-Type: application/jsonBody
{
"schedules": [
{
"id": "305e7971-4006-4554-a962-17278a136ba3",
"agentId": "aa-bb-cc-dd",
"day": "2018-12-31",
"hours": [
[
"09:00",
"14:00"
],
[
"15:00",
"18:00"
]
]
}
]
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"schedules": {
"type": "array"
}
}
}401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}400Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be understood by the server due to malformed syntax",
"status": 400,
"title": "Bad Request",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Set agent schedules ¶
Set agent schedulesPOST/agents/{id}/schedules
Set the working hours (in UTC) for a given agent on a given date
Example URI
- id
string(required) Example: aa-bb-ccID of an agent.
Headers
Content-Type: application/json
Authorization: aa.bb.ccBody
{
"day": "2018-01-01",
"hours": [
[
"09:00",
"18:00"
]
]
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"day": {
"type": "string"
},
"hours": {
"type": "array"
}
},
"required": [
"day",
"hours"
]
}201400Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be understood by the server due to malformed syntax",
"status": 400,
"title": "Bad Request",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}422Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request was well formed but was unable to be followed due to semantic errors",
"status": 422,
"title": "Unprocessable Entity",
"type": "`http://www.w3.org/Protocols/rfc2616/rfc2616",
"validationMessages": {
"field": {
"stringLength": "The input is less than 6 characters long"
}
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string",
"description": "sec10.html (string, required)"
},
"validationMessages": {
"type": "object",
"properties": {
"field": {
"type": "object",
"properties": {
"stringLength": {
"type": "string"
}
},
"required": [
"stringLength"
]
}
},
"description": "Contains a property for each field that failed validation."
}
},
"required": [
"detail",
"status",
"title"
]
}Update agent schedule ¶
Update agent schedulePUT/agents/{id}/schedules/{day}
Update the working hours (in UTC) for a given agent on a given date
Example URI
- id
string(required) Example: aa-bb-ccID of an agent.
- day
string(required) Example: yyyy-mm-ddDay to update its schedule.
Headers
Content-Type: application/json
Authorization: aa.bb.ccBody
{
"hours": [
[
"09:00",
"15:00"
]
]
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"hours": {
"type": "array"
}
},
"required": [
"hours"
]
}204401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}422Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request was well formed but was unable to be followed due to semantic errors",
"status": 422,
"title": "Unprocessable Entity",
"type": "`http://www.w3.org/Protocols/rfc2616/rfc2616",
"validationMessages": {
"field": {
"stringLength": "The input is less than 6 characters long"
}
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string",
"description": "sec10.html (string, required)"
},
"validationMessages": {
"type": "object",
"properties": {
"field": {
"type": "object",
"properties": {
"stringLength": {
"type": "string"
}
},
"required": [
"stringLength"
]
}
},
"description": "Contains a property for each field that failed validation."
}
},
"required": [
"detail",
"status",
"title"
]
}Bulk CSV update of agent schedules ¶
Bulk CSV update of agent schedulesPUT/agents/schedules-bulk
Example URI
Headers
Content-Type: text/csv
Authorization: aa.bb.cc
Time-Zone: '+0200'Body
{
"file": "it should be a text/csv file"
}Schema
{
"type": "object",
"properties": {
"file": {
"type": "string"
}
},
"required": [
"file"
],
"$schema": "http://json-schema.org/draft-04/schema#"
}204401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}422Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request was well formed but was unable to be followed due to semantic errors",
"status": 422,
"title": "Unprocessable Entity",
"type": "`http://www.w3.org/Protocols/rfc2616/rfc2616",
"validationMessages": {
"field": {
"stringLength": "The input is less than 6 characters long"
}
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string",
"description": "sec10.html (string, required)"
},
"validationMessages": {
"type": "object",
"properties": {
"field": {
"type": "object",
"properties": {
"stringLength": {
"type": "string"
}
},
"required": [
"stringLength"
]
}
},
"description": "Contains a property for each field that failed validation."
}
},
"required": [
"detail",
"status",
"title"
]
}Global ¶
Cities ¶
CitiesGET/cities{?enabled}
Return all cities.
Example URI
- enabled
boolean(optional) Example: true
Headers
Content-Type: application/json
Authorization: aa.bb.cc200Headers
Content-Type: application/jsonBody
{
"count": 1,
"total": 20,
"_links": {
"first": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"prev": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"next": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"last": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
},
"self": {
"href": "https://monolith.spotahome.com/api/{resource}/{id}"
}
},
"_embedded": {
"cities": [
"city A",
"city B"
]
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"count": {
"type": "number",
"description": "Number of listed items"
},
"total": {
"type": "number",
"description": "Total number of items"
},
"_links": {
"type": "object",
"properties": {
"first": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"prev": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"next": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"last": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
},
"self": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The link URI or URI template"
}
},
"required": [
"href"
]
}
}
},
"_embedded": {
"type": "object",
"properties": {
"cities": {
"type": "array"
}
}
}
}
}401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}CityGET/cities/{cityId}
Return information for a city.
Example URI
- cityId
string(required)Id of the city
Headers
Content-Type: application/json
Authorization: aa.bb.cc200Headers
Content-Type: application/jsonBody
{
"isBookable": true
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"isBookable": {
"type": "boolean"
}
}
}400Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be understood by the server due to malformed syntax",
"status": 400,
"title": "Bad Request",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}403Headers
Content-Type: application/problem+jsonBody
{
"detail": "Forbidden",
"status": 403,
"title": "Forbidden",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Promo ¶
Promo ¶
Get a Promo by Promo code with the greatest expiration dateGET/promos/{promoCode}
The endpoint returns the Promo identified by the promoCode
Example URI
- promoCode
string(required)Code of a promo.
Headers
Content-Type: application/json
Authorization: aa.bb.cc200Headers
Content-Type: application/hal+jsonBody
{
"id": "1234456",
"promoCode": true,
"discount": 15,
"expirationDate": "2010-01-01"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"promoCode": {
"type": "boolean"
},
"discount": {
"type": "number"
},
"expirationDate": {
"type": "string"
}
}
}401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Value Added Service ¶
Create value added service tracking ¶
Create value added service trackingPOST/vas-trackings
Save tracking information about value added services
Example URI
Headers
Content-Type: application/json
Authorization: aa.bb.ccBody
{
"valueAddedServiceId": "857a7a89-e044-4895-aab1-639748d4ed8e",
"targetUrl": "https://www.example.com",
"additionalInfo": {
"foo": "foo",
"foo1": "foo1"
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"valueAddedServiceId": {
"type": "string"
},
"targetUrl": {
"type": "string"
},
"additionalInfo": {
"type": "object",
"properties": {
"foo": {
"type": "string"
},
"foo1": {
"type": "string"
}
}
}
},
"required": [
"valueAddedServiceId",
"targetUrl"
]
}204401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}409Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be completed due to a conflict with the current state of the resource",
"status": 409,
"title": "Conflict",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}422Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request was well formed but was unable to be followed due to semantic errors",
"status": 422,
"title": "Unprocessable Entity",
"type": "`http://www.w3.org/Protocols/rfc2616/rfc2616",
"validationMessages": {
"field": {
"stringLength": "The input is less than 6 characters long"
}
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string",
"description": "sec10.html (string, required)"
},
"validationMessages": {
"type": "object",
"properties": {
"field": {
"type": "object",
"properties": {
"stringLength": {
"type": "string"
}
},
"required": [
"stringLength"
]
}
},
"description": "Contains a property for each field that failed validation."
}
},
"required": [
"detail",
"status",
"title"
]
}Get value added service by target and city ¶
Get value added service by target and cityGET/vas/{target}/{city}
This endpoint returns a list of value added services by target and city
Example URI
- target
string(required)tenant or landlord.
- city
string(required)ref code of the city
Headers
Content-Type: application/json
Authorization: aa.bb.cc200Headers
Content-Type: application/hal+json
Content-type: application/jsonBody
[
{
"id": "80e859d1-aca7-41ad-9a77-8a0d4c4663f6",
"target": "tenant",
"name": "n26",
"serviceType": "banking",
"tags": [
"moving-and-getting-up",
"test"
],
"cities": [
"madrid",
"london"
],
"titleBanner": "Mobile Phone",
"descriptionBanner": "description",
"titleCard": "Mobile",
"descriptionCard": "descriptionCard",
"listCard": [
"likedList: `* No hidden fees.\\n* Global support in range of languages.`"
],
"imageSrc": "https://our-bucket/img/img1.jpeg",
"link": "http://example.com",
"affiliateCode": "SAH97",
"featured": true,
"trustpilotScore": "7.7",
"trustpilotReviewsAmount": "+5.5k",
"imgLogoSrc": "https://our-bucket.com/img/img1.jpeg",
"discountCode": "code",
"discountType": "amount",
"discountAmount": "15",
"discountCurrency": "EUR"
}
]Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"enum": [
"80e859d1-aca7-41ad-9a77-8a0d4c4663f6"
]
},
"target": {
"type": "string",
"enum": [
"tenant",
"landlord"
]
},
"name": {
"type": "string",
"enum": [
"n26"
]
},
"serviceType": {
"type": "string",
"enum": [
"banking"
]
},
"tags": {
"type": "array",
"items": [
{
"type": "string",
"enum": [
"moving-and-getting-up"
]
},
{
"type": "string",
"enum": [
"test"
]
}
]
},
"cities": {
"type": "array",
"items": [
{
"type": "string",
"enum": [
"madrid"
]
},
{
"type": "string",
"enum": [
"london"
]
}
]
},
"titleBanner": {
"type": "string",
"enum": [
"Mobile Phone"
]
},
"descriptionBanner": {
"type": "string",
"enum": [
"description"
]
},
"titleCard": {
"type": "string",
"enum": [
"Mobile"
]
},
"descriptionCard": {
"type": "string",
"enum": [
"descriptionCard"
]
},
"listCard": {
"type": "array",
"items": {
"type": "string",
"enum": [
"likedList: `* No hidden fees.\\n* Global support in range of languages.`"
]
}
},
"imageSrc": {
"type": "string",
"enum": [
"https://our-bucket/img/img1.jpeg"
]
},
"link": {
"type": "string",
"enum": [
"http://example.com"
]
},
"affiliateCode": {
"type": "string",
"enum": [
"SAH97"
]
},
"featured": {
"type": "boolean",
"enum": [
true
]
},
"trustpilotScore": {
"type": "string",
"enum": [
"7.7"
]
},
"trustpilotReviewsAmount": {
"type": "string",
"enum": [
"+5.5k"
]
},
"imgLogoSrc": {
"type": "string",
"enum": [
"https://our-bucket.com/img/img1.jpeg"
]
},
"discountCode": {
"type": [
"string",
"null"
],
"enum": [
"code",
null
]
},
"discountType": {
"type": [
"string",
"null"
],
"enum": [
"amount",
"percentage",
null
]
},
"discountAmount": {
"type": [
"string",
"null"
],
"enum": [
"15",
null
]
},
"discountCurrency": {
"type": [
"string",
"null"
],
"enum": [
"EUR",
null
]
}
},
"required": [
"id",
"target",
"name",
"serviceType",
"tags",
"cities",
"titleBanner",
"descriptionBanner",
"titleCard",
"descriptionCard",
"listCard",
"imageSrc",
"link",
"affiliateCode",
"featured",
"trustpilotScore",
"trustpilotReviewsAmount",
"imgLogoSrc",
"discountCode",
"discountType",
"discountAmount",
"discountCurrency"
],
"additionalProperties": false
}
}401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Create value added service ¶
Create value added servicePOST/vas/services
Save a new value added service
Example URI
Headers
Content-Type: application/json
Authorization: aa.bb.ccBody
{
"target": "tenant",
"name": "link",
"links": {
"madrid": "Hello, world!",
"london": "Hello, world!"
},
"imageSrc": "http://example.com/image",
"imgLogoSrc": "http://example.com/logo",
"trustpilotScore": "7.7",
"trustpilotReviewsAmount": "23K"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"target": {
"type": "string"
},
"name": {
"type": "string"
},
"links": {
"type": "object",
"properties": {
"madrid": {
"type": "string"
},
"london": {
"type": "string"
}
}
},
"imageSrc": {
"type": "string"
},
"imgLogoSrc": {
"type": "string"
},
"trustpilotScore": {
"type": "string"
},
"trustpilotReviewsAmount": {
"type": "string"
}
},
"required": [
"target",
"name",
"name",
"name"
]
}201401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}409Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be completed due to a conflict with the current state of the resource",
"status": 409,
"title": "Conflict",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}422Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request was well formed but was unable to be followed due to semantic errors",
"status": 422,
"title": "Unprocessable Entity",
"type": "`http://www.w3.org/Protocols/rfc2616/rfc2616",
"validationMessages": {
"field": {
"stringLength": "The input is less than 6 characters long"
}
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string",
"description": "sec10.html (string, required)"
},
"validationMessages": {
"type": "object",
"properties": {
"field": {
"type": "object",
"properties": {
"stringLength": {
"type": "string"
}
},
"required": [
"stringLength"
]
}
},
"description": "Contains a property for each field that failed validation."
}
},
"required": [
"detail",
"status",
"title"
]
}Update value added service ¶
Update value added servicePUT/vas/services/
Update a value added service
Example URI
Headers
Content-Type: application/json
Authorization: aa.bb.ccBody
{
"id": "857a7a89-e044-4895-aab1-639748d4ed8e",
"target": "tenant",
"name": "link",
"links": "madrid",
"imageSrc": "http://example.com/image",
"imgLogoSrc": "http://example.com/logo",
"trustpilotScore": "7.7",
"trustpilotReviewsAmount": "23K"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"target": {
"type": "string"
},
"name": {
"type": "string"
},
"links": {
"type": "string",
"enum": [
"madrid",
"london"
]
},
"imageSrc": {
"type": "string"
},
"imgLogoSrc": {
"type": "string"
},
"trustpilotScore": {
"type": "string"
},
"trustpilotReviewsAmount": {
"type": "string"
}
},
"required": [
"id",
"target",
"name",
"name",
"name",
"links"
]
}204401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}422Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request was well formed but was unable to be followed due to semantic errors",
"status": 422,
"title": "Unprocessable Entity",
"type": "`http://www.w3.org/Protocols/rfc2616/rfc2616",
"validationMessages": {
"field": {
"stringLength": "The input is less than 6 characters long"
}
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string",
"description": "sec10.html (string, required)"
},
"validationMessages": {
"type": "object",
"properties": {
"field": {
"type": "object",
"properties": {
"stringLength": {
"type": "string"
}
},
"required": [
"stringLength"
]
}
},
"description": "Contains a property for each field that failed validation."
}
},
"required": [
"detail",
"status",
"title"
]
}Delete value added service ¶
Delete value added serviceDELETE/vas/services/{id}
Delete a value added service
Example URI
- id
string(required)Id of a value added service.
Headers
Content-Type: application/json
Authorization: aa.bb.cc204401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Event Schema ¶
List of Event Schemas ¶
List of Event SchemasGET/event-schemas
Return all stored event schemas
Example URI
Headers
Content-Type: application/json
Authorization: aa.bb.cc200Headers
Content-Type: application/jsonBody
[
{
"id": "EA14917183508531F65B35E9D4C64066",
"name": "SAH\\BookingsPostPaid\\Domain\\BookingRequestWasCreated",
"schema": {
"type": "record",
"name": "BookingRequestWasCreated",
"namespace": "spotahome.bookings.booking_lead",
"fields": [
{
"name": "bookingLeadId",
"type": "string"
},
{
"name": "bookingRequestId",
"type": "long"
},
{
"name": "occurredOn",
"type": "string"
}
]
},
"timestamp": 0
}
]Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}401Headers
Content-Type: application/jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Domain Events ¶
BookingRequestWasRemarked
{
"_id" : 1,
"type_name" : "SAH\BookingsPostPaid\Domain\BookingRequestWasRemarked",
"occurred_on" : "2017-05-18T09:55:06.000Z",
"event_body" : {
"bookingRequestId" : 95858,
"remark" : "this is the message",
"occurred_on" : "2017-05-18T09:55:06.000Z"
}
}
BookingRequestWasRated
{
"_id" : 1,
"type_name" : "SAH\BookingsPostPaid\Domain\BookingRequestWasRated",
"occurred_on" : "2017-05-18T09:55:06.000Z",
"event_body" : {
"bookingRequestId" : 95858,
"rating" : 4,
"occurred_on" : "2017-05-18T09:55:06.000Z"
}
}
BookingRequestWasViewed
{
"_id" : 1,
"type_name" : "SAH\BookingsPostPaid\Domain\BookingRequestWasViewed",
"occurred_on" : "2017-05-18T09:55:06.000Z",
"event_body" : {
"bookingRequestId" : 95858,
"occurred_on" : "2017-05-18T09:55:06.000Z"
}
}
BookingRequestDeviceInfoWasAttached
{
"_id" : 1,
"type_name" : "SAH\BookingsPostPaid\Domain\BookingRequestDeviceInfoWasAttached",
"occurred_on" : "2017-05-18T09:55:06.000Z",
"event_body" : {
"id" : 95858,
"deviceType" : "desktop",
"deviceOs" : "Windows",
"occurred_on" : "2017-05-18T09:55:06.000Z"
}
}
CancellationPenaltyWasCharged
{
"_id" : 1,
"type_name" : "SAH\BookingsPostPaid\Domain\CancellationPenaltyWasCharged",
"occurred_on" : "2017-05-18T09:55:06.000Z",
"event_body" : {
"bookingRequestId" : 95858,
"amount" : 10000,
"occurred_on" : "2017-05-18T09:55:06.000Z"
}
}
BookingWasCreatedFromBookingRequestPostPaid
{
"_id" : 1,
"type_name" : "SAH\BookingsPostPaid\Domain\Booking\BookingWasCreatedFromBookingRequestPostPaid",
"occurred_on" : "2017-05-18T09:55:06.000Z",
"event_body" : {
"bookingId" : "c551b5e8-cba8-4341-bdbd-b1039fd21746",
"bookingRequestId" : 95858,
"feeCollectionType" : "upfront",
"rentCollectionType" : "none",
"billCollectionType" : "none",
"platformSource" : "spotahome",
"plan" : "standard",
"occurred_on" : "2017-05-18T09:55:06.000Z"
}
}
BookingWasCreatedFromBookingRequestPrePaid
{
"_id" : 1,
"type_name" : "SAH\BookingsPostPaid\Domain\Booking\BookingWasCreatedFromBookingRequestPrePaid",
"occurred_on" : "2017-05-18T09:55:06.000Z",
"event_body" : {
"bookingId" : "c551b5e8-cba8-4341-bdbd-b1039fd21746",
"bookingRequestId" : 95858,
"feeCollectionType" : "upfront",
"rentCollectionType" : "none",
"billCollectionType" : "none",
"platformSource" : "spotahome",
"plan" : "standard",
"occurred_on" : "2017-05-18T09:55:06.000Z"
}
}
BookingWasCreatedFromRelocation
{
"_id" : 1,
"type_name" : "SAH\BookingsPostPaid\Domain\Booking\BookingWasCreatedFromRelocation",
"occurred_on" : "2017-05-18T09:55:06.000Z",
"event_body" : {
"bookingId" : "c551b5e8-cba8-4341-bdbd-b1039fd21746",
"bookingRequestId" : 95858,
"feeCollectionType" : "upfront",
"rentCollectionType" : "none",
"billCollectionType" : "none",
"platformSource" : "spotahome",
"plan" : "standard",
"occurred_on" : "2017-05-18T09:55:06.000Z"
}
}
BookingWasCreatedFromPartnerBookingRequest
{
"_id" : 1,
"type_name" : "SAH\BookingsPostPaid\Domain\Booking\BookingWasCreatedFromPartnerBookingRequest",
"occurred_on" : "2017-05-18T09:55:06.000Z",
"event_body" : {
"id" : "c551b5e8-cba8-4341-bdbd-b1039fd21746",
"bookingRequestId" : 95858,
"feeCollectionType" : "upfront",
"platformSource" : "spotahome",
"rentCollectionType" : "none",
"billCollectionType" : "none",
"plan" : "standard",
"occurred_on" : "2017-05-18T09:55:06.000Z"
}
}
BookingWasCreatedFromInstantBooking
{
"_id" : 1,
"type_name" : "SAH\BookingsPostPaid\Domain\Booking\BookingWasCreatedFromInstantBooking",
"occurred_on" : "2017-05-18T09:55:06.000Z",
"event_body" : {
"bookingId" : "c551b5e8-cba8-4341-bdbd-b1039fd21746",
"bookingRequestId" : 95858,
"feeCollectionType" : "upfront",
"platformSource" : "spotahome",
"rentCollectionType" : "none",
"billCollectionType" : "none",
"plan" : "standard",
"occurred_on" : "2017-05-18T09:55:06.000Z"
}
}
BookingWasCreatedFromPreAccepted
{
"_id" : 1,
"type_name" : "SAH\BookingsPostPaid\Domain\Booking\BookingWasCreatedFromPreAccepted",
"occurred_on" : "2017-05-18T09:55:06.000Z",
"event_body" : {
"bookingId" : "c551b5e8-cba8-4341-bdbd-b1039fd21746",
"bookingRequestId" : 95858,
"feeCollectionType" : "upfront",
"platformSource" : "spotahome",
"rentCollectionType" : "none",
"billCollectionType" : "none",
"plan" : "standard",
"occurred_on" : "2017-05-18T09:55:06.000Z"
}
}
PartnerBookingRequestWasCreated
{
"_id" : 1,
"type_name" : "SAH\BookingsPostPaid\Domain\PartnerBookingRequestWasCreated",
"occurred_on" : "2017-05-18T09:55:06.000Z",
"event_body" : {
"id" : "199259",
"name" : "Jane Doe",
"email" : "jane.doe@mailing.com",
"phone" : "+34666666666",
"birthday" : "1983-08-08",
"gender" : "female",
"country" : "WA",
"checkIn" : "2020-08-08",
"checkOut" : "2021-08-08",
"occurred_on" : "2017-05-18T09:55:06.000Z"
}
}
BookingMovingDatesWereUpdated
{
"_id" : 1,
"type_name" : "SAH\BookingsPostPaid\Domain\Booking\BookingMovingDatesWereUpdated",
"occurred_on" : "2017-05-18T09:55:06.000Z",
"event_body" : {
"id" : "c551b5e8-cba8-4341-bdbd-b1039fd21746",
"moveInDate" : "2019-01-01",
"moveOutDate" : "2019-02-25",
"occurredOn" : "2017-05-18T09:55:06.000Z"
}
}
BookingRequestWasCreated
{
"_id": 1,
"typeName": "SAH\BookingsPostPaid\Domain\Booking\BookingRequestWasCreated",
"occurredOn": "2017-05-18T09:55:06.000Z",
"eventBody": {
"bookingId": 111670,
"listingId": "110700",
"checkIn": "2019-08-30",
"checkOut": "2019-12-31",
"landlordTransferDueDate": "2019-09-01",
"bookingProcessId": "5dba3a84-12a4-4a8d-8969-0dede63cd6fd",
"locator": "34GKGE",
"ric": "H3",
"bookingProcess": "post_paid",
"pricingId": "5dba3a84-12a4-4a8d-8969-0dede63cd6fd",
"platformSource": "spotahome",
"occurredOn" : "2017-05-18T09:55:06.000Z"
}
}
RenegotiationWasRequestedByLandlord
{
"_id" : 1,
"type_name" : "SAH\BookingsPostPaid\Domain\RenegotiationWasRequestedByLandlord",
"occurred_on" : "2017-05-18T09:55:06.000Z",
"event_body" : {
"bookingRequestId" : "95858",
"message" : "A message",
"occurred_on" : "2017-05-18T09:55:06.000Z"
}
}
MovingDatesWereModified
{
"_id" : 1,
"type_name" : "SAH\BookingsPostPaid\Domain\MovingDatesWereModified",
"occurred_on" : "2017-05-18T09:55:06.000Z",
"event_body" : {
"id" : "95858",
"checkIn" : "2017-06-01",
"checkOut" : "2017-07-31",
"previousCheckIn" : "2016-06-01",
"previousCheckOut" : "2016-07-31",
"occurred_on" : "2017-05-18T09:55:06.000Z"
}
}
MovingDatesWereModifiedForAcceptedRenegotiation
{
"_id" : 1,
"type_name" : "SAH\BookingsPostPaid\Domain\MovingDatesWereModifiedForAcceptedRenegotiation",
"occurred_on" : "2017-05-18T09:55:06.000Z",
"event_body" : {
"id" : "95858",
"checkIn" : "2017-06-01",
"checkOut" : "2017-07-31",
"previousCheckIn" : "2016-06-01",
"previousCheckOut" : "2016-07-31",
"occurred_on" : "2017-05-18T09:55:06.000Z"
}
}
RemarkWasCreated
{
"_id" : 1,
"type_name" : "SAH\BookingsPostPaid\Domain\Remark\RemarkWasCreated",
"occurred_on" : "2017-05-18T09:55:06.000Z",
"event_body" : {
"id" : "95858",
"bookingRequestId" : "123456",
"userId" : "gha67k-jsi89-67ha",
"message" : "this is a remark",
"metadata" : {"occurredOn": {"date": "2018-03-06 14:50:48.634115", "timezone": "UTC", "timezone_type": 3}}
}
}
BookingLeadWasCreated
{
"_id" : 1,
"type_name": "SAH\BookingsPostPaid\Domain\Lead\BookingLeadWasCreated",
"occurred_on": "2018-08-02T16:09:54.000Z",
"event_body" : {
"checkOut" : "2019-02-01",
"listingId" : "82509",
"name" : "White",
"country" : "SZ",
"id" : "6761ae82-ff66-49ee-b184-1ff9ef45a2ec",
"bookingProcessId" : "6761ae82-ff66-49ee-b184-1ff9ef45a2ec",
"birthday" : "1910-10-31",
"email" : "jugux@mailinator.com",
"metadata" : {
"ipAddress" : "1.1.2.2"
},
"locator" : "8X1GX6",
"phone" : "+618-33-6967783",
"occurredOn" : "2018-08-02",
"checkIn" : "2018-09-01",
"gender" : "female",
"pricingId" : "98593aed-57f5-4d84-95a2-76c28dfe57d9",
"platformSource": "spotahome",
"userId" : "57f54d84-ff66-95a2-b184-1ff9ef45a2ec"
}
}
BookingLeadSocialInfoWasUpdated
Note: bookingLeadId in the event body has been deprecated in favor of id.
{
"_id" : 82378869,
"typeName" : "SAH\\BookingsPostPaid\\Domain\\Lead\\BookingLeadSocialInfoWasUpdated",
"occurredOn" : ISODate("2019-02-26T13:55:58.000Z"),
"eventBody" : {
"occupationDetails" : null,
"occupation" : "student",
"bookingLeadId" : "4910d87e-7080-4f96-936b-3302e7c570f9",
"occurredOn" : "2019-02-26T13:55:58+0000",
"id" : "4910d87e-7080-4f96-936b-3302e7c570f9",
"couple" : true,
"message" : "Hi there!"
}
}
BookingLeadConverted
{
"_id" : 82380837,
"typeName" : "SAH\\BookingsPostPaid\\Domain\\Lead\\BookingLeadConverted",
"occurredOn" : ISODate("2019-02-26T15:11:26.000Z"),
"eventBody" : {
"bookingLeadId" : "8e594080-922a-46f1-8ffa-c149b74af31a",
"occurredOn" : "2019-02-26T15:11:26+0000",
"bookingRequestId" : 192733
}
}
BookingLeadHouseRulesWereChecked
{
"_id" : 82378870,
"typeName" : "SAH\\BookingsPostPaid\\Domain\\Lead\\BookingLeadHouseRulesWereChecked",
"occurredOn" : ISODate("2019-02-26T13:55:58.000Z"),
"eventBody" : {
"occupationResult" : true,
"coupleResult" : false,
"occurredOn" : "2019-02-26T13:55:58+0000",
"id" : "4910d87e-7080-4f96-936b-3302e7c570f9",
"genderResult" : true
}
}
BookingLeadSuitabilityWasChecked
{
"_id" : 82378871,
"typeName" : "SAH\\BookingsPostPaid\\Domain\\Lead\\BookingLeadSuitabilityWasChecked",
"occurredOn" : ISODate("2019-02-26T13:55:58.000Z"),
"eventBody" : {
"id" : "4910d87e-7080-4f96-936b-3302e7c570f9",
"genderSuitable" : true,
"coupleSuitable" : true,
"bookingLeadSuitable" : true,
"occurredOn" : "2019-02-26T13:55:58+0000",
"occupationSuitable" : true
}
}
AgentWasAssigned
{
"_id" : 1,
"type_name": "SAH\BookingsPostPaid\Domain\AgentWasAssigned",
"occurred_on": "2018-09-18T08:05:56.000Z",
"event_body" : {
"occurredOn" : "2018-09-18T08:05:56+0000",
"id" : "172292",
"agentId" : "2230f7f0-a4ef-4844-9518-0e56d4331658"
}
}
AgentWasUnassigned
{
"_id" : 1,
"type_name": "SAH\BookingsPostPaid\Domain\AgentWasUnassigned",
"occurred_on": "2018-09-18T08:05:56.000Z",
"event_body" : {
"bookingRequestId" : "172292",
"agentId" : null,
"previousAgentId" : "2230f7f0-a4ef-4844-9518-0e56d4331658",
"occurredOn" : "2018-09-18T08:05:56+0000"
}
}
AgentAssignationWasConfirmed
{
"_id" : 1,
"type_name": "SAH\BookingsPostPaid\Domain\AgentAssignationWasConfirmed",
"occurred_on": "2018-09-18T08:05:56.000Z",
"event_body" : {
"bookingRequestId" : "172292",
"agentId" : "2230f7f0-a4ef-4844-9518-0e56d4331658",
"occurredOn" : "2018-09-18T08:05:56+0000"
}
}
BookingRequestExpirationWasChanged
{
"_id" : 1,
"type_name": "SAH\BookingsPostPaid\Domain\BookingRequestExpirationWasChanged",
"occurred_on": "2018-09-18T08:05:56.000Z",
"event_body" : {
"bookingRequestId" : "172292",
"expirationDate" : "2018-09-18T08:05:56+0000",
"actionedBy" : "2230f7f0-a4ef-4844-9518-0e56d4331658"
}
}
TenantDetailsWereDeleted
{
"_id" : 1,
"type_name" : "SAH\BookingsPostPaid\Domain\Tenant\TenantDetailsWereDeleted",
"occurred_on" : "2019-05-18T09:55:06.000Z",
"event_body" : {
"email" : "tenant@email.com",
"occurred_on" : "2019-05-18T09:55:06.000Z"
}
}
BankAccountHoldersWereDeleted
{
"_id" : 1,
"type_name" : "SAH\BookingsPostPaid\Domain\Landlord\BankAccountHoldersWereDeleted",
"occurred_on" : "2019-05-18T09:55:06.000Z",
"event_body" : {
"email" : "landlord@email.com",
"occurred_on" : "2019-05-18T09:55:06.000Z"
}
}
BookingChargeWasAuthorized
{
"bookingId" : 82375,
"occurredOn" : "2017-01-19T15:03:13+0000",
"provider" : "braintree",
"instrumentType" : "credit_card"
}
BookingChargeFailed
{
"bookingId" : 82375,
"occurredOn" : "2017-01-19T15:03:13+0000",
"errorMessage" : "Insufficient Funds",
"provider" : "braintree",
"instrumentType" : "credit_card"
}
BookingWasCharged
{
"bookingId" : 79400,
"occurredOn" : {
"timezone_type" : 3,
"date" : "2016-12-22 09:00:44.000000",
"timezone" : "UTC"
},
"currencyCode" : "EUR",
"provider" : "braintree",
"instrumentType" : "credit_card",
"amount" : 1597,
"transactionId" : "n7ek5cs8"
}
PreAcceptedBookingWasCreated
{
"id" : "79400",
"occurredOn" : "2020-07-07 15:00:00.000",
"listingId" : "230003",
"checkInDate" : "2020-07-10",
"checkOutDate" : "2020-08-10",
"startContractDate" : "2020-07-10",
"endContractDate" : "2020-08-10",
"bookingRequestCreationDate" : "2020-07-07"
}
InstantBookingConditionsForListingWereCreated
{
"_id" : 1,
"type_name": "SAH\BookingsPostPaid\Domain\Listing\InstantBookingConditionsForListingWereCreated",
"occurred_on": "2018-08-02T16:09:54.000Z",
"event_body":
{
"gender": "male",
"metadata": {
"occurredOn": {
"date": "2018-05-18 14:34:14.216743",
"timezone": "UTC",
"timezone_type": 3
}
},
"listingId": "99912",
"monthlyMinStay": [
5,
5,
4,
3,
2,
1,
1,
1,
5,
4,
3,
2
],
"ageRangeAllowed": [
18,
35
],
"areCouplesAllowed": true,
"maxDaysBeforeCheckIn": 60,
"isInstantBookingEnabled": true
}
}
InstantBookingConditionsForListingWereUpdated
{
"_id" : 1,
"type_name": "SAH\BookingsPostPaid\Domain\Listing\InstantBookingConditionsForListingWereUpdated",
"occurred_on": "2018-08-02T16:09:54.000Z",
"event_body":
{
"gender": "male",
"metadata": {
"occurredOn": {
"date": "2018-05-18 15:15:41.542048",
"timezone": "UTC",
"timezone_type": 3
}
},
"listingId": "100923",
"monthlyMinStay": [
5,
5,
4,
3,
2,
1,
1,
1,
5,
4,
3,
2
],
"ageRangeAllowed": [
18,
35
],
"areCouplesAllowed": true,
"maxDaysBeforeCheckIn": 60,
"isInstantBookingEnabled": true
}
}
ScheduleForAgentWasSet
{
"_id" : 1,
"type_name" : "SAH\BookingsPostPaid\Domain\BookingAgent\Schedule\ScheduleForAgentWasSet",
"occurred_on" : "2017-05-18T09:55:06.000Z",
"event_body" : {
"id" : `xx-yy-zz`,
"agentId" : "aa-bb-cc",
"day" : 2017-03-21,
"hours" : [
[
"09:00", "14:00"
],
[
"15:00", "18:00"
]
],
"metadata" : {
"occurredOn" : {
"date" : "2018-02-05 16:00:44.532756",
"timezone" : "UTC",
"timezone_type" : 3
}
}
}
}
BookingCreated
{
"_id" : 1,
"type_name" : "SAH\BookingsPostPaid\Domain\Booking\BookingCreated",
"occurred_on" : "2017-05-18T09:55:06.000Z",
"event_body" : {
"id" : "c197e843-8120-419a-bc7c-6449b239fbfb",
"occurred_on" : "2017-05-18T09:55:06.000Z",
"bookingRequestId" : "123456",
"platformSource" : "spotahome",
"plan" : "standard",
"rentCollectionType" : "none",
"billCollectionType" : "none"
}
}
BookingStarted
{
"_id" : 1,
"type_name" : "SAH\BookingsPostPaid\Domain\Booking\BookingStarted",
"occurred_on" : "2017-05-18T09:55:06.000Z",
"event_body" : {
"id" : "c197e843-8120-419a-bc7c-6449b239fbfb",
"occurred_on" : "2017-05-18T09:55:06.000Z"
}
}
BookingCheckedIn
{
"_id" : 1,
"type_name" : "SAH\BookingsPostPaid\Domain\Booking\BookingCheckedIn",
"occurred_on" : "2017-05-18T09:55:06.000Z",
"event_body" : {
"id" : "c197e843-8120-419a-bc7c-6449b239fbfb",
"occurred_on" : "2017-05-18T09:55:06.000Z"
}
}
BookingCancelled
{
"_id" : 1,
"type_name" : "SAH\BookingsPostPaid\Domain\Booking\BookingCancelled",
"occurred_on" : "2017-05-18T09:55:06.000Z",
"event_body" : {
"id" : "c197e843-8120-419a-bc7c-6449b239fbfb",
"occurred_on" : "2017-05-18T09:55:06.000Z"
}
}
BookingCheckedOut
{
"_id" : 1,
"type_name" : "SAH\BookingsPostPaid\Domain\Booking\BookingCheckedOut",
"occurred_on" : "2017-05-18T09:55:06.000Z",
"event_body" : {
"id" : "c197e843-8120-419a-bc7c-6449b239fbfb",
"occurred_on" : "2017-05-18T09:55:06.000Z"
}
}
BookingIntentionWasCreated
{
"_id" : 1,
"type_name" : "SAH\BookingsPostPaid\Domain\BookingIntention\BookingIntentionWasCreated",
"occurred_on" : "2017-05-18T09:55:06.000Z",
"event_body" : {
"id" : "95858",
"userId" : "gha67k-jsi89-67ha",
"listingId" : "123456",
"checkIn" : "2020-10-20",
"checkOut" : "2020-11-24",
"platformSource" : "spotahome",
"metadata" : {"occurredOn": {"date": "2018-03-06 14:50:48.634115", "timezone": "UTC", "timezone_type": 3}}
}
}
BookingRequestRenegotiationWasRequested
{
"_id" : 1,
"type_name" : "SAH\BookingsPostPaid\Domain\RenegotiationSuggestion\BookingRequestRenegotiationWasRequested",
"occurred_on" : "2017-05-18T09:55:06.000Z",
"event_body" : {
"id" : "d0e47311-cebc-48b3-9544-b31c4c853ca7",
"bookingRequestId" : "123456",
"userId" : "1bdb151d-c8a0-4988-aa8b-7496214c877d",
"newCheckInDate" : "2020-11-24",
"newCheckOutDate" : "2020-11-24",
"status" : "WaitingForAnswer",
"requestedAt" : "2020-11-24 14:30:02",
"landlordComment" : "I want to change the check-in date",
"occurredOn" : "2018-03-06 14:50:48.634115"
}
}
BookingRequestRenegotiationWasAccepted
{
"_id" : 1,
"type_name" : "SAH\BookingsPostPaid\Domain\RenegotiationSuggestion\BookingRequestRenegotiationWasAccepted",
"occurred_on" : "2017-05-18T09:55:06.000Z",
"event_body" : {
"id" : "d0e47311-cebc-48b3-9544-b31c4c853ca7",
"bookingRequestId" : "123456",
"userId" : "1bdb151d-c8a0-4988-aa8b-7496214c877d",
"status" : "Accepted",
"closedAt" : "2020-11-24 14:30:02",
"occurredOn" : "2018-03-06 14:50:48.634115"
}
}
BookingRequestRenegotiationWasRejected
{
"_id" : 1,
"type_name" : "SAH\BookingsPostPaid\Domain\RenegotiationSuggestion\BookingRequestRenegotiationWasRejected",
"occurred_on" : "2017-05-18T09:55:06.000Z",
"event_body" : {
"id" : "d0e47311-cebc-48b3-9544-b31c4c853ca7",
"bookingRequestId" : "123456",
"userId" : "1bdb151d-c8a0-4988-aa8b-7496214c877d",
"status" : "Rejected",
"closedAt" : "2020-11-24 14:30:02",
"occurredOn" : "2018-03-06 14:50:48.634115"
}
}
BookingRequestRenegotiationWasClosed
{
"_id" : 1,
"type_name" : "SAH\BookingsPostPaid\Domain\RenegotiationSuggestion\BookingRequestRenegotiationWasClosed",
"occurred_on" : "2017-05-18T09:55:06.000Z",
"event_body" : {
"id" : "d0e47311-cebc-48b3-9544-b31c4c853ca7",
"bookingRequestId" : "123456",
"userId" : "1bdb151d-c8a0-4988-aa8b-7496214c877d",
"status" : "Closed",
"closedAt" : "2020-11-24 14:30:02",
"occurredOn" : "2018-03-06 14:50:48.634115"
}
}
Event store ¶
Get Domain Events ¶
Get Domain EventsGET/api/monolith/event-store/{fromEventId}-{toEventId}
Gets a specific set of domain events from a specific interval. A maximum of 500 results will be shown if more are requested.
Example URI
- fromEventId
number(required)From domain event id
- toEventId
number(required)To domain event id
Headers
Content-Type: application/json
Authorization: aa.bb.cc200Headers
Content-Type: application/jsonBody
{
"events": [
{
"typeName": "SAH\\BookingsPostPaid\\Domain\\NotifyBookingRequestCreationInitiated",
"occurredOn": "2017-07-03T11:20:35.000Z",
"eventBody": "{\"bookingRequestId\":102549,\"occurredOn\":\"2017-07-03T11:20:35+0000\"}"
}
]
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"events": {
"type": "array"
}
}
}401Headers
Content-Type: application/jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Payment Provider ¶
A Payment Provider is a service which allows the system to perform payments over Booking Requests
Client Token ¶
Client TokenPOST/payment-provider/client-token
Generate a client token from the given provider
Example URI
Headers
Content-Type: application/jsonBody
{}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {}
}200Headers
Content-Type: application/jsonBody
{
"clientToken": "abcabcabc"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"clientToken": {
"type": "string"
}
}
}400Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be understood by the server due to malformed syntax",
"status": 400,
"title": "Bad Request",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}422Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request was well formed but was unable to be followed due to semantic errors",
"status": 422,
"title": "Unprocessable Entity",
"type": "`http://www.w3.org/Protocols/rfc2616/rfc2616",
"validationMessages": {
"field": {
"stringLength": "The input is less than 6 characters long"
}
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string",
"description": "sec10.html (string, required)"
},
"validationMessages": {
"type": "object",
"properties": {
"field": {
"type": "object",
"properties": {
"stringLength": {
"type": "string"
}
},
"required": [
"stringLength"
]
}
},
"description": "Contains a property for each field that failed validation."
}
},
"required": [
"detail",
"status",
"title"
]
}UnitStayRules ¶
UnitStayRules ¶
Create and Update multiple Unit Stay RulesPUT/unit-stay-rules
This endpoint creates and updates unit stay rules information for a given unit.
Example URI
Headers
Content-Type: application/json
Authorization: aa.bb.ccBody
[
{
"unitId": "123098",
"bookingTooEarlyDays": 90,
"minStay": 50,
"maxStay": 90
}
]Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}204400Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be understood by the server due to malformed syntax",
"status": 400,
"title": "Bad Request",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}403Headers
Content-Type: application/problem+jsonBody
{
"detail": "Forbidden",
"status": 403,
"title": "Forbidden",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Create and partial update multiple Unit Stay RulesPATCH/unit-stay-rules
This endpoint creates and updates unit stay rules information for a given unit.
Example URI
Headers
Content-Type: application/json
Authorization: aa.bb.ccBody
[
{
"unitId": "123098",
"bookingTooEarlyDays": 90,
"minStay": 50,
"maxStay": 90
}
]Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}204400Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be understood by the server due to malformed syntax",
"status": 400,
"title": "Bad Request",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}403Headers
Content-Type: application/problem+jsonBody
{
"detail": "Forbidden",
"status": 403,
"title": "Forbidden",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Get UnitStayRules by Unit IdGET/unit-stay-rules/{unitId}
This endpoint gets unit stay rules information for a given unit.
Example URI
- unitId
string(required) Example: 123456Id of a Unit.
Headers
Content-Type: application/json
Authorization: aa.bb.cc200Headers
Content-Type: application/jsonBody
{
"unitId": "123098",
"bookingTooEarlyDays": 90,
"minStay": 50,
"maxStay": 90
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"unitId": {
"type": "string"
},
"bookingTooEarlyDays": {
"type": [
"number",
"null"
]
},
"minStay": {
"type": [
"number",
"null"
]
},
"maxStay": {
"type": [
"number",
"null"
]
}
}
}401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be understood by the server due to malformed syntax",
"status": 400,
"title": "Bad Request",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}CityRules ¶
Get minimum stay by set of units ¶
Get minimum stay by set of unitsPOST/properties/city-rules
This endpoint gets unit stay rules information of a list of unit ids.
Example URI
Headers
Content-Type: application/json
Authorization: aa.bb.ccBody
{
"unitIds": [
"188392"
]
}200Headers
Content-Type: application/jsonBody
{
"cities": [
{
"id": "barcelona",
"minStay": 30
}
],
"maxMinStay": 30
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"cities": {
"type": "array"
},
"maxMinStay": {
"type": "number"
}
},
"required": [
"maxMinStay"
]
}401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}403Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be understood by the server due to malformed syntax",
"status": 400,
"title": "Bad Request",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Renegotiation Suggestion ¶
Renegotiation Suggestion ¶
Create Renegotiation SuggestionPOST/booking-requests/{bookingRequestId}/renegotiation-suggestions
Authorization: protected for ROLE_ACCOMMODATION_PROVIDER if booking request owner, uai_admin and uai_employee role.
Example URI
- bookingRequestId
string(required)Id of a Booking Request.
Headers
Content-Type: application/json
Authorization: aa.bb.ccBody
{
"newCheckInDate": "yyyy-mm-dd",
"newCheckOutDate": "yyyy-mm-dd",
"newStartContractDate": "yyyy-mm-dd",
"newEndContractDate": "yyyy-mm-dd",
"landlordComment": "This is a landlord comment about why he wants to change the booking request"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"newCheckInDate": {
"type": "string"
},
"newCheckOutDate": {
"type": "string"
},
"newStartContractDate": {
"type": "string"
},
"newEndContractDate": {
"type": "string"
},
"landlordComment": {
"type": "string"
}
}
}201400Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be understood by the server due to malformed syntax",
"status": 400,
"title": "Bad Request",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}403Headers
Content-Type: application/problem+jsonBody
{
"detail": "Forbidden",
"status": 403,
"title": "Forbidden",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Get Renegotiation SuggestionGET/booking-requests/{bookingRequestId}/renegotiation-suggestions
Authorization: protected for ROLE_ACCOMMODATION_PROVIDER if booking request owner, uai_admin and uai_employee role.
Example URI
- bookingRequestId
string(required)Id of a Booking Request.
Headers
Content-Type: application/json
Authorization: aa.bb.cc200Headers
Content-Type: application/jsonBody
[
{
"id": "ad4b1e06-952e-4738-9221-7988a285a6a1",
"bookingRequestId": "99998",
"userId": "9cc5b319-49fd-4c41-afb5-1d55360f56bb",
"newCheckInDate": "2023-09-05 00:00:00",
"newCheckOutDate": "2023-11-04 00:00:00",
"status": "WaitingForAnswer",
"requestedAt": "2023-09-04 11:37:50",
"closedAt": "2023-09-10 11:37:50",
"landlordComment": "this is just a landlord comment"
}
]Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}403Headers
Content-Type: application/problem+jsonBody
{
"detail": "Forbidden",
"status": 403,
"title": "Forbidden",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Get Renegotiation SuggestionGET/booking-requests/{bookingRequestId}/renegotiation-suggestions/{id}
Authorization: protected for ROLE_ACCOMMODATION_PROVIDER if booking request owner, uai_admin and uai_employee role.
Example URI
- id
string(required)Id of a renegotiation.
- bookingRequestId
string(required)Id of a Booking Request.
Headers
Content-Type: application/json
Authorization: aa.bb.cc200Headers
Content-Type: application/jsonBody
{
"id": "ad4b1e06-952e-4738-9221-7988a285a6a1",
"bookingRequestId": "99998",
"userId": "9cc5b319-49fd-4c41-afb5-1d55360f56bb",
"newCheckInDate": "2023-09-05 00:00:00",
"newCheckOutDate": "2023-11-04 00:00:00",
"status": "WaitingForAnswer",
"requestedAt": "2023-09-04 11:37:50",
"closedAt": "2023-09-10 11:37:50",
"landlordComment": "this is just a landlord comment"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"bookingRequestId": {
"type": "string"
},
"userId": {
"type": "string"
},
"newCheckInDate": {
"type": "string"
},
"newCheckOutDate": {
"type": "string"
},
"status": {
"type": "string"
},
"requestedAt": {
"type": "string"
},
"closedAt": {
"type": [
"string",
"null"
]
},
"landlordComment": {
"type": "string"
}
}
}401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}403Headers
Content-Type: application/problem+jsonBody
{
"detail": "Forbidden",
"status": 403,
"title": "Forbidden",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Reject Renegotiation SuggestionPUT/booking-requests/{bookingRequestId}/renegotiation-suggestions/{id}/rejects
Authorization: protected for uai_tenant if booking request owner, uai_admin and uai_employee role.
Example URI
- id
string(required)Id of a renegotiation.
- bookingRequestId
string(required)Id of a Booking Request.
Headers
Content-Type: application/json
Authorization: aa.bb.cc204Headers
Content-Type: application/json401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}403Headers
Content-Type: application/problem+jsonBody
{
"detail": "Forbidden",
"status": 403,
"title": "Forbidden",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}409Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be completed due to a conflict with the current state of the resource",
"status": 409,
"title": "Conflict",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}Accept Renegotiation SuggestionPUT/booking-requests/{bookingRequestId}/renegotiation-suggestions/{id}/accepts
Authorization: protected for uai_tenant if booking request owner, uai_admin and uai_employee role.
Example URI
- id
string(required)Id of a renegotiation.
- bookingRequestId
string(required)Id of a Booking Request.
Headers
Content-Type: application/json
Authorization: aa.bb.cc204Headers
Content-Type: application/json401Headers
Content-Type: application/problem+jsonBody
{
"detail": "Unauthorized user",
"status": 401,
"title": "Unauthorized",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}403Headers
Content-Type: application/problem+jsonBody
{
"detail": "Forbidden",
"status": 403,
"title": "Forbidden",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}404Headers
Content-Type: application/problem+jsonBody
{
"detail": "The resource was not found",
"status": 404,
"title": "Not Found",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}409Headers
Content-Type: application/problem+jsonBody
{
"detail": "The request could not be completed due to a conflict with the current state of the resource",
"status": 409,
"title": "Conflict",
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"status": {
"type": "number"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"detail",
"status",
"title",
"type"
]
}