POST /v2/houses/
Will create a new house entry in the database.
- None
{
"price_per_night": "number",
"max_adults": "number",
"max_children": "number",
"max_infants": "number",
"cleaning_fee": "number",
"service_fee": "number",
"occupancy_taxes_fees": "number",
"min_allowed_nights": "number"
}
- HTTP code according to if the request was succeeded or not:
- 201 in case that the house entry was created succesfully.
- 406 in case that the user (host) asked for a acceptable reqeust.
GET /v2/houses/:id
Will read and retrieve a specific house listing from the database.
- id: A number with the id of the house in the database.
- None
{
"id": "number",
"price_per_night": "number",
"max_adults": "number",
"max_children": "number",
"max_infants": "number",
"cleaning_fee": "number",
"service_fee": "number",
"occupancy_taxes_fees": "number",
"min_allowed_nights": "number"
}
PATCH /v2/houses/:id
Will update an existed house entry in the database - you do not have to specify all of them, only the properties you want to change.
- id: A number with the id of the house in the database
You can either change one of the properties or all of them.
{
"price_per_night": "number",
"max_adults": "number",
"max_children": "number",
"max_infants": "number",
"cleaning_fee": "number",
"service_fee": "number",
"occupancy_taxes_fees": "number",
"min_allowed_nights": "number"
}
- HTTP code according to if the request was succeeded or not:
- 201 in case that the house entry was changed succesfully.
- 406 in case that the user (host) asked for a not acceptable reqeust.
POST /v2/houses/:id
Will delete an existing house entry in the database.
- id: A number with the id of the house in the database
- None
- HTTP code according to if the request was succeeded or not:
- 201 in case that the house entry was deleted succesfully.
- 406 in case that the user (host) asked for not acceptable reqeust.
POST /v2/houses/:id/reservations/:check_in_date/:check_out_date/:adults/:children/:infants
Will create a new entry with in the database for a reservation.
- id: A number with the id of the house in the database
- check_in_date: A string with the check-in date in this format: 'mm-dd-yyyy'
- check_out_date: A string with the check-out date in this format: 'mm-dd-yyyy'
- adults: A number with the amount on the adults for this reservation
- children: A number with the amount on the children for this reservation
- infants: A number with the amount on the infants for this reservation
- None
- HTTP code according to if the request was succeeded or not:
- 201 in case that the reservation was created succesfully.
- 406 in case that the user asked for not acceptable reqeust.
GET /v2/houses/:id/reservations
Will get the reserved (or blacked out date by the host) dates for a specific house.
- The response will come as an array of reservation objects
{[
{
"id": 1,
"total_price": "number",
"adults_amout": "number",
"children_amout": "number",
"infants_amout": "number",
"check_in_date": "Date",
"check_out_date": "Date"
},
{
"id": 2,
"total_price": "number",
"adults_amout": "number",
"children_amout": "number",
"infants_amout": "number",
"check_in_date": "Date",
"check_out_date": "Date"
},
...,
{
"id": 99,
"total_price": "number",
"adults_amout": "number",
"children_amout": "number",
"infants_amout": "number",
"check_in_date": "Date",
"check_out_date": "Date"
}
]}
PATCH /v2/houses/:id/reservations/:reservationId/:check_in_date/:check_out_date/:adults/:children/:infants
Will update a specific house entry with a reservation including the reserved dates and people amount (for adults, children & infants) - you do not have to specify all of them, only the properties you want to change.
- id: A number with the id of the house in the database
- reservationId A number with the id of the reservation
- check_in_date: A string with the check-in date in this format: 'mm-dd-yyyy'
- check_out_date: A string with the check-out date in this format: 'mm-dd-yyyy'
- adults: A number with the amount on the adults for this reservation
- children: A number with the amount on the children for this reservation
- infants: A number with the amount on the infants for this reservation
- None
- HTTP code according to if the request was succeeded or not:
- 201 in case that the reservation entry was changed succesfully.
- 406 in case that the user asked for a not acceptable reqeust.
DELETE /v2/houses/:id/reservations/:reservationId
Will delete a specific reservation from a specific house
- id: A number with the id of the house in the database
- reservationId A number with the id of the reservation
- None
- HTTP code according to if the request was succeeded or not:
- 201 in case that the reservation entry was deleted succesfully.
- 406 in case that the user asked for not acceptable reqeust.