Introduction
Welcome to the Hostaway Public API! This API allows Hostaway users to create, update and delete listings and reservations, read listing calendars, block and unblock calendar days. Hostaway Public API is RESTful, JSON data format is used in both requests and responses bodies, only HTTPS protocol is allowed.
Please notice that:
- boolean type should be considered as integer 0 or 1 value
- all time values should be specified in UTC timezone (except for
checkInTimeStart
,checkInTimeEnd
andcheckOutTime
fields of Listing object, which have to be specified in listing’s local timezone) - all country code values are
ISO 3166-2
standard
Standard Response
We have the following data structure of response for the most of the endpoints:
{
"status": "success",
"result": "Endpoint result goes here",
"limit": null,
"offset": null,
"count": 1,
"page": 1,
"totalPages": 1
}
status
can be one of:success
if case of no errors occurred orfail
in case of any error.result
contains endpoint result if no errors or an error message string ifstatus
isfail
.
Pagination data — met in retrieve list
responses.
limit
number from 0, max to receive records count or count on page,offset
number from 0, the position “from” to get the records,count
: count of all records with specified filters,page
: page number,totalPages
: total pages number
Rate limits
To ensure a good performance of Hostaway’s Public API across the entire platform and protect it from external threats, we limit the number of calls an application can make at once by enforcing rate limits as follows: Maximum number of requests
Maximum number of requests | Time frame | Key |
---|---|---|
15 | 10 seconds | Per IP address |
20 | 10 seconds | Per account ID |
To ensure your service is not interrupted, make sure to spread API calls throughout the day instead of concentrating them, and implement queuing mechanisms that process a few requests and responses at a time
When you go over the rate limits specified above, the API will return HTTP code 429 and response
{
"status": "fail",
"message": "This error occurs because a server detects that your application has exceeded the rate limits or has made too many requests in a given period of time."
}
Webhook events
Hostaway allows you to create and manage webhooks so you get notified when something changes on our platform. That way, you don’t need to poll the API and can update your system in real-time.
Our system will not filter events for you, so once the webhooks are enabled, you will receive notifications for all supported events. Make sure your system is able to filter the events you need, as well as handle any new events that are added to the list.
If Hostaway tries to deliver the webhook notification to your server and doesn’t receive a successful status code in return, the system will retry it 3 times. After 3 failed attempts, the webhook notification won’t be retried by Hostaway anymore and we’ll send an email alert either to a pre-configured email address (see below) or to the account owner with the details of the failed message.
To create the webhooks, you’ll need to provide us with the following information: * URL (mandatory) → the endpoint that Hostaway should trigger to alert your system about an update * Login (optional) → a username that Hostaway should pass on the authentication header of the webhook request sent to your endpoint * Password (optional) → a password that Hostaway should pass on the authentication header of the webhook request sent to your endpoint * Recipient email (optional) → an email that Hostaway can use to send notifications when a webhook delivery fails. If not provided, the email with the error details will be sent to the primary email address from the Hostaway account
The events we support are the moment are the ones below, but keep in mind that we are constantly improving our webhooks and expect your service to handle any future webhook events that are added to this list: * reservation created → triggered when a new reservation is created in Hostaway, from any channel * reservation updated → triggered when an existing reservation is updated * new message received → triggered when a new message is added to a conversation
The full request to create the webhook.
Recommendations around polling
In general idea is to spread polling across different times instead of concentrating all requests at 00:00:01 every day. Instead of polling mechanism you can use unified webhooks to subscribe for events. To create unified webhook you can use public API request or Hostaway Dashboard https://dashboard.hostaway.com/settings/integrations. You can read more about events supported by webhooks here
Working with authorization token
To access Hostaway Public API endpoints you need to generate access token (here is how to do that).
Once access token is generated you can use it until it expires in 24 months. So the algorithm can be as following:
1. Check if there is non-expired token
2. IF yes -> use token to access public API endpoints
3. IF no -> get token using POST https://api.hostaway.com/v1/accessTokens
4. Store token somewhere on your side (for instance in the database table)
5. Once you get access denied 403 HTTP code it means your token is no longer valid and probably expired. You need to refresh it using step 1 and store a new refreshed token to continue using it in your public API calls
Important: There is NO need to generate new access token over and over for each particular API request putting unneeded load both on our and your systems. You should store it on your side instead while it is valid. There are rate limits which restrict amount of allowed requests per ip address and account in a time period.
Changing behavior of returning attached objects
In our efforts to improve your services, we will change the behavior on how to return the attached objects in response to requests made towards Hostaway’s Public API retrieving a list of reservations or calendar days.
Now you will need to pass an extra query parameter includeResources=1
to get those attached objects.
The following are the endpoints and its objects that will be affected by the change
GET {baseUrl}/v1/reservations
- customFieldValues
- reservationFees
- reservationUnit
- hostProxyEmail
Now, if you didn’t pass the query parameter ?includeResources=1
the above fields will be always an empty as shown in the response snippet on the right
{
"customFieldValues": [],
"reservationFees": [],
"reservationUnit": [],
"hostProxyEmail": null
}
GET {baseUrl}/v1/listings/{listingId}/calendar
- reservations
The same thing applied on the endpoint, if the query parameter ?includeResources=1
didn’t passed, the reservations
will be always an empty array []
as shown in the response snippet on the right
{
"reservations": []
}
Questions and bug reporting
If you have any questions regarding API, feel free to send them by email to support@hostaway.com.
If you ever notice a bug, please send a report to support@hostaway.com. Report should include cURL
request with endpoint URL, time of the request with timezone, header, payload, response and expected result.
Changelog
2025-01-13 - Added deprecation notes to the reservation webhook pages. Please consider using Unified webhooks instead.
2024-10-18
- Added hostProxyEmail
into the reservation
object. It will be accessible by including the includeResources=1
to the Retrieve a reservations list endpoint or from Retrieve a reservation by default.
2024-10-17
- Added cancellationPolicyId
into the reservation
object
2024-10-16
- Added fields below into the listing
object
- airbnbName
- airbnbSummary
- guestBathroomsNumber
2024-09-04
- Added predefined channel values: Channels
2024-05-15
- Changed
type
in financial fields:guestChannelFee
fromfee
tocommissions
airbnbClosedResolutionsSum
,refundSum
,damageDeposit
fromfee
toother
airbnbPassThroughTax
,airbnbTransientOccupancyTax
fromfee
totax
Full and actual list of financial fields and types can be found here
2024-04-17
- Changed
type
in financial fields:baseRate
,pricePerExtraPerson
fromprice
toaccomodation
totalPriceFromChannel
fromprice
tototals
cancellationPayout
,airbnbPayoutSum
,totalPaid
fromfee
tototals
hostCancellationPenalty
,bookingComCancellationGuestFee
,cancellationHostFee
,otaPaymentProcessingFee
,hostChannelFee
,paymentServiceProcessingFee
fromfee
tocommissions
2024-03-25
- Add
guestPaymentCardIsVirtual
to Reservation object
2024-01-23
- Adding
bookingEngineUrls
inlisting
object
2024-01-17
- Add listing object Airbnb fields
2024-01-08
- Adding the ability to sort and filter by latest activity in listings
2023-12-19
- Added endpoint Update offline charge
2023-12-14
- Added listing
airbnbOfficialListingMarkup
field - Added listing
bookingEngineMarkup
field - Added listing
homeawayApiMarkup
field - Added listing
marriottListingMarkup
field
2023-11-07
- Added listing
averageReviewRating
field - Added rate limit section
- Added
remainingBalance
to reservation object
2023-10-24
- Added
isVirtual
to reservation payment card object
2023-10-02
- Set includeResources default value to 0
2023-09-29
- Added listing airbnbListingUrl, vrboListingUrl, googleVrListingUrl fields
2023-09-11
- Added reservation coupons list endpoint
2023-08-25
- Added Guest payment / create offline charges
2023-08-24
- Added endpoint Get user by ID
2023-08-17
- Endpoints for tasks
2023-07-31
- Added Guest payment / auto-payment rules
2023-07-27
- thumbnailUrl in listing object is deprecated listing object
2023-05-11
- Added expense articles expense
2023-04-11
- Added guest payments article guest payments
2023-01-11
- Added reservation coupon creating endpoint create reservation coupon object
2022-12-22
- Added originalChannel field to reservation response
2022-11-09
- Airbnb cancellation policies - new endpoint, list of Airbnb cancellation policies, id can be used as listing.airBnbCancellationPolicyId parameter
- Booking.com cancellation policies - new endpoint, new endpoint, list of Booking.com cancellation policies, id can be used as listing.bookingCancellationPolicyId parameter
- Marriott cancellation policies - new endpoint, new endpoint, list of Marriott cancellation policies, id can be used as listing.marriottCancellationPolicyId parameter
- Vrbo cancellation policies - new endpoint, new endpoint, list of VRBO cancellation policies, id can be used as listing.vrboCancellationPolicyId parameter
- Channel specific cancellation policy added to listing object (marriottCancellationPolicyId, vrboCancellationPolicyId, airBnbCancellationPolicyId, bookingCancellationPolicyId, cancellationPolicyId)
2022-11-03
- Update finance fields in reservation - update reservation finance fields
- Finance fields - read and update finance fields in reservation breakdown
2022-11-01
- Calculate reservation price - new price details calculator. We recommend migrating to this calculator if you are using an old calculator as support for the old one has been discontinued.
- Calculate reservation price with extras - calculator price details with extras
- Create a reservation with price details - create reservation with price details. Now it is possible to create reservations with any price details.
2022-07-13
- Unified webhooks support added
2022-06-28
- Added vrboCaption and airbnbCaption to listing Image object
- Added possibility to limit listings list response by userId
2022-05-31
- Added possibility to create Rental Agreement
2022-05-10
- Seasonal rule intervals endpoint channelId query parameter added
2022-04-26
- Seasonal rule endpoint added
- Fix calculate reservation price endpoint parameters
2022-01-25
- Added possibility to create custom field with
dropDown
type
2022-01-18
- Guest invoice charge transaction object
2021-11-25
- Partners markup value is added to listing object
- Endpoints for custom fields (create, update and delete)
2021-08-12 - Added new field “customerUserId” in reservations
2021-08-09 - Reservation webhooks - Conversation message webhooks
2021-07-08 - Add price details components - Add listing fee settings
2021-04-09 - Fix owner statement retrieve endpoint doc
2021-03-31 - Reservation quote object updated - Owner statement endpoints added
2021-03-31
- A new reservation status ownerStay
is available. The status is used to identify the dates reserved by the property owner.
A reservation of ownerStay
status must not have financial information. The main use case is to have information about owner stays
in the financial reporting module.
2020-12-18
- confirmed
reservation status is deprecated for creating/updating reservations.
- listing update endpoint is improved. Now it’s safe to pass only fields you want to update. No need to pass entire object.
2020-11-19 - Added payment methods retrieve endpoint for reservations
2020-10-14 - Calculate reservation price endpoint introduced.
2020-09-08 - Added multi unit support
2020-08-20 - Listings section update.
2020-07-07 - Added Financial Reporting section. - Added Tax Settings section.
2019-11-01
- includeResources
parameter us now fully supported for listings, reservations, conversations, calendar endpoints. It is on by default.
2019-10-08
- paymentMethodGuestId
and paymentMethodMessage
reservation fields were renamed to stripeGuestId
and stripeMessage
, respectively
2019-06-24
- Added isBookingEngineActive
field for listing filtering
2019-05-24
- Custom reservation field object
- Custom field value of reservation object
2019-01-17 - Common information (countries, currencies, languages and timezones) endpoints introduced.
2018-10-04
- refundableDamageDeposit
listing field introduced
2018-08-24
includeResources
parameter added for listings, conversations, calendar endpoints (It is a coming feature, it will be effective by end of September and will be off by default).propertyLicenseNumber
,propertyLicenseType
,propertyLicenseIssueDate
,propertyLicenseExpirationDate
fields of listing object are added
2018-08-09
isDatesUnspecified
field of reservation added
2018-07-16
invoicingContactName
,invoicingContactSurName
,invoicingContactPhone1
,invoicingContactPhone2
,invoicingContactLanguage
,invoicingContactEmail
,invoicingContactAddress
,invoicingContactCity
,invoicingContactZipcode
,invoicingContactCountry
fields of listing object are added
2018-07-16
listingTimeZoneName
,communicationEvent
,communicationTimeDelta
,communicationApplyListingTimeZone
,communicationAlwaysTrigger
fields of communication message object are removeddate
,insertedOn
,updatedOn
fields of communication message object are added
2018-07-13
isInitial
field of reservation object
2018-07-02
- conversation object
- conversation message object
- message template object
- endpoints for messaging support
2018-06-16
guestZipCode
,guestAddress
fields of reservation object.
2018-05-07
channelId
field of reservation object should be specified on reservation creation.
2018-02-03
source
,cancellationDate
,cancelledBy
fields of reservation object.homeawayReservationPaymentDueDays
of listing removed.
2017-12-16
confirmationCode
field of Airbnb reservations.
2017-12-13
externalListingName
,internalListingName
,homeawayPropertyHeadline
fields added to listing object.
2017-10-28
doorCode
,doorCodeVendor
,doorCodeInstruction
fields added to reservation object.
2017-10-25
- Added the new reservation fields:
guestRecommendations
,guestTrips
,guestWork
,isGuestIdentityVerified
,isGuestVerifiedByEmail
,isGuestVerifiedByWorkEmail
,isGuestVerifiedByFacebook
,isGuestVerifiedByGovernmentId
,isGuestVerifiedByPhone
,isGuestVerifiedByReviews
,isStarred
,isArchived
,isPinned
2017-08-29
match
parameter added for list of reservations and listings
2017-08-11
Batch calendar update
New fields of listing: propertyRentTax, guestPerPersonPerNightTax, guestStayTax, guestNightlyTax
Currency and roomsToSell fields of CalendarDay are removed
2017-07-07
- V1 is released
Authentication
We use Client Credentials Grant of OAuth 2.0 protocol for API authentication.
Request
curl -X POST \
https://api.hostaway.com/v1/accessTokens \
-H 'Cache-control: no-cache' \
-H 'Content-type: application/x-www-form-urlencoded' \
-d 'grant_type=client_credentials&client_id={your Hostaway account ID}&client_secret=yourclientsecret&scope=general'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/accessTokens",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "grant_type=client_credentials&client_id={your Hostaway account ID}&client_secret=3e58c1cee59edd616b9c060035db664c35c970e320577314c07535be87041a5d&scope=general",
CURLOPT_HTTPHEADER => array(
"Cache-control: no-cache",
"Content-type: application/x-www-form-urlencoded"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var data = "grant_type=client_credentials&client_id={your Hostaway account ID}&client_secret=3e58c1cee59edd616b9c060035db664c35c970e320577314c07535be87041a5d&scope=general";
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.hostaway.com/v1/accessTokens");
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send(data);
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "grant_type=client_credentials&client_id={your Hostaway account ID}&client_secret=3e58c1cee59edd616b9c060035db664c35c970e320577314c07535be87041a5d&scope=general");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/accessTokens")
.post(body)
.addHeader("Content-type", "application/x-www-form-urlencoded")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import http.client
conn = http.client.HTTPSConnection("api.hostaway.com")
payload = "grant_type=client_credentials&client_id={your Hostaway account ID}&client_secret=3e58c1cee59edd616b9c060035db664c35c970e320577314c07535be87041a5d&scope=general"
headers = {
'Content-type': "application/x-www-form-urlencoded",
'Cache-control': "no-cache"
}
conn.request("POST", "/v1/accessTokens", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
POST https://api.hostaway.com/v1/accessTokens
To issue a new access token the client sends a POST
request with following request body parameters to the
Authorization server endpoint:
Parameter | Required | Type | Description |
---|---|---|---|
grant_type |
yes | string | Should be client_credentials |
client_id |
yes | int | Your Hostaway account ID |
client_secret |
yes | string | Client’s secret (can be obtained in your Hostaway dashboard) |
scope |
yes | string | Should be general |
Response
{
"token_type": "Bearer",
"expires_in": 15897600,
"access_token": "yournewaccesstoken"
}
The Authorization server will respond with a JSON object containing the following properties:
Property | Type | Description |
---|---|---|
token_type |
string | Bearer is always returned |
expires_in |
int | An integer representing the TTL of the access token |
access_token |
string | A JWT signed with the Authorization server’s private key |
The access token should be included in all other API requests to the server in a header and should look like the following:
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiId
sImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZ
jIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2J
kZWM0MDNiMzMwNzhhYTIyN2JmIiwi
Time to live for the generated access token is 24 months.
Revoke Authentication Token
Request
curl --location --request DELETE 'https://api.hostaway.com/v1/accessTokens?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxMjQ3MSIsImp0aSI6IjA4ODkwMzgwYzU0NzA4MWM1MmEwYWU5Y2I1NmIwNmZhMWZkMjgwNTY1YWRjNmQ0NTc2MjNjNTk1ZmUyYzlhYzM5NDE2NmFjZmJjY2IyZmIwIiwiaWF0IjoxNTg1ODUxNDI1LCJuYmYiOjE1ODU4NTE0MjUsImV4cCI6MTY0ODkyMzQyNSwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.R5TPnSTMYs7rSXNFj_GLxjO2vag2tKbsGKcSgMCFDXq6K0gLp-z52nOuCbCY7UlZnvbAFXi2zIpV-qzwCrBDHKi-YsY-LJEY5xzj8VTnlKiC9zKfRqhIaL_G3EQAvyFW04Kp2VXP3d7d_GiAFhTo412pjmrJIm6gN-N2JX6B-xo' \
--header 'Content-type: application/x-www-form-urlencoded'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/accessTokens?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxMjQ3MSIsImp0aSI6IjA4ODkwMzgwYzU0NzA4MWM1MmEwYWU5Y2I1NmIwNmZhMWZkMjgwNTY1YWRjNmQ0NTc2MjNjNTk1ZmUyYzlhYzM5NDE2NmFjZmJjY2IyZmIwIiwiaWF0IjoxNTg1ODUxNDI1LCJuYmYiOjE1ODU4NTE0MjUsImV4cCI6MTY0ODkyMzQyNSwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.R5TPnSTMYs7rSXNFj_GLxjO2vag2tKbsGKcSgMCFDXq6K0gLp-z52nOuCbCY7UlZnvbAFXi2zIpV-qzwCrBDHKi-YsY-LJEY5xzj8VTnlKiC9zKfRqhIaL_G3EQAvyFW04Kp2VXP3d7d_GiAFhTo412pjmrJIm6gN-N2JX6B-xo",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => array(
"Cache-control: no-cache",
"Content-type: application/x-www-form-urlencoded"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("DELETE", "https://api.hostaway.com/v1/accessTokens?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxMjQ3MSIsImp0aSI6IjA4ODkwMzgwYzU0NzA4MWM1MmEwYWU5Y2I1NmIwNmZhMWZkMjgwNTY1YWRjNmQ0NTc2MjNjNTk1ZmUyYzlhYzM5NDE2NmFjZmJjY2IyZmIwIiwiaWF0IjoxNTg1ODUxNDI1LCJuYmYiOjE1ODU4NTE0MjUsImV4cCI6MTY0ODkyMzQyNSwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.R5TPnSTMYs7rSXNFj_GLxjO2vag2tKbsGKcSgMCFDXq6K0gLp-z52nOuCbCY7UlZnvbAFXi2zIpV-qzwCrBDHKi-YsY-LJEY5xzj8VTnlKiC9zKfRqhIaL_G3EQAvyFW04Kp2VXP3d7d_GiAFhTo412pjmrJIm6gN-N2JX6B-xo");
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send();
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/accessTokens?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxMjQ3MSIsImp0aSI6IjA4ODkwMzgwYzU0NzA4MWM1MmEwYWU5Y2I1NmIwNmZhMWZkMjgwNTY1YWRjNmQ0NTc2MjNjNTk1ZmUyYzlhYzM5NDE2NmFjZmJjY2IyZmIwIiwiaWF0IjoxNTg1ODUxNDI1LCJuYmYiOjE1ODU4NTE0MjUsImV4cCI6MTY0ODkyMzQyNSwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.R5TPnSTMYs7rSXNFj_GLxjO2vag2tKbsGKcSgMCFDXq6K0gLp-z52nOuCbCY7UlZnvbAFXi2zIpV-qzwCrBDHKi-YsY-LJEY5xzj8VTnlKiC9zKfRqhIaL_G3EQAvyFW04Kp2VXP3d7d_GiAFhTo412pjmrJIm6gN-N2JX6B-xo")
.delete()
.addHeader("Content-type", "application/x-www-form-urlencoded")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import http.client
conn = http.client.HTTPSConnection("api.hostaway.com")
payload = ""
headers = {
'Content-type': "application/x-www-form-urlencoded",
'Cache-control': "no-cache"
}
conn.request("DELETE", "/v1/accessTokens?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxMjQ3MSIsImp0aSI6IjA4ODkwMzgwYzU0NzA4MWM1MmEwYWU5Y2I1NmIwNmZhMWZkMjgwNTY1YWRjNmQ0NTc2MjNjNTk1ZmUyYzlhYzM5NDE2NmFjZmJjY2IyZmIwIiwiaWF0IjoxNTg1ODUxNDI1LCJuYmYiOjE1ODU4NTE0MjUsImV4cCI6MTY0ODkyMzQyNSwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.R5TPnSTMYs7rSXNFj_GLxjO2vag2tKbsGKcSgMCFDXq6K0gLp-z52nOuCbCY7UlZnvbAFXi2zIpV-qzwCrBDHKi-YsY-LJEY5xzj8VTnlKiC9zKfRqhIaL_G3EQAvyFW04Kp2VXP3d7d_GiAFhTo412pjmrJIm6gN-N2JX6B-xo", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
DELETE https://api.hostaway.com/v1/accessTokens
To revoke existing access token the client sends a DELETE
request with following request URL parameters to the
Authorization server endpoint:
Parameter | Required | Type | Description |
---|---|---|---|
token |
yes | string | Should be token you generated using POST request |
Response
{
"status": "success",
"result": []
}
Revoked access tokens can no longer be used to access Public API endpoints.
Listings
Listing object
{
"id": 40160,
"propertyTypeId": 1,
"name": "Beautiful and cozy apartment close to city center",
"externalListingName": "Beautiful and cozy apartment close to city center",
"internalListingName": "Property #3",
"description": "In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.",
"houseRules": "Additional rules",
"keyPickup": "Key pickup",
"specialInstruction": "Any special instruction",
"doorSecurityCode": "ddff8",
"country": "Germany",
"countryCode": "DE",
"state": "Bremen",
"city": "Bremerhaven",
"street": "Schulstraße 7",
"address": "Schulstraße 7, Bremerhaven, Bremen 27570, Germany",
"publicAddress": "Bremerhaven, Bremen 27570, Germany",
"zipcode": "27570",
"price": 211.62,
"starRating": 2.5,
"averageReviewRating": 9.2,
"weeklyDiscount": 0.71,
"monthlyDiscount": 0.82,
"propertyRentTax": 12,
"guestPerPersonPerNightTax": 10,
"guestStayTax": 12,
"guestNightlyTax": 13,
"guestBathroomsNumber": 2,
"refundableDamageDeposit": 15,
"personCapacity": 6,
"maxChildrenAllowed": null,
"maxInfantsAllowed": null,
"maxPetsAllowed": null,
"lat": 53.5403,
"lng": 8.58936,
"checkInTimeStart": 12,
"checkInTimeEnd": 21,
"checkOutTime": 11,
"cancellationPolicy": "strict",
"cancellationPolicyId": 4010,
"vrboCancellationPolicyId": 4011,
"airBnbCancellationPolicyId": 4012,
"marriottCancellationPolicyId": 4013,
"bookingCancellationPolicyId": 4013,
"squareMeters": 10,
"roomType": "entire_home",
"bathroomType": "shared",
"bedroomsNumber": 1,
"bedsNumber": 1,
"bedType": "real_bed",
"bathroomsNumber": 1,
"minNights": 1,
"maxNights": 1125,
"guestsIncluded": 3,
"cleaningFee": 40.32,
"priceForExtraPerson": 54.01,
"instantBookable": 0,
"instantBookableLeadTime": 1,
"allowSameDayBooking": 2,
"sameDayBookingLeadTime": 12,
"contactName": "contactName",
"contactSurName": "contactSurName",
"contactPhone1": "contactPhone1",
"contactPhone2": "contactPhone2",
"contactLanguage": "contactLanguage",
"contactEmail": "contactEmail@mail.com",
"contactAddress": "contactAddress",
"language": "en",
"currencyCode": "USD",
"timeZoneName": "Europe/Berlin",
"wifiUsername": "un",
"wifiPassword": "pass",
"cleannessStatus": null,
"cleaningInstruction": null,
"cleannessStatusUpdatedOn": null,
"homeawayPropertyName": "Beautiful and cozy apartment close to city center",
"homeawayPropertyHeadline": "Beautiful and cozy apartment close to city center with a living room and bed room",
"homeawayPropertyDescription": "In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.",
"bookingcomPropertyName": "Beautiful and cozy apartment close to city center",
"bookingcomPropertyDescription": "In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.",
"invoicingContactName": "Name",
"invoicingContactSurName": "Surname",
"invoicingContactPhone1": "+11122334456",
"invoicingContactPhone2": "+11122334456",
"invoicingContactLanguage": "en",
"invoicingContactEmail": "invoice@company.com",
"invoicingContactAddress": "221B Baker Street",
"invoicingContactCity": "London",
"invoicingContactZipcode": "110011",
"invoicingContactCountry": "UK",
"propertyLicenseNumber": null,
"propertyLicenseType": null,
"propertyLicenseIssueDate": null,
"propertyLicenseExpirationDate": null,
"partnersListingMarkup": null,
"airbnbOfficialListingMarkup": null,
"bookingEngineMarkup": null,
"homeawayApiMarkup": null,
"marriottListingMarkup": null,
"isRentalAgreementActive": true,
"listingAgreementText": "Rental agreement text for listing",
"bookingcomPropertyRegisteredInVcs": false,
"bookingcomPropertyHasVat": false,
"bookingcomPropertyDeclaresRevenue": false,
"airbnbListingUrl": "https://www.airbnb.com/rooms/1234567",
"vrboListingUrl": "https://www.vrbo.com/1234567",
"googleVrListingUrl": "http://www.google.com/travel/hotels/entity/1234567/overview",
"airbnbName": "",
"airbnbSummary": "",
"airbnbSpace": null,
"airbnbAccess": null,
"airbnbInteraction": null,
"airbnbNeighborhoodOverview": null,
"airbnbTransit": null,
"airbnbNotes": null,
"insuranceEligibilityStatus": false,
"listingAmenities": [
{
"id": 3449,
"amenityId": 2
},
{
"id": 3444,
"amenityId": 3
}
],
"listingBedTypes": [
{
"id": 1,
"bedTypeId": 2,
"quantity": 1
},
{
"id": 2,
"bedTypeId": 33,
"quantity": 1
}
],
"listingImages": [
{
"id": 877,
"caption": "Kitche",
"url": "https://s3-us-west-2.amazonaws.com/hostaway-platform-dev/listing/10450-40160-fmR2QBJ-5jFbWDbHx-WcibQ5gXoSEq9V--FkCGtJ4jRE-591ab75c9816f",
"sortOrder": 1
},
{
"id": 1027,
"caption": "hall",
"url": "https://s3-us-west-2.amazonaws.com/hostaway-platform-dev/listing/10450-40160-QYseNxAOkr9LYYAwx4Vy-CQgo2gA0--lYu2Qqn8fpd3M-591ab82749ca1",
"sortOrder": 2
}
],
"customFieldValues": [
{
"customFieldId": 167,
"value": "Custom field value one"
},
{
"customFieldId": 243,
"value": "Custom field value two"
}
]
}
Some fields which is marked by asterisk (*) are required to change listing status to complete
.
Only complete
listing can be activated for synchronization.
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | |
propertyTypeId |
no | int | Identifier of propertyType object. |
name |
yes | string | |
externalListingName |
yes | string | The same as name . |
internalListingName |
no | string | |
description |
no | string | |
houseRules |
no | string | |
keyPickup |
no | string | |
specialInstruction |
no | string | |
doorSecurityCode |
no | string | |
country |
no | string | |
countryCode |
no | string | |
state |
no | string | |
city |
no | string | |
street |
no | string | |
address |
yes* | string | |
publicAddress |
no | string | |
zipcode |
no | string | |
price |
yes* | float | |
starRating |
no | float | 0-5 Star rating of the listing |
averageReviewRating |
no | float | 0-10 Average review rating of the listing |
weeklyDiscount |
no | float | |
monthlyDiscount |
no | float | |
propertyRentTax |
no | float | |
guestPerPersonPerNightTax |
no | float | |
guestStayTax |
no | float | |
guestNightlyTax |
no | float | |
guestBathroomsNumber |
no | int | |
refundableDamageDeposit |
no | float | |
personCapacity |
no | int | |
maxChildrenAllowed |
no | int | |
maxInfantsAllowed |
no | int | |
maxPetsAllowed |
no | int | |
lat |
no | float | Latitude. |
lng |
no | float | Longitude. |
checkInTimeStart |
no | int | Accepted values are 0-23 |
checkInTimeEnd |
no | int | Accepted values are 0-23 |
checkOutTime |
no | int | Accepted values are 0-23 |
cancellationPolicy |
no | string | One of: flexible, moderate, strict. |
cancellationPolicyId |
no | int | The policy that applies to OTA bookings. For cancellation policies that apply in direct channels please use the Cancellation policies endpoint |
airBnbCancellationPolicyId |
no | int | The policy that applies to Airbnb bookings. Airbnb cancellation policies |
bookingCancellationPolicyId |
no | int | The policy that applies to Booking.com bookings. Booking.com cancellation policies |
marriottCancellationPolicyId |
no | int | The policy that applies to Marriott bookings. Marriott cancellation policies |
vrboCancellationPolicyId |
no | int | The policy that applies to VRBO bookings. Vrbo cancellation policies |
squareMeters |
no | int | |
roomType |
no | string | One of: entire_home, private_room, shared_room. |
bathroomType |
no | string | One of: private, shared. |
bedroomsNumber |
no | int | |
bedsNumber |
no | int | |
bathroomsNumber |
no | int | |
minNights |
no | int | |
maxNights |
no | int | |
guestsIncluded |
yes* | int | |
cleaningFee |
no | float | |
priceForExtraPerson |
yes* | float | |
instantBookable |
no | bool | |
instantBookableLeadTime |
no | int | |
airbnbBookingLeadTime |
no | int | |
airbnbBookingLeadTimeAllowRequestToBook |
no | int | |
allowSameDayBooking |
no | int | |
sameDayBookingLeadTime |
no | int | |
contactName |
no | string | |
contactSurName |
no | string | |
contactPhone1 |
no | string | |
contactPhone2 |
no | string | |
contactLanguage |
no | string | |
contactEmail |
no | string | |
contactAddress |
no | string | |
language |
no | string | |
currencyCode |
yes* | string | |
timeZoneName |
no | string | |
wifiUsername |
no | string | |
wifiPassword |
no | string | |
cleannessStatus |
no | string | |
cleaningInstruction |
no | string | |
cleannessStatusUpdatedOn |
no | datetime | |
homeawayPropertyName |
no | string | |
homeawayPropertyHeadline |
no | string | |
homeawayPropertyDescription |
no | string | |
bookingcomPropertyName |
no | string | |
bookingcomPropertyDescription |
no | string | |
invoicingContactName |
no | string | |
invoicingContactSurName |
no | string | |
invoicingContactPhone1 |
no | string | |
invoicingContactPhone2 |
no | string | |
invoicingContactEmail |
no | string | |
invoicingContactAddress |
no | string | |
invoicingContactCity |
no | string | |
invoicingContactZipcode |
no | string | |
invoicingContactCountry |
no | string | |
propertyLicenseNumber |
no | string | |
propertyLicenseType |
no | string | |
propertyLicenseIssueDate |
no | date (YYYY-MM-DD) | |
propertyLicenseExpirationDate |
no | date (YYYY-MM-DD) | |
partnersListingMarkup |
no | float | |
airbnbOfficialListingMarkup |
no | float | |
bookingEngineMarkup |
no | float | |
homeawayApiMarkup |
no | float | |
marriottListingMarkup |
no | float | |
isRentalAgreementActive |
no | bool | |
listingAgreementText |
no | string | Text for Rental Agreement, set null to delete Agreement. |
listingAmenities |
no | array | Array of listingAmenity objects. |
listingBedTypes |
no | array | Array of listingBedType objects. |
listingImages |
no | array | Array of listingImage objects. |
latestActivityOn |
no | date | |
customFieldValues |
no | array | You should create Custom fields at the dashboard beforehand |
bookingcomPropertyRegisteredInVcs |
no | bool | Answer on the question: Am I registered as a professional at the trade commercial register (Registre du Commerce et des Sociétés)? |
bookingcomPropertyHasVat |
no | bool | Answer on the question: Do I have a VAT registered for this activity? |
bookingcomPropertyDeclaresRevenue |
no | bool | Answer on the question: Should I declare revenues as professional for direct tax purposes (see article 155 IV du CGI)? |
googleVrListingUrl |
no | string | Listing URL in Google VR |
vrboListingUrl |
no | string | Listing URL in VRBO |
airbnbListingUrl |
no | string | Listing URL in Airbnb |
airbnbName |
no | string | Listing name in Airbnb |
airbnbSummary |
no | string | Listing summary in Airbnb |
airbnbSpace |
no | string | Listing space in Airbnb |
airbnbAccess |
no | string | Listing access in Airbnb |
airbnbInteraction |
no | string | Listing interaction in Airbnb |
airbnbNeighborhoodOverview |
no | string | Listing neighborhood overview in Airbnb |
airbnbTransit |
no | string | Listing transit information in Airbnb |
airbnbNotes |
no | string | Listing notes in Airbnb |
bookingEngineUrls |
no | array | Empty array by default, pass the query parameter ?attachObjects[]=bookingEngineUrls to get the actual value when Retrieving the listings list or a single listing |
insuranceEligibilityStatus |
no | bool | Insurance eligibility status |
Listing amenity object
{
"id": 3449,
"amenityId": 2
}
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | |
amenityId |
yes | int |
Listing bed type object
{
"id": 1,
"bedTypeId": 2,
"quantity": 1
}
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | |
bedTypeId |
yes | int | |
quantity |
yes | int |
Listing image object
{
"id": 877,
"caption": "Kitche",
"vrboCaption": "Kitchen",
"airbnbCaption": "Kitchen",
"url": "https://s3-us-west-2.amazonaws.com/hostaway-platform-dev/listing/10450-40160-fmR2QBJ-5jFbWDbHx-WcibQ5gXoSEq9V--FkCGtJ4jRE-591ab75c9816f",
"sortOrder": 2
}
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | |
caption |
no | string | |
vrboCaption |
no | string | |
airbnbCaption |
no | string | |
url |
yes | string | |
sortOrder |
no | int |
Retrieve a listings list
Request
curl --request GET \
--url 'https://api.hostaway.com/v1/listings?limit=&offset=&sortOrder=&city=&match=&country=&contactName=&propertyTypeId=' \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c' \
-H 'Cache-control: no-cache'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/listings?limit=&offset=&sortOrder=&city=&match=&country=&contactName=&propertyTypeId=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
"Cache-control: no-cache"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.hostaway.com/v1/listings?limit=&offset=&sortOrder=&city=&match=&country=&isSyncig=&contactName=&propertyTypeId=",
"method": "GET",
"headers": {
"Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
"Cache-control": "no-cache"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/listings?limit=&offset=&sortOrder=&city=&match=&country=&contactName=&propertyTypeId=")
.get()
.addHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import requests
url = "https://api.hostaway.com/v1/listings"
querystring = {"limit":"","offset":"","sortOrder":"","city":"","match":"","country":"","contactName":"","propertyTypeId":""}
headers = {
'Authorization': "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
'Cache-control': "no-cache",
}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
GET https://api.hostaway.com/v1/listings
Query Parameter | Required | Type | Description |
---|---|---|---|
limit |
no | int | Maximum number of items in the list. |
offset |
no | int | Number of items to skip from beginning of the list. |
sortOrder |
no | string | One of: name, nameReversed, order, orderReversed, contactName, contactNameReversed, latestActivity, latestActivityDesc. |
city |
no | string | |
match |
no | string | Used to search a listing by listing name. |
country |
no | string | |
contactName |
no | string | |
propertyTypeId |
no | int | |
includeResources |
no | int | if includeResources flag is 1 then response objects are supplied with supplementary resources, default is 0. |
attachObjects[] |
no | array | if ?attachObjects[]=bookingEngineUrls is provided, the actual value of bookingEngineUrls will be returned in each object instead of the empty array default value |
availabilityDateStart |
no | string | date in Y-m-d format |
availabilityDateEnd |
no | string | date in Y-m-d format |
availabilityGuestNumber |
no | int | Listing person capacity |
userId |
no | int | Used to limit listing to user got access to |
latestActivityStart |
no | date | |
latestActivityEnd |
no | date | |
isBookingEngineActive |
no | bool | Listing is active on website (Booking Engine) |
Response
An array of listing objects.
Retrieve a listing
Request
curl --request GET \
--url 'https://api.hostaway.com/v1/listings/40160' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c' \
--header 'Cache-control: no-cache'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/listings/40160",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
"Cache-control: no-cache"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.hostaway.com/v1/listings/40160");
xhr.setRequestHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send(data);
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/listings/40160")
.get()
.addHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import requests
url = "https://api.hostaway.com/v1/listings/40160"
headers = {
'Authorization': "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
'Cache-control': "no-cache",
}
response = requests.request("GET", url, headers=headers)
print(response.text)
GET https://api.hostaway.com/v1/listings/{listingId}
Query Parameter | Required | Type | Description |
---|---|---|---|
includeResources |
no | int | if includeResources flag is 1 then response object is supplied with supplementary resources, default is 0. |
attachObjects[] |
no | array | if ?attachObjects[]=bookingEngineUrls is provided, the actual value of bookingEngineUrls will be returned instead of the empty array default value |
Response
A listing object.
Create a listing
Request
curl --request POST \
--url https://api.hostaway.com/v1/listings \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6Ijc4MjUwZDMxY2FmNTczMWRhZGFlMWE2YmMxYzQ4ZWE2MWZjNzU5YjljYjUyYmQyNGM3ZDBkNzA1ZTI1Nzc2MTQ4ZDIzNWRlY2NkMzJlZGU2In0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6Ijc4MjUwZDMxY2FmNTczMWRhZGFlMWE2YmMxYzQ4ZWE2MWZjNzU5YjljYjUyYmQyNGM3ZDBkNzA1ZTI1Nzc2MTQ4ZDIzNWRlY2NkMzJlZGU2IiwiaWF0IjoxNTA2Njc1MTc4LCJuYmYiOjE1MDY2NzUxNzgsImV4cCI6MTUyMjIyNzE3OCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.flG98dFtx0M0k9E_WQq2-fqUgGOip8s0HjuKGc4paLzgC1dMvIDAHnbR4xNnELL4PSN4HmzAQVVFfcMQOW3vP-qdPUae_wiMeT0Cu47wH-0KAZVSgZzCP0WhBTBgUm4yvgeKeKj5ha5WNfUo_w0Bx3cvtHtyjfEOr5yNNQznfF8' \
--header 'Cache-control: no-cache' \
--header 'Content-type: application/json' \
--data '{\n "propertyTypeId": 1,\n "name": "Beautiful and cozy apartment close to city center",\n "externalListingName": "Beautiful and cozy apartment close to city center",\n "internalListingName": "Property #3",\n "description": "In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.",\n "houseRules": "Additional rules",\n "keyPickup": "Key pickup",\n "specialInstruction": "Any special instruction",\n "doorSecurityCode": "ddff8",\n "country": "Germany",\n "countryCode": "DE",\n "state": "Bremen",\n "city": "Bremerhaven",\n "street": "Schulstraße 7",\n "address": "Schulstraße 7, Bremerhaven, Bremen 27570, Germany",\n "publicAddress": "Bremerhaven, Bremen 27570, Germany",\n "zipcode": "27570",\n "price": 211.62,\n "starRating": 5,\n "weeklyDiscount": 0.71,\n "monthlyDiscount": 0.82,\n "propertyRentTax": 12,\n "guestPerPersonPerNightTax": 10,\n "guestStayTax": 12,\n "guestNightlyTax": 13,\n "guestBathroomsNumber": 2,\n "refundableDamageDeposit": 15,\n "personCapacity": 6,\n "maxChildrenAllowed": null,\n "maxInfantsAllowed": null,\n "maxPetsAllowed": null,\n "lat": 53.5403,\n "lng": 8.58936,\n "checkInTimeStart": 12,\n "checkInTimeEnd": 21,\n "checkOutTime": 11,\n "cancellationPolicy": "strict",\n "cancellationPolicyId": 1,\n "vrboCancellationPolicyId": 2,\n "bookingCancellationPolicyId": 3,\n "airbnbCancellationPolicyId": 4,\n "marriottCancellationPolicyId": 5,\n "squareMeters": 10,\n "roomType": "entire_home",\n "bathroomType": "shared",\n "bedroomsNumber": 1,\n "bedsNumber": 1,\n "bedType": "real_bed",\n "bathroomsNumber": 1,\n "minNights": 1,\n "maxNights": 1125,\n "guestsIncluded": 3,\n "cleaningFee": 40.32,\n "priceForExtraPerson": 54.01,\n "instantBookable": 0,\n "instantBookableLeadTime": 1,\n "allowSameDayBooking": 2,\n "sameDayBookingLeadTime": 12,\n "contactName": "contactName",\n "contactSurName": "contactSurName",\n "contactPhone1": "contactPhone1",\n "contactPhone2": "contactPhone2",\n "contactLanguage": "contactLanguage",\n "contactEmail": "contactEmail@mail.com",\n "contactAddress": "contactAddress",\n "language": "en",\n "currencyCode": "USD",\n "timeZoneName": "Europe/Berlin",\n "wifiUsername": "un",\n "wifiPassword": "pass",\n "cleannessStatus": null,\n "cleaningInstruction": null,\n "cleannessStatusUpdatedOn": null,\n "homeawayPropertyName": "Beautiful and cozy apartment close to city center",\n "homeawayPropertyHeadline": "Beautiful and cozy apartment close to city center with a living room and bed room",\n "homeawayPropertyDescription": "In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.",\n "bookingcomPropertyName": "Beautiful and cozy apartment close to city center",\n "bookingcomPropertyDescription": "In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.",\n "airbnbName": "Beautiful and cozy apartment close to city center",\n "airbnbSummary": "Beautiful and cozy apartment close to city center with a living room and bed room",\n "invoicingContactName": "Name",\n "bookingcomPropertyHasVat": true,\n "invoicingContactSurName": "SurName",\n "invoicingContactPhone1": "+11122334456",\n "invoicingContactPhone2": "+11122334456",\n "invoicingContactLanguage": "en",\n "invoicingContactEmail": "invoice@company.com",\n "invoicingContactAddress": "221B Baker Street",\n "invoicingContactCity": "London",\n "invoicingContactZipcode": "110011",\n "invoicingContactCountry": "UK",\n "listingAmenities": [\n {\n "amenityId": 2\n },\n {\n "amenityId": 3\n },\n {\n "amenityId": 3\n }\n ],\n "listingBedTypes": [\n {\n "bedTypeId": 2,\n "quantity": 1\n },\n {\n "bedTypeId": 33,\n "quantity": 1\n },\n {\n "bedTypeId": 33,\n "quantity": 1\n }\n ],\n "listingImages": [\n {\n "caption": "Kitche",\n "url": "https://www.sharingxchange.com/spacelist/assets/uploads/property/9/5853ff465e538.JPG",\n "sortOrder": 2\n },\n {\n "caption": "hall",\n "url": "https://www.sharingxchange.com/spacelist/assets/uploads/property/6/57eb022da2b28.jpg",\n "sortOrder": 3\n }\n ]\n , "customFieldValues": [{"customFieldId": 167, "value": "Custom field value one"},{"customFieldId": 243, "value": "Custom field value two"}] \n}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/listings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\n \"propertyTypeId\": 1,\n \"name\": \"Beautiful and cozy apartment close to city center\",\n \"externalListingName\": \"Beautiful and cozy apartment close to city center\",\n \"internalListingName\": \"Property #3\",\n \"description\": \"In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.\",\n \"houseRules\": \"Additional rules\",\n \"keyPickup\": \"Key pickup\",\n \"specialInstruction\": \"Any special instruction\",\n \"doorSecurityCode\": \"ddff8\",\n \"country\": \"Germany\",\n \"countryCode\": \"DE\",\n \"state\": \"Bremen\",\n \"city\": \"Bremerhaven\",\n \"street\": \"Schulstraße 7\",\n \"address\": \"Schulstraße 7, Bremerhaven, Bremen 27570, Germany\",\n \"publicAddress\": \"Bremerhaven, Bremen 27570, Germany\",\n \"zipcode\": \"27570\",\n \"price\": 211.62,\n \"starRating\": 5,\n \"weeklyDiscount\": 0.71,\n \"monthlyDiscount\": 0.82,\n \"propertyRentTax\": 12,\n \"guestPerPersonPerNightTax\": 10,\n \"guestStayTax\": 12,\n \"guestNightlyTax\": 13,\n \"guestBathroomsNumber\": 2,\n \"refundableDamageDeposit\": 15,\n \"personCapacity\": 6,\n \"maxChildrenAllowed\": null,\n \"maxInfantsAllowed\": null,\n \"maxPetsAllowed\": null,\n \"lat\": 53.5403,\n \"lng\": 8.58936,\n \"checkInTimeStart\": 12,\n \"checkInTimeEnd\": 21,\n \"checkOutTime\": 11,\n \"cancellationPolicy\": \"strict\",\n \"cancellationPolicyId\": 1,\n \"bookingcomPropertyHasVat\": true,\n \"vrboCancellationPolicyId\": 2,\n \"bookingCancellationPolicyId\": 3,\n \"airbnbCancellationPolicyId\": 4,\n \"marriottCancellationPolicyId\": 5,\n \"squareMeters\": 10,\n \"roomType\": \"entire_home\",\n \"bathroomType\": \"shared\",\n \"bedroomsNumber\": 1,\n \"bedsNumber\": 1,\n \"bedType\": \"real_bed\",\n \"bathroomsNumber\": 1,\n \"minNights\": 1,\n \"maxNights\": 1125,\n \"guestsIncluded\": 3,\n \"cleaningFee\": 40.32,\n \"priceForExtraPerson\": 54.01,\n \"instantBookable\": 0,\n \"instantBookableLeadTime\": 1,\n \"allowSameDayBooking\": 2,\n \"sameDayBookingLeadTime\": 12,\n \"contactName\": \"contactName\",\n \"contactSurName\": \"contactSurName\",\n \"contactPhone1\": \"contactPhone1\",\n \"contactPhone2\": \"contactPhone2\",\n \"contactLanguage\": \"contactLanguage\",\n \"contactEmail\": \"contactEmail@mail.com\",\n \"contactAddress\": \"contactAddress\",\n \"language\": \"en\",\n \"currencyCode\": \"USD\",\n \"timeZoneName\": \"Europe/Berlin\",\n \"wifiUsername\": \"un\",\n \"wifiPassword\": \"pass\",\n \"cleannessStatus\": null,\n \"cleaningInstruction\": null,\n \"cleannessStatusUpdatedOn\": null,\n \"homeawayPropertyName\": \"Beautiful and cozy apartment close to city center\",\n \"homeawayPropertyHeadline\": \"Beautiful and cozy apartment close to city center with a living room and bed room\",\n \"homeawayPropertyDescription\": \"In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.\",\n \"bookingcomPropertyName\": \"Beautiful and cozy apartment close to city center\",\n \"bookingcomPropertyDescription\": \"In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.\",\n \"airbnbName\": \"Beautiful and cozy apartment close to city center\",\n \"airbnbSummary\": \"Beautiful and cozy apartment close to city center with a living room and bed room\",\n \"invoicingContactName\": \"Name\",\n \"invoicingContactSurName\": \"SurName\",\n \"invoicingContactPhone1\": \"+11122334456\",\n \"invoicingContactPhone2\": \"+11122334456\",\n \"invoicingContactLanguage\": \"en\",\n \"invoicingContactEmail\": \"invoice@company.com\",\n \"invoicingContactAddress\": \"221B Baker Street\",\n \"invoicingContactCity\": \"London\",\n \"invoicingContactZipcode\": \"110011\",\n \"invoicingContactCountry\": \"UK\",\n \"listingAmenities\": [\n {\n \"amenityId\": 2\n },\n {\n \"amenityId\": 3\n },\n {\n \"amenityId\": 3\n }\n ],\n \"listingBedTypes\": [\n {\n \"bedTypeId\": 2,\n \"quantity\": 1\n },\n {\n \"bedTypeId\": 33,\n \"quantity\": 1\n },\n {\n \"bedTypeId\": 33,\n \"quantity\": 1\n }\n ],\n \"listingImages\": [\n {\n \"caption\": \"Kitche\",\n \"url\": \"https://www.sharingxchange.com/spacelist/assets/uploads/property/9/5853ff465e538.JPG\",\n \"sortOrder\": 2\n },\n {\n \"caption\": \"hall\",\n \"url\": \"https://www.sharingxchange.com/spacelist/assets/uploads/property/6/57eb022da2b28.jpg\",\n \"sortOrder\": 3\n }\n ]\n,\"customFieldValues\": [{\"customFieldId\": 167, \"value\": \"Custom field value one\"}, {\"customFieldId\": 243, \"value\": \"Custom field value two\"}]\n}",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6Ijc4MjUwZDMxY2FmNTczMWRhZGFlMWE2YmMxYzQ4ZWE2MWZjNzU5YjljYjUyYmQyNGM3ZDBkNzA1ZTI1Nzc2MTQ4ZDIzNWRlY2NkMzJlZGU2In0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6Ijc4MjUwZDMxY2FmNTczMWRhZGFlMWE2YmMxYzQ4ZWE2MWZjNzU5YjljYjUyYmQyNGM3ZDBkNzA1ZTI1Nzc2MTQ4ZDIzNWRlY2NkMzJlZGU2IiwiaWF0IjoxNTA2Njc1MTc4LCJuYmYiOjE1MDY2NzUxNzgsImV4cCI6MTUyMjIyNzE3OCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.flG98dFtx0M0k9E_WQq2-fqUgGOip8s0HjuKGc4paLzgC1dMvIDAHnbR4xNnELL4PSN4HmzAQVVFfcMQOW3vP-qdPUae_wiMeT0Cu47wH-0KAZVSgZzCP0WhBTBgUm4yvgeKeKj5ha5WNfUo_w0Bx3cvtHtyjfEOr5yNNQznfF8",
"Cache-control: no-cache",
"Content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var data = JSON.stringify({
"propertyTypeId": 1,
"name": "Beautiful and cozy apartment close to city center",
"externalListingName": "Beautiful and cozy apartment close to city center",
"internalListingName": "Property #3",
"description": "In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.",
"houseRules": "Additional rules",
"keyPickup": "Key pickup",
"specialInstruction": "Any special instruction",
"doorSecurityCode": "ddff8",
"country": "Germany",
"countryCode": "DE",
"state": "Bremen",
"city": "Bremerhaven",
"street": "Schulstraße 7",
"address": "Schulstraße 7, Bremerhaven, Bremen 27570, Germany",
"publicAddress": "Bremerhaven, Bremen 27570, Germany",
"zipcode": "27570",
"price": 211.62,
"starRating": 5,
"weeklyDiscount": 0.71,
"monthlyDiscount": 0.82,
"propertyRentTax": 12,
"guestPerPersonPerNightTax": 10,
"guestStayTax": 12,
"guestNightlyTax": 13,
"guestBathroomsNumber": 2,
"refundableDamageDeposit": 15,
"personCapacity": 6,
"maxChildrenAllowed": null,
"maxInfantsAllowed": null,
"maxPetsAllowed": null,
"lat": 53.5403,
"lng": 8.58936,
"checkInTimeStart": 12,
"checkInTimeEnd": 21,
"checkOutTime": 11,
"cancellationPolicy": "strict",
"cancellationPolicyId": 6,
"bookingCancellationPolicyId": 1,
"vrboCancellationPolicyId": 2,
"airBnbCancellationPolicyId": 3,
"marriottBnbCancellationPolicyId": 4,
"squareMeters": 10,
"roomType": "entire_home",
"bathroomType": "shared",
"bedroomsNumber": 1,
"bedsNumber": 1,
"bedType": "real_bed",
"bathroomsNumber": 1,
"minNights": 1,
"maxNights": 1125,
"guestsIncluded": 3,
"cleaningFee": 40.32,
"priceForExtraPerson": 54.01,
"instantBookable": 0,
"instantBookableLeadTime": 1,
"allowSameDayBooking": 2,
"sameDayBookingLeadTime": 12,
"contactName": "contactName",
"contactSurName": "contactSurName",
"contactPhone1": "contactPhone1",
"contactPhone2": "contactPhone2",
"contactLanguage": "contactLanguage",
"contactEmail": "contactEmail@mail.com",
"contactAddress": "contactAddress",
"language": "en",
"currencyCode": "USD",
"timeZoneName": "Europe/Berlin",
"wifiUsername": "un",
"wifiPassword": "pass",
"cleannessStatus": null,
"cleaningInstruction": null,
"cleannessStatusUpdatedOn": null,
"homeawayPropertyName": "Beautiful and cozy apartment close to city center",
"homeawayPropertyHeadline": "Beautiful and cozy apartment close to city center with a living room and bed room",
"homeawayPropertyDescription": "In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.",
"bookingcomPropertyName": "Beautiful and cozy apartment close to city center",
"bookingcomPropertyDescription": "In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.",
"airbnbName": "Beautiful and cozy apartment close to city center",
"airbnbSummary": "In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.",
"invoicingContactName": "Name",
"invoicingContactSurName": "Surname",
"invoicingContactPhone1": "+11122334456",
"invoicingContactPhone2": "+11122334456",
"invoicingContactLanguage": "en",
"invoicingContactEmail": "invoice@company.com",
"invoicingContactAddress": "221B Baker Street",
"invoicingContactCity": "London",
"invoicingContactZipcode": "110011",
"invoicingContactCountry": "UK",
"propertyLicenseNumber": null,
"propertyLicenseType": null,
"propertyLicenseIssueDate": null,
"propertyLicenseExpirationDate": null,
"isRentalAgreementActive": true,
"bookingcomPropertyHasVat": true,
"listingAgreementText": "Rental agreement text for listing",
"listingAmenities": [
{
"amenityId": 2
},
{
"amenityId": 3
},
{
"amenityId": 3
}
],
"listingBedTypes": [
{
"bedTypeId": 2,
"quantity": 1
},
{
"bedTypeId": 33,
"quantity": 1
},
{
"bedTypeId": 33,
"quantity": 1
}
],
"listingImages": [
{
"caption": "Kitche",
"url": "https://www.sharingxchange.com/spacelist/assets/uploads/property/9/5853ff465e538.JPG",
"sortOrder": 2
},
{
"caption": "hall",
"url": "https://www.sharingxchange.com/spacelist/assets/uploads/property/6/57eb022da2b28.jpg",
"sortOrder": 3
}
],
"customFieldValues": [
{
"customFieldId": 167,
"value": "Custom field value one"
},
{
"customFieldId": 243,
"value": "Custom field value two"
}
]
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.hostaway.com/v1/listings");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6Ijc4MjUwZDMxY2FmNTczMWRhZGFlMWE2YmMxYzQ4ZWE2MWZjNzU5YjljYjUyYmQyNGM3ZDBkNzA1ZTI1Nzc2MTQ4ZDIzNWRlY2NkMzJlZGU2In0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6Ijc4MjUwZDMxY2FmNTczMWRhZGFlMWE2YmMxYzQ4ZWE2MWZjNzU5YjljYjUyYmQyNGM3ZDBkNzA1ZTI1Nzc2MTQ4ZDIzNWRlY2NkMzJlZGU2IiwiaWF0IjoxNTA2Njc1MTc4LCJuYmYiOjE1MDY2NzUxNzgsImV4cCI6MTUyMjIyNzE3OCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.flG98dFtx0M0k9E_WQq2-fqUgGOip8s0HjuKGc4paLzgC1dMvIDAHnbR4xNnELL4PSN4HmzAQVVFfcMQOW3vP-qdPUae_wiMeT0Cu47wH-0KAZVSgZzCP0WhBTBgUm4yvgeKeKj5ha5WNfUo_w0Bx3cvtHtyjfEOr5yNNQznfF8");
xhr.setRequestHeader("Content-type", "application/json");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send(data);
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"propertyTypeId\": 1,\n \"name\": \"Beautiful and cozy apartment close to city center\",\n \"externalListingName\": \"Beautiful and cozy apartment close to city center\",\n \"internalListingName\": \"Property #3\",\n \"description\": \"In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.\",\n \"houseRules\": \"Additional rules\",\n \"keyPickup\": \"Key pickup\",\n \"specialInstruction\": \"Any special instruction\",\n \"doorSecurityCode\": \"ddff8\",\n \"country\": \"Germany\",\n \"countryCode\": \"DE\",\n \"state\": \"Bremen\",\n \"city\": \"Bremerhaven\",\n \"street\": \"Schulstraße 7\",\n \"address\": \"Schulstraße 7, Bremerhaven, Bremen 27570, Germany\",\n \"publicAddress\": \"Bremerhaven, Bremen 27570, Germany\",\n \"zipcode\": \"27570\",\n \"price\": 211.62,\n \"starRating\": 5,\n \"weeklyDiscount\": 0.71,\n \"monthlyDiscount\": 0.82,\n \"propertyRentTax\": 12,\n \"guestPerPersonPerNightTax\": 10,\n \"guestStayTax\": 12,\n \"guestNightlyTax\": 13,\n \"guestBathroomsNumber\": 2,\n \"refundableDamageDeposit\": 15,\n \"personCapacity\": 6,\n \"maxChildrenAllowed\": null,\n \"maxInfantsAllowed\": null,\n \"maxPetsAllowed\": null,\n \"lat\": 53.5403,\n \"lng\": 8.58936,\n \"checkInTimeStart\": 12,\n \"checkInTimeEnd\": 21,\n \"checkOutTime\": 11,\n \"cancellationPolicy\": \"strict\",\n \"cancellationPolicyId\": 1,\n \"vrboCancellationPolicyId\": 2,\n \"bookingCancellationPolicyId\": 3,\n \"airbnbCancellationPolicyId\": 4,\n \"marriottCancellationPolicyId\": 5,\n \"squareMeters\": 10,\n \"roomType\": \"entire_home\",\n \"bathroomType\": \"shared\",\n \"bedroomsNumber\": 1,\n \"bedsNumber\": 1,\n \"bedType\": \"real_bed\",\n \"bathroomsNumber\": 1,\n \"minNights\": 1,\n \"maxNights\": 1125,\n \"guestsIncluded\": 3,\n \"cleaningFee\": 40.32,\n \"priceForExtraPerson\": 54.01,\n \"instantBookable\": 0,\n \"instantBookableLeadTime\": 1,\n \"allowSameDayBooking\": 2,\n \"sameDayBookingLeadTime\": 12,\n \"contactName\": \"contactName\",\n \"contactSurName\": \"contactSurName\",\n \"contactPhone1\": \"contactPhone1\",\n \"contactPhone2\": \"contactPhone2\",\n \"contactLanguage\": \"contactLanguage\",\n \"contactEmail\": \"contactEmail@mail.com\",\n \"contactAddress\": \"contactAddress\",\n \"language\": \"en\",\n \"currencyCode\": \"USD\",\n \"timeZoneName\": \"Europe/Berlin\",\n \"wifiUsername\": \"un\",\n \"wifiPassword\": \"pass\",\n \"cleannessStatus\": null,\n \"cleaningInstruction\": null,\n \"cleannessStatusUpdatedOn\": null,\n \"homeawayPropertyName\": \"Beautiful and cozy apartment close to city center\",\n \"homeawayPropertyHeadline\": \"Beautiful and cozy apartment close to city center with a living room and bed room\",\n \"homeawayPropertyDescription\": \"In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.\",\n \"bookingcomPropertyName\": \"Beautiful and cozy apartment close to city center\",\n \"bookingcomPropertyDescription\": \"In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.\",\n \"airbnbName\": \"Beautiful and cozy apartment close to city center\",\n \"airbnbSummary\": \"Beautiful and cozy apartment close to city center with a living room and bed room\",\n \"invoicingContactName\": \"Name\",\n \"invoicingContactSurName\": \"SurName\",\n \"invoicingContactPhone1\": \"+11122334456\",\n \"invoicingContactPhone2\": \"+11122334456\",\n \"invoicingContactLanguage\": \"en\",\n \"invoicingContactEmail\": \"invoice@company.com\",\n \"invoicingContactAddress\": \"221B Baker Street\",\n \"invoicingContactCity\": \"London\",\n \"invoicingContactZipcode\": \"110011\",\n \"invoicingContactCountry\": \"UK\",\n \"bookingcomPropertyHasVat\": true,\n \"listingAmenities\": [\n {\n \"amenityId\": 2\n },\n {\n \"amenityId\": 3\n },\n {\n \"amenityId\": 3\n }\n ],\n \"listingBedTypes\": [\n {\n \"bedTypeId\": 2,\n \"quantity\": 1\n },\n {\n \"bedTypeId\": 33,\n \"quantity\": 1\n },\n {\n \"bedTypeId\": 33,\n \"quantity\": 1\n }\n ],\n \"listingImages\": [\n {\n \"caption\": \"Kitche\",\n \"url\": \"https://www.sharingxchange.com/spacelist/assets/uploads/property/9/5853ff465e538.JPG\",\n \"sortOrder\": 2\n },\n {\n \"caption\": \"hall\",\n \"url\": \"https://www.sharingxchange.com/spacelist/assets/uploads/property/6/57eb022da2b28.jpg\",\n \"sortOrder\": 3\n }\n ]\n, \"customFieldValues\": [{\"customFieldId\": 167, \"value\": \"Custom field value one\"}, {\"customFieldId\": 243, \"value\": \"Custom field value two\"}]\n}");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/listings")
.post(body)
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6Ijc4MjUwZDMxY2FmNTczMWRhZGFlMWE2YmMxYzQ4ZWE2MWZjNzU5YjljYjUyYmQyNGM3ZDBkNzA1ZTI1Nzc2MTQ4ZDIzNWRlY2NkMzJlZGU2In0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6Ijc4MjUwZDMxY2FmNTczMWRhZGFlMWE2YmMxYzQ4ZWE2MWZjNzU5YjljYjUyYmQyNGM3ZDBkNzA1ZTI1Nzc2MTQ4ZDIzNWRlY2NkMzJlZGU2IiwiaWF0IjoxNTA2Njc1MTc4LCJuYmYiOjE1MDY2NzUxNzgsImV4cCI6MTUyMjIyNzE3OCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.flG98dFtx0M0k9E_WQq2-fqUgGOip8s0HjuKGc4paLzgC1dMvIDAHnbR4xNnELL4PSN4HmzAQVVFfcMQOW3vP-qdPUae_wiMeT0Cu47wH-0KAZVSgZzCP0WhBTBgUm4yvgeKeKj5ha5WNfUo_w0Bx3cvtHtyjfEOr5yNNQznfF8")
.addHeader("Content-type", "application/json")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import http.client
import json
conn = http.client.HTTPSConnection("api.hostaway.com")
payload = json.dumps({
"propertyTypeId": 1,
"name": "Beautiful and cozy apartment close to city center",
"externalListingName": "Beautiful and cozy apartment close to city center",
"internalListingName": "Property #3",
"description": "In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.",
"houseRules": "Additional rules",
"keyPickup": "Key pickup",
"specialInstruction": "Any special instruction",
"doorSecurityCode": "ddff8",
"country": "Germany",
"countryCode": "DE",
"state": "Bremen",
"city": "Bremerhaven",
"street": "Schulstraße 7",
"address": "Schulstraße 7, Bremerhaven, Bremen 27570, Germany",
"publicAddress": "Bremerhaven, Bremen 27570, Germany",
"zipcode": "27570",
"price": 211.62,
"starRating": 5,
"weeklyDiscount": 0.71,
"monthlyDiscount": 0.82,
"propertyRentTax": 12,
"guestPerPersonPerNightTax": 10,
"guestStayTax": 12,
"guestNightlyTax": 13,
"guestBathroomsNumber": 2,
"refundableDamageDeposit": 12.34,
"personCapacity": 6,
"maxChildrenAllowed": None,
"maxInfantsAllowed": None,
"maxPetsAllowed": None,
"lat": 53.5403,
"lng": 8.58936,
"checkInTimeStart": 12,
"checkInTimeEnd": 21,
"checkOutTime": 11,
"cancellationPolicy": "strict",
"squareMeters": 10,
"roomType": "entire_home",
"bathroomType": "shared",
"bedroomsNumber": 1,
"bedsNumber": 1,
"bedType": "real_bed",
"bathroomsNumber": 1,
"minNights": 1,
"maxNights": 1125,
"guestsIncluded": 3,
"cleaningFee": 40.32,
"priceForExtraPerson": 54.01,
"instantBookable": 0,
"instantBookableLeadTime": 1,
"allowSameDayBooking": 2,
"sameDayBookingLeadTime": 12,
"contactName": "contactName",
"contactSurName": "contactSurName",
"contactPhone1": "contactPhone1",
"contactPhone2": "contactPhone2",
"contactLanguage": "contactLanguage",
"contactEmail": "contactEmail@mail.com",
"contactAddress": "contactAddress",
"language": "en",
"currencyCode": "USD",
"timeZoneName": "Europe/Berlin",
"wifiUsername": "un",
"wifiPassword": "pass",
"cleannessStatus": None,
"cleaningInstruction": None,
"cleannessStatusUpdatedOn": None,
"homeawayPropertyName": "Beautiful and cozy apartment close to city center",
"homeawayPropertyHeadline": "Beautiful and cozy apartment close to city center with a living room and bed room",
"homeawayPropertyDescription": "In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.",
"bookingcomPropertyName": "Beautiful and cozy apartment close to city center",
"bookingcomPropertyRoomName": "Apartment",
"bookingcomPropertyDescription": "In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.",
"airbnbName": "Beautiful and cozy apartment close to city center",
"airbnbSummary": "In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.",
"invoicingContactName": "Name",
"invoicingContactSurName": "Surname",
"invoicingContactPhone1": "+11122334456",
"invoicingContactPhone2": "+11122334456",
"invoicingContactLanguage": "en",
"invoicingContactEmail": "invoice@company.com",
"invoicingContactAddress": "221B Baker Street",
"invoicingContactCity": "London",
"invoicingContactZipcode": "110011",
"invoicingContactCountry": "UK",
"bookingcomPropertyHasVat": 1,
"listingAmenities": [
{
"amenityId": 2
},
{
"amenityId": 3
},
{
"amenityId": 3
}
],
"listingBedTypes": [
{
"bedTypeId": 2,
"quantity": 1
},
{
"bedTypeId": 33,
"quantity": 1
},
{
"bedTypeId": 33,
"quantity": 1
}
],
"listingImages": [
{
"caption": "Kitche",
"url": "https://www.sharingxchange.com/spacelist/assets/uploads/property/9/5853ff465e538.JPG",
"sortOrder": 2
},
{
"caption": "hall",
"url": "https://www.sharingxchange.com/spacelist/assets/uploads/property/6/57eb022da2b28.jpg",
"sortOrder": 3
}
]
})
headers = {
'authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImMwY2UzMWU2MWRlZmM5MTUyZDY1ZmNjNDc1ZDg5MjI5OThlNTFmNjFhOGNlZGI1ZmYxZjRjYzI4YmJiOTFiOTIyNWQyMTE4MDdiMjdmMDA4IiwiaWF0IjoxNjczMjcxNDQzLCJuYmYiOjE2NzMyNzE0NDMsImV4cCI6MTczNjQyOTg0Mywic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjIxMX0.MWyrGSUuP7KmSxRlDfM3jsMKavjBu6w5JvHEeTfYr-HOKlQld5THmrLgKY3W_2taZXteFuhC_jQu3uZO1G1jtdOUQRYzSEzzP5Hj_2sqBmZUhR2niW7UtBnrMMMZvbOL_8FHnid11j2xR6gJLnOG0Fo-BqedZK2GbZsAQrOkEhk',
'Content-Type': 'application/json'
}
conn.request("POST", "/v1/listings", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
POST https://api.hostaway.com/v1/listings
A listing object should be provided in the request body.
Response
The created listing object or error response.
Update a listing
Request
curl --request PUT \
--url https://api.hostaway.com/v1/listings/40214 \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6Ijc4MjUwZDMxY2FmNTczMWRhZGFlMWE2YmMxYzQ4ZWE2MWZjNzU5YjljYjUyYmQyNGM3ZDBkNzA1ZTI1Nzc2MTQ4ZDIzNWRlY2NkMzJlZGU2In0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6Ijc4MjUwZDMxY2FmNTczMWRhZGFlMWE2YmMxYzQ4ZWE2MWZjNzU5YjljYjUyYmQyNGM3ZDBkNzA1ZTI1Nzc2MTQ4ZDIzNWRlY2NkMzJlZGU2IiwiaWF0IjoxNTA2Njc1MTc4LCJuYmYiOjE1MDY2NzUxNzgsImV4cCI6MTUyMjIyNzE3OCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.flG98dFtx0M0k9E_WQq2-fqUgGOip8s0HjuKGc4paLzgC1dMvIDAHnbR4xNnELL4PSN4HmzAQVVFfcMQOW3vP-qdPUae_wiMeT0Cu47wH-0KAZVSgZzCP0WhBTBgUm4yvgeKeKj5ha5WNfUo_w0Bx3cvtHtyjfEOr5yNNQznfF8' \
--header 'Cache-control: no-cache' \
--header 'Content-type: application/json' \
--data '{\n "propertyTypeId": 1,\n "name": "Beautiful and cozy apartment close to city center",\n "externalListingName": "Beautiful and cozy apartment close to city center",\n "internalListingName": "Property #3",\n "description": "In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.",\n "houseRules": "Additional rules",\n "keyPickup": "Key pickup",\n "specialInstruction": "Any special instruction",\n "doorSecurityCode": "ddff8",\n "country": "Germany",\n "countryCode": "DE",\n "state": "Bremen",\n "city": "Bremerhaven",\n "street": "Schulstraße 7",\n "address": "Schulstraße 7, Bremerhaven, Bremen 27570, Germany",\n "publicAddress": "Bremerhaven, Bremen 27570, Germany",\n "zipcode": "27570",\n "price": 211.62,\n "starRating": 5,\n "weeklyDiscount": 0.71,\n "monthlyDiscount": 0.82,\n "propertyRentTax": 12,\n "guestPerPersonPerNightTax": 10,\n "guestStayTax": 12,\n "guestNightlyTax": 13,\n "guestBathroomsNumber": 2,\n "refundableDamageDeposit": 15,\n "personCapacity": 6,\n "maxChildrenAllowed": null,\n "maxInfantsAllowed": null,\n "maxPetsAllowed": null,\n "lat": 53.5403,\n "lng": 8.58936,\n "checkInTimeStart": 12,\n "checkInTimeEnd": 21,\n "checkOutTime": 11,\n "cancellationPolicy": "strict",\n "cancellationPolicyId": 1,\n "vrboCancellationPolicyId": 2,\n "bookingCancellationPolicyId": 3,\n "airbnbCancellationPolicyId": 4,\n "marriottCancellationPolicyId": 5,\n "squareMeters": 10,\n "roomType": "entire_home",\n "bathroomType": "shared",\n "bedroomsNumber": 1,\n "bedsNumber": 1,\n "bedType": "real_bed",\n "bathroomsNumber": 1,\n "minNights": 1,\n "maxNights": 1125,\n "guestsIncluded": 3,\n "cleaningFee": 40.32,\n "priceForExtraPerson": 54.01,\n "instantBookable": 0,\n "instantBookableLeadTime": 1,\n "allowSameDayBooking": 2,\n "sameDayBookingLeadTime": 12,\n "contactName": "contactName",\n "contactSurName": "contactSurName",\n "contactPhone1": "contactPhone1",\n "contactPhone2": "contactPhone2",\n "contactLanguage": "contactLanguage",\n "contactEmail": "contactEmail@mail.com",\n "contactAddress": "contactAddress",\n "language": "en",\n "currencyCode": "USD",\n "timeZoneName": "Europe/Berlin",\n "wifiUsername": "un",\n "wifiPassword": "pass",\n "cleannessStatus": null,\n "cleaningInstruction": null,\n "cleannessStatusUpdatedOn": null,\n "homeawayPropertyName": "Beautiful and cozy apartment close to city center",\n "homeawayPropertyHeadline": "Beautiful and cozy apartment close to city center with a living room and bed room",\n "homeawayPropertyDescription": "In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.",\n "bookingcomPropertyName": "Beautiful and cozy apartment close to city center",\n "bookingcomPropertyDescription": "In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.",\n "airbnbName": "Beautiful and cozy apartment close to city center",\n "airbnbSummary": "Beautiful and cozy apartment close to city center with a living room and bed room",\n "invoicingContactName": "Name",\n "invoicingContactSurName": "SurName",\n "invoicingContactPhone1": "+11122334456",\n "invoicingContactPhone2": "+11122334456",\n "invoicingContactLanguage": "en",\n "invoicingContactEmail": "invoice@company.com",\n "invoicingContactAddress": "221B Baker Street",\n "invoicingContactCity": "London",\n "invoicingContactZipcode": "110011",\n "invoicingContactCountry": "UK",\n "bookingcomPropertyHasVat": true,\n "listingAmenities": [\n {\n "amenityId": 2\n },\n {\n "amenityId": 3\n }\n ],\n "listingBedTypes": [\n {\n "bedTypeId": 2,\n "quantity": 1\n }\n ],\n "listingImages": [\n {\n "caption": "Kitche",\n "url": "https://www.sharingxchange.com/spacelist/assets/uploads/property/9/5853ff465e538.JPG",\n "sortOrder": 2\n },\n {\n "caption": "hall",\n "url": "https://www.sharingxchange.com/spacelist/assets/uploads/property/6/57eb022da2b28.jpg",\n "sortOrder": 3\n }\n ]\n,"customFieldValues": [{"customFieldId": 167,"value": "Custom field value one"},{"customFieldId": 243,"value": "Custom field value two"}]\n}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/listings/40214",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "{\n \"propertyTypeId\": 1,\n \"name\": \"Beautiful and cozy apartment close to city center\",\n \"externalListingName\": \"Beautiful and cozy apartment close to city center\",\n \"internalListingName\": \"Property #3\",\n \"description\": \"In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.\",\n \"houseRules\": \"Additional rules\",\n \"keyPickup\": \"Key pickup\",\n \"specialInstruction\": \"Any special instruction\",\n \"doorSecurityCode\": \"ddff8\",\n \"country\": \"Germany\",\n \"countryCode\": \"DE\",\n \"state\": \"Bremen\",\n \"city\": \"Bremerhaven\",\n \"street\": \"Schulstraße 7\",\n \"address\": \"Schulstraße 7, Bremerhaven, Bremen 27570, Germany\",\n \"publicAddress\": \"Bremerhaven, Bremen 27570, Germany\",\n \"zipcode\": \"27570\",\n \"price\": 211.62,\n \"starRating\": 5,\n \"weeklyDiscount\": 0.71,\n \"monthlyDiscount\": 0.82,\n \"propertyRentTax\": 12,\n \"guestPerPersonPerNightTax\": 10,\n \"guestStayTax\": 12,\n \"guestNightlyTax\": 13,\n \"guestBathroomsNumber\": 2,\n \"refundableDamageDeposit\": 15,\n \"personCapacity\": 6,\n \"maxChildrenAllowed\": null,\n \"maxInfantsAllowed\": null,\n \"maxPetsAllowed\": null,\n \"lat\": 53.5403,\n \"lng\": 8.58936,\n \"checkInTimeStart\": 12,\n \"checkInTimeEnd\": 21,\n \"checkOutTime\": 11,\n \"cancellationPolicy\": \"strict\",\n \"cancellationPolicyId\": 1,\n \"vrboCancellationPolicyId\": 2,\n \"bookingCancellationPolicyId\": 3,\n \"airbnbCancellationPolicyId\": 4,\n \"marriottCancellationPolicyId\": 5,\n \"squareMeters\": 10,\n \"roomType\": \"entire_home\",\n \"bathroomType\": \"shared\",\n \"bedroomsNumber\": 1,\n \"bedsNumber\": 1,\n \"bedType\": \"real_bed\",\n \"bathroomsNumber\": 1,\n \"minNights\": 1,\n \"maxNights\": 1125,\n \"guestsIncluded\": 3,\n \"cleaningFee\": 40.32,\n \"priceForExtraPerson\": 54.01,\n \"instantBookable\": 0,\n \"instantBookableLeadTime\": 1,\n \"allowSameDayBooking\": 2,\n \"sameDayBookingLeadTime\": 12,\n \"contactName\": \"contactName\",\n \"contactSurName\": \"contactSurName\",\n \"contactPhone1\": \"contactPhone1\",\n \"contactPhone2\": \"contactPhone2\",\n \"contactLanguage\": \"contactLanguage\",\n \"contactEmail\": \"contactEmail@mail.com\",\n \"contactAddress\": \"contactAddress\",\n \"language\": \"en\",\n \"currencyCode\": \"USD\",\n \"timeZoneName\": \"Europe/Berlin\",\n \"wifiUsername\": \"un\",\n \"wifiPassword\": \"pass\",\n \"cleannessStatus\": null,\n \"cleaningInstruction\": null,\n \"cleannessStatusUpdatedOn\": null,\n \"homeawayPropertyName\": \"Beautiful and cozy apartment close to city center\",\n \"homeawayPropertyHeadline\": \"Beautiful and cozy apartment close to city center with a living room and bed room\",\n \"homeawayPropertyDescription\": \"In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.\",\n \"bookingcomPropertyName\": \"Beautiful and cozy apartment close to city center\",\n \"bookingcomPropertyDescription\": \"In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.\",\n \"airbnbName\": \"Beautiful and cozy apartment close to city center\",\n \"airbnbSummary\": \"Beautiful and cozy apartment close to city center with a living room and bed room\",\n \"invoicingContactName\": \"Name\",\n \"invoicingContactSurName\": \"SurName\",\n \"invoicingContactPhone1\": \"+11122334456\",\n \"invoicingContactPhone2\": \"+11122334456\",\n \"invoicingContactLanguage\": \"en\",\n \"invoicingContactEmail\": \"invoice@company.com\",\n \"invoicingContactAddress\": \"221B Baker Street\",\n \"invoicingContactCity\": \"London\",\n \"invoicingContactZipcode\": \"110011\",\n \"invoicingContactCountry\": \"UK\",\n \"listingAmenities\": [\n {\n \"amenityId\": 2\n },\n {\n \"amenityId\": 3\n }\n ],\n \"listingBedTypes\": [\n {\n \"bedTypeId\": 2,\n \"quantity\": 1\n }\n ],\n \"listingImages\": [\n {\n \"caption\": \"Kitche\",\n \"url\": \"https://www.sharingxchange.com/spacelist/assets/uploads/property/9/5853ff465e538.JPG\",\n \"sortOrder\": 2\n },\n {\n \"caption\": \"hall\",\n \"url\": \"https://www.sharingxchange.com/spacelist/assets/uploads/property/6/57eb022da2b28.jpg\",\n \"sortOrder\": 3\n }\n ]\n,\n \"customFieldValues\": [{\"customFieldId\": 167, \"value\": \"Custom field value one\"}, {\"customFieldId\": 243, \"value\": \"Custom field value two\"}]\n}",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6Ijc4MjUwZDMxY2FmNTczMWRhZGFlMWE2YmMxYzQ4ZWE2MWZjNzU5YjljYjUyYmQyNGM3ZDBkNzA1ZTI1Nzc2MTQ4ZDIzNWRlY2NkMzJlZGU2In0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6Ijc4MjUwZDMxY2FmNTczMWRhZGFlMWE2YmMxYzQ4ZWE2MWZjNzU5YjljYjUyYmQyNGM3ZDBkNzA1ZTI1Nzc2MTQ4ZDIzNWRlY2NkMzJlZGU2IiwiaWF0IjoxNTA2Njc1MTc4LCJuYmYiOjE1MDY2NzUxNzgsImV4cCI6MTUyMjIyNzE3OCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.flG98dFtx0M0k9E_WQq2-fqUgGOip8s0HjuKGc4paLzgC1dMvIDAHnbR4xNnELL4PSN4HmzAQVVFfcMQOW3vP-qdPUae_wiMeT0Cu47wH-0KAZVSgZzCP0WhBTBgUm4yvgeKeKj5ha5WNfUo_w0Bx3cvtHtyjfEOr5yNNQznfF8",
"Cache-control: no-cache",
"Content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var data = JSON.stringify({
"propertyTypeId": 1,
"name": "Beautiful and cozy apartment close to city center",
"externalListingName": "Beautiful and cozy apartment close to city center",
"internalListingName": "Property #3",
"description": "In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.",
"houseRules": "Additional rules",
"keyPickup": "Key pickup",
"specialInstruction": "Any special instruction",
"doorSecurityCode": "ddff8",
"country": "Germany",
"countryCode": "DE",
"state": "Bremen",
"city": "Bremerhaven",
"street": "Schulstraße 7",
"address": "Schulstraße 7, Bremerhaven, Bremen 27570, Germany",
"publicAddress": "Bremerhaven, Bremen 27570, Germany",
"zipcode": "27570",
"price": 211.62,
"starRating": 5,
"weeklyDiscount": 0.71,
"monthlyDiscount": 0.82,
"propertyRentTax": 12,
"guestPerPersonPerNightTax": 10,
"guestStayTax": 12,
"guestNightlyTax": 13,
"guestBathroomsNumber": 2,
"refundableDamageDeposit": 15,
"personCapacity": 6,
"maxChildrenAllowed": null,
"maxInfantsAllowed": null,
"maxPetsAllowed": null,
"lat": 53.5403,
"lng": 8.58936,
"checkInTimeStart": 12,
"checkInTimeEnd": 21,
"checkOutTime": 11,
"cancellationPolicy": "strict",
"cancellationPolicyId": 6,
"bookingCancellationPolicyId": 1,
"vrboCancellationPolicyId": 2,
"airBnbCancellationPolicyId": 3,
"marriottBnbCancellationPolicyId": 4,
"squareMeters": 10,
"roomType": "entire_home",
"bathroomType": "shared",
"bedroomsNumber": 1,
"bedsNumber": 1,
"bedType": "real_bed",
"bathroomsNumber": 1,
"minNights": 1,
"maxNights": 1125,
"guestsIncluded": 3,
"cleaningFee": 40.32,
"priceForExtraPerson": 54.01,
"instantBookable": 0,
"instantBookableLeadTime": 1,
"allowSameDayBooking": 2,
"sameDayBookingLeadTime": 12,
"contactName": "contactName",
"contactSurName": "contactSurName",
"contactPhone1": "contactPhone1",
"contactPhone2": "contactPhone2",
"contactLanguage": "contactLanguage",
"contactEmail": "contactEmail@mail.com",
"contactAddress": "contactAddress",
"language": "en",
"currencyCode": "USD",
"timeZoneName": "Europe/Berlin",
"wifiUsername": "un",
"wifiPassword": "pass",
"cleannessStatus": null,
"cleaningInstruction": null,
"cleannessStatusUpdatedOn": null,
"homeawayPropertyName": "Beautiful and cozy apartment close to city center",
"homeawayPropertyHeadline": "Beautiful and cozy apartment close to city center with a living room and bed room",
"homeawayPropertyDescription": "In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.",
"bookingcomPropertyName": "Beautiful and cozy apartment close to city center",
"bookingcomPropertyDescription": "In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.",
"airbnbName": "Beautiful and cozy apartment close to city center",
"airbnbSummary": "In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.",
"invoicingContactName": "Name",
"invoicingContactSurName": "Surname",
"invoicingContactPhone1": "+11122334456",
"invoicingContactPhone2": "+11122334456",
"invoicingContactLanguage": "en",
"invoicingContactEmail": "invoice@company.com",
"invoicingContactAddress": "221B Baker Street",
"invoicingContactCity": "London",
"invoicingContactZipcode": "110011",
"invoicingContactCountry": "UK",
"isRentalAgreementActive": true,
"bookingcomPropertyHasVat": true,
"listingAgreementText": "Rental agreement text for listing",
"propertyLicenseNumber": null,
"propertyLicenseType": null,
"propertyLicenseIssueDate": null,
"propertyLicenseExpirationDate": null,
"listingAmenities": [
{
"amenityId": 2
},
{
"amenityId": 3
}
],
"listingBedTypes": [
{
"bedTypeId": 2,
"quantity": 1
}
],
"listingImages": [
{
"caption": "Kitche",
"url": "https://www.sharingxchange.com/spacelist/assets/uploads/property/9/5853ff465e538.JPG",
"sortOrder": 2
},
{
"caption": "hall",
"url": "https://www.sharingxchange.com/spacelist/assets/uploads/property/6/57eb022da2b28.jpg",
"sortOrder": 3
}
],
"customFieldValues": [
{
"customFieldId": 167,
"value": "Custom field value one"
},
{
"customFieldId": 243,
"value": "Custom field value two"
}
]
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("PUT", "https://api.hostaway.com/v1/listings/40214");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6Ijc4MjUwZDMxY2FmNTczMWRhZGFlMWE2YmMxYzQ4ZWE2MWZjNzU5YjljYjUyYmQyNGM3ZDBkNzA1ZTI1Nzc2MTQ4ZDIzNWRlY2NkMzJlZGU2In0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6Ijc4MjUwZDMxY2FmNTczMWRhZGFlMWE2YmMxYzQ4ZWE2MWZjNzU5YjljYjUyYmQyNGM3ZDBkNzA1ZTI1Nzc2MTQ4ZDIzNWRlY2NkMzJlZGU2IiwiaWF0IjoxNTA2Njc1MTc4LCJuYmYiOjE1MDY2NzUxNzgsImV4cCI6MTUyMjIyNzE3OCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.flG98dFtx0M0k9E_WQq2-fqUgGOip8s0HjuKGc4paLzgC1dMvIDAHnbR4xNnELL4PSN4HmzAQVVFfcMQOW3vP-qdPUae_wiMeT0Cu47wH-0KAZVSgZzCP0WhBTBgUm4yvgeKeKj5ha5WNfUo_w0Bx3cvtHtyjfEOr5yNNQznfF8");
xhr.setRequestHeader("Content-type", "application/json");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send(data);
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"propertyTypeId\": 1,\n \"name\": \"Beautiful and cozy apartment close to city center\",\n \"externalListingName\": \"Beautiful and cozy apartment close to city center\",\n \"internalListingName\": \"Property #3\",\n \"description\": \"In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.\",\n \"houseRules\": \"Additional rules\",\n \"keyPickup\": \"Key pickup\",\n \"specialInstruction\": \"Any special instruction\",\n \"doorSecurityCode\": \"ddff8\",\n \"country\": \"Germany\",\n \"countryCode\": \"DE\",\n \"state\": \"Bremen\",\n \"city\": \"Bremerhaven\",\n \"street\": \"Schulstraße 7\",\n \"address\": \"Schulstraße 7, Bremerhaven, Bremen 27570, Germany\",\n \"publicAddress\": \"Bremerhaven, Bremen 27570, Germany\",\n \"zipcode\": \"27570\",\n \"price\": 211.62,\n \"starRating\": 5,\n \"weeklyDiscount\": 0.71,\n \"monthlyDiscount\": 0.82,\n \"propertyRentTax\": 12,\n \"guestPerPersonPerNightTax\": 10,\n \"guestStayTax\": 12,\n \"guestNightlyTax\": 13,\n \"guestBathroomsNumber\": 2,\n \"refundableDamageDeposit\": 15,\n \"personCapacity\": 6,\n \"maxChildrenAllowed\": null,\n \"maxInfantsAllowed\": null,\n \"maxPetsAllowed\": null,\n \"lat\": 53.5403,\n \"lng\": 8.58936,\n \"checkInTimeStart\": 12,\n \"checkInTimeEnd\": 21,\n \"checkOutTime\": 11,\n \"cancellationPolicy\": \"strict\",\n \"cancellationPolicyId\": 1,\n \"vrboCancellationPolicyId\": 2,\n \"bookingCancellationPolicyId\": 3,\n \"airbnbCancellationPolicyId\": 4,\n \"marriottCancellationPolicyId\": 5,\n \"squareMeters\": 10,\n \"roomType\": \"entire_home\",\n \"bathroomType\": \"shared\",\n \"bedroomsNumber\": 1,\n \"bedsNumber\": 1,\n \"bedType\": \"real_bed\",\n \"bathroomsNumber\": 1,\n \"minNights\": 1,\n \"maxNights\": 1125,\n \"guestsIncluded\": 3,\n \"cleaningFee\": 40.32,\n \"priceForExtraPerson\": 54.01,\n \"instantBookable\": 0,\n \"instantBookableLeadTime\": 1,\n \"allowSameDayBooking\": 2,\n \"sameDayBookingLeadTime\": 12,\n \"contactName\": \"contactName\",\n \"contactSurName\": \"contactSurName\",\n \"contactPhone1\": \"contactPhone1\",\n \"contactPhone2\": \"contactPhone2\",\n \"contactLanguage\": \"contactLanguage\",\n \"contactEmail\": \"contactEmail@mail.com\",\n \"contactAddress\": \"contactAddress\",\n \"language\": \"en\",\n \"currencyCode\": \"USD\",\n \"timeZoneName\": \"Europe/Berlin\",\n \"wifiUsername\": \"un\",\n \"wifiPassword\": \"pass\",\n \"cleannessStatus\": null,\n \"cleaningInstruction\": null,\n \"cleannessStatusUpdatedOn\": null,\n \"homeawayPropertyName\": \"Beautiful and cozy apartment close to city center\",\n \"homeawayPropertyHeadline\": \"Beautiful and cozy apartment close to city center with a living room and bed room\",\n \"homeawayPropertyDescription\": \"In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.\",\n \"bookingcomPropertyName\": \"Beautiful and cozy apartment close to city center\",\n \"bookingcomPropertyDescription\": \"In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.\",\n \"airbnbName\": \"Beautiful and cozy apartment close to city center\",\n \"airbnbSummary\": \"Beautiful and cozy apartment close to city center with a living room and bed room\",\n \"invoicingContactName\": \"Name\",\n \"invoicingContactSurName\": \"SurName\",\n \"invoicingContactPhone1\": \"+11122334456\",\n \"invoicingContactPhone2\": \"+11122334456\",\n \"invoicingContactLanguage\": \"en\",\n \"invoicingContactEmail\": \"invoice@company.com\",\n \"invoicingContactAddress\": \"221B Baker Street\",\n \"invoicingContactCity\": \"London\",\n \"invoicingContactZipcode\": \"110011\",\n \"invoicingContactCountry\": \"UK\",\n \"listingAmenities\": [\n {\n \"amenityId\": 2\n },\n {\n \"amenityId\": 3\n }\n ],\n \"listingBedTypes\": [\n {\n \"bedTypeId\": 2,\n \"quantity\": 1\n }\n ],\n \"listingImages\": [\n {\n \"caption\": \"Kitche\",\n \"url\": \"https://www.sharingxchange.com/spacelist/assets/uploads/property/9/5853ff465e538.JPG\",\n \"sortOrder\": 2\n },\n {\n \"caption\": \"hall\",\n \"url\": \"https://www.sharingxchange.com/spacelist/assets/uploads/property/6/57eb022da2b28.jpg\",\n \"sortOrder\": 3\n }\n ]\n,\n \"customFieldValues\": [{\"customFieldId\": 167, \"value\": \"Custom field value one\"}, {\"customFieldId\": 243, \"value\": \"Custom field value two\"}]\n}");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/listings/40214")
.put(body)
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6Ijc4MjUwZDMxY2FmNTczMWRhZGFlMWE2YmMxYzQ4ZWE2MWZjNzU5YjljYjUyYmQyNGM3ZDBkNzA1ZTI1Nzc2MTQ4ZDIzNWRlY2NkMzJlZGU2In0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6Ijc4MjUwZDMxY2FmNTczMWRhZGFlMWE2YmMxYzQ4ZWE2MWZjNzU5YjljYjUyYmQyNGM3ZDBkNzA1ZTI1Nzc2MTQ4ZDIzNWRlY2NkMzJlZGU2IiwiaWF0IjoxNTA2Njc1MTc4LCJuYmYiOjE1MDY2NzUxNzgsImV4cCI6MTUyMjIyNzE3OCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.flG98dFtx0M0k9E_WQq2-fqUgGOip8s0HjuKGc4paLzgC1dMvIDAHnbR4xNnELL4PSN4HmzAQVVFfcMQOW3vP-qdPUae_wiMeT0Cu47wH-0KAZVSgZzCP0WhBTBgUm4yvgeKeKj5ha5WNfUo_w0Bx3cvtHtyjfEOr5yNNQznfF8")
.addHeader("Content-type", "application/json")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import http.client
import json
conn = http.client.HTTPSConnection("api.hostaway.com")
payload = {
"propertyTypeId": 1,
"name": "Beautiful and cozy apartment close to city center",
"externalListingName": "Beautiful and cozy apartment close to city center",
"internalListingName": "Property #3",
"description": "In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.",
"houseRules": "Additional rules",
"keyPickup": "Key pickup",
"specialInstruction": "Any special instruction",
"doorSecurityCode": "ddff8",
"country": "Germany",
"countryCode": "DE",
"state": "Bremen",
"city": "Bremerhaven",
"street": "Schulstraße 7",
"address": "Schulstraße 7, Bremerhaven, Bremen 27570, Germany",
"publicAddress": "Bremerhaven, Bremen 27570, Germany",
"zipcode": "27570",
"price": 211.62,
"starRating": 5,
"weeklyDiscount": 0.71,
"monthlyDiscount": 0.82,
"propertyRentTax": 12,
"guestPerPersonPerNightTax": 10,
"guestStayTax": 12,
"guestNightlyTax": 13,
"guestBathroomsNumber": 2,
"refundableDamageDeposit": 15,
"personCapacity": 6,
"maxChildrenAllowed": None,
"maxInfantsAllowed": None,
"maxPetsAllowed": None,
"lat": 53.5403,
"lng": 8.58936,
"checkInTimeStart": 12,
"checkInTimeEnd": 21,
"checkOutTime": 11,
"cancellationPolicy": "strict",
"cancellationPolicyId": 1,
"vrboCancellationPolicyId": 2,
"bookingCancellationPolicyId": 3,
"airbnbCancellationPolicyId": 4,
"marriottCancellationPolicyId": 5,
"squareMeters": 10,
"roomType": "entire_home",
"bathroomType": "shared",
"bedroomsNumber": 1,
"bedsNumber": 1,
"bedType": "real_bed",
"bathroomsNumber": 1,
"minNights": 1,
"maxNights": 1125,
"guestsIncluded": 3,
"cleaningFee": 40.32,
"priceForExtraPerson": 54.01,
"instantBookable": 0,
"instantBookableLeadTime": 1,
"allowSameDayBooking": 2,
"sameDayBookingLeadTime": 12,
"contactName": "contactName",
"contactSurName": "contactSurName",
"contactPhone1": "contactPhone1",
"contactPhone2": "contactPhone2",
"contactLanguage": "contactLanguage",
"contactEmail": "contactEmail@mail.com",
"contactAddress": "contactAddress",
"language": "en",
"currencyCode": "USD",
"timeZoneName": "Europe/Berlin",
"wifiUsername": "un",
"wifiPassword": "pass",
"cleannessStatus": None,
"cleaningInstruction": None,
"cleannessStatusUpdatedOn": None,
"homeawayPropertyName": "Beautiful and cozy apartment close to city center",
"homeawayPropertyHeadline": "Beautiful and cozy apartment close to city center with a living room and bed room",
"homeawayPropertyDescription": "In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.",
"bookingcomPropertyName": "Beautiful and cozy apartment close to city center",
"bookingcomPropertyDescription": "In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.",
"airbnbName": "Beautiful and cozy apartment close to city center",
"airbnbSummary": "In a classic Bremerhaven house we rent out our apartment which has a living room, bed room and is close to all the restaurants and nightlife.",
"invoicingContactName": "Name",
"invoicingContactSurName": "SurName",
"invoicingContactPhone1": "+11122334456",
"invoicingContactPhone2": "+11122334456",
"invoicingContactLanguage": "en",
"invoicingContactEmail": "invoice@company.com",
"invoicingContactAddress": "221B Baker Street",
"invoicingContactCity": "London",
"invoicingContactZipcode": "110011",
"invoicingContactCountry": "UK",
"listingAmenities": [{"amenityId": 2}, {"amenityId": 3}],
"listingBedTypes": [{"bedTypeId": 2, "quantity": 1}],
"listingImages": [
{"caption": "Kitche", "url": "https://www.sharingxchange.com/spacelist/assets/uploads/property/9/5853ff465e538.JPG", "sortOrder": 2},
{"caption": "hall", "url": "https://www.sharingxchange.com/spacelist/assets/uploads/property/6/57eb022da2b28.jpg", "sortOrder": 3}
],
"customFieldValues": [{"customFieldId": 167, "value": "Custom field value one"}, {"customFieldId": 243, "value": "Custom field value two"}]
}
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6Ijc4MjUwZDMxY2FmNTczMWRhZGFlMWE2YmMxYzQ4ZWE2MWZjNzU5YjljYjUyYmQyNGM3ZDBkNzA1ZTI1Nzc2MTQ4ZDIzNWRlY2NkMzJlZGU2In0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6Ijc4MjUwZDMxY2FmNTczMWRhZGFlMWE2YmMxYzQ4ZWE2MWZjNzU5YjljYjUyYmQyNGM3ZDBkNzA1ZTI1Nzc2MTQ4ZDIzNWRlY2NkMzJlZGU2IiwiaWF0IjoxNTA2Njc1MTc4LCJuYmYiOjE1MDY2NzUxNzgsImV4cCI6MTUyMjIyNzE3OCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.flG98dFtx0M0k9E_WQq2-fqUgGOip8s0HjuKGc4paLzgC1dMvIDAHnbR4xNnELL4PSN4HmzAQVVFfcMQOW3vP-qdPUae_wiMeT0Cu47wH-0KAZVSgZzCP0WhBTBgUm4yvgeKeKj5ha5WNfUo_w0Bx3cvtHtyjfEOr5yNNQznfF8",
'Content-type': "application/json",
'Cache-control': "no-cache"
}
conn.request("PUT", "/v1/listings/40214", json.dumps(payload), headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
PUT https://api.hostaway.com/v1/listings/{listingId}
A listing object should be provided in the request body.
Response
The updated listing object or error response.
Delete a listing
Request
curl -X DELETE \
https://api.hostaway.com/v1/listings/40169 \
-H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIiwiaWF0IjoxNDk4NTc5NzQ0LCJuYmYiOjE0OTg1Nzk3NDQsImV4cCI6MTUxNDM5MDk0NCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.TsbJaDOZ0VlEF4vBg7mqLX8DxEuu5rjtsmqix1IbsEcR7F9cdx8F3dDq2zOc6mw8FNAfXT8xp1r5qKu2AYoxv4ublZhxxW0Y6uPSFs0jv5Fh5lliNBJAeQqFOChOVEbYzdbfH_6uu4HHSL31si1RvpVccAjA1Ap9vXlSg3DcPgw' \
-H 'Cache-control: no-cache' \
-H 'Content-type: application/json'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/listings/40169",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIiwiaWF0IjoxNDk4NTc5NzQ0LCJuYmYiOjE0OTg1Nzk3NDQsImV4cCI6MTUxNDM5MDk0NCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.TsbJaDOZ0VlEF4vBg7mqLX8DxEuu5rjtsmqix1IbsEcR7F9cdx8F3dDq2zOc6mw8FNAfXT8xp1r5qKu2AYoxv4ublZhxxW0Y6uPSFs0jv5Fh5lliNBJAeQqFOChOVEbYzdbfH_6uu4HHSL31si1RvpVccAjA1Ap9vXlSg3DcPgw",
"Cache-control: no-cache",
"Content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("DELETE", "https://api.hostaway.com/v1/listings/40169");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIiwiaWF0IjoxNDk4NTc5NzQ0LCJuYmYiOjE0OTg1Nzk3NDQsImV4cCI6MTUxNDM5MDk0NCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.TsbJaDOZ0VlEF4vBg7mqLX8DxEuu5rjtsmqix1IbsEcR7F9cdx8F3dDq2zOc6mw8FNAfXT8xp1r5qKu2AYoxv4ublZhxxW0Y6uPSFs0jv5Fh5lliNBJAeQqFOChOVEbYzdbfH_6uu4HHSL31si1RvpVccAjA1Ap9vXlSg3DcPgw");
xhr.setRequestHeader("Content-type", "application/json");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send(data);
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/listings/40169")
.delete(null)
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIiwiaWF0IjoxNDk4NTc5NzQ0LCJuYmYiOjE0OTg1Nzk3NDQsImV4cCI6MTUxNDM5MDk0NCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.TsbJaDOZ0VlEF4vBg7mqLX8DxEuu5rjtsmqix1IbsEcR7F9cdx8F3dDq2zOc6mw8FNAfXT8xp1r5qKu2AYoxv4ublZhxxW0Y6uPSFs0jv5Fh5lliNBJAeQqFOChOVEbYzdbfH_6uu4HHSL31si1RvpVccAjA1Ap9vXlSg3DcPgw")
.addHeader("Content-type", "application/json")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import http.client
conn = http.client.HTTPSConnection("api.hostaway.com")
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIiwiaWF0IjoxNDk4NTc5NzQ0LCJuYmYiOjE0OTg1Nzk3NDQsImV4cCI6MTUxNDM5MDk0NCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.TsbJaDOZ0VlEF4vBg7mqLX8DxEuu5rjtsmqix1IbsEcR7F9cdx8F3dDq2zOc6mw8FNAfXT8xp1r5qKu2AYoxv4ublZhxxW0Y6uPSFs0jv5Fh5lliNBJAeQqFOChOVEbYzdbfH_6uu4HHSL31si1RvpVccAjA1Ap9vXlSg3DcPgw",
'Content-type': "application/json",
'Cache-control': "no-cache"
}
conn.request("DELETE", "/v1/listings/40169", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
DELETE https://api.hostaway.com/v1/listings/{listingId}
Response
An empty success response or error response.
Export listing to airbnb
Creates listing export job to Airbnb. The export will be completed approximately in the next 5-10 minutes.
Request
curl -X POST \
https://api.hostaway.com/v1/listings/40169/export/airbnb \
-H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIiwiaWF0IjoxNDk4NTc5NzQ0LCJuYmYiOjE0OTg1Nzk3NDQsImV4cCI6MTUxNDM5MDk0NCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.TsbJaDOZ0VlEF4vBg7mqLX8DxEuu5rjtsmqix1IbsEcR7F9cdx8F3dDq2zOc6mw8FNAfXT8xp1r5qKu2AYoxv4ublZhxxW0Y6uPSFs0jv5Fh5lliNBJAeQqFOChOVEbYzdbfH_6uu4HHSL31si1RvpVccAjA1Ap9vXlSg3DcPgw' \
-H 'Cache-control: no-cache' \
-H 'Content-type: application/json'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/listings/40169/export/airbnb",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIiwiaWF0IjoxNDk4NTc5NzQ0LCJuYmYiOjE0OTg1Nzk3NDQsImV4cCI6MTUxNDM5MDk0NCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.TsbJaDOZ0VlEF4vBg7mqLX8DxEuu5rjtsmqix1IbsEcR7F9cdx8F3dDq2zOc6mw8FNAfXT8xp1r5qKu2AYoxv4ublZhxxW0Y6uPSFs0jv5Fh5lliNBJAeQqFOChOVEbYzdbfH_6uu4HHSL31si1RvpVccAjA1Ap9vXlSg3DcPgw",
"Cache-control: no-cache",
"Content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.hostaway.com/v1/listings/40169/export/airbnb");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIiwiaWF0IjoxNDk4NTc5NzQ0LCJuYmYiOjE0OTg1Nzk3NDQsImV4cCI6MTUxNDM5MDk0NCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.TsbJaDOZ0VlEF4vBg7mqLX8DxEuu5rjtsmqix1IbsEcR7F9cdx8F3dDq2zOc6mw8FNAfXT8xp1r5qKu2AYoxv4ublZhxxW0Y6uPSFs0jv5Fh5lliNBJAeQqFOChOVEbYzdbfH_6uu4HHSL31si1RvpVccAjA1Ap9vXlSg3DcPgw");
xhr.setRequestHeader("Content-type", "application/json");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send(data);
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/listings/40169/export/airbnb")
.delete(null)
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIiwiaWF0IjoxNDk4NTc5NzQ0LCJuYmYiOjE0OTg1Nzk3NDQsImV4cCI6MTUxNDM5MDk0NCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.TsbJaDOZ0VlEF4vBg7mqLX8DxEuu5rjtsmqix1IbsEcR7F9cdx8F3dDq2zOc6mw8FNAfXT8xp1r5qKu2AYoxv4ublZhxxW0Y6uPSFs0jv5Fh5lliNBJAeQqFOChOVEbYzdbfH_6uu4HHSL31si1RvpVccAjA1Ap9vXlSg3DcPgw")
.addHeader("Content-type", "application/json")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import http.client
conn = http.client.HTTPSConnection("api.hostaway.com")
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIiwiaWF0IjoxNDk4NTc5NzQ0LCJuYmYiOjE0OTg1Nzk3NDQsImV4cCI6MTUxNDM5MDk0NCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.TsbJaDOZ0VlEF4vBg7mqLX8DxEuu5rjtsmqix1IbsEcR7F9cdx8F3dDq2zOc6mw8FNAfXT8xp1r5qKu2AYoxv4ublZhxxW0Y6uPSFs0jv5Fh5lliNBJAeQqFOChOVEbYzdbfH_6uu4HHSL31si1RvpVccAjA1Ap9vXlSg3DcPgw",
'Content-type': "application/json",
'Cache-control': "no-cache"
}
conn.request("POST", "/v1/listings/40169/export/airbnb", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
POST https://api.hostaway.com/v1/listings/{listingId}/export/airbnb
Response
An empty success response or error response.
List Listing Fee Settings
Get listing fee settings by listing map
Request
curl --request GET \
--url 'https://api.hostaway.com/v1/listingFeeSettings/{listingId}' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c' \
--header 'Cache-control: no-cache'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/listingFeeSettings/{listingId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
"Cache-control: no-cache"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.hostaway.com/v1/listingFeeSettings/{listingId}");
xhr.setRequestHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send(data);
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/listingFeeSettings/{listingId}")
.get()
.addHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import requests
url = "https://api.hostaway.com/v1/listingFeeSettings/{listingId}"
headers = {
'Authorization': "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
'Cache-control': "no-cache",
}
response = requests.request("GET", url, headers=headers)
print(response.text)
GET https://api.hostaway.com/v1/listingFeeSettings/{listingId}
Response
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | |
accountId |
yes | int | |
listingMapId |
yes | int | |
feeType |
yes | string | Can be one of the following: additionalCleaningFee, parkingFee, towelChangeFee, midstayCleaningFee, roomRequestFee, reservationChangeFee, lateCheckoutFee, otherFees, creditCardFee, kitchenLinenFee, linenPackageFee, transferFee, wristbandFee, extraBedsFee, serviceFee, bedLinenFee, bookingFee, petFee, skiPassFee, tourismFee, childrenExtraFee, resortFee |
feeTitle |
no | string | Fee title |
feeAppliedPer |
yes | string | Can be one of the following: reservation, person, night, person_per_night |
amount |
yes | float | |
amountType |
yes | string | Can be one of the following: percent, flat |
isMandatory |
no | int | 1 = fee always included in total price, 0/null = is not included by default |
isQuantitySelectable |
yes | int | 1 = fee quantity can be selected, it will be multiplied to get value, 0 = quantity is not selectable and is always 1 |
insertedOn |
yes | date time | |
updatedOn |
yes | date time |
{
"status": "success",
"result": [
{
"id": 2,
"accountId": 10638,
"listingMapId": 40270,
"feeType": "parkingFee",
"feeTitle": null,
"feeAppliedPer": "base_rate",
"amount": 1000,
"amountType": "flat",
"isMandatory": null,
"isQuantitySelectable": 0,
"insertedOn": "2020-07-29 15:23:49",
"updatedOn": "2020-07-29 15:23:49"
}
]
}
Add Listing Fee Settings
Add listing fee settings by listing map. Then you can use it for calculate total price and create reservation. Please check calculate reservation price with extras
Request
curl --location --request POST 'https://api.hostaway.com/v1/listingFeeSettings/40270' \
--header 'jwt;' \
--header 'Content-type: application/json' \
--data-raw '{
"feeType": "parkingFee",
"feeTitle": null,
"feeAppliedPer": "base_rate",
"amount": 1000,
"amountType": "flat",
"isMandatory": 0,
"isQuantitySelectable": 1
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.hostaway.com/v1/listingFeeSettings/40270',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"feeType": "parkingFee",
"feeTitle": null,
"feeAppliedPer": "base_rate",
"amount": 1000,
"amountType": "flat",
"isMandatory": 0,
"isQuantitySelectable": 1
}',
CURLOPT_HTTPHEADER => array(
'jwt: ',
'Content-type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var data = JSON.stringify({
"feeType": "parkingFee",
"feeTitle": null,
"feeAppliedPer": "base_rate",
"amount": 1000,
"amountType": "flat",
"isMandatory": 0,
"isQuantitySelectable": 1
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.hostaway.com/v1/listingFeeSettings/40270");
xhr.setRequestHeader("jwt", "");
xhr.setRequestHeader("Content-type", "application/json");
xhr.send(data);
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"feeType\": \"parkingFee\",\n \"feeTitle\": null,\n \"feeAppliedPer\": \"base_rate\",\n \"amount\": 1000,\n \"amountType\": \"flat\",\n \"isMandatory\": 0,\n \"isQuantitySelectable\": 1\n}");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/listingFeeSettings/40270")
.method("POST", body)
.addHeader("jwt", "")
.addHeader("Content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
import http.client
import json
conn = http.client.HTTPSConnection("api.hostaway.com")
payload = json.dumps({
"feeType": "parkingFee",
"feeTitle": None,
"feeAppliedPer": "base_rate",
"amount": 1000,
"amountType": "flat",
"isMandatory": 0,
"isQuantitySelectable": 1
})
headers = {
'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImNhMmJhMjAyZGMwYzU0ZWZlYmVkNTJmZjhkNjZjNjZhODBjMmVhYmQ0ZDU4ODVmZmRmMGI1YjkzODBjN2I2MzU3ZTE2NDk4YTVmNTQyOWQ4IiwiaWF0IjoxNjkxNjUzNDc2LCJuYmYiOjE2OTE2NTM0NzYsImV4cCI6MTc1NDgxMTg3Niwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjF9.cr4vNqZ1WuR5IOY-SoVitOv8PBdhMnMrUp2WZx8E6Adet-9rYI3KB3wMzxjTShXp_63TGGKYsdmNQ6DQOuB4PbN8qH1jsacmwn0cY4ynxfLaG5n9bdJ5DxLHe8EGv-MD2HIM1-zrK1bMBYTx6idti0L2IK6S6xxJCHQ5fBfsuyc'',
'Content-type': 'application/json'
}
conn.request("POST", "/v1/listingFeeSettings/40270", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
POST https://api.hostaway.com/v1/listingFeeSettings/{listingId}
Response
The created listing fee object or error response.
Update Listing Fee Settings
Update listing fee settings by listing map and ID
Request
curl --location --request PUT 'https://api.hostaway.com/v1/listingFeeSettings/40270/1' \
--header 'jwt;' \
--header 'Content-type: application/json' \
--data-raw '{
"feeType": "parkingFee",
"feeTitle": null,
"feeAppliedPer": "base_rate",
"amount": 1000,
"amountType": "flat",
"isMandatory": 0,
"isQuantitySelectable": 1
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.hostaway.com/v1/listingFeeSettings/40270/1',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{
"feeType": "parkingFee",
"feeTitle": null,
"feeAppliedPer": "base_rate",
"amount": 1000,
"amountType": "flat",
"isMandatory": 0,
"isQuantitySelectable": 1
}',
CURLOPT_HTTPHEADER => array(
'jwt: ',
'Content-type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var data = JSON.stringify({
"feeType": "parkingFee",
"feeTitle": null,
"feeAppliedPer": "base_rate",
"amount": 1000,
"amountType": "flat",
"isMandatory": 0,
"isQuantitySelectable": 1
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("PUT", "https://api.hostaway.com/v1/listingFeeSettings/40270/1");
xhr.setRequestHeader("jwt", "");
xhr.setRequestHeader("Content-type", "application/json");
xhr.send(data);
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"feeType\": \"parkingFee\",\n \"feeTitle\": null,\n \"feeAppliedPer\": \"base_rate\",\n \"amount\": 1000,\n \"amountType\": \"flat\",\n \"isMandatory\": 0,\n \"isQuantitySelectable\": 1\n}");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/listingFeeSettings/40270/1")
.method("PUT", body)
.addHeader("jwt", "")
.addHeader("Content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
import http.client
import json
conn = http.client.HTTPSConnection("api.hostaway.com")
payload = json.dumps({
"feeType": "parkingFee",
"feeTitle": None,
"feeAppliedPer": "base_rate",
"amount": 1000,
"amountType": "flat",
"isMandatory": 0,
"isQuantitySelectable": 1
})
headers = {
'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImNhMmJhMjAyZGMwYzU0ZWZlYmVkNTJmZjhkNjZjNjZhODBjMmVhYmQ0ZDU4ODVmZmRmMGI1YjkzODBjN2I2MzU3ZTE2NDk4YTVmNTQyOWQ4IiwiaWF0IjoxNjkxNjUzNDc2LCJuYmYiOjE2OTE2NTM0NzYsImV4cCI6MTc1NDgxMTg3Niwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjF9.cr4vNqZ1WuR5IOY-SoVitOv8PBdhMnMrUp2WZx8E6Adet-9rYI3KB3wMzxjTShXp_63TGGKYsdmNQ6DQOuB4PbN8qH1jsacmwn0cY4ynxfLaG5n9bdJ5DxLHe8EGv-MD2HIM1-zrK1bMBYTx6idti0L2IK6S6xxJCHQ5fBfsuyc'',
'Content-type': 'application/json'
}
conn.request("PUT", "/v1/listingFeeSettings/40270/1", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
PUT https://api.hostaway.com/v1/listingFeeSettings/{listingId}
Response
The updated listing fee object or error response.
Delete Listing Fee Settings
Delete listing fee settings by ID
Request
curl --location --request DELETE 'https://api.hostaway.com/v1/listingFeeSettings/4' \
--header 'jwt;'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.hostaway.com/v1/listingFeeSettings/4',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => array(
'jwt: '
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("DELETE", "https://api.hostaway.com/v1/listingFeeSettings/4");
xhr.setRequestHeader("jwt", "");
xhr.send();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/listingFeeSettings/4")
.method("DELETE", body)
.addHeader("jwt", "")
.build();
Response response = client.newCall(request).execute();
import http.client
conn = http.client.HTTPSConnection("api.hostaway.com")
payload = ''
headers = {
'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImNhMmJhMjAyZGMwYzU0ZWZlYmVkNTJmZjhkNjZjNjZhODBjMmVhYmQ0ZDU4ODVmZmRmMGI1YjkzODBjN2I2MzU3ZTE2NDk4YTVmNTQyOWQ4IiwiaWF0IjoxNjkxNjUzNDc2LCJuYmYiOjE2OTE2NTM0NzYsImV4cCI6MTc1NDgxMTg3Niwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjF9.cr4vNqZ1WuR5IOY-SoVitOv8PBdhMnMrUp2WZx8E6Adet-9rYI3KB3wMzxjTShXp_63TGGKYsdmNQ6DQOuB4PbN8qH1jsacmwn0cY4ynxfLaG5n9bdJ5DxLHe8EGv-MD2HIM1-zrK1bMBYTx6idti0L2IK6S6xxJCHQ5fBfsuyc''
}
conn.request("DELETE", "/v1/listingFeeSettings/4", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
DELETE https://api.hostaway.com/v1/listingFeeSettings/{id}
Response
Success or error response.
Get Listing Agreement
Get listing agreement by listing map
Request
curl --request GET \
--url 'https://api.hostaway.com/v1/listingAgreement/{listingId}' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c' \
--header 'Cache-control: no-cache'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/listingAgreement/{listingId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
"Cache-control: no-cache"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.hostaway.com/v1/listingAgreement/{listingId}");
xhr.setRequestHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send(data);
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/listingAgreement/{listingId}")
.get()
.addHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import requests
url = "https://api.hostaway.com/v1/listingAgreement/{listingId}"
headers = {
'Authorization': "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
'Cache-control': "no-cache",
}
response = requests.request("GET", url, headers=headers)
print(response.text)
GET https://api.hostaway.com/v1/listingAgreement/{listingId}
Response
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | |
listingMapId |
yes | int | |
text |
yes | string | Agreement text with template variables, that will be replaced in rental agreement |
{
"status": "success",
"result": [
{
"id": 2,
"text": "text with {{template}}",
"listingMapId": 40270
}
]
}
Add Listing Agreement
Add listing agreement by listing map
Request
curl --location --request POST 'https://api.hostaway.com/v1/listingAgreement/40270' \
--header 'jwt;' \
--header 'Content-type: application/json' \
--data-raw '{
"text": "some listing agreement text with {{template_var}}"
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.hostaway.com/v1/listingAgreement/40270',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"text": "some listing agreement text with {{template_var}}"
}',
CURLOPT_HTTPHEADER => array(
'jwt: ',
'Content-type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var data = JSON.stringify({
"text": "some listing agreement text with {{template_var}}"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.hostaway.com/v1/listingAgreement/40270");
xhr.setRequestHeader("jwt", "");
xhr.setRequestHeader("Content-type", "application/json");
xhr.send(data);
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"text\": \"some listing agreement text with {{template_var}}\"}");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/listingAgreement/40270")
.method("POST", body)
.addHeader("jwt", "")
.addHeader("Content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
import http.client
import json
conn = http.client.HTTPSConnection("api.hostaway.com")
payload = json.dumps({
"text": "some listing agreement text with {{template_var}}"
})
headers = {
'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImNhMmJhMjAyZGMwYzU0ZWZlYmVkNTJmZjhkNjZjNjZhODBjMmVhYmQ0ZDU4ODVmZmRmMGI1YjkzODBjN2I2MzU3ZTE2NDk4YTVmNTQyOWQ4IiwiaWF0IjoxNjkxNjUzNDc2LCJuYmYiOjE2OTE2NTM0NzYsImV4cCI6MTc1NDgxMTg3Niwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjF9.cr4vNqZ1WuR5IOY-SoVitOv8PBdhMnMrUp2WZx8E6Adet-9rYI3KB3wMzxjTShXp_63TGGKYsdmNQ6DQOuB4PbN8qH1jsacmwn0cY4ynxfLaG5n9bdJ5DxLHe8EGv-MD2HIM1-zrK1bMBYTx6idti0L2IK6S6xxJCHQ5fBfsuyc'',
'Content-type': 'application/json'
}
conn.request("POST", "/v1/listingAgreement/40270", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
POST https://api.hostaway.com/v1/listingAgreement/{listingId}
Response
The created listing agreement object or error response.
Update Listing Agreement
Update listing agreement by listing map ID
Request
curl --location --request PUT 'https://api.hostaway.com/v1/listingAgreement/40270' \
--header 'jwt;' \
--header 'Content-type: application/json' \
--data-raw '{
"text": "another text with {{address}}"
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.hostaway.com/v1/listingAgreement/40270',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{
"text": "another text with {{address}}"
}',
CURLOPT_HTTPHEADER => array(
'jwt: ',
'Content-type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var data = JSON.stringify({
"text": "another text with {{address}}",
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("PUT", "https://api.hostaway.com/v1/listingAgreement/40270");
xhr.setRequestHeader("jwt", "");
xhr.setRequestHeader("Content-type", "application/json");
xhr.send(data);
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"text\": \"another text with {{address}}\"}");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/listingAgreement/40270")
.method("PUT", body)
.addHeader("jwt", "")
.addHeader("Content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
import http.client
import json
conn = http.client.HTTPSConnection("api.hostaway.com")
payload = json.dumps({
"text": "another text with {{address}}",
})
headers = {
'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImNhMmJhMjAyZGMwYzU0ZWZlYmVkNTJmZjhkNjZjNjZhODBjMmVhYmQ0ZDU4ODVmZmRmMGI1YjkzODBjN2I2MzU3ZTE2NDk4YTVmNTQyOWQ4IiwiaWF0IjoxNjkxNjUzNDc2LCJuYmYiOjE2OTE2NTM0NzYsImV4cCI6MTc1NDgxMTg3Niwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjF9.cr4vNqZ1WuR5IOY-SoVitOv8PBdhMnMrUp2WZx8E6Adet-9rYI3KB3wMzxjTShXp_63TGGKYsdmNQ6DQOuB4PbN8qH1jsacmwn0cY4ynxfLaG5n9bdJ5DxLHe8EGv-MD2HIM1-zrK1bMBYTx6idti0L2IK6S6xxJCHQ5fBfsuyc'',
'Content-type': 'application/json'
}
conn.request("PUT", "/v1/listingAgreement/40270", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
PUT https://api.hostaway.com/v1/listingAgreement/{listingId}
Response
The updated listing agreement object or error response.
Delete Listing Agreement
Delete Listing Agreement by listing ID
Request
curl --location --request DELETE 'https://api.hostaway.com/v1/listingAgreement/40270' \
--header 'jwt;'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.hostaway.com/v1/listingAgreement/40270',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => array(
'jwt: '
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("DELETE", "https://api.hostaway.com/v1/listingAgreement/40270");
xhr.setRequestHeader("jwt", "");
xhr.send();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/listingAgreement/40270")
.method("DELETE", body)
.addHeader("jwt", "")
.build();
Response response = client.newCall(request).execute();
import http.client
conn = http.client.HTTPSConnection("api.hostaway.com")
payload = ''
headers = {
'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImNhMmJhMjAyZGMwYzU0ZWZlYmVkNTJmZjhkNjZjNjZhODBjMmVhYmQ0ZDU4ODVmZmRmMGI1YjkzODBjN2I2MzU3ZTE2NDk4YTVmNTQyOWQ4IiwiaWF0IjoxNjkxNjUzNDc2LCJuYmYiOjE2OTE2NTM0NzYsImV4cCI6MTc1NDgxMTg3Niwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjF9.cr4vNqZ1WuR5IOY-SoVitOv8PBdhMnMrUp2WZx8E6Adet-9rYI3KB3wMzxjTShXp_63TGGKYsdmNQ6DQOuB4PbN8qH1jsacmwn0cY4ynxfLaG5n9bdJ5DxLHe8EGv-MD2HIM1-zrK1bMBYTx6idti0L2IK6S6xxJCHQ5fBfsuyc''
}
conn.request("DELETE", "/v1/listingFeeSettings/40270", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
DELETE https://api.hostaway.com/v1/listingFeeSettings/{id}
Response
Success or error response.
Duplicate Listing Agreement
Duplicate listing agreement by listing id and listing map ids
Request
curl --location --request POST 'https://api.hostaway.com/v1/listingAgreement/duplicate' \
--header 'jwt;' \
--header 'Content-type: application/json' \
--data-raw '{
"listingId": 40270,
"listingIds": [40271, 40272]
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.hostaway.com/v1/listingAgreement/duplicate',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"listingId": 40270,
"listingIds": [40271, 40272]
}',
CURLOPT_HTTPHEADER => array(
'jwt: ',
'Content-type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var data = JSON.stringify({
"listingId": 40270,
"listingIds": [40271, 40272]
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.hostaway.com/v1/listingAgreement/duplicate");
xhr.setRequestHeader("jwt", "");
xhr.setRequestHeader("Content-type", "application/json");
xhr.send(data);
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"listingId\": 40270, \"listingIds\": [40271, 40272]}");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/listingAgreement/duplicate")
.method("POST", body)
.addHeader("jwt", "")
.addHeader("Content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
import http.client
import json
conn = http.client.HTTPSConnection("api.hostaway.com")
payload = json.dumps({
"listingId": 40270,
"listingIds": [40271, 40272]
})
headers = {
'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImNhMmJhMjAyZGMwYzU0ZWZlYmVkNTJmZjhkNjZjNjZhODBjMmVhYmQ0ZDU4ODVmZmRmMGI1YjkzODBjN2I2MzU3ZTE2NDk4YTVmNTQyOWQ4IiwiaWF0IjoxNjkxNjUzNDc2LCJuYmYiOjE2OTE2NTM0NzYsImV4cCI6MTc1NDgxMTg3Niwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjF9.cr4vNqZ1WuR5IOY-SoVitOv8PBdhMnMrUp2WZx8E6Adet-9rYI3KB3wMzxjTShXp_63TGGKYsdmNQ6DQOuB4PbN8qH1jsacmwn0cY4ynxfLaG5n9bdJ5DxLHe8EGv-MD2HIM1-zrK1bMBYTx6idti0L2IK6S6xxJCHQ5fBfsuyc'',
'Content-type': 'application/json'
}
conn.request("POST", "/v1/listingAgreement/duplicate", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
POST https://api.hostaway.com/v1/listingAgreement/duplicate
Property | Required | Type | Description |
---|---|---|---|
listingId |
yes | int | parent listing id |
listingIds |
yes | array | list of child listings ids |
Response
The listing agreement object or error response.
Get Listing Price Settings
Get price settings by listing map
Request
curl --request GET \
--url 'https://api.hostaway.com/v1/listing/pricingSettings/{listingId}' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c' \
--header 'Cache-control: no-cache'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/listing/pricingSettings/{listingId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
"Cache-control: no-cache"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.hostaway.com/v1/listing/pricingSettings/{listingId}");
xhr.setRequestHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send(data);
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/listing/pricingSettings/{listingId}")
.get()
.addHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import requests
url = "https://api.hostaway.com/v1/listing/pricingSettings/{listingId}"
headers = {
'Authorization': "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
'Cache-control': "no-cache",
}
response = requests.request("GET", url, headers=headers)
print(response.text)
GET https://api.hostaway.com/v1/listing/pricingSettings/{listingId}
Response
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | |
listingMapId |
yes | int | |
isAirbnbLOSActive |
yes | bool | Airbnb LOS active flag |
isBookingLOSActive |
yes | bool | Booking LOS active flag |
isVrboLOSActive |
yes | bool | Vrbo LOS active flag |
isExpediaLOSActive |
yes | bool | Expedia LOS active flag |
{
"status": "success",
"result": [
{
"listingMapId": 40270,
"isAirbnbLOSActive": 1,
"isBookingLOSActive": 0,
"isVrboLOSActive" : 1,
"isExpediaLOSActive": 0
}
]
}
Update Listing Price Settings
Update listing price settings by listing map ID
Request
curl --location --request PUT 'https://api.hostaway.com/v1/listing/pricingSettings/40270' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c' \
--header 'Content-type: application/json' \
--data-raw '{
"isAirbnbLOSActive": 1,
"isBookingLOSActive": 0,
"isVrboLOSActive" : 1,
"isExpediaLOSActive": 0
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.hostaway.com/v1/listing/pricingSettings/40270',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{
"isAirbnbLOSActive": 1,
"isBookingLOSActive": 0,
"isVrboLOSActive" : 1,
"isExpediaLOSActive": 0
}',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c',
'Content-type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var data = JSON.stringify({
"isAirbnbLOSActive": 1,
"isBookingLOSActive": 0,
"isVrboLOSActive" : 1,
"isExpediaLOSActive": 0
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("PUT", "https://api.hostaway.com/v1/listing/pricingSettings/40270");
xhr.setRequestHeader("Authorization", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c");
xhr.setRequestHeader("Content-type", "application/json");
xhr.send(data);
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"isAirbnbLOSActive": 1,\"isBookingLOSActive\": 0,\"isVrboLOSActive\" : 1,\"isExpediaLOSActive\": 0}");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/listing/pricingSettings/40270")
.method("PUT", body)
.addHeader("Authorization", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c")
.addHeader("Content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
import http.client
import json
conn = http.client.HTTPSConnection("api.hostaway.com")
payload = json.dumps({
"isAirbnbLOSActive": 1,
"isBookingLOSActive": 0,
"isVrboLOSActive" : 1,
"isExpediaLOSActive": 0
})
headers = {
'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImNhMmJhMjAyZGMwYzU0ZWZlYmVkNTJmZjhkNjZjNjZhODBjMmVhYmQ0ZDU4ODVmZmRmMGI1YjkzODBjN2I2MzU3ZTE2NDk4YTVmNTQyOWQ4IiwiaWF0IjoxNjkxNjUzNDc2LCJuYmYiOjE2OTE2NTM0NzYsImV4cCI6MTc1NDgxMTg3Niwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjF9.cr4vNqZ1WuR5IOY-SoVitOv8PBdhMnMrUp2WZx8E6Adet-9rYI3KB3wMzxjTShXp_63TGGKYsdmNQ6DQOuB4PbN8qH1jsacmwn0cY4ynxfLaG5n9bdJ5DxLHe8EGv-MD2HIM1-zrK1bMBYTx6idti0L2IK6S6xxJCHQ5fBfsuyc'',
'Content-type': 'application/json'
}
conn.request("PUT", "/v1/listing/pricingSettings/40270", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
PUT https://api.hostaway.com/v1/listing/pricingSettings/{listingId}
Response
The updated listing price settings object or error response.
ListingUnits
ListingUnit object
{
"id": 1,
"name": "Apartment",
"ground": "2",
"unitNumber": "234",
"listingMapIdUnit": "2"
}
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | |
name |
yes | string | ListingUnit name |
ground |
no | string | Ground |
unitNumber |
no | string | Number of unit e.g. room number 234 |
listingMapIdUnit |
no | int | Related ListingMap object (only if this listingUnit is connected to Hostaway ListingMap object) |
Retrieve a listingUnits list for the listingMap
Request
curl -X GET \
https://api.hostaway.com/v1/listingUnits/1 \
-H 'Cache-control: no-cache' \
-H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIiwiaWF0IjoxNTI2NjQ0MzE0LCJuYmYiOjE1MjY2NDQzMTQsImV4cCI6MTU0MjE5NjMxNCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.hVv1ybL5Ifl6VatEBXxJz4sNa7f2RPGlSGCK5YNiSDNBeW9FjgfzbKFW4GaKGXNBYk2b7TpxhwF_3RbBRE0Y817TIiwUNZEhMCz5do4Kp9ZX6nrHlvJiqdLYZXhaHUlU8vq-80a0xTmgVnjRH20JeA0q9t8gxcfYJUQfQMOb59Q'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/listingUnits/1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Cache-control: no-cache",
"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIiwiaWF0IjoxNTI2NjQ0MzE0LCJuYmYiOjE1MjY2NDQzMTQsImV4cCI6MTU0MjE5NjMxNCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.hVv1ybL5Ifl6VatEBXxJz4sNa7f2RPGlSGCK5YNiSDNBeW9FjgfzbKFW4GaKGXNBYk2b7TpxhwF_3RbBRE0Y817TIiwUNZEhMCz5do4Kp9ZX6nrHlvJiqdLYZXhaHUlU8vq-80a0xTmgVnjRH20JeA0q9t8gxcfYJUQfQMOb59Q"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.hostaway.com/v1/listingUnits/1");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIiwiaWF0IjoxNTI2NjQ0MzE0LCJuYmYiOjE1MjY2NDQzMTQsImV4cCI6MTU0MjE5NjMxNCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.hVv1ybL5Ifl6VatEBXxJz4sNa7f2RPGlSGCK5YNiSDNBeW9FjgfzbKFW4GaKGXNBYk2b7TpxhwF_3RbBRE0Y817TIiwUNZEhMCz5do4Kp9ZX6nrHlvJiqdLYZXhaHUlU8vq-80a0xTmgVnjRH20JeA0q9t8gxcfYJUQfQMOb59Q");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send(data);
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/listingUnits/1")
.get()
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIiwiaWF0IjoxNTI2NjQ0MzE0LCJuYmYiOjE1MjY2NDQzMTQsImV4cCI6MTU0MjE5NjMxNCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.hVv1ybL5Ifl6VatEBXxJz4sNa7f2RPGlSGCK5YNiSDNBeW9FjgfzbKFW4GaKGXNBYk2b7TpxhwF_3RbBRE0Y817TIiwUNZEhMCz5do4Kp9ZX6nrHlvJiqdLYZXhaHUlU8vq-80a0xTmgVnjRH20JeA0q9t8gxcfYJUQfQMOb59Q")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import requests
url = "https://api.hostaway.com/v1/listingUnits/1"
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIiwiaWF0IjoxNTI2NjQ0MzE0LCJuYmYiOjE1MjY2NDQzMTQsImV4cCI6MTU0MjE5NjMxNCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.hVv1ybL5Ifl6VatEBXxJz4sNa7f2RPGlSGCK5YNiSDNBeW9FjgfzbKFW4GaKGXNBYk2b7TpxhwF_3RbBRE0Y817TIiwUNZEhMCz5do4Kp9ZX6nrHlvJiqdLYZXhaHUlU8vq-80a0xTmgVnjRH20JeA0q9t8gxcfYJUQfQMOb59Q",
'Cache-control': "no-cache",
}
response = requests.request("GET", url, headers=headers)
print(response.text)
GET https://api.hostaway.com/v1/listingUnits/{listingMapId}
Response
Array of listingUnits objects.
Cancellation policies
The cancellation policies in this endpoint are the ones used in direct channel bookings. For the cancellation policy that applies to OTAs, please refer to the listing object > cancellationPolicy property.
Cancellation policy object
{
"id": 2,
"accountId": 1,
"name": "Flexible",
"cancellationPolicyItem": [
{
"id": "1",
"cancellationPolicyId": "2",
"refundAmount": "100",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-1209600",
"event": "arrival"
},
{
"id": "2",
"cancellationPolicyId": "2",
"refundAmount": "50",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-604800",
"event": "arrival"
}
]
}
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | Identifier of cancellation policy object |
accountId |
yes | int | Identifier of account object |
name |
yes | string | Cancellation policy name |
cancellationPolicyItem |
yes | object | Cancellation policy items (please check cancellation policy item object) |
Cancellation policy item object
{
"id": "1",
"cancellationPolicyId": "2",
"refundAmount": "100",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-1209600",
"event": "arrival"
}
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | Identifier of cancellation policy item object |
cancellationPolicyId |
yes | int | Identifier of related cancellation policy object |
refundAmount |
yes | int | Refund amount |
refundType |
yes | string | possible values: percentage, flat |
refundField |
yes | string | possible values: totalPrice |
timeDelta |
yes | int | time delta in seconds of event type (negative or positive) (please check event value) |
event |
yes | string | possible values: reservation, arrival |
Retrieve cancellation policies
Get cancellation policies list
Request
curl --request GET \
--url https://api.hostaway.com/v1/cancellationPolicies \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiZjg1M2FkNzU4YjI1M2Y0ZmFhZjk2MjIxODcyMDIzMDYyNjg2MjVhMjU2MTRkOWM1NTllYzM4ODJmZDVmZjYxYzNhNzY1NjI3NzUyZjE4ZTkiLCJpYXQiOjE2MTk1OTQ3MDgsIm5iZiI6MTYxOTU5NDcwOCwiZXhwIjoxNjgyNjY2NzA4LCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6MX0.pOQxtj9ur2GTBtLHnDyFdNkXGLQKxPR6kA2z6-eVv_GsCmb1-kWh1FPD3SY-ADVYwbsna_QrT0mRU4_wZNwC7WO3s9LUFUDwkGaQOMDvJO4nWZodvNZZuhAY96QzOZ7JBwpW_NlYk5mQ_WVPvbYr9RRpw-nUB8JDXOwbrph4nuw' \
--header 'Cache-control: no-cache'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/cancellationPolicies",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiZjg1M2FkNzU4YjI1M2Y0ZmFhZjk2MjIxODcyMDIzMDYyNjg2MjVhMjU2MTRkOWM1NTllYzM4ODJmZDVmZjYxYzNhNzY1NjI3NzUyZjE4ZTkiLCJpYXQiOjE2MTk1OTQ3MDgsIm5iZiI6MTYxOTU5NDcwOCwiZXhwIjoxNjgyNjY2NzA4LCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6MX0.pOQxtj9ur2GTBtLHnDyFdNkXGLQKxPR6kA2z6-eVv_GsCmb1-kWh1FPD3SY-ADVYwbsna_QrT0mRU4_wZNwC7WO3s9LUFUDwkGaQOMDvJO4nWZodvNZZuhAY96QzOZ7JBwpW_NlYk5mQ_WVPvbYr9RRpw-nUB8JDXOwbrph4nuw",
"Cache-control: no-cache"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.hostaway.com/v1/cancellationPolicies");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiZjg1M2FkNzU4YjI1M2Y0ZmFhZjk2MjIxODcyMDIzMDYyNjg2MjVhMjU2MTRkOWM1NTllYzM4ODJmZDVmZjYxYzNhNzY1NjI3NzUyZjE4ZTkiLCJpYXQiOjE2MTk1OTQ3MDgsIm5iZiI6MTYxOTU5NDcwOCwiZXhwIjoxNjgyNjY2NzA4LCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6MX0.pOQxtj9ur2GTBtLHnDyFdNkXGLQKxPR6kA2z6-eVv_GsCmb1-kWh1FPD3SY-ADVYwbsna_QrT0mRU4_wZNwC7WO3s9LUFUDwkGaQOMDvJO4nWZodvNZZuhAY96QzOZ7JBwpW_NlYk5mQ_WVPvbYr9RRpw-nUB8JDXOwbrph4nuw");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send(data);
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/cancellationPolicies")
.get()
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiZjg1M2FkNzU4YjI1M2Y0ZmFhZjk2MjIxODcyMDIzMDYyNjg2MjVhMjU2MTRkOWM1NTllYzM4ODJmZDVmZjYxYzNhNzY1NjI3NzUyZjE4ZTkiLCJpYXQiOjE2MTk1OTQ3MDgsIm5iZiI6MTYxOTU5NDcwOCwiZXhwIjoxNjgyNjY2NzA4LCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6MX0.pOQxtj9ur2GTBtLHnDyFdNkXGLQKxPR6kA2z6-eVv_GsCmb1-kWh1FPD3SY-ADVYwbsna_QrT0mRU4_wZNwC7WO3s9LUFUDwkGaQOMDvJO4nWZodvNZZuhAY96QzOZ7JBwpW_NlYk5mQ_WVPvbYr9RRpw-nUB8JDXOwbrph4nuw")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import requests
url = "https://api.hostaway.com/v1/cancellationPolicies"
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiZjg1M2FkNzU4YjI1M2Y0ZmFhZjk2MjIxODcyMDIzMDYyNjg2MjVhMjU2MTRkOWM1NTllYzM4ODJmZDVmZjYxYzNhNzY1NjI3NzUyZjE4ZTkiLCJpYXQiOjE2MTk1OTQ3MDgsIm5iZiI6MTYxOTU5NDcwOCwiZXhwIjoxNjgyNjY2NzA4LCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6MX0.pOQxtj9ur2GTBtLHnDyFdNkXGLQKxPR6kA2z6-eVv_GsCmb1-kWh1FPD3SY-ADVYwbsna_QrT0mRU4_wZNwC7WO3s9LUFUDwkGaQOMDvJO4nWZodvNZZuhAY96QzOZ7JBwpW_NlYk5mQ_WVPvbYr9RRpw-nUB8JDXOwbrph4nuw",
'Cache-control': "no-cache"
}
response = requests.request("GET", url, headers=headers)
print(response.text)
GET https://api.hostaway.com/v1/cancellationPolicies
Response
{
"status": "success",
"result": [
{
"id": 2,
"accountId": 1,
"name": "Flexible",
"cancellationPolicyItem": [
{
"id": "1",
"cancellationPolicyId": "2",
"refundAmount": "100",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-1209600",
"event": "arrival"
},
{
"id": "2",
"cancellationPolicyId": "2",
"refundAmount": "50",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-604800",
"event": "arrival"
}
]
},
{
"id": 3,
"accountId": 1,
"name": "Firm",
"cancellationPolicyItem": [
{
"id": "3",
"cancellationPolicyId": "3",
"refundAmount": "100",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-2592000",
"event": "arrival"
},
{
"id": "4",
"cancellationPolicyId": "3",
"refundAmount": "50",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-1209600",
"event": "arrival"
}
]
},
{
"id": 4,
"accountId": 1,
"name": "Moderate",
"cancellationPolicyItem": [
{
"id": "5",
"cancellationPolicyId": "4",
"refundAmount": "100",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-5184000",
"event": "arrival"
},
{
"id": "6",
"cancellationPolicyId": "4",
"refundAmount": "50",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-2592000",
"event": "arrival"
}
]
},
{
"id": 5,
"accountId": 1,
"name": "Strict",
"cancellationPolicyItem": [
{
"id": "7",
"cancellationPolicyId": "5",
"refundAmount": "100",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-5184000",
"event": "arrival"
}
]
}
]
}
Retrieve Airbnb cancellation policies
Get Airbnb cancellation policies list, object id
can be used as listing.airBnbCancellationPolicyId
Request
curl --request GET \
--url https://api.hostaway.com/v1/cancellationPolicies/airbnb \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiZjg1M2FkNzU4YjI1M2Y0ZmFhZjk2MjIxODcyMDIzMDYyNjg2MjVhMjU2MTRkOWM1NTllYzM4ODJmZDVmZjYxYzNhNzY1NjI3NzUyZjE4ZTkiLCJpYXQiOjE2MTk1OTQ3MDgsIm5iZiI6MTYxOTU5NDcwOCwiZXhwIjoxNjgyNjY2NzA4LCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6MX0.pOQxtj9ur2GTBtLHnDyFdNkXGLQKxPR6kA2z6-eVv_GsCmb1-kWh1FPD3SY-ADVYwbsna_QrT0mRU4_wZNwC7WO3s9LUFUDwkGaQOMDvJO4nWZodvNZZuhAY96QzOZ7JBwpW_NlYk5mQ_WVPvbYr9RRpw-nUB8JDXOwbrph4nuw' \
--header 'Cache-control: no-cache'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/cancellationPolicies/airbnb",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiZjg1M2FkNzU4YjI1M2Y0ZmFhZjk2MjIxODcyMDIzMDYyNjg2MjVhMjU2MTRkOWM1NTllYzM4ODJmZDVmZjYxYzNhNzY1NjI3NzUyZjE4ZTkiLCJpYXQiOjE2MTk1OTQ3MDgsIm5iZiI6MTYxOTU5NDcwOCwiZXhwIjoxNjgyNjY2NzA4LCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6MX0.pOQxtj9ur2GTBtLHnDyFdNkXGLQKxPR6kA2z6-eVv_GsCmb1-kWh1FPD3SY-ADVYwbsna_QrT0mRU4_wZNwC7WO3s9LUFUDwkGaQOMDvJO4nWZodvNZZuhAY96QzOZ7JBwpW_NlYk5mQ_WVPvbYr9RRpw-nUB8JDXOwbrph4nuw",
"Cache-control: no-cache"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.hostaway.com/v1/cancellationPolicies/airbnb");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiZjg1M2FkNzU4YjI1M2Y0ZmFhZjk2MjIxODcyMDIzMDYyNjg2MjVhMjU2MTRkOWM1NTllYzM4ODJmZDVmZjYxYzNhNzY1NjI3NzUyZjE4ZTkiLCJpYXQiOjE2MTk1OTQ3MDgsIm5iZiI6MTYxOTU5NDcwOCwiZXhwIjoxNjgyNjY2NzA4LCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6MX0.pOQxtj9ur2GTBtLHnDyFdNkXGLQKxPR6kA2z6-eVv_GsCmb1-kWh1FPD3SY-ADVYwbsna_QrT0mRU4_wZNwC7WO3s9LUFUDwkGaQOMDvJO4nWZodvNZZuhAY96QzOZ7JBwpW_NlYk5mQ_WVPvbYr9RRpw-nUB8JDXOwbrph4nuw");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send(data);
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/cancellationPolicies/airbnb")
.get()
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiZjg1M2FkNzU4YjI1M2Y0ZmFhZjk2MjIxODcyMDIzMDYyNjg2MjVhMjU2MTRkOWM1NTllYzM4ODJmZDVmZjYxYzNhNzY1NjI3NzUyZjE4ZTkiLCJpYXQiOjE2MTk1OTQ3MDgsIm5iZiI6MTYxOTU5NDcwOCwiZXhwIjoxNjgyNjY2NzA4LCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6MX0.pOQxtj9ur2GTBtLHnDyFdNkXGLQKxPR6kA2z6-eVv_GsCmb1-kWh1FPD3SY-ADVYwbsna_QrT0mRU4_wZNwC7WO3s9LUFUDwkGaQOMDvJO4nWZodvNZZuhAY96QzOZ7JBwpW_NlYk5mQ_WVPvbYr9RRpw-nUB8JDXOwbrph4nuw")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import requests
url = "https://api.hostaway.com/v1/cancellationPolicies/airbnb"
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiZjg1M2FkNzU4YjI1M2Y0ZmFhZjk2MjIxODcyMDIzMDYyNjg2MjVhMjU2MTRkOWM1NTllYzM4ODJmZDVmZjYxYzNhNzY1NjI3NzUyZjE4ZTkiLCJpYXQiOjE2MTk1OTQ3MDgsIm5iZiI6MTYxOTU5NDcwOCwiZXhwIjoxNjgyNjY2NzA4LCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6MX0.pOQxtj9ur2GTBtLHnDyFdNkXGLQKxPR6kA2z6-eVv_GsCmb1-kWh1FPD3SY-ADVYwbsna_QrT0mRU4_wZNwC7WO3s9LUFUDwkGaQOMDvJO4nWZodvNZZuhAY96QzOZ7JBwpW_NlYk5mQ_WVPvbYr9RRpw-nUB8JDXOwbrph4nuw",
'Cache-control': "no-cache"
}
response = requests.request("GET", url, headers=headers)
print(response.text)
GET https://api.hostaway.com/v1/cancellationPolicies/airbnb
Response
{
"status": "success",
"result": [
{
"id": 2,
"accountId": 1,
"name": "Flexible",
"cancellationPolicyItem": [
{
"id": "1",
"cancellationPolicyId": "2",
"refundAmount": "100",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-1209600",
"event": "arrival"
},
{
"id": "2",
"cancellationPolicyId": "2",
"refundAmount": "50",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-604800",
"event": "arrival"
}
]
},
{
"id": 3,
"accountId": 1,
"name": "Firm",
"cancellationPolicyItem": [
{
"id": "3",
"cancellationPolicyId": "3",
"refundAmount": "100",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-2592000",
"event": "arrival"
},
{
"id": "4",
"cancellationPolicyId": "3",
"refundAmount": "50",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-1209600",
"event": "arrival"
}
]
},
{
"id": 4,
"accountId": 1,
"name": "Moderate",
"cancellationPolicyItem": [
{
"id": "5",
"cancellationPolicyId": "4",
"refundAmount": "100",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-5184000",
"event": "arrival"
},
{
"id": "6",
"cancellationPolicyId": "4",
"refundAmount": "50",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-2592000",
"event": "arrival"
}
]
},
{
"id": 5,
"accountId": 1,
"name": "Strict",
"cancellationPolicyItem": [
{
"id": "7",
"cancellationPolicyId": "5",
"refundAmount": "100",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-5184000",
"event": "arrival"
}
]
}
]
}
Retrieve Booking.com cancellation policies
Get Booking cancellation policies list, object id
can be used as listing.bookingCancellationPolicyId
Request
curl --request GET \
--url https://api.hostaway.com/v1/cancellationPolicies/booking \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiZjg1M2FkNzU4YjI1M2Y0ZmFhZjk2MjIxODcyMDIzMDYyNjg2MjVhMjU2MTRkOWM1NTllYzM4ODJmZDVmZjYxYzNhNzY1NjI3NzUyZjE4ZTkiLCJpYXQiOjE2MTk1OTQ3MDgsIm5iZiI6MTYxOTU5NDcwOCwiZXhwIjoxNjgyNjY2NzA4LCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6MX0.pOQxtj9ur2GTBtLHnDyFdNkXGLQKxPR6kA2z6-eVv_GsCmb1-kWh1FPD3SY-ADVYwbsna_QrT0mRU4_wZNwC7WO3s9LUFUDwkGaQOMDvJO4nWZodvNZZuhAY96QzOZ7JBwpW_NlYk5mQ_WVPvbYr9RRpw-nUB8JDXOwbrph4nuw' \
--header 'Cache-control: no-cache'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/cancellationPolicies/booking",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiZjg1M2FkNzU4YjI1M2Y0ZmFhZjk2MjIxODcyMDIzMDYyNjg2MjVhMjU2MTRkOWM1NTllYzM4ODJmZDVmZjYxYzNhNzY1NjI3NzUyZjE4ZTkiLCJpYXQiOjE2MTk1OTQ3MDgsIm5iZiI6MTYxOTU5NDcwOCwiZXhwIjoxNjgyNjY2NzA4LCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6MX0.pOQxtj9ur2GTBtLHnDyFdNkXGLQKxPR6kA2z6-eVv_GsCmb1-kWh1FPD3SY-ADVYwbsna_QrT0mRU4_wZNwC7WO3s9LUFUDwkGaQOMDvJO4nWZodvNZZuhAY96QzOZ7JBwpW_NlYk5mQ_WVPvbYr9RRpw-nUB8JDXOwbrph4nuw",
"Cache-control: no-cache"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.hostaway.com/v1/cancellationPolicies/booking");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiZjg1M2FkNzU4YjI1M2Y0ZmFhZjk2MjIxODcyMDIzMDYyNjg2MjVhMjU2MTRkOWM1NTllYzM4ODJmZDVmZjYxYzNhNzY1NjI3NzUyZjE4ZTkiLCJpYXQiOjE2MTk1OTQ3MDgsIm5iZiI6MTYxOTU5NDcwOCwiZXhwIjoxNjgyNjY2NzA4LCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6MX0.pOQxtj9ur2GTBtLHnDyFdNkXGLQKxPR6kA2z6-eVv_GsCmb1-kWh1FPD3SY-ADVYwbsna_QrT0mRU4_wZNwC7WO3s9LUFUDwkGaQOMDvJO4nWZodvNZZuhAY96QzOZ7JBwpW_NlYk5mQ_WVPvbYr9RRpw-nUB8JDXOwbrph4nuw");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send(data);
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/cancellationPolicies/booking")
.get()
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiZjg1M2FkNzU4YjI1M2Y0ZmFhZjk2MjIxODcyMDIzMDYyNjg2MjVhMjU2MTRkOWM1NTllYzM4ODJmZDVmZjYxYzNhNzY1NjI3NzUyZjE4ZTkiLCJpYXQiOjE2MTk1OTQ3MDgsIm5iZiI6MTYxOTU5NDcwOCwiZXhwIjoxNjgyNjY2NzA4LCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6MX0.pOQxtj9ur2GTBtLHnDyFdNkXGLQKxPR6kA2z6-eVv_GsCmb1-kWh1FPD3SY-ADVYwbsna_QrT0mRU4_wZNwC7WO3s9LUFUDwkGaQOMDvJO4nWZodvNZZuhAY96QzOZ7JBwpW_NlYk5mQ_WVPvbYr9RRpw-nUB8JDXOwbrph4nuw")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import requests
url = "https://api.hostaway.com/v1/cancellationPolicies/booking"
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiZjg1M2FkNzU4YjI1M2Y0ZmFhZjk2MjIxODcyMDIzMDYyNjg2MjVhMjU2MTRkOWM1NTllYzM4ODJmZDVmZjYxYzNhNzY1NjI3NzUyZjE4ZTkiLCJpYXQiOjE2MTk1OTQ3MDgsIm5iZiI6MTYxOTU5NDcwOCwiZXhwIjoxNjgyNjY2NzA4LCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6MX0.pOQxtj9ur2GTBtLHnDyFdNkXGLQKxPR6kA2z6-eVv_GsCmb1-kWh1FPD3SY-ADVYwbsna_QrT0mRU4_wZNwC7WO3s9LUFUDwkGaQOMDvJO4nWZodvNZZuhAY96QzOZ7JBwpW_NlYk5mQ_WVPvbYr9RRpw-nUB8JDXOwbrph4nuw",
'Cache-control': "no-cache"
}
response = requests.request("GET", url, headers=headers)
print(response.text)
GET https://api.hostaway.com/v1/cancellationPolicies/booking
Response
{
"status": "success",
"result": [
{
"id": 2,
"accountId": 1,
"name": "Flexible",
"cancellationPolicyItem": [
{
"id": "1",
"cancellationPolicyId": "2",
"refundAmount": "100",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-1209600",
"event": "arrival"
},
{
"id": "2",
"cancellationPolicyId": "2",
"refundAmount": "50",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-604800",
"event": "arrival"
}
]
},
{
"id": 3,
"accountId": 1,
"name": "Firm",
"cancellationPolicyItem": [
{
"id": "3",
"cancellationPolicyId": "3",
"refundAmount": "100",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-2592000",
"event": "arrival"
},
{
"id": "4",
"cancellationPolicyId": "3",
"refundAmount": "50",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-1209600",
"event": "arrival"
}
]
},
{
"id": 4,
"accountId": 1,
"name": "Moderate",
"cancellationPolicyItem": [
{
"id": "5",
"cancellationPolicyId": "4",
"refundAmount": "100",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-5184000",
"event": "arrival"
},
{
"id": "6",
"cancellationPolicyId": "4",
"refundAmount": "50",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-2592000",
"event": "arrival"
}
]
},
{
"id": 5,
"accountId": 1,
"name": "Strict",
"cancellationPolicyItem": [
{
"id": "7",
"cancellationPolicyId": "5",
"refundAmount": "100",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-5184000",
"event": "arrival"
}
]
}
]
}
Retrieve Marriott cancellation policies
Get Marriott cancellation policies list, object id
can be used as listing.marriottCancellationPolicyId
Request
curl --request GET \
--url https://api.hostaway.com/v1/cancellationPolicies/marriott \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiZjg1M2FkNzU4YjI1M2Y0ZmFhZjk2MjIxODcyMDIzMDYyNjg2MjVhMjU2MTRkOWM1NTllYzM4ODJmZDVmZjYxYzNhNzY1NjI3NzUyZjE4ZTkiLCJpYXQiOjE2MTk1OTQ3MDgsIm5iZiI6MTYxOTU5NDcwOCwiZXhwIjoxNjgyNjY2NzA4LCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6MX0.pOQxtj9ur2GTBtLHnDyFdNkXGLQKxPR6kA2z6-eVv_GsCmb1-kWh1FPD3SY-ADVYwbsna_QrT0mRU4_wZNwC7WO3s9LUFUDwkGaQOMDvJO4nWZodvNZZuhAY96QzOZ7JBwpW_NlYk5mQ_WVPvbYr9RRpw-nUB8JDXOwbrph4nuw' \
--header 'Cache-control: no-cache'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/cancellationPolicies/marriott",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiZjg1M2FkNzU4YjI1M2Y0ZmFhZjk2MjIxODcyMDIzMDYyNjg2MjVhMjU2MTRkOWM1NTllYzM4ODJmZDVmZjYxYzNhNzY1NjI3NzUyZjE4ZTkiLCJpYXQiOjE2MTk1OTQ3MDgsIm5iZiI6MTYxOTU5NDcwOCwiZXhwIjoxNjgyNjY2NzA4LCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6MX0.pOQxtj9ur2GTBtLHnDyFdNkXGLQKxPR6kA2z6-eVv_GsCmb1-kWh1FPD3SY-ADVYwbsna_QrT0mRU4_wZNwC7WO3s9LUFUDwkGaQOMDvJO4nWZodvNZZuhAY96QzOZ7JBwpW_NlYk5mQ_WVPvbYr9RRpw-nUB8JDXOwbrph4nuw",
"Cache-control: no-cache"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.hostaway.com/v1/cancellationPolicies/marriott");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiZjg1M2FkNzU4YjI1M2Y0ZmFhZjk2MjIxODcyMDIzMDYyNjg2MjVhMjU2MTRkOWM1NTllYzM4ODJmZDVmZjYxYzNhNzY1NjI3NzUyZjE4ZTkiLCJpYXQiOjE2MTk1OTQ3MDgsIm5iZiI6MTYxOTU5NDcwOCwiZXhwIjoxNjgyNjY2NzA4LCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6MX0.pOQxtj9ur2GTBtLHnDyFdNkXGLQKxPR6kA2z6-eVv_GsCmb1-kWh1FPD3SY-ADVYwbsna_QrT0mRU4_wZNwC7WO3s9LUFUDwkGaQOMDvJO4nWZodvNZZuhAY96QzOZ7JBwpW_NlYk5mQ_WVPvbYr9RRpw-nUB8JDXOwbrph4nuw");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send(data);
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/cancellationPolicies/marriott")
.get()
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiZjg1M2FkNzU4YjI1M2Y0ZmFhZjk2MjIxODcyMDIzMDYyNjg2MjVhMjU2MTRkOWM1NTllYzM4ODJmZDVmZjYxYzNhNzY1NjI3NzUyZjE4ZTkiLCJpYXQiOjE2MTk1OTQ3MDgsIm5iZiI6MTYxOTU5NDcwOCwiZXhwIjoxNjgyNjY2NzA4LCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6MX0.pOQxtj9ur2GTBtLHnDyFdNkXGLQKxPR6kA2z6-eVv_GsCmb1-kWh1FPD3SY-ADVYwbsna_QrT0mRU4_wZNwC7WO3s9LUFUDwkGaQOMDvJO4nWZodvNZZuhAY96QzOZ7JBwpW_NlYk5mQ_WVPvbYr9RRpw-nUB8JDXOwbrph4nuw")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import requests
url = "https://api.hostaway.com/v1/cancellationPolicies/marriott"
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiZjg1M2FkNzU4YjI1M2Y0ZmFhZjk2MjIxODcyMDIzMDYyNjg2MjVhMjU2MTRkOWM1NTllYzM4ODJmZDVmZjYxYzNhNzY1NjI3NzUyZjE4ZTkiLCJpYXQiOjE2MTk1OTQ3MDgsIm5iZiI6MTYxOTU5NDcwOCwiZXhwIjoxNjgyNjY2NzA4LCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6MX0.pOQxtj9ur2GTBtLHnDyFdNkXGLQKxPR6kA2z6-eVv_GsCmb1-kWh1FPD3SY-ADVYwbsna_QrT0mRU4_wZNwC7WO3s9LUFUDwkGaQOMDvJO4nWZodvNZZuhAY96QzOZ7JBwpW_NlYk5mQ_WVPvbYr9RRpw-nUB8JDXOwbrph4nuw",
'Cache-control': "no-cache"
}
response = requests.request("GET", url, headers=headers)
print(response.text)
GET https://api.hostaway.com/v1/cancellationPolicies/marriott
Response
{
"status": "success",
"result": [
{
"id": 2,
"accountId": 1,
"name": "Flexible",
"cancellationPolicyItem": [
{
"id": "1",
"cancellationPolicyId": "2",
"refundAmount": "100",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-1209600",
"event": "arrival"
},
{
"id": "2",
"cancellationPolicyId": "2",
"refundAmount": "50",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-604800",
"event": "arrival"
}
]
},
{
"id": 3,
"accountId": 1,
"name": "Firm",
"cancellationPolicyItem": [
{
"id": "3",
"cancellationPolicyId": "3",
"refundAmount": "100",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-2592000",
"event": "arrival"
},
{
"id": "4",
"cancellationPolicyId": "3",
"refundAmount": "50",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-1209600",
"event": "arrival"
}
]
},
{
"id": 4,
"accountId": 1,
"name": "Moderate",
"cancellationPolicyItem": [
{
"id": "5",
"cancellationPolicyId": "4",
"refundAmount": "100",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-5184000",
"event": "arrival"
},
{
"id": "6",
"cancellationPolicyId": "4",
"refundAmount": "50",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-2592000",
"event": "arrival"
}
]
},
{
"id": 5,
"accountId": 1,
"name": "Strict",
"cancellationPolicyItem": [
{
"id": "7",
"cancellationPolicyId": "5",
"refundAmount": "100",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-5184000",
"event": "arrival"
}
]
}
]
}
Retrieve VRBO cancellation policies
Get VRBO cancellation policies list, object id
can be used as listing.vrboCancellationPolicyId
Request
curl --request GET \
--url https://api.hostaway.com/v1/cancellationPolicies/vrbo \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiZjg1M2FkNzU4YjI1M2Y0ZmFhZjk2MjIxODcyMDIzMDYyNjg2MjVhMjU2MTRkOWM1NTllYzM4ODJmZDVmZjYxYzNhNzY1NjI3NzUyZjE4ZTkiLCJpYXQiOjE2MTk1OTQ3MDgsIm5iZiI6MTYxOTU5NDcwOCwiZXhwIjoxNjgyNjY2NzA4LCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6MX0.pOQxtj9ur2GTBtLHnDyFdNkXGLQKxPR6kA2z6-eVv_GsCmb1-kWh1FPD3SY-ADVYwbsna_QrT0mRU4_wZNwC7WO3s9LUFUDwkGaQOMDvJO4nWZodvNZZuhAY96QzOZ7JBwpW_NlYk5mQ_WVPvbYr9RRpw-nUB8JDXOwbrph4nuw' \
--header 'Cache-control: no-cache'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/cancellationPolicies/vrbo",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiZjg1M2FkNzU4YjI1M2Y0ZmFhZjk2MjIxODcyMDIzMDYyNjg2MjVhMjU2MTRkOWM1NTllYzM4ODJmZDVmZjYxYzNhNzY1NjI3NzUyZjE4ZTkiLCJpYXQiOjE2MTk1OTQ3MDgsIm5iZiI6MTYxOTU5NDcwOCwiZXhwIjoxNjgyNjY2NzA4LCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6MX0.pOQxtj9ur2GTBtLHnDyFdNkXGLQKxPR6kA2z6-eVv_GsCmb1-kWh1FPD3SY-ADVYwbsna_QrT0mRU4_wZNwC7WO3s9LUFUDwkGaQOMDvJO4nWZodvNZZuhAY96QzOZ7JBwpW_NlYk5mQ_WVPvbYr9RRpw-nUB8JDXOwbrph4nuw",
"Cache-control: no-cache"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.hostaway.com/v1/cancellationPolicies/vrbo");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiZjg1M2FkNzU4YjI1M2Y0ZmFhZjk2MjIxODcyMDIzMDYyNjg2MjVhMjU2MTRkOWM1NTllYzM4ODJmZDVmZjYxYzNhNzY1NjI3NzUyZjE4ZTkiLCJpYXQiOjE2MTk1OTQ3MDgsIm5iZiI6MTYxOTU5NDcwOCwiZXhwIjoxNjgyNjY2NzA4LCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6MX0.pOQxtj9ur2GTBtLHnDyFdNkXGLQKxPR6kA2z6-eVv_GsCmb1-kWh1FPD3SY-ADVYwbsna_QrT0mRU4_wZNwC7WO3s9LUFUDwkGaQOMDvJO4nWZodvNZZuhAY96QzOZ7JBwpW_NlYk5mQ_WVPvbYr9RRpw-nUB8JDXOwbrph4nuw");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send(data);
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/cancellationPolicies/vrbo")
.get()
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiZjg1M2FkNzU4YjI1M2Y0ZmFhZjk2MjIxODcyMDIzMDYyNjg2MjVhMjU2MTRkOWM1NTllYzM4ODJmZDVmZjYxYzNhNzY1NjI3NzUyZjE4ZTkiLCJpYXQiOjE2MTk1OTQ3MDgsIm5iZiI6MTYxOTU5NDcwOCwiZXhwIjoxNjgyNjY2NzA4LCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6MX0.pOQxtj9ur2GTBtLHnDyFdNkXGLQKxPR6kA2z6-eVv_GsCmb1-kWh1FPD3SY-ADVYwbsna_QrT0mRU4_wZNwC7WO3s9LUFUDwkGaQOMDvJO4nWZodvNZZuhAY96QzOZ7JBwpW_NlYk5mQ_WVPvbYr9RRpw-nUB8JDXOwbrph4nuw")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import requests
url = "https://api.hostaway.com/v1/cancellationPolicies/vrbo"
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiZjg1M2FkNzU4YjI1M2Y0ZmFhZjk2MjIxODcyMDIzMDYyNjg2MjVhMjU2MTRkOWM1NTllYzM4ODJmZDVmZjYxYzNhNzY1NjI3NzUyZjE4ZTkiLCJpYXQiOjE2MTk1OTQ3MDgsIm5iZiI6MTYxOTU5NDcwOCwiZXhwIjoxNjgyNjY2NzA4LCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6MX0.pOQxtj9ur2GTBtLHnDyFdNkXGLQKxPR6kA2z6-eVv_GsCmb1-kWh1FPD3SY-ADVYwbsna_QrT0mRU4_wZNwC7WO3s9LUFUDwkGaQOMDvJO4nWZodvNZZuhAY96QzOZ7JBwpW_NlYk5mQ_WVPvbYr9RRpw-nUB8JDXOwbrph4nuw",
'Cache-control': "no-cache"
}
response = requests.request("GET", url, headers=headers)
print(response.text)
GET https://api.hostaway.com/v1/cancellationPolicies/vrbo
Response
{
"status": "success",
"result": [
{
"id": 2,
"accountId": 1,
"name": "Flexible",
"cancellationPolicyItem": [
{
"id": "1",
"cancellationPolicyId": "2",
"refundAmount": "100",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-1209600",
"event": "arrival"
},
{
"id": "2",
"cancellationPolicyId": "2",
"refundAmount": "50",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-604800",
"event": "arrival"
}
]
},
{
"id": 3,
"accountId": 1,
"name": "Firm",
"cancellationPolicyItem": [
{
"id": "3",
"cancellationPolicyId": "3",
"refundAmount": "100",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-2592000",
"event": "arrival"
},
{
"id": "4",
"cancellationPolicyId": "3",
"refundAmount": "50",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-1209600",
"event": "arrival"
}
]
},
{
"id": 4,
"accountId": 1,
"name": "Moderate",
"cancellationPolicyItem": [
{
"id": "5",
"cancellationPolicyId": "4",
"refundAmount": "100",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-5184000",
"event": "arrival"
},
{
"id": "6",
"cancellationPolicyId": "4",
"refundAmount": "50",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-2592000",
"event": "arrival"
}
]
},
{
"id": 5,
"accountId": 1,
"name": "Strict",
"cancellationPolicyItem": [
{
"id": "7",
"cancellationPolicyId": "5",
"refundAmount": "100",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-5184000",
"event": "arrival"
}
]
}
]
}
Create cancellation policy
Request
curl -X POST \
https://api.hostaway.com/v1/cancellationPolicies \
-H 'Cache-control: no-cache' \
-H 'Content-type: application/json' \
-H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0In0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0IiwiaWF0IjoxNTI4MjgzMjgwLCJuYmYiOjE1MjgyODMyODAsImV4cCI6MTU0MzgzNTI4MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.pzzHM2Qebad--FC8iwWZrFpblWQyiCKiroaEyrXKPWTXug3soe-62HK1bzZVlLQEJa166AtkevdEjXkOhQ6yRMJh3LlINrOKpLOSZKeTyMIydtYCdXJyWqgl3b3llAk8dZyQ8L8J_oyV9sRWMhy7MuIgAyFf1ITdVS2Z94KdyII' \
-d '{
"name": "New cancellation policy name",
"cancellationPolicyItem": [
{
"refundAmount": 30,
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": 3600,
"event": "reservation"
},
{
"refundAmount": 30,
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": 3600,
"event": "reservation"
},
{
"refundAmount": 30,
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": 3600,
"event": "reservation"
}
]
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/cancellationPolicies",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\n \"name\": \"Cancellation policies\",\n \"cancellationPolicyItem\": [\n {\n \"refundAmount\": 30,\n \"refundType\": \"percentage\",\n \"refundField\": \"totalPrice\",\n \"timeDelta\": 3600,\n \"event\": \"reservation\"\n },\n {\n \"refundAmount\": 30,\n \"refundType\": \"percentage\",\n \"refundField\": \"totalPrice\",\n \"timeDelta\": 3600,\n \"event\": \"reservation\"\n },\n {\n \"refundAmount\": 30,\n \"refundType\": \"percentage\",\n \"refundField\": \"totalPrice\",\n \"timeDelta\": 3600,\n \"event\": \"reservation\"\n }\n ]\n}\n",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiNjNhMWY4MzIwZTU5Zjc5YTJlNzMxNzBkYzU5MDk5MzdlNTU2NGVmNWQwOTgzNjk3N2ZjMjZiYmQ4MWJlYWFjNzI0OTk5Y2ZiZWQ1N2FiMmYiLCJpYXQiOjE2Mzc0ODc0ODYsIm5iZiI6MTYzNzQ4NzQ4NiwiZXhwIjoxNzAwNTU5NDg2LCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6Mn0.Mt3I5myc1G1aJ3Rls5JYGggFiNh3LH9I88AJYmucXjd3qeE-jICpg49eIvBHSv6KGGqzl-ApuV3_3j5pSIbHXjUYqmXvE6WeU-kcRMCnZ3V4yDQ4Zh_-m5kKCEn4gx4A_flWf4EhS7UJL24FPS3y5CWIQR2rvWJUPnMs_obV1s4",
"Postman-Token: f86ea419-a48d-403c-8beb-b89c0187ccf4",
"Cache-control: no-cache"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var data = JSON.stringify({
"name": "New cancellation policy name",
"cancellationPolicyItem": [
{
"refundAmount": 30,
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": 3600,
"event": "reservation"
},
{
"refundAmount": 30,
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": 3600,
"event": "reservation"
},
{
"refundAmount": 30,
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": 3600,
"event": "reservation"
}
]
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.hostaway.com/v1/cancellationPolicies");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0In0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0IiwiaWF0IjoxNTI4MjgzMjgwLCJuYmYiOjE1MjgyODMyODAsImV4cCI6MTU0MzgzNTI4MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.pzzHM2Qebad--FC8iwWZrFpblWQyiCKiroaEyrXKPWTXug3soe-62HK1bzZVlLQEJa166AtkevdEjXkOhQ6yRMJh3LlINrOKpLOSZKeTyMIydtYCdXJyWqgl3b3llAk8dZyQ8L8J_oyV9sRWMhy7MuIgAyFf1ITdVS2Z94KdyII");
xhr.setRequestHeader("Content-type", "application/json");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send(data);
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"name\": \"Cancellation policies\",\n \"cancellationPolicyItem\": [\n {\n \"refundAmount\": 30,\n \"refundType\": \"percentage\",\n \"refundField\": \"totalPrice\",\n \"timeDelta\": 3600,\n \"event\": \"reservation\"\n },\n {\n \"refundAmount\": 30,\n \"refundType\": \"percentage\",\n \"refundField\": \"totalPrice\",\n \"timeDelta\": 3600,\n \"event\": \"reservation\"\n },\n {\n \"refundAmount\": 30,\n \"refundType\": \"percentage\",\n \"refundField\": \"totalPrice\",\n \"timeDelta\": 3600,\n \"event\": \"reservation\"\n }\n ]\n}\n");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/cancellationPolicies")
.post(body)
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0In0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0IiwiaWF0IjoxNTI4MjgzMjgwLCJuYmYiOjE1MjgyODMyODAsImV4cCI6MTU0MzgzNTI4MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.pzzHM2Qebad--FC8iwWZrFpblWQyiCKiroaEyrXKPWTXug3soe-62HK1bzZVlLQEJa166AtkevdEjXkOhQ6yRMJh3LlINrOKpLOSZKeTyMIydtYCdXJyWqgl3b3llAk8dZyQ8L8J_oyV9sRWMhy7MuIgAyFf1ITdVS2Z94KdyII")
.addHeader("Content-type", "application/json")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import http.client
import json
conn = http.client.HTTPSConnection("api.hostaway.com")
payload_obj = {
"name": "Cancellation policies",
"cancellationPolicyItem": [
{
"refundAmount": 30,
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": 3600,
"event": "reservation"
},
{
"refundAmount": 30,
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": 3600,
"event": "reservation"
},
{
"refundAmount": 30,
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": 3600,
"event": "reservation"
}
]
}
payload_json = json.dumps(payload_obj)
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0In0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0IiwiaWF0IjoxNTI4MjgzMjgwLCJuYmYiOjE1MjgyODMyODAsImV4cCI6MTU0MzgzNTI4MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.pzzHM2Qebad--FC8iwWZrFpblWQyiCKiroaEyrXKPWTXug3soe-62HK1bzZVlLQEJa166AtkevdEjXkOhQ6yRMJh3LlINrOKpLOSZKeTyMIydtYCdXJyWqgl3b3llAk8dZyQ8L8J_oyV9sRWMhy7MuIgAyFf1ITdVS2Z94KdyII",
'Content-type': "application/json",
'Cache-control': "no-cache"
}
conn.request("POST", "v1/cancellationPolicies", payload_json, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
POST https://api.hostaway.com/v1/cancellationPolicies
Response
The created cancellation policy or error response.
Read cancellation policy
Read cancellation policy with cancellation policy items by ID
Request
curl --request GET \
--url https://api.hostaway.com/v1/cancellationPolicies/11 \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiZjg1M2FkNzU4YjI1M2Y0ZmFhZjk2MjIxODcyMDIzMDYyNjg2MjVhMjU2MTRkOWM1NTllYzM4ODJmZDVmZjYxYzNhNzY1NjI3NzUyZjE4ZTkiLCJpYXQiOjE2MTk1OTQ3MDgsIm5iZiI6MTYxOTU5NDcwOCwiZXhwIjoxNjgyNjY2NzA4LCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6MX0.pOQxtj9ur2GTBtLHnDyFdNkXGLQKxPR6kA2z6-eVv_GsCmb1-kWh1FPD3SY-ADVYwbsna_QrT0mRU4_wZNwC7WO3s9LUFUDwkGaQOMDvJO4nWZodvNZZuhAY96QzOZ7JBwpW_NlYk5mQ_WVPvbYr9RRpw-nUB8JDXOwbrph4nuw' \
--header 'Cache-control: no-cache'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/cancellationPolicies/11",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiZjg1M2FkNzU4YjI1M2Y0ZmFhZjk2MjIxODcyMDIzMDYyNjg2MjVhMjU2MTRkOWM1NTllYzM4ODJmZDVmZjYxYzNhNzY1NjI3NzUyZjE4ZTkiLCJpYXQiOjE2MTk1OTQ3MDgsIm5iZiI6MTYxOTU5NDcwOCwiZXhwIjoxNjgyNjY2NzA4LCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6MX0.pOQxtj9ur2GTBtLHnDyFdNkXGLQKxPR6kA2z6-eVv_GsCmb1-kWh1FPD3SY-ADVYwbsna_QrT0mRU4_wZNwC7WO3s9LUFUDwkGaQOMDvJO4nWZodvNZZuhAY96QzOZ7JBwpW_NlYk5mQ_WVPvbYr9RRpw-nUB8JDXOwbrph4nuw",
"Cache-control: no-cache"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.hostaway.com/v1/cancellationPolicies/11");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiZjg1M2FkNzU4YjI1M2Y0ZmFhZjk2MjIxODcyMDIzMDYyNjg2MjVhMjU2MTRkOWM1NTllYzM4ODJmZDVmZjYxYzNhNzY1NjI3NzUyZjE4ZTkiLCJpYXQiOjE2MTk1OTQ3MDgsIm5iZiI6MTYxOTU5NDcwOCwiZXhwIjoxNjgyNjY2NzA4LCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6MX0.pOQxtj9ur2GTBtLHnDyFdNkXGLQKxPR6kA2z6-eVv_GsCmb1-kWh1FPD3SY-ADVYwbsna_QrT0mRU4_wZNwC7WO3s9LUFUDwkGaQOMDvJO4nWZodvNZZuhAY96QzOZ7JBwpW_NlYk5mQ_WVPvbYr9RRpw-nUB8JDXOwbrph4nuw");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send(data);
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/cancellationPolicies/11")
.get()
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiZjg1M2FkNzU4YjI1M2Y0ZmFhZjk2MjIxODcyMDIzMDYyNjg2MjVhMjU2MTRkOWM1NTllYzM4ODJmZDVmZjYxYzNhNzY1NjI3NzUyZjE4ZTkiLCJpYXQiOjE2MTk1OTQ3MDgsIm5iZiI6MTYxOTU5NDcwOCwiZXhwIjoxNjgyNjY2NzA4LCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6MX0.pOQxtj9ur2GTBtLHnDyFdNkXGLQKxPR6kA2z6-eVv_GsCmb1-kWh1FPD3SY-ADVYwbsna_QrT0mRU4_wZNwC7WO3s9LUFUDwkGaQOMDvJO4nWZodvNZZuhAY96QzOZ7JBwpW_NlYk5mQ_WVPvbYr9RRpw-nUB8JDXOwbrph4nuw")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import requests
url = "https://api.hostaway.com/v1/cancellationPolicies/11"
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiZjg1M2FkNzU4YjI1M2Y0ZmFhZjk2MjIxODcyMDIzMDYyNjg2MjVhMjU2MTRkOWM1NTllYzM4ODJmZDVmZjYxYzNhNzY1NjI3NzUyZjE4ZTkiLCJpYXQiOjE2MTk1OTQ3MDgsIm5iZiI6MTYxOTU5NDcwOCwiZXhwIjoxNjgyNjY2NzA4LCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6MX0.pOQxtj9ur2GTBtLHnDyFdNkXGLQKxPR6kA2z6-eVv_GsCmb1-kWh1FPD3SY-ADVYwbsna_QrT0mRU4_wZNwC7WO3s9LUFUDwkGaQOMDvJO4nWZodvNZZuhAY96QzOZ7JBwpW_NlYk5mQ_WVPvbYr9RRpw-nUB8JDXOwbrph4nuw",
'Cache-control': "no-cache"
}
response = requests.request("GET", url, headers=headers)
print(response.text)
GET https://api.hostaway.com/v1/cancellationPolicies/11
Response
{
"status": "success",
"result": {
"id": 11,
"accountId": 1,
"name": "Flexible",
"cancellationPolicyItem": [
{
"id": "21",
"cancellationPolicyId": "2",
"refundAmount": "100",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-1209600",
"event": "arrival"
},
{
"id": "22",
"cancellationPolicyId": "2",
"refundAmount": "50",
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": "-604800",
"event": "arrival"
}
]
}
}
Update cancellation policy
Request
curl -X PUT \
https://api.hostaway.com/v1/cancellationPolicies/4015 \
-H 'Cache-control: no-cache' \
-H 'Content-type: application/json' \
-H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0In0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0IiwiaWF0IjoxNTI4MjgzMjgwLCJuYmYiOjE1MjgyODMyODAsImV4cCI6MTU0MzgzNTI4MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.pzzHM2Qebad--FC8iwWZrFpblWQyiCKiroaEyrXKPWTXug3soe-62HK1bzZVlLQEJa166AtkevdEjXkOhQ6yRMJh3LlINrOKpLOSZKeTyMIydtYCdXJyWqgl3b3llAk8dZyQ8L8J_oyV9sRWMhy7MuIgAyFf1ITdVS2Z94KdyII' \
-d '{
"name": "New name cancellation policy",
"cancellationPolicyItem": [
{
"refundAmount": 30,
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": 3600,
"event": "reservation"
},
{
"refundAmount": 30,
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": 3600,
"event": "reservation"
},
{
"refundAmount": 30,
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": 3600,
"event": "reservation"
}
]
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/cancellationPolicies/4015",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_PUTFIELDS => "{\n \"name\": \"Cancellation policies\",\n \"cancellationPolicyItem\": [\n {\n \"refundAmount\": 30,\n \"refundType\": \"percentage\",\n \"refundField\": \"totalPrice\",\n \"timeDelta\": 3600,\n \"event\": \"reservation\"\n },\n {\n \"refundAmount\": 30,\n \"refundType\": \"percentage\",\n \"refundField\": \"totalPrice\",\n \"timeDelta\": 3600,\n \"event\": \"reservation\"\n },\n {\n \"refundAmount\": 30,\n \"refundType\": \"percentage\",\n \"refundField\": \"totalPrice\",\n \"timeDelta\": 3600,\n \"event\": \"reservation\"\n }\n ]\n}\n",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiNjNhMWY4MzIwZTU5Zjc5YTJlNzMxNzBkYzU5MDk5MzdlNTU2NGVmNWQwOTgzNjk3N2ZjMjZiYmQ4MWJlYWFjNzI0OTk5Y2ZiZWQ1N2FiMmYiLCJpYXQiOjE2Mzc0ODc0ODYsIm5iZiI6MTYzNzQ4NzQ4NiwiZXhwIjoxNzAwNTU5NDg2LCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6Mn0.Mt3I5myc1G1aJ3Rls5JYGggFiNh3LH9I88AJYmucXjd3qeE-jICpg49eIvBHSv6KGGqzl-ApuV3_3j5pSIbHXjUYqmXvE6WeU-kcRMCnZ3V4yDQ4Zh_-m5kKCEn4gx4A_flWf4EhS7UJL24FPS3y5CWIQR2rvWJUPnMs_obV1s4",
"PUTman-Token: f86ea419-a48d-403c-8beb-b89c0187ccf4",
"Cache-control: no-cache"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var data = JSON.stringify({
"name": "New cancellation policy name",
"cancellationPolicyItem": [
{
"refundAmount": 30,
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": 3600,
"event": "reservation"
},
{
"refundAmount": 30,
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": 3600,
"event": "reservation"
},
{
"refundAmount": 30,
"refundType": "percentage",
"refundField": "totalPrice",
"timeDelta": 3600,
"event": "reservation"
}
]
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("PUT", "https://api.hostaway.com/v1/cancellationPolicies/4015");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0In0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0IiwiaWF0IjoxNTI4MjgzMjgwLCJuYmYiOjE1MjgyODMyODAsImV4cCI6MTU0MzgzNTI4MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.pzzHM2Qebad--FC8iwWZrFpblWQyiCKiroaEyrXKPWTXug3soe-62HK1bzZVlLQEJa166AtkevdEjXkOhQ6yRMJh3LlINrOKpLOSZKeTyMIydtYCdXJyWqgl3b3llAk8dZyQ8L8J_oyV9sRWMhy7MuIgAyFf1ITdVS2Z94KdyII");
xhr.setRequestHeader("Content-type", "application/json");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send(data);
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"name\": \"Cancellation policies\",\n \"cancellationPolicyItem\": [\n {\n \"refundAmount\": 30,\n \"refundType\": \"percentage\",\n \"refundField\": \"totalPrice\",\n \"timeDelta\": 3600,\n \"event\": \"reservation\"\n },\n {\n \"refundAmount\": 30,\n \"refundType\": \"percentage\",\n \"refundField\": \"totalPrice\",\n \"timeDelta\": 3600,\n \"event\": \"reservation\"\n },\n {\n \"refundAmount\": 30,\n \"refundType\": \"percentage\",\n \"refundField\": \"totalPrice\",\n \"timeDelta\": 3600,\n \"event\": \"reservation\"\n }\n ]\n}\n");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/cancellationPolicies/4015")
.PUT(body)
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0In0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0IiwiaWF0IjoxNTI4MjgzMjgwLCJuYmYiOjE1MjgyODMyODAsImV4cCI6MTU0MzgzNTI4MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.pzzHM2Qebad--FC8iwWZrFpblWQyiCKiroaEyrXKPWTXug3soe-62HK1bzZVlLQEJa166AtkevdEjXkOhQ6yRMJh3LlINrOKpLOSZKeTyMIydtYCdXJyWqgl3b3llAk8dZyQ8L8J_oyV9sRWMhy7MuIgAyFf1ITdVS2Z94KdyII")
.addHeader("Content-type", "application/json")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import http.client
conn = http.client.HTTPSConnection("api.hostaway.com")
payload = "{\n \"name\": \"Cancellation policies\",\n \"cancellationPolicyItem\": [\n {\n \"refundAmount\": 30,\n \"refundType\": \"percentage\",\n \"refundField\": \"totalPrice\",\n \"timeDelta\": 3600,\n \"event\": \"reservation\"\n },\n {\n \"refundAmount\": 30,\n \"refundType\": \"percentage\",\n \"refundField\": \"totalPrice\",\n \"timeDelta\": 3600,\n \"event\": \"reservation\"\n },\n {\n \"refundAmount\": 30,\n \"refundType\": \"percentage\",\n \"refundField\": \"totalPrice\",\n \"timeDelta\": 3600,\n \"event\": \"reservation\"\n }\n ]\n}\n"
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0In0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0IiwiaWF0IjoxNTI4MjgzMjgwLCJuYmYiOjE1MjgyODMyODAsImV4cCI6MTU0MzgzNTI4MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.pzzHM2Qebad--FC8iwWZrFpblWQyiCKiroaEyrXKPWTXug3soe-62HK1bzZVlLQEJa166AtkevdEjXkOhQ6yRMJh3LlINrOKpLOSZKeTyMIydtYCdXJyWqgl3b3llAk8dZyQ8L8J_oyV9sRWMhy7MuIgAyFf1ITdVS2Z94KdyII",
'Content-type': "application/json",
'Cache-control': "no-cache"
}
conn.request("PUT", "v1/cancellationPolicies/4015", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
PUT https://api.hostaway.com/v1/cancellationPolicies/4015
Response
The updated cancellation policy or error response.
Delete cancellation policy
Request
curl -X DELETE \
https://api.hostaway.com/v1/cancellationPolicies/4010 \
-H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIiwiaWF0IjoxNDk4NTc5NzQ0LCJuYmYiOjE0OTg1Nzk3NDQsImV4cCI6MTUxNDM5MDk0NCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.TsbJaDOZ0VlEF4vBg7mqLX8DxEuu5rjtsmqix1IbsEcR7F9cdx8F3dDq2zOc6mw8FNAfXT8xp1r5qKu2AYoxv4ublZhxxW0Y6uPSFs0jv5Fh5lliNBJAeQqFOChOVEbYzdbfH_6uu4HHSL31si1RvpVccAjA1Ap9vXlSg3DcPgw' \
-H 'Cache-control: no-cache' \
-H 'Content-type: application/json'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/cancellationPolicies/4010",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIiwiaWF0IjoxNDk4NTc5NzQ0LCJuYmYiOjE0OTg1Nzk3NDQsImV4cCI6MTUxNDM5MDk0NCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.TsbJaDOZ0VlEF4vBg7mqLX8DxEuu5rjtsmqix1IbsEcR7F9cdx8F3dDq2zOc6mw8FNAfXT8xp1r5qKu2AYoxv4ublZhxxW0Y6uPSFs0jv5Fh5lliNBJAeQqFOChOVEbYzdbfH_6uu4HHSL31si1RvpVccAjA1Ap9vXlSg3DcPgw",
"Cache-control: no-cache",
"Content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("DELETE", "https://api.hostaway.com/v1/cancellationPolicies/4010");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIiwiaWF0IjoxNDk4NTc5NzQ0LCJuYmYiOjE0OTg1Nzk3NDQsImV4cCI6MTUxNDM5MDk0NCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.TsbJaDOZ0VlEF4vBg7mqLX8DxEuu5rjtsmqix1IbsEcR7F9cdx8F3dDq2zOc6mw8FNAfXT8xp1r5qKu2AYoxv4ublZhxxW0Y6uPSFs0jv5Fh5lliNBJAeQqFOChOVEbYzdbfH_6uu4HHSL31si1RvpVccAjA1Ap9vXlSg3DcPgw");
xhr.setRequestHeader("Content-type", "application/json");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send(data);
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/cancellationPolicies/4010")
.delete(null)
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIiwiaWF0IjoxNDk4NTc5NzQ0LCJuYmYiOjE0OTg1Nzk3NDQsImV4cCI6MTUxNDM5MDk0NCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.TsbJaDOZ0VlEF4vBg7mqLX8DxEuu5rjtsmqix1IbsEcR7F9cdx8F3dDq2zOc6mw8FNAfXT8xp1r5qKu2AYoxv4ublZhxxW0Y6uPSFs0jv5Fh5lliNBJAeQqFOChOVEbYzdbfH_6uu4HHSL31si1RvpVccAjA1Ap9vXlSg3DcPgw")
.addHeader("Content-type", "application/json")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import http.client
conn = http.client.HTTPSConnection("api.hostaway.com")
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIiwiaWF0IjoxNDk4NTc5NzQ0LCJuYmYiOjE0OTg1Nzk3NDQsImV4cCI6MTUxNDM5MDk0NCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.TsbJaDOZ0VlEF4vBg7mqLX8DxEuu5rjtsmqix1IbsEcR7F9cdx8F3dDq2zOc6mw8FNAfXT8xp1r5qKu2AYoxv4ublZhxxW0Y6uPSFs0jv5Fh5lliNBJAeQqFOChOVEbYzdbfH_6uu4HHSL31si1RvpVccAjA1Ap9vXlSg3DcPgw",
'Content-type': "application/json",
'Cache-control': "no-cache"
}
conn.request("DELETE", "/v1/cancellationPolicies/4010", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Response
An empty success response or error response.
Reservations
Reservation object
{
"id": 13,
"listingMapId": 40160,
"channelId": 2001,
"source": "homeawayApi",
"channelName": "airbnb",
"reservationId": "10450-40160-thread313906227-9586017324",
"hostawayReservationId": 13,
"channelReservationId": "10450-40160-thread313906227-9586017324",
"externalPropertyId": null,
"externalRatePlanId": null,
"externalUnitId": null,
"assigneeUserId": 1,
"manualIcalId": null,
"manualIcalName": null,
"isProcessed": 1,
"isInitial": 0,
"isManuallyChecked": 0,
"isInstantBooked": 0,
"hasPullError": 0,
"reservationDate": "2017-06-10 10:41:10",
"pendingExpireDate": null,
"guestName": "Andrew Peterson",
"guestFirstName": "Andrew",
"guestLastName": "Peterson",
"guestExternalAccountId": "84497323",
"guestZipCode": "TX 78705",
"guestAddress": "3411 Cedar St",
"guestCity": "Austin",
"guestCountry": "US",
"guestEmail": "mail@test.com",
"guestPicture": "https://a0.muscache.com/im/pictures/3c4d82ed-196d-493a-a43b-07fcc70d5ccd.jpg?aki_policy=profile_small",
"guestRecommendations": 5,
"guestTrips": 10,
"guestWork": "The company name",
"isGuestIdentityVerified": 1,
"isGuestVerifiedByEmail": 1,
"isGuestVerifiedByWorkEmail": 1,
"isGuestVerifiedByFacebook": 1,
"isGuestVerifiedByGovernmentId": 1,
"isGuestVerifiedByPhone": 1,
"isGuestVerifiedByReviews": 1,
"numberOfGuests": 1,
"adults": 1,
"children": null,
"infants": null,
"pets": null,
"arrivalDate": "2017-07-15",
"departureDate": "2017-07-16",
"isDatesUnspecified": 0,
"previousArrivalDate": null,
"previousDepartureDate": null,
"checkInTime": null,
"checkOutTime": null,
"nights": 1,
"phone": "+75125551212",
"totalPrice": 267,
"taxAmount": null,
"channelCommissionAmount": null,
"hostawayCommissionAmount": null,
"cleaningFee": null,
"securityDepositFee": null,
"isPaid": null,
"paymentMethod": null,
"stripeGuestId": null,
"currency": "USD",
"status": "new",
"cancellationDate": null,
"cancelledBy": null,
"hostNote": null,
"guestNote": null,
"guestLocale": null,
"doorCode": "12345",
"doorCodeVendor": "vendor",
"doorCodeInstruction": "instruction",
"comment": null,
"confirmationCode": "HMP2KQ4B44",
"airbnbExpectedPayoutAmount": 111.12,
"airbnbListingBasePrice": 110,
"airbnbListingCancellationHostFee": 12.02,
"airbnbListingCancellationPayout": 122,
"airbnbListingCleaningFee": 1,
"airbnbListingHostFee": 43,
"airbnbListingSecurityPrice": 12,
"airbnbOccupancyTaxAmountPaidToHost": 332,
"airbnbTotalPaidAmount": 12,
"airbnbTransientOccupancyTaxPaidAmount": 0,
"airbnbCancellationPolicy": "moderate",
"isStarred": 0,
"isArchived": 0,
"isPinned": 0,
"originalChannel": null,
"customerUserId": null,
"rentalAgreementFileUrl": "https://a0.muscache.com/im/pictures/3c4d82ed-196d-493a-a43b-07fcc70d5ccd.pdf",
"reservationAgreement": "signed",
"remainingBalance": 4563.54,
"insuranceStatus": "insured",
"claimStatus": "claim_started",
"insurancePolicyId": 6,
"cancellationPolicyId": 9,
"hostProxyEmail": "c-123124124124@host.hostaway.info",
"customFieldValues": [
{
"customFieldId": 167,
"value": "Custom field value one"
},
{
"customFieldId": 243,
"value": "Custom field value two"
}
],
"financeField": [
{
"id": 1,
"units": 1,
"listingFeeSettingId": null,
"type": "fee",
"name": "checkinFee",
"title": "Checkin fee",
"alias": null,
"value": 1000,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 1,
"isMandatory": null,
"isQuantitySelectable": 0,
"isDeleted": 0,
"total": 69
},
{
"id": 2,
"units": 1,
"listingFeeSettingId": null,
"type": "price",
"name": "totalPriceFromChannel",
"title": "Total price from channel",
"alias": null,
"value": 1000,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 1,
"isMandatory": null,
"isQuantitySelectable": 0,
"isDeleted": 0,
"total": 42
}
]
}
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | Unique ID of the reservation on Hostaway |
listingMapId |
yes | int | Identifier of listing object. |
channelId |
yes | int | Identifier of the channel. Please check here for valid channel values: Channels |
source |
no | string | |
channelName |
yes | string | Channel name (Airbnb, Booking.com, Expedia, Vrbo etc.) Please check here for valid channel values: Channels |
reservationId |
yes | string | Reservation ID value which gets from the channel (Airbnb, Booking.com, Expedia, Vrbo etc.) |
hostawayReservationId |
yes | int | Unique ID of the reservation on Hostaway (the same value as ID) |
channelReservationId |
yes | string | The same value as reservationId |
externalPropertyId |
no | string | |
externalRatePlanId |
no | string | |
externalUnitId |
no | string | |
assigneeUserId |
no | int | |
manualIcalId |
no | string | |
manualIcalName |
no | string | |
isProcessed |
no | bool | |
isManuallyChecked |
no | bool | |
isInstantBooked |
no | bool | |
hasPullError |
no | bool | |
reservationDate |
no | datetime | |
pendingExpireDate |
no | datetime | |
guestName |
no | string | |
guestFirstName |
no | string | Guest first name |
guestLastName |
no | string | Guest last name |
guestExternalAccountId |
no | string | |
guestZipCode |
no | string | Guest ZIP code |
guestAddress |
no | string | Guest address |
guestCity |
no | string | Guest city |
guestCountry |
no | string | Guest country |
guestEmail |
no | string | Guest email |
guestPicture |
no | string | Guest picture |
guestRecommendations |
no | int | |
guestTrips |
no | int | |
guestWork |
no | string | |
isGuestIdentityVerified |
no | bool | |
isGuestVerifiedByEmail |
no | bool | |
isGuestVerifiedByWorkEmail |
no | bool | |
isGuestVerifiedByFacebook |
no | bool | |
isGuestVerifiedByGovernmentId |
no | bool | |
isGuestVerifiedByPhone |
no | bool | |
isGuestVerifiedByReviews |
no | bool | |
numberOfGuests |
no | int | |
adults |
no | int | |
children |
no | int | |
infants |
no | int | |
pets |
no | int | |
arrivalDate |
yes | date | |
departureDate |
yes | date | |
isDatesUnspecified |
no | int | Set to 1 in case a channel doesn’t provide reservation dates. If it is 1 arrivalDate and departureDate are set to yesterday. |
previousArrivalDate |
no | date | |
previousDepartureDate |
no | date | |
checkInTime |
no | int | |
checkOutTime |
no | int | |
nights |
no | int | |
phone |
no | string | |
totalPrice |
no | float | |
taxAmount |
no | float | |
channelCommissionAmount |
no | float | |
hostawayCommissionAmount |
no | float | |
cleaningFee |
no | float | |
securityDepositFee |
no | float | |
isPaid |
no | bool | |
paymentMethod |
no | string | |
stripeGuestId |
no | string | |
currency |
no | string | |
status |
no | string | Can be one of the following: new , modified , cancelled , ownerStay , pending , awaitingPayment , declined , expired , inquiry , inquiryPreapproved , inquiryDenied , inquiryTimedout , inquiryNotPossible |
cancellationDate |
no | date | |
cancelledBy |
no | string | Can be one of the following: guest , host |
hostNote |
no | string | |
guestNote |
no | string | |
guestLocale |
no | string | |
doorCode |
no | string | |
doorCodeVendor |
no | string | |
doorCodeInstruction |
no | string | |
comment |
no | string | |
confirmationCode |
no | string | Airbnb confirmation code |
airbnbExpectedPayoutAmount |
no | float | |
airbnbListingBasePrice |
no | float | |
airbnbListingCancellationHostFee |
no | float | |
airbnbListingCancellationPayout |
no | float | |
airbnbListingCleaningFee |
no | float | |
airbnbListingHostFee |
no | float | |
airbnbListingSecurityPrice |
no | float | |
airbnbOccupancyTaxAmountPaidToHost |
no | float | |
airbnbTotalPaidAmount |
no | float | |
airbnbTransientOccupancyTaxPaidAmount |
no | float | |
airbnbCancellationPolicy |
no | string | |
isStarred |
no | bool | |
isArchived |
no | bool | |
isPinned |
no | bool | |
guestAuthHash |
no | string | |
guestPortalUrl |
no | string | |
originalChannel |
no | string | |
latestActivityOn |
no | date | |
customerUserId |
no | string | |
reservationAgreement |
no | string | Can be one of the following: not_required , signed , not_signed |
remainingBalance |
no | float | Difference between reservation total price and amount already paid by guest. Returns only if includePayments=1 passed |
rentalAgreementFileUrl |
no | string | Link to pdf file with signed Rental Agreement |
customFieldValues |
no | array | You should create Custom fields at the dashboard beforehand |
reservationFees |
no | array | Array of reservationFee objects (will be empty array if includeResources parameter is set to 0). |
reservationUnit |
no | array | Array of reservationUnit objects (will be empty array if includeResources parameter is set to 0 or reservation is not multi unit). |
financeField |
no | array | Array of financeField objects |
guestPaymentCardIsVirtual |
no | int | 1 = guest payment card is virtual, 0 = not virtual |
insuranceStatus |
no | string | Can be one of the following: insured , pending , rejected , not_eligible |
claimStatus |
no | string | Can be one of the following: claim_started , claim_approved , claim_rejected , claim_draft , claim_paid , claim_withdrawn and null when claim status not found. |
insurancePolicyId |
no | string | Insurance external policyID |
cancellationPolicyId |
no | int | Cancellation Policy Id of the reservation. Cancellation Policies |
hostProxyEmail |
no | string | Proxy email of the host of the reservation. Will be accessible by including the includeResources=1 to the Retrieve a reservations list endpoint or from Retrieve a reservation by default |
Reservation fee object
{
"id": 123,
"accountId": 456,
"listingMapId": 111,
"reservationId": 222,
"name": "Test",
"amount": 5.12345,
"currency": "EUR",
"percentage": 10,
"isIncluded": 0,
"isPerNight": 1,
"isPerPerson": 0,
"isImported": 1,
"insertedOn": "2019-12-02 17:16:28",
"updatedOn": "2019-12-02 17:16:28"
}
Property | Required | Type | Description |
---|---|---|---|
accountId |
yes | int | ID of related Account |
listingMapId |
yes | int | ID of related ListingMap |
reservationId |
yes | int | ID of related Reservation |
name |
yes | string | Fee name, different set of fee names is used for each channel |
amount |
no | decimal | Fee amount |
currency |
no | string | Currency code |
percentage |
no | int | Fee percentage (0-100) from reservation total amount |
isIncluded |
no | int | 1 - amount already included to reservation total amount, 0 - not included |
isPerNight |
no | int | 1 - amount is applied per-night, 0 - per reservation |
isPerPerson |
no | int | 1 - amount is applied for each guests, 0 - for all guests |
isImported |
no | int | 1 - reservation fee was created during initial reservations import, 0 - was created by channel |
insertedOn |
yes | datetime | Date and time when fee was inserted |
updatedOn |
yes | datetime | Date and time when fee was updated |
Reservation unit object
This object needs only for multi unit reservation. There can be several reservationUnit objects in one reservation.
{
"id": 123,
"reservationId": 111,
"listingUnitId": 222,
"externalReservationId": "123",
"externalReservationUnitId": "342",
"guestName": "Michael",
"guestFirstName": "Michael",
"guestLastName": "Park",
"numberOfGuests": 1,
"adults": 1,
"children": 0,
"infants": 0,
"pets": 0,
"totalPrice": 300
}
Property | Required | Type | Description |
---|---|---|---|
reservationId |
yes | int | ID of related Reservation |
listingUnitId |
yes | int | ID of related ListingUnit |
externalReservationId |
no | string | External reservation ID |
externalReservationUnitId |
no | string | External reservation unit ID |
guestName |
yes | string | Guest name |
guestFirstName |
no | string | Guest first name |
guestLastName |
no | string | Guest last name |
numberOfGuests |
yes | int | Number of guests |
adults |
yes | int | Number of adults |
children |
yes | int | Number of children |
infants |
yes | int | Number of infants |
pets |
no | int | Number of pets |
totalPrice |
yes | float | Total price of this reservation unit |
Reservation statuses
Status | Description |
---|---|
new |
New reservation, blocks calendar |
modified |
Reservation that has dates, guests, listing or pricing modified. Blocks calendar |
cancelled |
Reservation cancelled by either host or guest. Does not block calendar |
ownerStay |
Hostaway specific status for reservations created by Owners that wish to block their properties usually because they plan to stay in them |
pending |
Airbnb only: for those clients using Airbnb’s Request to Book functionality. Client needs to approve or decline the reservation. If approved, the status will change to new. If declined, the status wil be expired |
awaitingPayment |
Airbnb only: Intermediary reservation states that require guest action (no host action). If the guest fails to complete their tasks, this would result in status cancelled, otherwise status will be new. This status blocks the calendar |
declined |
Airbnb only as a result of declining a Request to Book reservation (pending) |
expired |
As explained in row 5 |
unconfirmed |
Vrbo only: similar to pending status for those clients that use Vrbo Request to Book functionality. Client needs to approve or decline the reservation. If approved the status will change to new, if declined it will change to cancelled |
awaitingGuestVerification |
Airbnb only: Intermediary reservation states that require guest action (no host action). If the guest fails to complete their tasks, this would result in status cancelled, otherwise status will be new. This status blocks the calendar |
inquiry |
Reservation status representing a guest question which doesn’t block the calendar |
inquiryPreapproved |
Airbnb only: Hosts can preapprove the guest to encourage reservation. The host will have 24 hours to confirm their reservation. If they don’t the reservation will show status inquiryTimeout. The host can also decline the inquriy and the reservation will have status inquiryNotPossible. |
inquiryDenied |
Airbnb only: If a host does not preapprove a guest they will receive a simple inquiry. Hosts will still have 24 to approve or deny de inquiry. If approved it will become a new reservation. If declined it will show status inquiryDenied |
inquiryTimedout |
as explained in row 13 |
inquiryNotPossible |
as explained in row 13 |
unknown |
Airbnb only: something made the inquiry fail. |
Retrieve a reservations list
Request
curl -X GET \
'https://api.hostaway.com/v1/reservations?limit=&offset=&order=&channelId=&listingId=&arrivalStartDate=&arrivalEndDate=&departureStartDate=&departureEndDate=&hasUnreadConversationMessages=' \
-H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIiwiaWF0IjoxNDk4NTc5NzQ0LCJuYmYiOjE0OTg1Nzk3NDQsImV4cCI6MTUxNDM5MDk0NCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.TsbJaDOZ0VlEF4vBg7mqLX8DxEuu5rjtsmqix1IbsEcR7F9cdx8F3dDq2zOc6mw8FNAfXT8xp1r5qKu2AYoxv4ublZhxxW0Y6uPSFs0jv5Fh5lliNBJAeQqFOChOVEbYzdbfH_6uu4HHSL31si1RvpVccAjA1Ap9vXlSg3DcPgw' \
-H 'Cache-control: no-cache'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/reservations?limit=&offset=&order=&channelId=&listingId=&arrivalStartDate=&arrivalEndDate=&departureStartDate=&departureEndDate=&hasUnreadConversationMessages=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIiwiaWF0IjoxNDk4NTc5NzQ0LCJuYmYiOjE0OTg1Nzk3NDQsImV4cCI6MTUxNDM5MDk0NCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.TsbJaDOZ0VlEF4vBg7mqLX8DxEuu5rjtsmqix1IbsEcR7F9cdx8F3dDq2zOc6mw8FNAfXT8xp1r5qKu2AYoxv4ublZhxxW0Y6uPSFs0jv5Fh5lliNBJAeQqFOChOVEbYzdbfH_6uu4HHSL31si1RvpVccAjA1Ap9vXlSg3DcPgw",
"Cache-control: no-cache"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.hostaway.com/v1/reservations?limit=&offset=&order=&channelId=&listingId=&arrivalStartDate=&arrivalEndDate=&departureStartDate=&departureEndDate=&hasUnreadConversationMessages=");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIiwiaWF0IjoxNDk4NTc5NzQ0LCJuYmYiOjE0OTg1Nzk3NDQsImV4cCI6MTUxNDM5MDk0NCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.TsbJaDOZ0VlEF4vBg7mqLX8DxEuu5rjtsmqix1IbsEcR7F9cdx8F3dDq2zOc6mw8FNAfXT8xp1r5qKu2AYoxv4ublZhxxW0Y6uPSFs0jv5Fh5lliNBJAeQqFOChOVEbYzdbfH_6uu4HHSL31si1RvpVccAjA1Ap9vXlSg3DcPgw");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send();
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/reservations?limit=&offset=&order=&channelId=&listingId=&arrivalStartDate=&arrivalEndDate=&departureStartDate=&departureEndDate=&hasUnreadConversationMessages=")
.get()
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIiwiaWF0IjoxNDk4NTc5NzQ0LCJuYmYiOjE0OTg1Nzk3NDQsImV4cCI6MTUxNDM5MDk0NCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.TsbJaDOZ0VlEF4vBg7mqLX8DxEuu5rjtsmqix1IbsEcR7F9cdx8F3dDq2zOc6mw8FNAfXT8xp1r5qKu2AYoxv4ublZhxxW0Y6uPSFs0jv5Fh5lliNBJAeQqFOChOVEbYzdbfH_6uu4HHSL31si1RvpVccAjA1Ap9vXlSg3DcPgw")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import http.client
conn = http.client.HTTPSConnection("api.hostaway.com")
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIiwiaWF0IjoxNDk4NTc5NzQ0LCJuYmYiOjE0OTg1Nzk3NDQsImV4cCI6MTUxNDM5MDk0NCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.TsbJaDOZ0VlEF4vBg7mqLX8DxEuu5rjtsmqix1IbsEcR7F9cdx8F3dDq2zOc6mw8FNAfXT8xp1r5qKu2AYoxv4ublZhxxW0Y6uPSFs0jv5Fh5lliNBJAeQqFOChOVEbYzdbfH_6uu4HHSL31si1RvpVccAjA1Ap9vXlSg3DcPgw",
'Cache-control': "no-cache"
}
conn.request("GET", "/v1/reservations?limit=&offset=&order=&channelId=&listingId=&arrivalStartDate=&arrivalEndDate=&departureStartDate=&departureEndDate=&hasUnreadConversationMessages=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
GET https://api.hostaway.com/v1/reservations
Query Parameter | Required | Type | Description |
---|---|---|---|
limit |
no | int | Maximum number of items in the list (default limit is 100). |
offset |
no | int | Number of items to skip from beginning of the list. To retrieve next items set the parameter to 100, 200, etc. accordingly. |
sortOrder |
no | string | One of: arrivalDate, arrivalDateDesc, lastConversationMessageSent, lastConversationMessageSentDesc, lastConversationMessageReceived, lastConversationMessageReceivedDesc, latestActivity, latestActivityDesc. |
channelId |
no | int | Please check here for valid channel values: Channels |
listingId |
no | int | |
assigneeUserId |
no | int | |
match |
no | string | Used to search a reservation by guest name. |
arrivalStartDate |
no | date | |
arrivalEndDate |
no | date | |
departureStartDate |
no | date | |
departureEndDate |
no | date | |
hasUnreadConversationMessages |
no | bool | |
isStarred |
no | bool | |
isArchived |
no | bool | |
isPinned |
no | bool | |
customerUserId |
no | string | |
includeResources |
no | int | if includeResources flag is 1 then response object is supplied with supplementary resources, default is 0. |
latestActivityStart |
no | date | |
latestActivityEnd |
no | date | |
reservationAgreement |
no | string | |
guestEmail |
no | string | Filter reservations by guest email address |
Response
An array of reservations objects.
Retrieve a reservation
Request
curl -X GET \
https://api.hostaway.com/v1/reservations/13 \
-H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIiwiaWF0IjoxNDk4NTc5NzQ0LCJuYmYiOjE0OTg1Nzk3NDQsImV4cCI6MTUxNDM5MDk0NCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.TsbJaDOZ0VlEF4vBg7mqLX8DxEuu5rjtsmqix1IbsEcR7F9cdx8F3dDq2zOc6mw8FNAfXT8xp1r5qKu2AYoxv4ublZhxxW0Y6uPSFs0jv5Fh5lliNBJAeQqFOChOVEbYzdbfH_6uu4HHSL31si1RvpVccAjA1Ap9vXlSg3DcPgw' \
-H 'Cache-control: no-cache'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/reservations/13",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIiwiaWF0IjoxNDk4NTc5NzQ0LCJuYmYiOjE0OTg1Nzk3NDQsImV4cCI6MTUxNDM5MDk0NCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.TsbJaDOZ0VlEF4vBg7mqLX8DxEuu5rjtsmqix1IbsEcR7F9cdx8F3dDq2zOc6mw8FNAfXT8xp1r5qKu2AYoxv4ublZhxxW0Y6uPSFs0jv5Fh5lliNBJAeQqFOChOVEbYzdbfH_6uu4HHSL31si1RvpVccAjA1Ap9vXlSg3DcPgw",
"Cache-control: no-cache"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.hostaway.com/v1/reservations/13");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIiwiaWF0IjoxNDk4NTc5NzQ0LCJuYmYiOjE0OTg1Nzk3NDQsImV4cCI6MTUxNDM5MDk0NCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.TsbJaDOZ0VlEF4vBg7mqLX8DxEuu5rjtsmqix1IbsEcR7F9cdx8F3dDq2zOc6mw8FNAfXT8xp1r5qKu2AYoxv4ublZhxxW0Y6uPSFs0jv5Fh5lliNBJAeQqFOChOVEbYzdbfH_6uu4HHSL31si1RvpVccAjA1Ap9vXlSg3DcPgw");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send();
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/reservations/13")
.get()
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIiwiaWF0IjoxNDk4NTc5NzQ0LCJuYmYiOjE0OTg1Nzk3NDQsImV4cCI6MTUxNDM5MDk0NCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.TsbJaDOZ0VlEF4vBg7mqLX8DxEuu5rjtsmqix1IbsEcR7F9cdx8F3dDq2zOc6mw8FNAfXT8xp1r5qKu2AYoxv4ublZhxxW0Y6uPSFs0jv5Fh5lliNBJAeQqFOChOVEbYzdbfH_6uu4HHSL31si1RvpVccAjA1Ap9vXlSg3DcPgw")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import http.client
conn = http.client.HTTPSConnection("api.hostaway.com")
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIiwiaWF0IjoxNDk4NTc5NzQ0LCJuYmYiOjE0OTg1Nzk3NDQsImV4cCI6MTUxNDM5MDk0NCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.TsbJaDOZ0VlEF4vBg7mqLX8DxEuu5rjtsmqix1IbsEcR7F9cdx8F3dDq2zOc6mw8FNAfXT8xp1r5qKu2AYoxv4ublZhxxW0Y6uPSFs0jv5Fh5lliNBJAeQqFOChOVEbYzdbfH_6uu4HHSL31si1RvpVccAjA1Ap9vXlSg3DcPgw",
'Cache-control': "no-cache"
}
conn.request("GET", "/v1/reservations/13", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
GET https://api.hostaway.com/v1/reservations/{reservationId}
Response
A reservation object.
Create a reservation
Request
curl -X POST \
https://api.hostaway.com/v1/reservations?forceOverbooking=1 \
-H 'Cache-control: no-cache' \
-H 'Content-type: application/json' \
-H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0In0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0IiwiaWF0IjoxNTI4MjgzMjgwLCJuYmYiOjE1MjgyODMyODAsImV4cCI6MTU0MzgzNTI4MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.pzzHM2Qebad--FC8iwWZrFpblWQyiCKiroaEyrXKPWTXug3soe-62HK1bzZVlLQEJa166AtkevdEjXkOhQ6yRMJh3LlINrOKpLOSZKeTyMIydtYCdXJyWqgl3b3llAk8dZyQ8L8J_oyV9sRWMhy7MuIgAyFf1ITdVS2Z94KdyII' \
-d '{
"channelId": 2000,
"listingMapId": 40160,
"isManuallyChecked": 0,
"isInitial": 0,
"guestName": "Andrew Peterson",
"guestFirstName": "Andrew",
"guestLastName": "Peterson",
"guestZipCode": "TX 78705",
"guestAddress": "3411 Cedar street",
"guestCity": "Austin",
"guestCountry": "US",
"guestEmail": "mail@test.com",
"guestPicture": "https://a0.muscache.com/im/pictures/3c4d82ed-196d-493a-a43b-07fcc70d5ccd.jpg?aki_policy=profile_small",
"guestRecommendations": 5,
"guestTrips": 10,
"guestWork": "test",
"isGuestIdentityVerified": 1,
"isGuestVerifiedByEmail": 1,
"isGuestVerifiedByWorkEmail": 1,
"isGuestVerifiedByFacebook": 1,
"isGuestVerifiedByGovernmentId": 1,
"isGuestVerifiedByPhone": 1,
"isGuestVerifiedByReviews": 1,
"numberOfGuests": 1,
"adults": 1,
"children": null,
"infants": null,
"pets": null,
"arrivalDate": "2019-05-19",
"departureDate": "2019-05-20",
"checkInTime": null,
"checkOutTime": null,
"phone": "+75125551212",
"totalPrice": 267,
"taxAmount": null,
"channelCommissionAmount": null,
"cleaningFee": null,
"securityDepositFee": null,
"isPaid": null,
"currency": "USD",
"hostNote": null,
"guestNote": null,
"guestLocale": null,
"doorCode": "12345",
"doorCodeVendor": "test",
"doorCodeInstruction": "test",
"comment": null,
"airbnbExpectedPayoutAmount": 111.12,
"airbnbListingBasePrice": 110,
"airbnbListingCancellationHostFee": 12.02,
"airbnbListingCancellationPayout": 122,
"airbnbListingCleaningFee": 1,
"airbnbListingHostFee": 43,
"airbnbListingSecurityPrice": 12,
"airbnbOccupancyTaxAmountPaidToHost": 332,
"airbnbTotalPaidAmount": 12,
"airbnbTransientOccupancyTaxPaidAmount": 0,
"airbnbCancellationPolicy": "moderate",
"customerUserId": null,
"customFieldValues": [
{
"customFieldId": 167,
"value": "Custom field value one"
},
{
"customFieldId": 243,
"value": "Custom field value two"
}
]
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/reservations?forceOverbooking=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\n \"channelId\": 2000,\n \"listingMapId\": 40160,\n \"isManuallyChecked\": 0,\n \"isInitial\": 0,\n \"guestName\": \"Andrew Peterson\",\n \"guestFirstName\": \"Andrew\",\n \"guestLastName\": \"Peterson\",\n \"guestZipCode\": \"TX 78705\",\n \"guestAddress\": \"3411 Cedar street\",\n \"guestCity\": \"Austin\",\n \"guestCountry\": \"US\",\n \"guestEmail\": \"mail@test.com\",\n \"guestPicture\": \"https://a0.muscache.com/im/pictures/3c4d82ed-196d-493a-a43b-07fcc70d5ccd.jpg?aki_policy=profile_small\",\n \"guestRecommendations\": 5,\n \"guestTrips\": 10,\n \"guestWork\": \"test\",\n \"isGuestIdentityVerified\": 1,\n \"isGuestVerifiedByEmail\": 1,\n \"isGuestVerifiedByWorkEmail\": 1,\n \"isGuestVerifiedByFacebook\": 1,\n \"isGuestVerifiedByGovernmentId\": 1,\n \"isGuestVerifiedByPhone\": 1,\n \"isGuestVerifiedByReviews\": 1,\n \"numberOfGuests\": 1,\n \"adults\": 1,\n \"children\": null,\n \"infants\": null,\n \"pets\": null,\n \"arrivalDate\": \"2019-05-19\",\n \"departureDate\": \"2019-05-20\",\n \"checkInTime\": null,\n \"checkOutTime\": null,\n \"phone\": \"+75125551212\",\n \"totalPrice\": 267,\n \"taxAmount\": null,\n \"channelCommissionAmount\": null,\n \"cleaningFee\": null,\n \"securityDepositFee\": null,\n \"isPaid\": null,\n \"currency\": \"USD\",\n \"hostNote\": null,\n \"guestNote\": null,\n \"guestLocale\": null,\n \"doorCode\": \"12345\",\n \"doorCodeVendor\": \"test\",\n \"doorCodeInstruction\": \"test\",\n \"comment\": null,\n \"airbnbExpectedPayoutAmount\": 111.12,\n \"airbnbListingBasePrice\": 110,\n \"airbnbListingCancellationHostFee\": 12.02,\n \"airbnbListingCancellationPayout\": 122,\n \"airbnbListingCleaningFee\": 1,\n \"airbnbListingHostFee\": 43,\n \"airbnbListingSecurityPrice\": 111.12,\n \"airbnbOccupancyTaxAmountPaidToHost\": 111.12,\n \"airbnbTotalPaidAmount\": 111.12,\n \"airbnbTransientOccupancyTaxPaidAmount\": 111.12,\n \"airbnbCancellationPolicy\": \"moderate\"\n,\n \"customerUserId\": null\n,\n \"customFieldValues\": [{\"customFieldId\": 167, \"value\": \"Custom field value one\"}, {\"customFieldId\": 243, \"value\": \"Custom field value two\"}]\n}",
CURLOPT_HTTPHEADER => array(
"Cache-control: no-cache",
"Content-type: application/json",
"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0In0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0IiwiaWF0IjoxNTI4MjgzMjgwLCJuYmYiOjE1MjgyODMyODAsImV4cCI6MTU0MzgzNTI4MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.pzzHM2Qebad--FC8iwWZrFpblWQyiCKiroaEyrXKPWTXug3soe-62HK1bzZVlLQEJa166AtkevdEjXkOhQ6yRMJh3LlINrOKpLOSZKeTyMIydtYCdXJyWqgl3b3llAk8dZyQ8L8J_oyV9sRWMhy7MuIgAyFf1ITdVS2Z94KdyII"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var data = JSON.stringify({
"channelId": 2000,
"listingMapId": 40160,
"isManuallyChecked": 0,
"isInitial": 0,
"guestName": "Andrew Peterson",
"guestFirstName": "Andrew",
"guestLastName": "Peterson",
"guestZipCode": "TX 78705",
"guestAddress": "3411 Cedar street",
"guestCity": "Austin",
"guestCountry": "US",
"guestEmail": "mail@test.com",
"guestPicture": "https://a0.muscache.com/im/pictures/3c4d82ed-196d-493a-a43b-07fcc70d5ccd.jpg?aki_policy=profile_small",
"guestRecommendations": 5,
"guestTrips": 10,
"guestWork": "test",
"isGuestIdentityVerified": 1,
"isGuestVerifiedByEmail": 1,
"isGuestVerifiedByWorkEmail": 1,
"isGuestVerifiedByFacebook": 1,
"isGuestVerifiedByGovernmentId": 1,
"isGuestVerifiedByPhone": 1,
"isGuestVerifiedByReviews": 1,
"numberOfGuests": 1,
"adults": 1,
"children": null,
"infants": null,
"pets": null,
"arrivalDate": "2019-05-19",
"departureDate": "2019-05-20",
"checkInTime": null,
"checkOutTime": null,
"phone": "+75125551212",
"totalPrice": 267,
"taxAmount": null,
"channelCommissionAmount": null,
"cleaningFee": null,
"securityDepositFee": null,
"isPaid": null,
"currency": "USD",
"hostNote": null,
"guestNote": null,
"guestLocale": null,
"doorCode": "12345",
"doorCodeVendor": "test",
"doorCodeInstruction": "test",
"comment": null,
"airbnbExpectedPayoutAmount": 111.12,
"airbnbListingBasePrice": 110,
"airbnbListingCancellationHostFee": 12.02,
"airbnbListingCancellationPayout": 122,
"airbnbListingCleaningFee": 1,
"airbnbListingHostFee": 43,
"airbnbListingSecurityPrice": 12,
"airbnbOccupancyTaxAmountPaidToHost": 332,
"airbnbTotalPaidAmount": 12,
"airbnbTransientOccupancyTaxPaidAmount": 0,
"airbnbCancellationPolicy": "moderate",
"customerUserId": null,
"customFieldValues": [
{
"customFieldId": 167,
"value": "Custom field value one"
},
{
"customFieldId": 243,
"value": "Custom field value two"
}
]
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.hostaway.com/v1/reservations?forceOverbooking=1");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0In0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0IiwiaWF0IjoxNTI4MjgzMjgwLCJuYmYiOjE1MjgyODMyODAsImV4cCI6MTU0MzgzNTI4MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.pzzHM2Qebad--FC8iwWZrFpblWQyiCKiroaEyrXKPWTXug3soe-62HK1bzZVlLQEJa166AtkevdEjXkOhQ6yRMJh3LlINrOKpLOSZKeTyMIydtYCdXJyWqgl3b3llAk8dZyQ8L8J_oyV9sRWMhy7MuIgAyFf1ITdVS2Z94KdyII");
xhr.setRequestHeader("Content-type", "application/json");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send(data);
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"channelId\": 2000,\n \"listingMapId\": 40160,\n \"isManuallyChecked\": 0,\n \"isInitial\": 0,\n \"guestName\": \"Andrew Peterson\",\n \"guestFirstName\": \"Andrew\",\n \"guestLastName\": \"Peterson\",\n \"guestZipCode\": \"TX 78705\",\n \"guestAddress\": \"3411 Cedar street\",\n \"guestCity\": \"Austin\",\n \"guestCountry\": \"US\",\n \"guestEmail\": \"mail@test.com\",\n \"guestPicture\": \"https://a0.muscache.com/im/pictures/3c4d82ed-196d-493a-a43b-07fcc70d5ccd.jpg?aki_policy=profile_small\",\n \"guestRecommendations\": 5,\n \"guestTrips\": 10,\n \"guestWork\": \"test\",\n \"isGuestIdentityVerified\": 1,\n \"isGuestVerifiedByEmail\": 1,\n \"isGuestVerifiedByWorkEmail\": 1,\n \"isGuestVerifiedByFacebook\": 1,\n \"isGuestVerifiedByGovernmentId\": 1,\n \"isGuestVerifiedByPhone\": 1,\n \"isGuestVerifiedByReviews\": 1,\n \"numberOfGuests\": 1,\n \"adults\": 1,\n \"children\": null,\n \"infants\": null,\n \"pets\": null,\n \"arrivalDate\": \"2019-05-19\",\n \"departureDate\": \"2019-05-20\",\n \"checkInTime\": null,\n \"checkOutTime\": null,\n \"phone\": \"+75125551212\",\n \"totalPrice\": 267,\n \"taxAmount\": null,\n \"channelCommissionAmount\": null,\n \"cleaningFee\": null,\n \"securityDepositFee\": null,\n \"isPaid\": null,\n \"currency\": \"USD\",\n \"hostNote\": null,\n \"guestNote\": null,\n \"guestLocale\": null,\n \"doorCode\": \"12345\",\n \"doorCodeVendor\": \"test\",\n \"doorCodeInstruction\": \"test\",\n \"comment\": null,\n \"airbnbExpectedPayoutAmount\": 111.12,\n \"airbnbListingBasePrice\": 111.12,\n \"airbnbListingCancellationHostFee\": 12.02,\n \"airbnbListingCancellationPayout\": 122,\n \"airbnbListingCleaningFee\": 1,\n \"airbnbListingHostFee\": 43,\n \"airbnbListingSecurityPrice\": 111.12,\n \"airbnbOccupancyTaxAmountPaidToHost\": 111.12,\n \"airbnbTotalPaidAmount\": 111.12,\n \"airbnbTransientOccupancyTaxPaidAmount\": 111.12,\n \"airbnbCancellationPolicy\": \"moderate\"\n,\n \"customerUserId\": null\n,\n \"customFieldValues\": [{\"customFieldId\": 167, \"value\": \"Custom field value one\"}, {\"customFieldId\": 243, \"value\": \"Custom field value two\"}]\n}");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/reservations?forceOverbooking=1")
.post(body)
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0In0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0IiwiaWF0IjoxNTI4MjgzMjgwLCJuYmYiOjE1MjgyODMyODAsImV4cCI6MTU0MzgzNTI4MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.pzzHM2Qebad--FC8iwWZrFpblWQyiCKiroaEyrXKPWTXug3soe-62HK1bzZVlLQEJa166AtkevdEjXkOhQ6yRMJh3LlINrOKpLOSZKeTyMIydtYCdXJyWqgl3b3llAk8dZyQ8L8J_oyV9sRWMhy7MuIgAyFf1ITdVS2Z94KdyII")
.addHeader("Content-type", "application/json")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import http.client
import json
conn = http.client.HTTPSConnection("api.hostaway.com")
payload_obj = {
"channelId": 2000,
"listingMapId": 40160,
"isManuallyChecked": 0,
"isInitial": 0,
"guestName": "Andrew Peterson",
"guestFirstName": "Andrew",
"guestLastName": "Peterson",
"guestZipCode": "TX 78705",
"guestAddress": "3411 Cedar street",
"guestCity": "Austin",
"guestCountry": "US",
"guestEmail": "mail@test.com",
"guestPicture": "https://a0.muscache.com/im/pictures/3c4d82ed-196d-493a-a43b-07fcc70d5ccd.jpg?aki_policy=profile_small",
"guestRecommendations": 5,
"guestTrips": 10,
"guestWork": "test",
"isGuestIdentityVerified": 1,
"isGuestVerifiedByEmail": 1,
"isGuestVerifiedByWorkEmail": 1,
"isGuestVerifiedByFacebook": 1,
"isGuestVerifiedByGovernmentId": 1,
"isGuestVerifiedByPhone": 1,
"isGuestVerifiedByReviews": 1,
"numberOfGuests": 1,
"adults": 1,
"children": None,
"infants": None,
"pets": None,
"arrivalDate": "2019-05-19",
"departureDate": "2019-05-20",
"checkInTime": None,
"checkOutTime": None,
"phone": "+75125551212",
"totalPrice": 267,
"taxAmount": None,
"channelCommissionAmount": None,
"cleaningFee": None,
"securityDepositFee": None,
"isPaid": None,
"currency": "USD",
"hostNote": None,
"guestNote": None,
"guestLocale": None,
"doorCode": "12345",
"doorCodeVendor": "test",
"doorCodeInstruction": "test",
"comment": None,
"airbnbExpectedPayoutAmount": 111.12,
"airbnbListingBasePrice": 110,
"airbnbListingCancellationHostFee": 12.02,
"airbnbListingCancellationPayout": 122,
"airbnbListingCleaningFee": 1,
"airbnbListingHostFee": 43,
"airbnbListingSecurityPrice": 111.12,
"airbnbOccupancyTaxAmountPaidToHost": 111.12,
"airbnbTotalPaidAmount": 111.12,
"airbnbTransientOccupancyTaxPaidAmount": 111.12,
"airbnbCancellationPolicy": "moderate",
"customerUserId": None,
"customFieldValues": [
{"customFieldId": 167, "value": "Custom field value one"},
{"customFieldId": 243, "value": "Custom field value two"}
]
}
payload_json = json.dumps(payload_obj)
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0In0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0IiwiaWF0IjoxNTI4MjgzMjgwLCJuYmYiOjE1MjgyODMyODAsImV4cCI6MTU0MzgzNTI4MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.pzzHM2Qebad--FC8iwWZrFpblWQyiCKiroaEyrXKPWTXug3soe-62HK1bzZVlLQEJa166AtkevdEjXkOhQ6yRMJh3LlINrOKpLOSZKeTyMIydtYCdXJyWqgl3b3llAk8dZyQ8L8J_oyV9sRWMhy7MuIgAyFf1ITdVS2Z94KdyII",
'Content-type': "application/json",
'Cache-control': "no-cache"
}
conn.request("POST", "v1/reservations?forceOverbooking=1", payload_json, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
POST https://api.hostaway.com/v1/reservations?forceOverbooking=1
A reservation object should be provided in the request body.
Please check here for a valid channelId
: Channels.
Also couponName
string field can be provided inside reservation object, it will cause the corresponding coupon to
be applied to the specified reservation, however, keep in mind that it won’t affect price, it will only decrement
coupon usages.
To calculate correct total price, including coupon discounts make sure you call calculate reservation price
with all necessary query params and use total price received from it as totalPrice
value for reservation object + include
couponName
(if any). This will help you to get coupon usage counter, price and financial reporting aligned.
Query parameters
Query parameter | Required | Type | Description |
---|---|---|---|
forceOverbooking |
no | int | Ignore overbooking protection |
Response
The created reservation object or error response.
Create a reservation with credit card validation
Request
curl -X POST \
https://api.hostaway.com/v1/reservations?validatePaymentMethod=1 \
-H 'Cache-control: no-cache' \
-H 'Content-type: application/json' \
-H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0In0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0IiwiaWF0IjoxNTI4MjgzMjgwLCJuYmYiOjE1MjgyODMyODAsImV4cCI6MTU0MzgzNTI4MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.pzzHM2Qebad--FC8iwWZrFpblWQyiCKiroaEyrXKPWTXug3soe-62HK1bzZVlLQEJa166AtkevdEjXkOhQ6yRMJh3LlINrOKpLOSZKeTyMIydtYCdXJyWqgl3b3llAk8dZyQ8L8J_oyV9sRWMhy7MuIgAyFf1ITdVS2Z94KdyII' \
-d '{
"channelId": 2000,
"listingMapId": 40160,
"isManuallyChecked": 0,
"isInitial": 0,
"guestName": "Andrew Peterson",
"guestFirstName": "Andrew",
"guestLastName": "Peterson",
"guestZipCode": "TX 78705",
"guestAddress": "3411 Cedar street",
"guestCity": "Austin",
"guestCountry": "US",
"guestEmail": "mail@test.com",
"guestPicture": "https://a0.muscache.com/im/pictures/3c4d82ed-196d-493a-a43b-07fcc70d5ccd.jpg?aki_policy=profile_small",
"guestRecommendations": 5,
"guestTrips": 10,
"guestWork": "test",
"isGuestIdentityVerified": 1,
"isGuestVerifiedByEmail": 1,
"isGuestVerifiedByWorkEmail": 1,
"isGuestVerifiedByFacebook": 1,
"isGuestVerifiedByGovernmentId": 1,
"isGuestVerifiedByPhone": 1,
"isGuestVerifiedByReviews": 1,
"numberOfGuests": 1,
"adults": 1,
"children": null,
"infants": null,
"pets": null,
"arrivalDate": "2022-05-19",
"departureDate": "2022-05-20",
"checkInTime": null,
"checkOutTime": null,
"phone": "+75125551212",
"totalPrice": 267,
"taxAmount": null,
"channelCommissionAmount": null,
"cleaningFee": null,
"securityDepositFee": null,
"isPaid": null,
"currency": "USD",
"hostNote": null,
"guestNote": null,
"doorCode": "12345",
"doorCodeVendor": "test",
"doorCodeInstruction": "test",
"comment": null,
"airbnbExpectedPayoutAmount": 111.12,
"airbnbListingBasePrice": 110,
"airbnbListingCancellationHostFee": 12.02,
"airbnbListingCancellationPayout": 122,
"airbnbListingCleaningFee": 1,
"airbnbListingHostFee": 43,
"airbnbListingSecurityPrice": 12,
"airbnbOccupancyTaxAmountPaidToHost": 332,
"airbnbTotalPaidAmount": 12,
"airbnbTransientOccupancyTaxPaidAmount": 0,
"airbnbCancellationPolicy": "moderate",
"customerUserId": null,
"ccNumber": "4242424242424242",
"ccName": "Andrew Peterson",
"ccExpirationYear": "2025",
"ccExpirationMonth": "12",
"cvc": "423"
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/reservations?validatePaymentMethod=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\n \"channelId\": 2000,\n \"listingMapId\": 40160,\n \"isManuallyChecked\": 0,\n \"isInitial\": 0,\n \"guestName\": \"Andrew Peterson\",\n \"guestFirstName\": \"Andrew\",\n \"guestLastName\": \"Peterson\",\n \"guestZipCode\": \"TX 78705\",\n \"guestAddress\": \"3411 Cedar street\",\n \"guestCity\": \"Austin\",\n \"guestCountry\": \"US\",\n \"guestEmail\": \"mail@test.com\",\n \"guestPicture\": \"https://a0.muscache.com/im/pictures/3c4d82ed-196d-493a-a43b-07fcc70d5ccd.jpg?aki_policy=profile_small\",\n \"guestRecommendations\": 5,\n \"guestTrips\": 10,\n \"guestWork\": \"test\",\n \"isGuestIdentityVerified\": 1,\n \"isGuestVerifiedByEmail\": 1,\n \"isGuestVerifiedByWorkEmail\": 1,\n \"isGuestVerifiedByFacebook\": 1,\n \"isGuestVerifiedByGovernmentId\": 1,\n \"isGuestVerifiedByPhone\": 1,\n \"isGuestVerifiedByReviews\": 1,\n \"numberOfGuests\": 1,\n \"adults\": 1,\n \"children\": null,\n \"infants\": null,\n \"pets\": null,\n \"arrivalDate\": \"2019-05-19\",\n \"departureDate\": \"2019-05-20\",\n \"checkInTime\": null,\n \"checkOutTime\": null,\n \"phone\": \"+75125551212\",\n \"totalPrice\": 267,\n \"taxAmount\": null,\n \"channelCommissionAmount\": null,\n \"cleaningFee\": null,\n \"securityDepositFee\": null,\n \"isPaid\": null,\n \"currency\": \"USD\",\n \"hostNote\": null,\n \"guestNote\": null,\n \"doorCode\": \"12345\",\n \"doorCodeVendor\": \"test\",\n \"doorCodeInstruction\": \"test\",\n \"comment\": null,\n \"airbnbExpectedPayoutAmount\": 111.12,\n \"airbnbListingBasePrice\": 110,\n \"airbnbListingCancellationHostFee\": 12.02,\n \"airbnbListingCancellationPayout\": 122,\n \"airbnbListingCleaningFee\": 1,\n \"airbnbListingHostFee\": 43,\n \"airbnbListingSecurityPrice\": 111.12,\n \"airbnbOccupancyTaxAmountPaidToHost\": 111.12,\n \"airbnbTotalPaidAmount\": 111.12,\n \"airbnbTransientOccupancyTaxPaidAmount\": 111.12,\n \"airbnbCancellationPolicy\": \"moderate\"\n,\n \"customerUserId\": null\n,\n \"customFieldValues\": [{\"customFieldId\": 167, \"value\": \"Custom field value one\"}, {\"customFieldId\": 243, \"value\": \"Custom field value two\"}], \"ccNumber\": \"4242424242424242\", \"ccName\": \"Andrew Peterson\", \"ccExpirationYear\": \"2025\", \"ccExpirationMonth\": \"12\", \"cvc\": \"423\"\n}",
CURLOPT_HTTPHEADER => array(
"Cache-control: no-cache",
"Content-type: application/json",
"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0In0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0IiwiaWF0IjoxNTI4MjgzMjgwLCJuYmYiOjE1MjgyODMyODAsImV4cCI6MTU0MzgzNTI4MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.pzzHM2Qebad--FC8iwWZrFpblWQyiCKiroaEyrXKPWTXug3soe-62HK1bzZVlLQEJa166AtkevdEjXkOhQ6yRMJh3LlINrOKpLOSZKeTyMIydtYCdXJyWqgl3b3llAk8dZyQ8L8J_oyV9sRWMhy7MuIgAyFf1ITdVS2Z94KdyII"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var data = JSON.stringify({
"channelId": 2000,
"listingMapId": 40160,
"isManuallyChecked": 0,
"isInitial": 0,
"guestName": "Andrew Peterson",
"guestFirstName": "Andrew",
"guestLastName": "Peterson",
"guestZipCode": "TX 78705",
"guestAddress": "3411 Cedar street",
"guestCity": "Austin",
"guestCountry": "US",
"guestEmail": "mail@test.com",
"guestPicture": "https://a0.muscache.com/im/pictures/3c4d82ed-196d-493a-a43b-07fcc70d5ccd.jpg?aki_policy=profile_small",
"guestRecommendations": 5,
"guestTrips": 10,
"guestWork": "test",
"isGuestIdentityVerified": 1,
"isGuestVerifiedByEmail": 1,
"isGuestVerifiedByWorkEmail": 1,
"isGuestVerifiedByFacebook": 1,
"isGuestVerifiedByGovernmentId": 1,
"isGuestVerifiedByPhone": 1,
"isGuestVerifiedByReviews": 1,
"numberOfGuests": 1,
"adults": 1,
"children": null,
"infants": null,
"pets": null,
"arrivalDate": "2019-05-19",
"departureDate": "2019-05-20",
"checkInTime": null,
"checkOutTime": null,
"phone": "+75125551212",
"totalPrice": 267,
"taxAmount": null,
"channelCommissionAmount": null,
"cleaningFee": null,
"securityDepositFee": null,
"isPaid": null,
"currency": "USD",
"hostNote": null,
"guestNote": null,
"doorCode": "12345",
"doorCodeVendor": "test",
"doorCodeInstruction": "test",
"comment": null,
"airbnbExpectedPayoutAmount": 111.12,
"airbnbListingBasePrice": 110,
"airbnbListingCancellationHostFee": 12.02,
"airbnbListingCancellationPayout": 122,
"airbnbListingCleaningFee": 1,
"airbnbListingHostFee": 43,
"airbnbListingSecurityPrice": 12,
"airbnbOccupancyTaxAmountPaidToHost": 332,
"airbnbTotalPaidAmount": 12,
"airbnbTransientOccupancyTaxPaidAmount": 0,
"airbnbCancellationPolicy": "moderate",
"customerUserId": null,
"ccNumber": "4242424242424242",
"ccName": "Andrew Peterson",
"ccExpirationYear": "2025",
"ccExpirationMonth": "12",
"cvc": "423"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.hostaway.com/v1/reservations?validatePaymentMethod=1");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0In0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0IiwiaWF0IjoxNTI4MjgzMjgwLCJuYmYiOjE1MjgyODMyODAsImV4cCI6MTU0MzgzNTI4MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.pzzHM2Qebad--FC8iwWZrFpblWQyiCKiroaEyrXKPWTXug3soe-62HK1bzZVlLQEJa166AtkevdEjXkOhQ6yRMJh3LlINrOKpLOSZKeTyMIydtYCdXJyWqgl3b3llAk8dZyQ8L8J_oyV9sRWMhy7MuIgAyFf1ITdVS2Z94KdyII");
xhr.setRequestHeader("Content-type", "application/json");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send(data);
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"channelId\": 2000,\n \"listingMapId\": 40160,\n \"isManuallyChecked\": 0,\n \"isInitial\": 0,\n \"guestName\": \"Andrew Peterson\",\n \"guestFirstName\": \"Andrew\",\n \"guestLastName\": \"Peterson\",\n \"guestZipCode\": \"TX 78705\",\n \"guestAddress\": \"3411 Cedar street\",\n \"guestCity\": \"Austin\",\n \"guestCountry\": \"US\",\n \"guestEmail\": \"mail@test.com\",\n \"guestPicture\": \"https://a0.muscache.com/im/pictures/3c4d82ed-196d-493a-a43b-07fcc70d5ccd.jpg?aki_policy=profile_small\",\n \"guestRecommendations\": 5,\n \"guestTrips\": 10,\n \"guestWork\": \"test\",\n \"isGuestIdentityVerified\": 1,\n \"isGuestVerifiedByEmail\": 1,\n \"isGuestVerifiedByWorkEmail\": 1,\n \"isGuestVerifiedByFacebook\": 1,\n \"isGuestVerifiedByGovernmentId\": 1,\n \"isGuestVerifiedByPhone\": 1,\n \"isGuestVerifiedByReviews\": 1,\n \"numberOfGuests\": 1,\n \"adults\": 1,\n \"children\": null,\n \"infants\": null,\n \"pets\": null,\n \"arrivalDate\": \"2019-05-19\",\n \"departureDate\": \"2019-05-20\",\n \"checkInTime\": null,\n \"checkOutTime\": null,\n \"phone\": \"+75125551212\",\n \"totalPrice\": 267,\n \"taxAmount\": null,\n \"channelCommissionAmount\": null,\n \"cleaningFee\": null,\n \"securityDepositFee\": null,\n \"isPaid\": null,\n \"currency\": \"USD\",\n \"hostNote\": null,\n \"guestNote\": null,\n \"doorCode\": \"12345\",\n \"doorCodeVendor\": \"test\",\n \"doorCodeInstruction\": \"test\",\n \"comment\": null,\n \"airbnbExpectedPayoutAmount\": 111.12,\n \"airbnbListingBasePrice\": 111.12,\n \"airbnbListingCancellationHostFee\": 12.02,\n \"airbnbListingCancellationPayout\": 122,\n \"airbnbListingCleaningFee\": 1,\n \"airbnbListingHostFee\": 43,\n \"airbnbListingSecurityPrice\": 111.12,\n \"airbnbOccupancyTaxAmountPaidToHost\": 111.12,\n \"airbnbTotalPaidAmount\": 111.12,\n \"airbnbTransientOccupancyTaxPaidAmount\": 111.12,\n \"airbnbCancellationPolicy\": \"moderate\"\n,\n \"customerUserId\": null\n,\n \"customFieldValues\": [{\"customFieldId\": 167, \"value\": \"Custom field value one\"}, {\"customFieldId\": 243, \"value\": \"Custom field value two\"}], \"ccNumber\": \"4242424242424242\", \"ccName\": \"Andrew Peterson\", \"ccExpirationYear\": \"2025\", \"ccExpirationMonth\": \"12\", \"cvc\": \"423\"\n}");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/reservations?validatePaymentMethod=1")
.post(body)
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0In0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0IiwiaWF0IjoxNTI4MjgzMjgwLCJuYmYiOjE1MjgyODMyODAsImV4cCI6MTU0MzgzNTI4MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.pzzHM2Qebad--FC8iwWZrFpblWQyiCKiroaEyrXKPWTXug3soe-62HK1bzZVlLQEJa166AtkevdEjXkOhQ6yRMJh3LlINrOKpLOSZKeTyMIydtYCdXJyWqgl3b3llAk8dZyQ8L8J_oyV9sRWMhy7MuIgAyFf1ITdVS2Z94KdyII")
.addHeader("Content-type", "application/json")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import http.client
import json
conn = http.client.HTTPSConnection("api.hostaway.com")
payload_obj = {
"channelId": 2000,
"listingMapId": 40160,
"isManuallyChecked": 0,
"isInitial": 0,
"guestName": "Andrew Peterson",
"guestFirstName": "Andrew",
"guestLastName": "Peterson",
"guestZipCode": "TX 78705",
"guestAddress": "3411 Cedar street",
"guestCity": "Austin",
"guestCountry": "US",
"guestEmail": "mail@test.com",
"guestPicture": "https://a0.muscache.com/im/pictures/3c4d82ed-196d-493a-a43b-07fcc70d5ccd.jpg?aki_policy=profile_small",
"guestRecommendations": 5,
"guestTrips": 10,
"guestWork": "test",
"isGuestIdentityVerified": 1,
"isGuestVerifiedByEmail": 1,
"isGuestVerifiedByWorkEmail": 1,
"isGuestVerifiedByFacebook": 1,
"isGuestVerifiedByGovernmentId": 1,
"isGuestVerifiedByPhone": 1,
"isGuestVerifiedByReviews": 1,
"numberOfGuests": 1,
"adults": 1,
"children": None,
"infants": None,
"pets": None,
"arrivalDate": "2019-05-19",
"departureDate": "2019-05-20",
"checkInTime": None,
"checkOutTime": None,
"phone": "+75125551212",
"totalPrice": 267,
"taxAmount": None,
"channelCommissionAmount": None,
"cleaningFee": None,
"securityDepositFee": None,
"isPaid": None,
"currency": "USD",
"hostNote": None,
"guestNote": None,
"guestLocale": None,
"doorCode": "12345",
"doorCodeVendor": "test",
"doorCodeInstruction": "test",
"comment": None,
"airbnbExpectedPayoutAmount": 111.12,
"airbnbListingBasePrice": 110,
"airbnbListingCancellationHostFee": 12.02,
"airbnbListingCancellationPayout": 122,
"airbnbListingCleaningFee": 1,
"airbnbListingHostFee": 43,
"airbnbListingSecurityPrice": 111.12,
"airbnbOccupancyTaxAmountPaidToHost": 111.12,
"airbnbTotalPaidAmount": 111.12,
"airbnbTransientOccupancyTaxPaidAmount": 111.12,
"airbnbCancellationPolicy": "moderate",
"customerUserId": None,
"customFieldValues": [
{"customFieldId": 167, "value": "Custom field value one"},
{"customFieldId": 243, "value": "Custom field value two"}
],
"ccNumber": "4242424242424242",
"ccName": "Andrew Peterson",
"ccExpirationYear": "2025",
"ccExpirationMonth": "12",
"cvc": "423"
}
payload_json = json.dumps(payload_obj)
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0In0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0IiwiaWF0IjoxNTI4MjgzMjgwLCJuYmYiOjE1MjgyODMyODAsImV4cCI6MTU0MzgzNTI4MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.pzzHM2Qebad--FC8iwWZrFpblWQyiCKiroaEyrXKPWTXug3soe-62HK1bzZVlLQEJa166AtkevdEjXkOhQ6yRMJh3LlINrOKpLOSZKeTyMIydtYCdXJyWqgl3b3llAk8dZyQ8L8J_oyV9sRWMhy7MuIgAyFf1ITdVS2Z94KdyII",
'Content-type': "application/json",
'Cache-control': "no-cache"
}
conn.request("POST", "v1/reservations?validatePaymentMethod=1", payload_json, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
POST https://api.hostaway.com/v1/reservations?validatePaymentMethod=1
It is possible to validate a credit card upon creating a reservation, so you should add query parameter validatePaymentMethod=1 and credit card information in the json body (ccNumber
, ccName
, ccExpirationYear
, ccExpirationMonth
, cvc
).
Before that you need to create guest auto payment with auto charge in it. Auto charge must have event reservation
and time delta must be zero (at event).
During creation, a reservation guest charge will be created and charged immediately.
if the charge fails the reservation will be deleted and you get a response with error.
Query parameters
Query parameter | Required | Type | Description |
---|---|---|---|
validatePaymentMethod |
no | int | Validate guest credit card |
Response
The created reservation object or error response.
Troubleshooting
Issue | Description |
---|---|
Reservation was created without validation | Please check auto payment configuration. Pay attention on event and time delta, event must be reservation and time delta must be zero (at event). If it is impossible to find such auto payment the reservation will be created without validation. |
Error no credit card in the response |
Please check json body of the request. It must have ccNumber , ccName , ccExpirationYear , ccExpirationMonth , cvc |
Create a reservation with price details
Request
curl --location --request POST 'https://api.hostaway.com/v1/reservations?forceOverbooking=1' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIyODY3MyIsImp0aSI6IjJjYjk4NWRlNDIzYmExZTBiMzdiZjgzNjdjOWExZDE0ZmIwNDE3YjIxNGQ0Yjk4OGJkYzE5NjU3NjI4YmFiZDQ0YTQxNGRlZmI5NTYyMGRhIiwiaWF0IjoxNjY3MzEyNjUxLCJuYmYiOjE2NjczMTI2NTEsImV4cCI6MTczMDQ3MTA1MSwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjI3MTd9.JSvlt8VuBvPygoSjBeShiG0SQgwleninXSMuD4S4NwpsvljtHmsfM5CF1uQT-FTVeRuc8BdxNVPFuobWovQIEOlh6dYZJtaYv8PECp-EzgJCZKyv7-sY6cEC9s8Kf8hmJP3uOc-T90gxmOmOWm5zeL09HzWrdOqF_b-WgMifBtQ' \
--header 'Content-type: text/plain' \
--data-raw '{
"channelId": 2000,
"listingMapId": 90632,
"isManuallyChecked": 0,
"isInitial": 0,
"guestName": "Mikhail",
"guestFirstName": "Mikhail",
"guestLastName": "Peterson",
"guestZipCode": "TX 78705",
"guestAddress": "3411 Cedar street",
"guestCity": "Austin",
"guestCountry": "US",
"guestEmail": "mikhail@hostaway.com",
"guestPicture": "https://a0.muscache.com/im/pictures/3c4d82ed-196d-493a-a43b-07fcc70d5ccd.jpg?aki_policy=profile_small",
"guestRecommendations": 5,
"guestTrips": 10,
"guestWork": "test",
"isGuestIdentityVerified": 1,
"isGuestVerifiedByEmail": 1,
"isGuestVerifiedByWorkEmail": 1,
"isGuestVerifiedByFacebook": 1,
"isGuestVerifiedByGovernmentId": 1,
"isGuestVerifiedByPhone": 1,
"isGuestVerifiedByReviews": 1,
"numberOfGuests": 1,
"adults": 1,
"children": null,
"infants": null,
"pets": null,
"arrivalDate": "2022-11-19",
"departureDate": "2022-11-20",
"checkInTime": null,
"checkOutTime": null,
"phone": "+75125551212",
"totalPrice": 13520,
"taxAmount": null,
"channelCommissionAmount": null,
"cleaningFee": null,
"securityDepositFee": null,
"isPaid": null,
"currency": "USD",
"hostNote": null,
"guestNote": null,
"guestLocale": null,
"doorCode": "12345",
"doorCodeVendor": "test",
"doorCodeInstruction": "test",
"comment": null,
"airbnbExpectedPayoutAmount": 111.12,
"airbnbListingBasePrice": 110,
"airbnbListingCancellationHostFee": 12.02,
"airbnbListingCancellationPayout": 122,
"airbnbListingCleaningFee": 1,
"airbnbListingHostFee": 43,
"airbnbListingSecurityPrice": 12,
"airbnbOccupancyTaxAmountPaidToHost": 332,
"airbnbTotalPaidAmount": 12,
"airbnbTransientOccupancyTaxPaidAmount": 0,
"airbnbCancellationPolicy": "moderate",
"customerUserId": null,
"financeField": [
{
"id": null,
"listingFeeSettingId": null,
"type": "price",
"name": "baseRate",
"title": "Base rate",
"alias": null,
"quantity": null,
"value": 12320,
"total": 12320,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 0,
"isQuantitySelectable": 0,
"isMandatory": null,
"isDeleted": 0
},
{
"id": null,
"listingFeeSettingId": null,
"type": "fee",
"name": "cleaningFee",
"title": "Cleaning fee",
"alias": null,
"quantity": null,
"value": 500,
"total": 500,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 0,
"isQuantitySelectable": 0,
"isMandatory": null,
"isDeleted": 0
},
{
"id": null,
"listingFeeSettingId": null,
"type": "tax",
"name": "vat",
"title": "VAT / GST",
"alias": null,
"quantity": null,
"value": 200,
"total": 200,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 0,
"isQuantitySelectable": 0,
"isMandatory": null,
"isDeleted": 0
},
{
"id": null,
"listingFeeSettingId": null,
"type": "fee",
"name": "damageDeposit",
"title": "Damage deposit",
"alias": null,
"quantity": null,
"value": 500,
"total": 500,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 0,
"isQuantitySelectable": 0,
"isMandatory": null,
"isDeleted": 0
}
]
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.hostaway.com/v1/reservations?forceOverbooking=1',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"channelId": 2000,
"listingMapId": 90632,
"isManuallyChecked": 0,
"isInitial": 0,
"guestName": "Mikhail",
"guestFirstName": "Mikhail",
"guestLastName": "Peterson",
"guestZipCode": "TX 78705",
"guestAddress": "3411 Cedar street",
"guestCity": "Austin",
"guestCountry": "US",
"guestEmail": "mikhail@hostaway.com",
"guestPicture": "https://a0.muscache.com/im/pictures/3c4d82ed-196d-493a-a43b-07fcc70d5ccd.jpg?aki_policy=profile_small",
"guestRecommendations": 5,
"guestTrips": 10,
"guestWork": "test",
"isGuestIdentityVerified": 1,
"isGuestVerifiedByEmail": 1,
"isGuestVerifiedByWorkEmail": 1,
"isGuestVerifiedByFacebook": 1,
"isGuestVerifiedByGovernmentId": 1,
"isGuestVerifiedByPhone": 1,
"isGuestVerifiedByReviews": 1,
"numberOfGuests": 1,
"adults": 1,
"children": null,
"infants": null,
"pets": null,
"arrivalDate": "2022-11-19",
"departureDate": "2022-11-20",
"checkInTime": null,
"checkOutTime": null,
"phone": "+75125551212",
"totalPrice": 13520,
"taxAmount": null,
"channelCommissionAmount": null,
"cleaningFee": null,
"securityDepositFee": null,
"isPaid": null,
"currency": "USD",
"hostNote": null,
"guestNote": null,
"guestLocale": null,
"doorCode": "12345",
"doorCodeVendor": "test",
"doorCodeInstruction": "test",
"comment": null,
"airbnbExpectedPayoutAmount": 111.12,
"airbnbListingBasePrice": 110,
"airbnbListingCancellationHostFee": 12.02,
"airbnbListingCancellationPayout": 122,
"airbnbListingCleaningFee": 1,
"airbnbListingHostFee": 43,
"airbnbListingSecurityPrice": 12,
"airbnbOccupancyTaxAmountPaidToHost": 332,
"airbnbTotalPaidAmount": 12,
"airbnbTransientOccupancyTaxPaidAmount": 0,
"airbnbCancellationPolicy": "moderate",
"customerUserId": null,
"financeField": [
{
"id": null,
"listingFeeSettingId": null,
"type": "price",
"name": "baseRate",
"title": "Base rate",
"alias": null,
"quantity": null,
"value": 12320,
"total": 12320,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 0,
"isQuantitySelectable": 0,
"isMandatory": null,
"isDeleted": 0
},
{
"id": null,
"listingFeeSettingId": null,
"type": "fee",
"name": "cleaningFee",
"title": "Cleaning fee",
"alias": null,
"quantity": null,
"value": 500,
"total": 500,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 0,
"isQuantitySelectable": 0,
"isMandatory": null,
"isDeleted": 0
},
{
"id": null,
"listingFeeSettingId": null,
"type": "tax",
"name": "vat",
"title": "VAT / GST",
"alias": null,
"quantity": null,
"value": 200,
"total": 200,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 0,
"isQuantitySelectable": 0,
"isMandatory": null,
"isDeleted": 0
},
{
"id": null,
"listingFeeSettingId": null,
"type": "fee",
"name": "damageDeposit",
"title": "Damage deposit",
"alias": null,
"quantity": null,
"value": 500,
"total": 500,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 0,
"isQuantitySelectable": 0,
"isMandatory": null,
"isDeleted": 0
}
]
}',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIyODY3MyIsImp0aSI6IjJjYjk4NWRlNDIzYmExZTBiMzdiZjgzNjdjOWExZDE0ZmIwNDE3YjIxNGQ0Yjk4OGJkYzE5NjU3NjI4YmFiZDQ0YTQxNGRlZmI5NTYyMGRhIiwiaWF0IjoxNjY3MzEyNjUxLCJuYmYiOjE2NjczMTI2NTEsImV4cCI6MTczMDQ3MTA1MSwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjI3MTd9.JSvlt8VuBvPygoSjBeShiG0SQgwleninXSMuD4S4NwpsvljtHmsfM5CF1uQT-FTVeRuc8BdxNVPFuobWovQIEOlh6dYZJtaYv8PECp-EzgJCZKyv7-sY6cEC9s8Kf8hmJP3uOc-T90gxmOmOWm5zeL09HzWrdOqF_b-WgMifBtQ',
'Content-type: text/plain'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var data = "{\n \"channelId\": 2000,\n \"listingMapId\": 90632,\n \"isManuallyChecked\": 0,\n \"isInitial\": 0,\n \"guestName\": \"Mikhail\",\n \"guestFirstName\": \"Mikhail\",\n \"guestLastName\": \"Peterson\",\n \"guestZipCode\": \"TX 78705\",\n \"guestAddress\": \"3411 Cedar street\",\n \"guestCity\": \"Austin\",\n \"guestCountry\": \"US\",\n \"guestEmail\": \"mikhail@hostaway.com\",\n \"guestPicture\": \"https://a0.muscache.com/im/pictures/3c4d82ed-196d-493a-a43b-07fcc70d5ccd.jpg?aki_policy=profile_small\",\n \"guestRecommendations\": 5,\n \"guestTrips\": 10,\n \"guestWork\": \"test\",\n \"isGuestIdentityVerified\": 1,\n \"isGuestVerifiedByEmail\": 1,\n \"isGuestVerifiedByWorkEmail\": 1,\n \"isGuestVerifiedByFacebook\": 1,\n \"isGuestVerifiedByGovernmentId\": 1,\n \"isGuestVerifiedByPhone\": 1,\n \"isGuestVerifiedByReviews\": 1,\n \"numberOfGuests\": 1,\n \"adults\": 1,\n \"children\": null,\n \"infants\": null,\n \"pets\": null,\n \"arrivalDate\": \"2022-11-19\",\n \"departureDate\": \"2022-11-20\",\n \"checkInTime\": null,\n \"checkOutTime\": null,\n \"phone\": \"+75125551212\",\n \"totalPrice\": 13520,\n \"taxAmount\": null,\n \"channelCommissionAmount\": null,\n \"cleaningFee\": null,\n \"securityDepositFee\": null,\n \"isPaid\": null,\n \"currency\": \"USD\",\n \"hostNote\": null,\n \"guestNote\": null,\n \"guestLocale\": null,\n \"doorCode\": \"12345\",\n \"doorCodeVendor\": \"test\",\n \"doorCodeInstruction\": \"test\",\n \"comment\": null,\n \"airbnbExpectedPayoutAmount\": 111.12,\n \"airbnbListingBasePrice\": 110,\n \"airbnbListingCancellationHostFee\": 12.02,\n \"airbnbListingCancellationPayout\": 122,\n \"airbnbListingCleaningFee\": 1,\n \"airbnbListingHostFee\": 43,\n \"airbnbListingSecurityPrice\": 12,\n \"airbnbOccupancyTaxAmountPaidToHost\": 332,\n \"airbnbTotalPaidAmount\": 12,\n \"airbnbTransientOccupancyTaxPaidAmount\": 0,\n \"airbnbCancellationPolicy\": \"moderate\",\n \"customerUserId\": null,\n \"financeField\": [\n {\n \"id\": null,\n \"listingFeeSettingId\": null,\n \"type\": \"price\",\n \"name\": \"baseRate\",\n \"title\": \"Base rate\",\n \"alias\": null,\n \"quantity\": null,\n \"value\": 12320,\n \"total\": 12320,\n \"isIncludedInTotalPrice\": 1,\n \"isOverriddenByUser\": 0,\n \"isQuantitySelectable\": 0,\n \"isMandatory\": null,\n \"isDeleted\": 0\n },\n {\n \"id\": null,\n \"listingFeeSettingId\": null,\n \"type\": \"fee\",\n \"name\": \"cleaningFee\",\n \"title\": \"Cleaning fee\",\n \"alias\": null,\n \"quantity\": null,\n \"value\": 500,\n \"total\": 500,\n \"isIncludedInTotalPrice\": 1,\n \"isOverriddenByUser\": 0,\n \"isQuantitySelectable\": 0,\n \"isMandatory\": null,\n \"isDeleted\": 0\n },\n {\n \"id\": null,\n \"listingFeeSettingId\": null,\n \"type\": \"tax\",\n \"name\": \"vat\",\n \"title\": \"VAT / GST\",\n \"alias\": null,\n \"quantity\": null,\n \"value\": 200,\n \"total\": 200,\n \"isIncludedInTotalPrice\": 1,\n \"isOverriddenByUser\": 0,\n \"isQuantitySelectable\": 0,\n \"isMandatory\": null,\n \"isDeleted\": 0\n },\n {\n \"id\": null,\n \"listingFeeSettingId\": null,\n \"type\": \"fee\",\n \"name\": \"damageDeposit\",\n \"title\": \"Damage deposit\",\n \"alias\": null,\n \"quantity\": null,\n \"value\": 500,\n \"total\": 500,\n \"isIncludedInTotalPrice\": 1,\n \"isOverriddenByUser\": 0,\n \"isQuantitySelectable\": 0,\n \"isMandatory\": null,\n \"isDeleted\": 0\n }\n ]\n}";
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.hostaway.com/v1/reservations?forceOverbooking=1");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIyODY3MyIsImp0aSI6IjJjYjk4NWRlNDIzYmExZTBiMzdiZjgzNjdjOWExZDE0ZmIwNDE3YjIxNGQ0Yjk4OGJkYzE5NjU3NjI4YmFiZDQ0YTQxNGRlZmI5NTYyMGRhIiwiaWF0IjoxNjY3MzEyNjUxLCJuYmYiOjE2NjczMTI2NTEsImV4cCI6MTczMDQ3MTA1MSwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjI3MTd9.JSvlt8VuBvPygoSjBeShiG0SQgwleninXSMuD4S4NwpsvljtHmsfM5CF1uQT-FTVeRuc8BdxNVPFuobWovQIEOlh6dYZJtaYv8PECp-EzgJCZKyv7-sY6cEC9s8Kf8hmJP3uOc-T90gxmOmOWm5zeL09HzWrdOqF_b-WgMifBtQ");
xhr.setRequestHeader("Content-type", "text/plain");
xhr.send(data);
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "{\n \"channelId\": 2000,\n \"listingMapId\": 90632,\n \"isManuallyChecked\": 0,\n \"isInitial\": 0,\n \"guestName\": \"Mikhail\",\n \"guestFirstName\": \"Mikhail\",\n \"guestLastName\": \"Peterson\",\n \"guestZipCode\": \"TX 78705\",\n \"guestAddress\": \"3411 Cedar street\",\n \"guestCity\": \"Austin\",\n \"guestCountry\": \"US\",\n \"guestEmail\": \"mikhail@hostaway.com\",\n \"guestPicture\": \"https://a0.muscache.com/im/pictures/3c4d82ed-196d-493a-a43b-07fcc70d5ccd.jpg?aki_policy=profile_small\",\n \"guestRecommendations\": 5,\n \"guestTrips\": 10,\n \"guestWork\": \"test\",\n \"isGuestIdentityVerified\": 1,\n \"isGuestVerifiedByEmail\": 1,\n \"isGuestVerifiedByWorkEmail\": 1,\n \"isGuestVerifiedByFacebook\": 1,\n \"isGuestVerifiedByGovernmentId\": 1,\n \"isGuestVerifiedByPhone\": 1,\n \"isGuestVerifiedByReviews\": 1,\n \"numberOfGuests\": 1,\n \"adults\": 1,\n \"children\": null,\n \"infants\": null,\n \"pets\": null,\n \"arrivalDate\": \"2022-11-19\",\n \"departureDate\": \"2022-11-20\",\n \"checkInTime\": null,\n \"checkOutTime\": null,\n \"phone\": \"+75125551212\",\n \"totalPrice\": 13520,\n \"taxAmount\": null,\n \"channelCommissionAmount\": null,\n \"cleaningFee\": null,\n \"securityDepositFee\": null,\n \"isPaid\": null,\n \"currency\": \"USD\",\n \"hostNote\": null,\n \"guestNote\": null,\n \"guestLocale\": null,\n \"doorCode\": \"12345\",\n \"doorCodeVendor\": \"test\",\n \"doorCodeInstruction\": \"test\",\n \"comment\": null,\n \"airbnbExpectedPayoutAmount\": 111.12,\n \"airbnbListingBasePrice\": 110,\n \"airbnbListingCancellationHostFee\": 12.02,\n \"airbnbListingCancellationPayout\": 122,\n \"airbnbListingCleaningFee\": 1,\n \"airbnbListingHostFee\": 43,\n \"airbnbListingSecurityPrice\": 12,\n \"airbnbOccupancyTaxAmountPaidToHost\": 332,\n \"airbnbTotalPaidAmount\": 12,\n \"airbnbTransientOccupancyTaxPaidAmount\": 0,\n \"airbnbCancellationPolicy\": \"moderate\",\n \"customerUserId\": null,\n \"financeField\": [\n {\n \"id\": null,\n \"listingFeeSettingId\": null,\n \"type\": \"price\",\n \"name\": \"baseRate\",\n \"title\": \"Base rate\",\n \"alias\": null,\n \"quantity\": null,\n \"value\": 12320,\n \"total\": 12320,\n \"isIncludedInTotalPrice\": 1,\n \"isOverriddenByUser\": 0,\n \"isQuantitySelectable\": 0,\n \"isMandatory\": null,\n \"isDeleted\": 0\n },\n {\n \"id\": null,\n \"listingFeeSettingId\": null,\n \"type\": \"fee\",\n \"name\": \"cleaningFee\",\n \"title\": \"Cleaning fee\",\n \"alias\": null,\n \"quantity\": null,\n \"value\": 500,\n \"total\": 500,\n \"isIncludedInTotalPrice\": 1,\n \"isOverriddenByUser\": 0,\n \"isQuantitySelectable\": 0,\n \"isMandatory\": null,\n \"isDeleted\": 0\n },\n {\n \"id\": null,\n \"listingFeeSettingId\": null,\n \"type\": \"tax\",\n \"name\": \"vat\",\n \"title\": \"VAT / GST\",\n \"alias\": null,\n \"quantity\": null,\n \"value\": 200,\n \"total\": 200,\n \"isIncludedInTotalPrice\": 1,\n \"isOverriddenByUser\": 0,\n \"isQuantitySelectable\": 0,\n \"isMandatory\": null,\n \"isDeleted\": 0\n },\n {\n \"id\": null,\n \"listingFeeSettingId\": null,\n \"type\": \"fee\",\n \"name\": \"damageDeposit\",\n \"title\": \"Damage deposit\",\n \"alias\": null,\n \"quantity\": null,\n \"value\": 500,\n \"total\": 500,\n \"isIncludedInTotalPrice\": 1,\n \"isOverriddenByUser\": 0,\n \"isQuantitySelectable\": 0,\n \"isMandatory\": null,\n \"isDeleted\": 0\n }\n ]\n}");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/reservations?forceOverbooking=1")
.method("POST", body)
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIyODY3MyIsImp0aSI6IjJjYjk4NWRlNDIzYmExZTBiMzdiZjgzNjdjOWExZDE0ZmIwNDE3YjIxNGQ0Yjk4OGJkYzE5NjU3NjI4YmFiZDQ0YTQxNGRlZmI5NTYyMGRhIiwiaWF0IjoxNjY3MzEyNjUxLCJuYmYiOjE2NjczMTI2NTEsImV4cCI6MTczMDQ3MTA1MSwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjI3MTd9.JSvlt8VuBvPygoSjBeShiG0SQgwleninXSMuD4S4NwpsvljtHmsfM5CF1uQT-FTVeRuc8BdxNVPFuobWovQIEOlh6dYZJtaYv8PECp-EzgJCZKyv7-sY6cEC9s8Kf8hmJP3uOc-T90gxmOmOWm5zeL09HzWrdOqF_b-WgMifBtQ")
.addHeader("Content-type", "text/plain")
.build();
Response response = client.newCall(request).execute();
import http.client
import json
conn = http.client.HTTPSConnection("api.hostaway.com")
payload = {
"channelId": 2000,
"listingMapId": 90632,
"isManuallyChecked": 0,
"isInitial": 0,
"guestName": "Mikhail",
"guestFirstName": "Mikhail",
"guestLastName": "Peterson",
"guestZipCode": "TX 78705",
"guestAddress": "3411 Cedar street",
"guestCity": "Austin",
"guestCountry": "US",
"guestEmail": "mikhail@hostaway.com",
"guestPicture": "https://a0.muscache.com/im/pictures/3c4d82ed-196d-493a-a43b-07fcc70d5ccd.jpg?aki_policy=profile_small",
"guestRecommendations": 5,
"guestTrips": 10,
"guestWork": "test",
"isGuestIdentityVerified": 1,
"isGuestVerifiedByEmail": 1,
"isGuestVerifiedByWorkEmail": 1,
"isGuestVerifiedByFacebook": 1,
"isGuestVerifiedByGovernmentId": 1,
"isGuestVerifiedByPhone": 1,
"isGuestVerifiedByReviews": 1,
"numberOfGuests": 1,
"adults": 1,
"children": None,
"infants": None,
"pets": None,
"arrivalDate": "2022-11-19",
"departureDate": "2022-11-20",
"checkInTime": None,
"checkOutTime": None,
"phone": "+75125551212",
"totalPrice": 13520,
"taxAmount": None,
"channelCommissionAmount": None,
"cleaningFee": None,
"securityDepositFee": None,
"isPaid": None,
"currency": "USD",
"hostNote": None,
"guestNote": None,
"guestLocale": None,
"doorCode": "12345",
"doorCodeVendor": "test",
"doorCodeInstruction": "test",
"comment": None,
"airbnbExpectedPayoutAmount": 111.12,
"airbnbListingBasePrice": 110,
"airbnbListingCancellationHostFee": 12.02,
"airbnbListingCancellationPayout": 122,
"airbnbListingCleaningFee": 1,
"airbnbListingHostFee": 43,
"airbnbListingSecurityPrice": 12,
"airbnbOccupancyTaxAmountPaidToHost": 332,
"airbnbTotalPaidAmount": 12,
"airbnbTransientOccupancyTaxPaidAmount": 0,
"airbnbCancellationPolicy": "moderate",
"customerUserId": None,
"financeField": [
{
"type": "price",
"name": "baseRate",
"value": 12320,
"total": 12320,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 0,
"isQuantitySelectable": 0,
"isDeleted": 0
},
{
"type": "fee",
"name": "cleaningFee",
"value": 500,
"total": 500,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 0,
"isQuantitySelectable": 0,
"isDeleted": 0
},
{
"type": "tax",
"name": "vat",
"value": 200,
"total": 200,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 0,
"isQuantitySelectable": 0,
"isDeleted": 0
},
{
"type": "fee",
"name": "damageDeposit",
"value": 500,
"total": 500,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 0,
"isQuantitySelectable": 0,
"isDeleted": 0
}
]
}
payload_json = json.dumps(payload)
headers = {
'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIyODY3MyIsImp0aSI6IjJjYjk4NWRlNDIzYmExZTBiMzdiZjgzNjdjOWExZDE0ZmIwNDE3YjIxNGQ0Yjk4OGJkYzE5NjU3NjI4YmFiZDQ0YTQxNGRlZmI5NTYyMGRhIiwiaWF0IjoxNjY3MzEyNjUxLCJuYmYiOjE2NjczMTI2NTEsImV4cCI6MTczMDQ3MTA1MSwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjI3MTd9.JSvlt8VuBvPygoSjBeShiG0SQgwleninXSMuD4S4NwpsvljtHmsfM5CF1uQT-FTVeRuc8BdxNVPFuobWovQIEOlh6dYZJtaYv8PECp-EzgJCZKyv7-sY6cEC9s8Kf8hmJP3uOc-T90gxmOmOWm5zeL09HzWrdOqFI noticed that you're using the header `'Content-type': 'text/plain'`. This might not be the correct content type if you're sending a JSON payload. The standard content type for JSON is `'application/json'`. If you intend to send JSON data, you should update the content type in the headers as follows:
```python
headers = {
'Authorization': 'Bearer ...',
'Content-type': 'application/json',
}
POST https://api.hostaway.com/v1/reservations?forceOverbooking=1
You can create a reservation with flexible price details using price calculator calculate reservation price. From the calculator response you should use components array of objects for creating reservation with price details.
A reservation object should be provided in the request body.
Please check here for a valid channelId
values: Channels
Also couponName
string field can be provided inside reservation object, it will cause the corresponding coupon to
be applied to the specified reservation, however, keep in mind that it won’t affect price, it will only decrement
coupon usages.
To calculate correct total price, including coupon discounts make sure you call calculate reservation price
with all necessary query params and use total price received from it as totalPrice
value for reservation object + include
couponName
(if any). This will help you to get coupon usage counter, price and financial reporting aligned.
Query parameters
Query parameter | Required | Type | Description |
---|---|---|---|
forceOverbooking |
no | int | Ignore overbooking protection |
Finance component object.
Array of finance components from calculate reservation price response you should use for filling financeField
object in reservation creation.
Json Parameter | Required | Type | Description |
---|---|---|---|
listingFeeSettingId |
no | int | Listing fee setting ID |
type |
yes | string | Type of component (price, tax, fee, discount) |
name |
yes | string | Name of component |
title |
yes | string | Title of component |
alias |
yes | string | Alias of component |
quantity |
no | int | Quantity of component (only if component is quantity selectable) |
value |
yes | float | Price of component |
total |
yes | float | Total amount of component |
isIncludedInTotalPrice |
yes | int | Included or not included in total price |
isOverriddenByUser |
yes | int | Is component changed or not by the client |
isMandatory |
yes | int | Сomponent is mandatory for creating reservation or not |
isDeleted |
yes | int | Сomponent is deleted or not by the client |
Response
The created reservation object or error response.
Update a reservation
Request
curl -X PUT \
https://api.hostaway.com/v1/reservations/117277?forceOverbooking=1 \
-H 'Cache-control: no-cache' \
-H 'Content-type: application/json' \
-H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0In0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0IiwiaWF0IjoxNTI4MjgzMjgwLCJuYmYiOjE1MjgyODMyODAsImV4cCI6MTU0MzgzNTI4MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.pzzHM2Qebad--FC8iwWZrFpblWQyiCKiroaEyrXKPWTXug3soe-62HK1bzZVlLQEJa166AtkevdEjXkOhQ6yRMJh3LlINrOKpLOSZKeTyMIydtYCdXJyWqgl3b3llAk8dZyQ8L8J_oyV9sRWMhy7MuIgAyFf1ITdVS2Z94KdyII' \
-d '{
"listingMapId": 40160,
"isManuallyChecked": 0,
"guestName": "Andrew Peterson",
"guestFirstName": "Andrew",
"guestLastName": "Peterson",
"guestZipCode": "TX 78705",
"guestAddress": "3411 Cedar street",
"guestCity": "Austin",
"guestCountry": "US",
"guestEmail": "mail@test.com",
"guestPicture": "https://a0.muscache.com/im/pictures/3c4d82ed-196d-493a-a43b-07fcc70d5ccd.jpg?aki_policy=profile_small",
"guestRecommendations": 1,
"guestTrips": 1,
"guestWork": "test",
"isGuestIdentityVerified": 2,
"isGuestVerifiedByEmail": 2,
"isGuestVerifiedByWorkEmail": 2,
"isGuestVerifiedByFacebook": 2,
"isGuestVerifiedByGovernmentId": 2,
"isGuestVerifiedByPhone": 2,
"isGuestVerifiedByReviews": 2,
"numberOfGuests": 1,
"adults": 1,
"children": null,
"infants": null,
"pets": null,
"arrivalDate": "2018-04-15",
"departureDate": "2018-04-16",
"checkInTime": null,
"checkOutTime": null,
"phone": "+75125551212",
"totalPrice": 267,
"taxAmount": null,
"channelCommissionAmount": null,
"cleaningFee": null,
"securityDepositFee": null,
"isPaid": null,
"currency": "USD",
"hostNote": null,
"guestNote": null,
"guestLocale": null,
"doorCode": "2222222",
"doorCodeVendor": "test2",
"doorCodeInstruction": "test2",
"comment": null,
"airbnbExpectedPayoutAmount": 111.12,
"airbnbListingBasePrice": 110,
"airbnbListingCancellationHostFee": 12.02,
"airbnbListingCancellationPayout": 122,
"airbnbListingCleaningFee": 1,
"airbnbListingHostFee": 43,
"airbnbListingSecurityPrice": 12,
"airbnbOccupancyTaxAmountPaidToHost": 332,
"airbnbTotalPaidAmount": 12,
"airbnbTransientOccupancyTaxPaidAmount": 0,
"airbnbCancellationPolicy": "moderate",
"customerUserId": null,
"customFieldValues": [
{
"customFieldId": 167,
"value": "Custom field value one"
},
{
"customFieldId": 243,
"value": "Custom field value two"
}
]
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/reservations/117277?forceOverbooking=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "{\n \"listingMapId\": 40160,\n \"isManuallyChecked\": 0,\n \"guestName\": \"Andrew Peterson\",\n \"guestFirstName\": \"Andrew\",\n \"guestLastName\": \"Peterson\",\n \"guestZipCode\": \"TX 78705\",\n \"guestAddress\": \"3411 Cedar street\",\n \"guestCity\": \"Austin\",\n \"guestCountry\": \"US\",\n \"guestEmail\": \"mail@test.com\",\n \"guestPicture\": \"https://a0.muscache.com/im/pictures/3c4d82ed-196d-493a-a43b-07fcc70d5ccd.jpg?aki_policy=profile_small\",\n \"guestRecommendations\": 1,\n \"guestTrips\": 1,\n \"guestWork\": \"test\",\n \"isGuestIdentityVerified\": 2,\n \"isGuestVerifiedByEmail\": 2,\n \"isGuestVerifiedByWorkEmail\": 2,\n \"isGuestVerifiedByFacebook\": 2,\n \"isGuestVerifiedByGovernmentId\": 2,\n \"isGuestVerifiedByPhone\": 2,\n \"isGuestVerifiedByReviews\": 2,\n \"numberOfGuests\": 1,\n \"adults\": 1,\n \"children\": null,\n \"infants\": null,\n \"pets\": null,\n \"arrivalDate\": \"2018-04-15\",\n \"departureDate\": \"2018-04-16\",\n \"checkInTime\": null,\n \"checkOutTime\": null,\n \"phone\": \"+75125551212\",\n \"totalPrice\": 267,\n \"taxAmount\": null,\n \"channelCommissionAmount\": null,\n \"cleaningFee\": null,\n \"securityDepositFee\": null,\n \"isPaid\": null,\n \"currency\": \"USD\",\n \"hostNote\": null,\n \"guestNote\": null,\n \"guestLocale\": null,\n \"doorCode\": \"2222222\",\n \"doorCodeVendor\": \"test2\",\n \"doorCodeInstruction\": \"test2\", \n \"comment\": null,\n \"airbnbExpectedPayoutAmount\": 111.12,\n \"airbnbListingBasePrice\": 110,\n \"airbnbListingCancellationHostFee\": 12.02,\n \"airbnbListingCancellationPayout\": 122,\n \"airbnbListingCleaningFee\": 1,\n \"airbnbListingHostFee\": 43,\n \"airbnbListingSecurityPrice\": 111.12,\n \"airbnbOccupancyTaxAmountPaidToHost\": 111.12,\n \"airbnbTotalPaidAmount\": 111.12,\n \"airbnbTransientOccupancyTaxPaidAmount\": 111.12,\n \"airbnbCancellationPolicy\": \"moderate\"\n,\n \"customerUserId\": null\n,\n \"customFieldValues\": [{\"customFieldId\": 167, \"value\": \"Custom field value one\"}, {\"customFieldId\": 243, \"value\": \"Custom field value two\"}]\n}",
CURLOPT_HTTPHEADER => array(
"Cache-control: no-cache",
"Content-type: application/json",
"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0In0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0IiwiaWF0IjoxNTI4MjgzMjgwLCJuYmYiOjE1MjgyODMyODAsImV4cCI6MTU0MzgzNTI4MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.pzzHM2Qebad--FC8iwWZrFpblWQyiCKiroaEyrXKPWTXug3soe-62HK1bzZVlLQEJa166AtkevdEjXkOhQ6yRMJh3LlINrOKpLOSZKeTyMIydtYCdXJyWqgl3b3llAk8dZyQ8L8J_oyV9sRWMhy7MuIgAyFf1ITdVS2Z94KdyII"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var data = JSON.stringify({
"listingMapId": 40160,
"isManuallyChecked": 0,
"guestName": "Andrew Peterson",
"guestFirstName": "Andrew",
"guestLastName": "Peterson",
"guestZipCode": "TX 78705",
"guestAddress": "3411 Cedar street",
"guestCity": "Austin",
"guestCountry": "US",
"guestEmail": "mail@test.com",
"guestPicture": "https://a0.muscache.com/im/pictures/3c4d82ed-196d-493a-a43b-07fcc70d5ccd.jpg?aki_policy=profile_small",
"guestRecommendations": 1,
"guestTrips": 1,
"guestWork": "test",
"isGuestIdentityVerified": 2,
"isGuestVerifiedByEmail": 2,
"isGuestVerifiedByWorkEmail": 2,
"isGuestVerifiedByFacebook": 2,
"isGuestVerifiedByGovernmentId": 2,
"isGuestVerifiedByPhone": 2,
"isGuestVerifiedByReviews": 2,
"numberOfGuests": 1,
"adults": 1,
"children": null,
"infants": null,
"pets": null,
"arrivalDate": "2018-04-15",
"departureDate": "2018-04-16",
"checkInTime": null,
"checkOutTime": null,
"phone": "+75125551212",
"totalPrice": 267,
"taxAmount": null,
"channelCommissionAmount": null,
"cleaningFee": null,
"securityDepositFee": null,
"isPaid": null,
"currency": "USD",
"hostNote": null,
"guestNote": null,
"guestLocale": null,
"doorCode": "2222222",
"doorCodeVendor": "test2",
"doorCodeInstruction": "test2",
"comment": null,
"airbnbExpectedPayoutAmount": 111.12,
"airbnbListingBasePrice": 110,
"airbnbListingCancellationHostFee": 12.02,
"airbnbListingCancellationPayout": 122,
"airbnbListingCleaningFee": 1,
"airbnbListingHostFee": 43,
"airbnbListingSecurityPrice": 12,
"airbnbOccupancyTaxAmountPaidToHost": 332,
"airbnbTotalPaidAmount": 12,
"airbnbTransientOccupancyTaxPaidAmount": 0,
"airbnbCancellationPolicy": "moderate",
"customerUserId": null,
"customFieldValues": [
{
"customFieldId": 167,
"value": "Custom field value one"
},
{
"customFieldId": 243,
"value": "Custom field value two"
}
]
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("PUT", "https://api.hostaway.com/v1/reservations/117277?forceOverbooking=1");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0In0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0IiwiaWF0IjoxNTI4MjgzMjgwLCJuYmYiOjE1MjgyODMyODAsImV4cCI6MTU0MzgzNTI4MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.pzzHM2Qebad--FC8iwWZrFpblWQyiCKiroaEyrXKPWTXug3soe-62HK1bzZVlLQEJa166AtkevdEjXkOhQ6yRMJh3LlINrOKpLOSZKeTyMIydtYCdXJyWqgl3b3llAk8dZyQ8L8J_oyV9sRWMhy7MuIgAyFf1ITdVS2Z94KdyII");
xhr.setRequestHeader("Content-type", "application/json");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send(data);
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"listingMapId\": 40160,\n \"isManuallyChecked\": 0,\n \"guestName\": \"Andrew Peterson\",\n \"guestFirstName\": \"Andrew\",\n \"guestLastName\": \"Peterson\",\n \"guestZipCode\": \"TX 78705\",\n \"guestAddress\": \"3411 Cedar street\",\n \"guestCity\": \"Austin\",\n \"guestCountry\": \"US\",\n \"guestEmail\": \"mail@test.com\",\n \"guestPicture\": \"https://a0.muscache.com/im/pictures/3c4d82ed-196d-493a-a43b-07fcc70d5ccd.jpg?aki_policy=profile_small\",\n \"guestRecommendations\": 1,\n \"guestTrips\": 1,\n \"guestWork\": \"test\",\n \"isGuestIdentityVerified\": 2,\n \"isGuestVerifiedByEmail\": 2,\n \"isGuestVerifiedByWorkEmail\": 2,\n \"isGuestVerifiedByFacebook\": 2,\n \"isGuestVerifiedByGovernmentId\": 2,\n \"isGuestVerifiedByPhone\": 2,\n \"isGuestVerifiedByReviews\": 2,\n \"numberOfGuests\": 1,\n \"adults\": 1,\n \"children\": null,\n \"infants\": null,\n \"pets\": null,\n \"arrivalDate\": \"2018-04-15\",\n \"departureDate\": \"2018-04-16\",\n \"checkInTime\": null,\n \"checkOutTime\": null,\n \"phone\": \"+75125551212\",\n \"totalPrice\": 267,\n \"taxAmount\": null,\n \"channelCommissionAmount\": null,\n \"cleaningFee\": null,\n \"securityDepositFee\": null,\n \"isPaid\": null,\n \"currency\": \"USD\",\n \"hostNote\": null,\n \"guestNote\": null,\n \"guestLocale\": null,\n \"doorCode\": \"2222222\",\n \"doorCodeVendor\": \"test2\",\n \"doorCodeInstruction\": \"test2\", \n \"comment\": null,\n \"airbnbExpectedPayoutAmount\": 111.12,\n \"airbnbListingBasePrice\": 110,\n \"airbnbListingCancellationHostFee\": 12.02,\n \"airbnbListingCancellationPayout\": 122,\n \"airbnbListingCleaningFee\": 1,\n \"airbnbListingHostFee\": 43,\n \"airbnbListingSecurityPrice\": 111.12,\n \"airbnbOccupancyTaxAmountPaidToHost\": 111.12,\n \"airbnbTotalPaidAmount\": 111.12,\n \"airbnbTransientOccupancyTaxPaidAmount\": 111.12,\n \"airbnbCancellationPolicy\": \"moderate\"\n,\n \"customerUserId\": null\n,\n \"customFieldValues\": [{\"customFieldId\": 167, \"value\": \"Custom field value one\"}, {\"customFieldId\": 243, \"value\": \"Custom field value two\"}]\n}");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/reservations/117277?forceOverbooking=1")
.put(body)
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0In0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0IiwiaWF0IjoxNTI4MjgzMjgwLCJuYmYiOjE1MjgyODMyODAsImV4cCI6MTU0MzgzNTI4MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.pzzHM2Qebad--FC8iwWZrFpblWQyiCKiroaEyrXKPWTXug3soe-62HK1bzZVlLQEJa166AtkevdEjXkOhQ6yRMJh3LlINrOKpLOSZKeTyMIydtYCdXJyWqgl3b3llAk8dZyQ8L8J_oyV9sRWMhy7MuIgAyFf1ITdVS2Z94KdyII")
.addHeader("Content-type", "application/json")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import http.client
import json
conn = http.client.HTTPSConnection("api.hostaway.com")
payload = {
"listingMapId": 40160,
"isManuallyChecked": 0,
"guestName": "Andrew Peterson",
"guestFirstName": "Andrew",
"guestLastName": "Peterson",
"guestZipCode": "TX 78705",
"guestAddress": "3411 Cedar street",
"guestCity": "Austin",
"guestCountry": "US",
"guestEmail": "mail@test.com",
"guestPicture": "https://a0.muscache.com/im/pictures/3c4d82ed-196d-493a-a43b-07fcc70d5ccd.jpg?aki_policy=profile_small",
"guestRecommendations": 1,
"guestTrips": 1,
"guestWork": "test",
"isGuestIdentityVerified": 2,
"isGuestVerifiedByEmail": 2,
"isGuestVerifiedByWorkEmail": 2,
"isGuestVerifiedByFacebook": 2,
"isGuestVerifiedByGovernmentId": 2,
"isGuestVerifiedByPhone": 2,
"isGuestVerifiedByReviews": 2,
"numberOfGuests": 1,
"adults": 1,
"children": None,
"infants": None,
"pets": None,
"arrivalDate": "2018-04-15",
"departureDate": "2018-04-16",
"checkInTime": None,
"checkOutTime": None,
"phone": "+75125551212",
"totalPrice": 267,
"taxAmount": None,
"channelCommissionAmount": None,
"cleaningFee": None,
"securityDepositFee": None,
"isPaid": None,
"currency": "USD",
"hostNote": None,
"guestNote": None,
"guestLocale": None,
"doorCode": "2222222",
"doorCodeVendor": "test2",
"doorCodeInstruction": "test2",
"comment": None,
"airbnbExpectedPayoutAmount": 111.12,
"airbnbListingBasePrice": 110,
"airbnbListingCancellationHostFee": 12.02,
"airbnbListingCancellationPayout": 122,
"airbnbListingCleaningFee": 1,
"airbnbListingHostFee": 43,
"airbnbListingSecurityPrice": 111.12,
"airbnbOccupancyTaxAmountPaidToHost": 111.12,
"airbnbTotalPaidAmount": 111.12,
"airbnbTransientOccupancyTaxPaidAmount": 111.12,
"airbnbCancellationPolicy": "moderate",
"customerUserId": None,
"customFieldValues": [
{"customFieldId": 167, "value": "Custom field value one"},
{"customFieldId": 243, "value": "Custom field value two"}
]
}
payload_json = json.dumps(payload)
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0In0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0IiwiaWF0IjoxNTI4MjgzMjgwLCJuYmYiOjE1MjgyODMyODAsImV4cCI6MTU0MzgzNTI4MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.pzzHM2Qebad--FC8iwWZrFpblWQyiCKiroaEyrXKPWTXug3soe-62HK1bzZVlLQEJa166AtkevdEjXkOhQ6yRMJh3LlINrOKpLOSZKeTyMIydtYCdXJyWqgl3b3llAk8dZyQ8L8J_oyV9sRWMhy7MuIgAyFf1ITdVS2Z94KdyII",
'Content-type': "application/json",
'Cache-control': "no-cache",
}
conn.request("PUT", "v1/reservations/117277?forceOverbooking=1", payload_json, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
PUT https://api.hostaway.com/v1/reservations/{reservationId}?forceOverbooking=1
A reservation object should be provided in the request body. It’s not possible to update the listingMapId of a reservation with this request.
Query parameters
Query parameter | Required | Type | Description |
---|---|---|---|
forceOverbooking |
no | int | Ignore overbooking protection |
Response
The updated reservation object or error response.
Cancel a reservation
Request
curl --request PUT \
--url https://api.hostaway.com/v1/reservations/117243/statuses/cancelled \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjRhODc4MWU0YjQ5ZjYxMDc4NzEzM2MxMDQ1ODQ1MTQ1ZDNjNTZkMjliODkyYjc1ZGQ3Yjg1ZGZiNmYxMTI4ZDA5NTM2MWYyZDQ2MDc5NmQwIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6IjRhODc4MWU0YjQ5ZjYxMDc4NzEzM2MxMDQ1ODQ1MTQ1ZDNjNTZkMjliODkyYjc1ZGQ3Yjg1ZGZiNmYxMTI4ZDA5NTM2MWYyZDQ2MDc5NmQwIiwiaWF0IjoxNTE3Mzg5NTM1LCJuYmYiOjE1MTczODk1MzUsImV4cCI6MTUzMjk0MTUzNSwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.A_9lN7I-0qO663ELIVMMnI8u6gnfnFdJy7Fi5fpj5TGObPzwmCW1R2S_-H63ve65pId6T7gTaZK1HWc4w87lIyodAsKJotC8PDDZmhlcc3FyxuZ-0IwbmZic7ZR3aDmifEcE8ixh6LF60yb55ldYGTcxsMY-KmSz-Z3wfwpFtFs' \
--header 'Cache-control: no-cache' \
--header 'Content-type: application/json' \
--data '{\n "cancelledBy": "guest"\n}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/reservations/117243/statuses/cancelled",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "{\n\t\"cancelledBy\": \"guest\"\n}",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjRhODc4MWU0YjQ5ZjYxMDc4NzEzM2MxMDQ1ODQ1MTQ1ZDNjNTZkMjliODkyYjc1ZGQ3Yjg1ZGZiNmYxMTI4ZDA5NTM2MWYyZDQ2MDc5NmQwIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6IjRhODc4MWU0YjQ5ZjYxMDc4NzEzM2MxMDQ1ODQ1MTQ1ZDNjNTZkMjliODkyYjc1ZGQ3Yjg1ZGZiNmYxMTI4ZDA5NTM2MWYyZDQ2MDc5NmQwIiwiaWF0IjoxNTE3Mzg5NTM1LCJuYmYiOjE1MTczODk1MzUsImV4cCI6MTUzMjk0MTUzNSwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.A_9lN7I-0qO663ELIVMMnI8u6gnfnFdJy7Fi5fpj5TGObPzwmCW1R2S_-H63ve65pId6T7gTaZK1HWc4w87lIyodAsKJotC8PDDZmhlcc3FyxuZ-0IwbmZic7ZR3aDmifEcE8ixh6LF60yb55ldYGTcxsMY-KmSz-Z3wfwpFtFs",
"Cache-control: no-cache",
"Content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var data = JSON.stringify({
"cancelledBy": "guest"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("PUT", "https://api.hostaway.com/v1/reservations/117243/statuses/cancelled");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjRhODc4MWU0YjQ5ZjYxMDc4NzEzM2MxMDQ1ODQ1MTQ1ZDNjNTZkMjliODkyYjc1ZGQ3Yjg1ZGZiNmYxMTI4ZDA5NTM2MWYyZDQ2MDc5NmQwIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6IjRhODc4MWU0YjQ5ZjYxMDc4NzEzM2MxMDQ1ODQ1MTQ1ZDNjNTZkMjliODkyYjc1ZGQ3Yjg1ZGZiNmYxMTI4ZDA5NTM2MWYyZDQ2MDc5NmQwIiwiaWF0IjoxNTE3Mzg5NTM1LCJuYmYiOjE1MTczODk1MzUsImV4cCI6MTUzMjk0MTUzNSwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.A_9lN7I-0qO663ELIVMMnI8u6gnfnFdJy7Fi5fpj5TGObPzwmCW1R2S_-H63ve65pId6T7gTaZK1HWc4w87lIyodAsKJotC8PDDZmhlcc3FyxuZ-0IwbmZic7ZR3aDmifEcE8ixh6LF60yb55ldYGTcxsMY-KmSz-Z3wfwpFtFs");
xhr.setRequestHeader("Content-type", "application/json");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send(data);
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n\t\"cancelledBy\": \"guest\"\n}");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/reservations/117243/statuses/cancelled")
.put(body)
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjRhODc4MWU0YjQ5ZjYxMDc4NzEzM2MxMDQ1ODQ1MTQ1ZDNjNTZkMjliODkyYjc1ZGQ3Yjg1ZGZiNmYxMTI4ZDA5NTM2MWYyZDQ2MDc5NmQwIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6IjRhODc4MWU0YjQ5ZjYxMDc4NzEzM2MxMDQ1ODQ1MTQ1ZDNjNTZkMjliODkyYjc1ZGQ3Yjg1ZGZiNmYxMTI4ZDA5NTM2MWYyZDQ2MDc5NmQwIiwiaWF0IjoxNTE3Mzg5NTM1LCJuYmYiOjE1MTczODk1MzUsImV4cCI6MTUzMjk0MTUzNSwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.A_9lN7I-0qO663ELIVMMnI8u6gnfnFdJy7Fi5fpj5TGObPzwmCW1R2S_-H63ve65pId6T7gTaZK1HWc4w87lIyodAsKJotC8PDDZmhlcc3FyxuZ-0IwbmZic7ZR3aDmifEcE8ixh6LF60yb55ldYGTcxsMY-KmSz-Z3wfwpFtFs")
.addHeader("Content-type", "application/json")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import http.client
conn = http.client.HTTPSConnection("api.hostaway.com")
payload = "{\n\t\"cancelledBy\": \"guest\"\n}"
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjRhODc4MWU0YjQ5ZjYxMDc4NzEzM2MxMDQ1ODQ1MTQ1ZDNjNTZkMjliODkyYjc1ZGQ3Yjg1ZGZiNmYxMTI4ZDA5NTM2MWYyZDQ2MDc5NmQwIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6IjRhODc4MWU0YjQ5ZjYxMDc4NzEzM2MxMDQ1ODQ1MTQ1ZDNjNTZkMjliODkyYjc1ZGQ3Yjg1ZGZiNmYxMTI4ZDA5NTM2MWYyZDQ2MDc5NmQwIiwiaWF0IjoxNTE3Mzg5NTM1LCJuYmYiOjE1MTczODk1MzUsImV4cCI6MTUzMjk0MTUzNSwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.A_9lN7I-0qO663ELIVMMnI8u6gnfnFdJy7Fi5fpj5TGObPzwmCW1R2S_-H63ve65pId6T7gTaZK1HWc4w87lIyodAsKJotC8PDDZmhlcc3FyxuZ-0IwbmZic7ZR3aDmifEcE8ixh6LF60yb55ldYGTcxsMY-KmSz-Z3wfwpFtFs",
'Content-type': "application/json",
'Cache-control': "no-cache"
}
conn.request("PUT", "/v1/reservations/117243/statuses/cancelled", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
PUT https://api.hostaway.com/v1/reservations/{reservationId}/statuses/cancelled
cancelledBy
JSON body parameter should be specified with value host
or guest
.
Response
The cancelled reservation object or error response.
Delete a reservation
Request
curl -X DELETE \
https://api.hostaway.com/v1/reservations/30 \
-H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIiwiaWF0IjoxNDk4NTc5NzQ0LCJuYmYiOjE0OTg1Nzk3NDQsImV4cCI6MTUxNDM5MDk0NCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.TsbJaDOZ0VlEF4vBg7mqLX8DxEuu5rjtsmqix1IbsEcR7F9cdx8F3dDq2zOc6mw8FNAfXT8xp1r5qKu2AYoxv4ublZhxxW0Y6uPSFs0jv5Fh5lliNBJAeQqFOChOVEbYzdbfH_6uu4HHSL31si1RvpVccAjA1Ap9vXlSg3DcPgw' \
-H 'Cache-control: no-cache' \
-H 'Content-type: application/json'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/reservations/30",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIiwiaWF0IjoxNDk4NTc5NzQ0LCJuYmYiOjE0OTg1Nzk3NDQsImV4cCI6MTUxNDM5MDk0NCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.TsbJaDOZ0VlEF4vBg7mqLX8DxEuu5rjtsmqix1IbsEcR7F9cdx8F3dDq2zOc6mw8FNAfXT8xp1r5qKu2AYoxv4ublZhxxW0Y6uPSFs0jv5Fh5lliNBJAeQqFOChOVEbYzdbfH_6uu4HHSL31si1RvpVccAjA1Ap9vXlSg3DcPgw",
"Cache-control: no-cache",
"Content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("DELETE", "https://api.hostaway.com/v1/reservations/30");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIiwiaWF0IjoxNDk4NTc5NzQ0LCJuYmYiOjE0OTg1Nzk3NDQsImV4cCI6MTUxNDM5MDk0NCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.TsbJaDOZ0VlEF4vBg7mqLX8DxEuu5rjtsmqix1IbsEcR7F9cdx8F3dDq2zOc6mw8FNAfXT8xp1r5qKu2AYoxv4ublZhxxW0Y6uPSFs0jv5Fh5lliNBJAeQqFOChOVEbYzdbfH_6uu4HHSL31si1RvpVccAjA1Ap9vXlSg3DcPgw");
xhr.setRequestHeader("Content-type", "application/json");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send(data);
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/reservations/30")
.delete(null)
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIiwiaWF0IjoxNDk4NTc5NzQ0LCJuYmYiOjE0OTg1Nzk3NDQsImV4cCI6MTUxNDM5MDk0NCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.TsbJaDOZ0VlEF4vBg7mqLX8DxEuu5rjtsmqix1IbsEcR7F9cdx8F3dDq2zOc6mw8FNAfXT8xp1r5qKu2AYoxv4ublZhxxW0Y6uPSFs0jv5Fh5lliNBJAeQqFOChOVEbYzdbfH_6uu4HHSL31si1RvpVccAjA1Ap9vXlSg3DcPgw")
.addHeader("Content-type", "application/json")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import http.client
conn = http.client.HTTPSConnection("api.hostaway.com")
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIiwiaWF0IjoxNDk4NTc5NzQ0LCJuYmYiOjE0OTg1Nzk3NDQsImV4cCI6MTUxNDM5MDk0NCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.TsbJaDOZ0VlEF4vBg7mqLX8DxEuu5rjtsmqix1IbsEcR7F9cdx8F3dDq2zOc6mw8FNAfXT8xp1r5qKu2AYoxv4ublZhxxW0Y6uPSFs0jv5Fh5lliNBJAeQqFOChOVEbYzdbfH_6uu4HHSL31si1RvpVccAjA1Ap9vXlSg3DcPgw",
'Content-type': "application/json",
'Cache-control': "no-cache"
}
conn.request("DELETE", "/v1/reservations/30", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
DELETE https://api.hostaway.com/v1/reservations/{reservationId}
Response
An empty success response or error response.
Reservation Channels
We have these channels predefined:
Channel ID | Channel Name |
---|---|
2018 | airbnbOfficial |
2002 | homeaway |
2005 | bookingcom |
2007 | expedia |
2009 | homeawayical |
2010 | vrboical |
2000 | direct |
2013 | bookingengine |
2015 | customIcal |
2016 | tripadvisorical |
2017 | wordpress |
2019 | marriott |
2020 | partner |
2021 | gds |
2022 |
Reservation price calculation
Calculate reservation price
This API was updated on 2022-11-01. If you use API version 1 (GET request) we recommend to migrate to API version 2 because previous version is deprecated. It is quite similar with previous version but allow you to create reservation with flexible price breakdown.
If you need to use reservation coupon discount you should create reservation coupon object before price calculation and then calculate price by passing reservationCouponId.
For getting reservationCouponId
please follow create reservation coupon object
Request
curl --location --request POST --data-raw '{"startingDate": "2022-11-01", "endingDate": "2022-11-03", "numberOfGuests": 2, "reservationCouponId": 1, "markup": 1, "version": 2}'
'https://api.hostaway.com/v1/listings/90632/calendar/priceDetails' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIyODY3MyIsImp0aSI6ImFmMjM3NWZiYjJkZmNiM2Y3YmJhZTk2MTFkY2YxYTc1ZGU5MjllZTQ0YWIxYjcwZmE4NzQzYjNlNGE1M2I5ZDBiNzk2NmVhZDk2MDQ5Nzg3IiwiaWF0IjoxNjY3MzEyMTYwLCJuYmYiOjE2NjczMTIxNjAsImV4cCI6MTczMDQ3MDU2MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjI3MTd9.ArIr26BPlgMDbexpkR-J2Xi_NrLdCXi186YTOYlZHlTMzXrfopeY2T9tzKC6oNNRoedEGKCVrSrDiEnt00fErNETaRiYj2wH7dwoHpmOgEqfajhQImUFlC_uHuMgtyoN1slzX9oj80px156RaZEK6Dnxf1qXsFhWsb0YETQFohc'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/listings/90632/calendar/priceDetails",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => '{"startingDate": "2022-11-01", "endingDate": "2022-11-03", "numberOfGuests": 2, "reservationCouponId": 1, "markup": 1, "version": 2}'
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIyODY3MyIsImp0aSI6ImFmMjM3NWZiYjJkZmNiM2Y3YmJhZTk2MTFkY2YxYTc1ZGU5MjllZTQ0YWIxYjcwZmE4NzQzYjNlNGE1M2I5ZDBiNzk2NmVhZDk2MDQ5Nzg3IiwiaWF0IjoxNjY3MzEyMTYwLCJuYmYiOjE2NjczMTIxNjAsImV4cCI6MTczMDQ3MDU2MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjI3MTd9.ArIr26BPlgMDbexpkR-J2Xi_NrLdCXi186YTOYlZHlTMzXrfopeY2T9tzKC6oNNRoedEGKCVrSrDiEnt00fErNETaRiYj2wH7dwoHpmOgEqfajhQImUFlC_uHuMgtyoN1slzX9oj80px156RaZEK6Dnxf1qXsFhWsb0YETQFohc"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
var data = "{\n \"startingDate\": \"2022-12-01\",\n \"endingDate\": \"2022-12-31\",\n \"numberOfGuests\": \"1\",\n \"cleaningFee\": 123,\n \"version\": 2,\n \"weeklyDiscount\": \"\",\n \"includeInTotal\": [\n \"parkingFee\",\n \"employeeDiscount\"\n ]\n}";
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.hostaway.com/v1/listings/90632/calendar/priceDetails");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIyODY3MyIsImp0aSI6ImFmMjM3NWZiYjJkZmNiM2Y3YmJhZTk2MTFkY2YxYTc1ZGU5MjllZTQ0YWIxYjcwZmE4NzQzYjNlNGE1M2I5ZDBiNzk2NmVhZDk2MDQ5Nzg3IiwiaWF0IjoxNjY3MzEyMTYwLCJuYmYiOjE2NjczMTIxNjAsImV4cCI6MTczMDQ3MDU2MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjI3MTd9.ArIr26BPlgMDbexpkR-J2Xi_NrLdCXi186YTOYlZHlTMzXrfopeY2T9tzKC6oNNRoedEGKCVrSrDiEnt00fErNETaRiYj2wH7dwoHpmOgEqfajhQImUFlC_uHuMgtyoN1slzX9oj80px156RaZEK6Dnxf1qXsFhWsb0YETQFohc");
xhr.send(data);
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "{\n \"startingDate\": \"2022-12-01\",\n \"endingDate\": \"2022-12-31\",\n \"numberOfGuests\": \"1\",\n \"cleaningFee\": 123,\n \"version\": 2,\n \"weeklyDiscount\": \"\",\n \"includeInTotal\": [\n \"parkingFee\",\n \"employeeDiscount\"\n ]\n}");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/listings/40100/calendar/priceDetails")
.method("POST", body)
.addHeader("Authorization", "Bearer {{publicApiToken}}")
.addHeader("Content-type", "text/plain")
.build();
Response response = client.newCall(request).execute();
import http.client
import json
conn = http.client.HTTPSConnection("api.hostaway.com")
payload = {
"startingDate": "2022-12-01",
"endingDate": "2022-12-31",
"numberOfGuests": "1",
"version": 2
}
headers = {
'Authorization': 'Bearer {{publicApiToken}}',
'Content-type': 'application/json',
'Cache-control': 'no-cache'
}
payload_json = json.dumps(payload)
conn.request("POST", "/v1/listings/40100/calendar/priceDetails", payload_json, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
POST https://api.hostaway.com/v1/listings/{listingId}/calendar/priceDetails
Json Parameter | Required | Type | Description |
---|---|---|---|
startingDate |
yes | date | Arrival date |
endingDate |
yes | date | Departure date |
numberOfGuests |
yes | int | Number of guest |
markup |
no | float | Markup must be more then 1.0 |
reservationCouponId |
no | int | Reservation Coupon ID / How to create reservation coupon object |
version |
yes | int | Please use version 2 (version = 2) |
Please note: for getting reservationCouponId
please follow How to create reservation coupon object
Response
Price details object.
Json Parameter | Required | Type | Description |
---|---|---|---|
totalPrice |
yes | float | Calculated total price |
components |
yes | array | Price components |
Price component object.
Json Parameter | Required | Type | Description |
---|---|---|---|
listingFeeSettingId |
no | int | Listing fee setting ID |
type |
yes | string | Type of component (price, tax, fee, discount) |
name |
yes | string | Name of component |
title |
yes | string | Title of component |
alias |
yes | string | Alias of component |
quantity |
no | int | Quantity of component (only if component is quantity selectable) |
value |
yes | float | Price of component |
total |
yes | float | Total amount of component |
isIncludedInTotalPrice |
yes | int | Included or not included in total price |
isOverriddenByUser |
yes | int | Is component changed or not by the client |
isMandatory |
yes | int | Сomponent is mandatory for creating reservation or not |
isDeleted |
yes | int | Сomponent is deleted or not by the client |
{
"status": "success",
"result": {
"totalPrice": 13520,
"originalTotalPrice": 0,
"selectedComponentsAmount": 0,
"components": [
{
"id": null,
"listingFeeSettingId": null,
"type": "price",
"name": "baseRate",
"title": "Base rate",
"alias": null,
"quantity": null,
"value": 12320,
"total": 12320,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 0,
"isQuantitySelectable": 0,
"isMandatory": null,
"isDeleted": 0
},
{
"id": null,
"listingFeeSettingId": null,
"type": "fee",
"name": "cleaningFee",
"title": "Cleaning fee",
"alias": null,
"quantity": null,
"value": 500,
"total": 500,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 0,
"isQuantitySelectable": 0,
"isMandatory": null,
"isDeleted": 0
},
{
"id": null,
"listingFeeSettingId": null,
"type": "tax",
"name": "vat",
"title": "VAT / GST",
"alias": null,
"quantity": null,
"value": 200,
"total": 200,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 0,
"isQuantitySelectable": 0,
"isMandatory": null,
"isDeleted": 0
},
{
"id": null,
"listingFeeSettingId": null,
"type": "fee",
"name": "damageDeposit",
"title": "Damage deposit",
"alias": null,
"quantity": null,
"value": 500,
"total": 500,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 0,
"isQuantitySelectable": 0,
"isMandatory": null,
"isDeleted": 0
}
],
"extraComponents": [],
"selectedComponents": []
}
}
Calculate reservation price with extras
You can add not mandatory extras (mondatory is added automatically) in total price calculation request and get total price and components for creating new reservation with print components in it.
For getting list of available extras please check Listing fee settings
Request
curl --location --request POST 'https://api.hostaway.com/v1/listings/90632/calendar/priceDetails' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIyODY3MyIsImp0aSI6IjJjYjk4NWRlNDIzYmExZTBiMzdiZjgzNjdjOWExZDE0ZmIwNDE3YjIxNGQ0Yjk4OGJkYzE5NjU3NjI4YmFiZDQ0YTQxNGRlZmI5NTYyMGRhIiwiaWF0IjoxNjY3MzEyNjUxLCJuYmYiOjE2NjczMTI2NTEsImV4cCI6MTczMDQ3MTA1MSwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjI3MTd9.JSvlt8VuBvPygoSjBeShiG0SQgwleninXSMuD4S4NwpsvljtHmsfM5CF1uQT-FTVeRuc8BdxNVPFuobWovQIEOlh6dYZJtaYv8PECp-EzgJCZKyv7-sY6cEC9s8Kf8hmJP3uOc-T90gxmOmOWm5zeL09HzWrdOqF_b-WgMifBtQ' \
--header 'Content-type: text/plain' \
--data-raw '{
"startingDate": "2020-12-01",
"endingDate": "2020-12-31",
"numberOfGuests": "1",
"version": 2,
"components": [
{
"listingFeeSettingId": 17643,
"name": "childrenExtraFee"
}
]
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.hostaway.com/v1/listings/90632/calendar/priceDetails',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"startingDate": "2020-12-01",
"endingDate": "2020-12-31",
"numberOfGuests": "1",
"version": 2,
"components": [
{
"listingFeeSettingId": 17643,
"name": "childrenExtraFee"
}
]
}',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIyODY3MyIsImp0aSI6IjJjYjk4NWRlNDIzYmExZTBiMzdiZjgzNjdjOWExZDE0ZmIwNDE3YjIxNGQ0Yjk4OGJkYzE5NjU3NjI4YmFiZDQ0YTQxNGRlZmI5NTYyMGRhIiwiaWF0IjoxNjY3MzEyNjUxLCJuYmYiOjE2NjczMTI2NTEsImV4cCI6MTczMDQ3MTA1MSwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjI3MTd9.JSvlt8VuBvPygoSjBeShiG0SQgwleninXSMuD4S4NwpsvljtHmsfM5CF1uQT-FTVeRuc8BdxNVPFuobWovQIEOlh6dYZJtaYv8PECp-EzgJCZKyv7-sY6cEC9s8Kf8hmJP3uOc-T90gxmOmOWm5zeL09HzWrdOqF_b-WgMifBtQ',
'Content-type: text/plain'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var data = "{\n \"startingDate\": \"2020-12-01\",\n \"endingDate\": \"2020-12-31\",\n \"numberOfGuests\": \"1\",\n \"version\": 2,\n \"components\": [\n {\n \"listingFeeSettingId\": 17643,\n \"name\": \"childrenExtraFee\"\n }\n ]\n}";
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.hostaway.com/v1/listings/90632/calendar/priceDetails");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIyODY3MyIsImp0aSI6IjJjYjk4NWRlNDIzYmExZTBiMzdiZjgzNjdjOWExZDE0ZmIwNDE3YjIxNGQ0Yjk4OGJkYzE5NjU3NjI4YmFiZDQ0YTQxNGRlZmI5NTYyMGRhIiwiaWF0IjoxNjY3MzEyNjUxLCJuYmYiOjE2NjczMTI2NTEsImV4cCI6MTczMDQ3MTA1MSwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjI3MTd9.JSvlt8VuBvPygoSjBeShiG0SQgwleninXSMuD4S4NwpsvljtHmsfM5CF1uQT-FTVeRuc8BdxNVPFuobWovQIEOlh6dYZJtaYv8PECp-EzgJCZKyv7-sY6cEC9s8Kf8hmJP3uOc-T90gxmOmOWm5zeL09HzWrdOqF_b-WgMifBtQ");
xhr.setRequestHeader("Content-type", "text/plain");
xhr.send(data);
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "{\n \"startingDate\": \"2020-12-01\",\n \"endingDate\": \"2020-12-31\",\n \"numberOfGuests\": \"1\",\n \"version\": 2,\n \"components\": [\n {\n \"listingFeeSettingId\": 17643,\n \"name\": \"childrenExtraFee\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/listings/90632/calendar/priceDetails")
.method("POST", body)
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIyODY3MyIsImp0aSI6IjJjYjk4NWRlNDIzYmExZTBiMzdiZjgzNjdjOWExZDE0ZmIwNDE3YjIxNGQ0Yjk4OGJkYzE5NjU3NjI4YmFiZDQ0YTQxNGRlZmI5NTYyMGRhIiwiaWF0IjoxNjY3MzEyNjUxLCJuYmYiOjE2NjczMTI2NTEsImV4cCI6MTczMDQ3MTA1MSwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjI3MTd9.JSvlt8VuBvPygoSjBeShiG0SQgwleninXSMuD4S4NwpsvljtHmsfM5CF1uQT-FTVeRuc8BdxNVPFuobWovQIEOlh6dYZJtaYv8PECp-EzgJCZKyv7-sY6cEC9s8Kf8hmJP3uOc-T90gxmOmOWm5zeL09HzWrdOqF_b-WgMifBtQ")
.addHeader("Content-type", "text/plain")
.build();
Response response = client.newCall(request).execute();
import http.client
import json
conn = http.client.HTTPSConnection("api.hostaway.com")
payload = {
"startingDate": "2020-12-01",
"endingDate": "2020-12-31",
"numberOfGuests": "1",
"version": 2,
"components": [
{
"listingFeeSettingId": 17643,
"name": "childrenExtraFee"
}
]
}
headers = {
'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIyODY3MyIsImp0aSI6IjJjYjk4NWRlNDIzYmExZTBiMzdiZjgzNjdjOWExZDE0ZmIwNDE3YjIxNGQ0Yjk4OGJkYzE5NjU3NjI4YmFiZDQ0YTQxNGRlZmI5NTYyMGRhIiwiaWF0IjoxNjY3MzEyNjUxLCJuYmYiOjE2NjczMTI2NTEsImV4cCI6MTczMDQ3MTA1MSwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjI3MTd9.JSvlt8VuBvPygoSjBeShiG0SQgwleninXSMuD4S4NwpsvljtHmsfM5CF1uQT-FTVeRuc8BdxNVPFuobWovQIEOlh6dYZJtaYv8PECp-EzgJCZKyv7-sY6cEC9s8Kf8hmJP3uOc-T90gxmOmOWm5zeL09HzWrdOqF_b-WgMifBtQ',
'Content-type': 'application/json',
'Cache-control': 'no-cache'
}
payload_json = json.dumps(payload)
conn.request("POST", "/v1/listings/90632/calendar/priceDetails", payload_json, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
POST https://api.hostaway.com/v1/listings/{listingId}/calendar/priceDetails
Json Parameter | Required | Type | Description |
---|---|---|---|
startingDate |
yes | date | Arrival date |
endingDate |
yes | date | Departure date |
numberOfGuests |
yes | int | Number of guest |
markup |
no | float | Markup must be more then 1.0 |
reservationCouponId |
no | int | Reservation Coupon ID |
version |
yes | int | Please use version 2 (version = 2) |
components |
no | array | Components for midifying or adding extras (please check example) |
Response
Price details object.
Json Parameter | Required | Type | Description |
---|---|---|---|
totalPrice |
yes | float | Calculated total price |
components |
yes | array | Price components |
Price component object.
Json Parameter | Required | Type | Description |
---|---|---|---|
listingFeeSettingId |
no | int | Listing fee setting ID |
type |
yes | string | Type of component (price, tax, fee, discount) |
name |
yes | string | Name of component |
title |
yes | string | Title of component |
alias |
yes | string | Alias of component |
quantity |
no | int | Quantity of component (only if component is quantity selectable) |
value |
yes | float | Price of component |
total |
yes | float | Total amount of component |
isIncludedInTotalPrice |
yes | int | Included or not included in total price |
isOverriddenByUser |
yes | int | Is component changed or not by the client |
isMandatory |
yes | int | Сomponent is mandatory for creating reservation or not |
isDeleted |
yes | int | Сomponent is deleted or not by the client |
{
"status": "success",
"result": {
"totalPrice": 313160,
"originalTotalPrice": 0,
"selectedComponentsAmount": 0,
"components": [
{
"id": null,
"listingFeeSettingId": null,
"type": "price",
"name": "baseRate",
"title": "Base rate",
"alias": null,
"quantity": null,
"value": 315000,
"total": 315000,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 0,
"isQuantitySelectable": 0,
"isMandatory": null,
"isDeleted": 0
},
{
"id": null,
"listingFeeSettingId": null,
"type": "discount",
"name": "monthlyDiscount",
"title": "Monthly discount",
"alias": null,
"quantity": null,
"value": -31500,
"total": -31500,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 0,
"isQuantitySelectable": 0,
"isMandatory": null,
"isDeleted": 0
},
{
"id": null,
"listingFeeSettingId": null,
"type": "fee",
"name": "cleaningFee",
"title": "Cleaning fee",
"alias": null,
"quantity": null,
"value": 500,
"total": 500,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 0,
"isQuantitySelectable": 0,
"isMandatory": null,
"isDeleted": 0
},
{
"id": null,
"listingFeeSettingId": 17643,
"type": "fee",
"name": "childrenExtraFee",
"title": "Children Extra fee",
"alias": "",
"quantity": null,
"value": 100,
"total": 100,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 0,
"isQuantitySelectable": 0,
"isMandatory": 0,
"isDeleted": 0
},
{
"id": null,
"listingFeeSettingId": null,
"type": "tax",
"name": "salesTax",
"title": "Sales tax",
"alias": null,
"quantity": null,
"value": 28360,
"total": 28360,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 0,
"isQuantitySelectable": 0,
"isMandatory": null,
"isDeleted": 0
},
{
"id": null,
"listingFeeSettingId": null,
"type": "tax",
"name": "vat",
"title": "VAT / GST",
"alias": null,
"quantity": null,
"value": 200,
"total": 200,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 0,
"isQuantitySelectable": 0,
"isMandatory": null,
"isDeleted": 0
},
{
"id": null,
"listingFeeSettingId": null,
"type": "fee",
"name": "damageDeposit",
"title": "Damage deposit",
"alias": null,
"quantity": null,
"value": 500,
"total": 500,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 0,
"isQuantitySelectable": 0,
"isMandatory": null,
"isDeleted": 0
}
],
"extraComponents": [],
"selectedComponents": []
}
}
Set manual value for price component
You can set value of any component manually. You should set for such components flag isOverriddenByUser = 1 and value = your value. Please check next examples.
Request
curl --location --request POST 'https://api.hostaway.com/v1/listings/90632/calendar/priceDetails' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIyODY3MyIsImp0aSI6IjJjYjk4NWRlNDIzYmExZTBiMzdiZjgzNjdjOWExZDE0ZmIwNDE3YjIxNGQ0Yjk4OGJkYzE5NjU3NjI4YmFiZDQ0YTQxNGRlZmI5NTYyMGRhIiwiaWF0IjoxNjY3MzEyNjUxLCJuYmYiOjE2NjczMTI2NTEsImV4cCI6MTczMDQ3MTA1MSwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjI3MTd9.JSvlt8VuBvPygoSjBeShiG0SQgwleninXSMuD4S4NwpsvljtHmsfM5CF1uQT-FTVeRuc8BdxNVPFuobWovQIEOlh6dYZJtaYv8PECp-EzgJCZKyv7-sY6cEC9s8Kf8hmJP3uOc-T90gxmOmOWm5zeL09HzWrdOqF_b-WgMifBtQ' \
--header 'Content-type: text/plain' \
--data-raw '{
"startingDate": "2020-12-01",
"endingDate": "2020-12-31",
"numberOfGuests": "1",
"version": 2,
"components": [
{
"listingFeeSettingId": 17643,
"name": "childrenExtraFee",
"isOverriddenByUser": 1,
"value": 500
}
]
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.hostaway.com/v1/listings/90632/calendar/priceDetails',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"startingDate": "2020-12-01",
"endingDate": "2020-12-31",
"numberOfGuests": "1",
"version": 2,
"components": [
{
"listingFeeSettingId": 17643,
"name": "childrenExtraFee",
"isOverriddenByUser": 1,
"value": 500
}
]
}',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIyODY3MyIsImp0aSI6IjJjYjk4NWRlNDIzYmExZTBiMzdiZjgzNjdjOWExZDE0ZmIwNDE3YjIxNGQ0Yjk4OGJkYzE5NjU3NjI4YmFiZDQ0YTQxNGRlZmI5NTYyMGRhIiwiaWF0IjoxNjY3MzEyNjUxLCJuYmYiOjE2NjczMTI2NTEsImV4cCI6MTczMDQ3MTA1MSwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjI3MTd9.JSvlt8VuBvPygoSjBeShiG0SQgwleninXSMuD4S4NwpsvljtHmsfM5CF1uQT-FTVeRuc8BdxNVPFuobWovQIEOlh6dYZJtaYv8PECp-EzgJCZKyv7-sY6cEC9s8Kf8hmJP3uOc-T90gxmOmOWm5zeL09HzWrdOqF_b-WgMifBtQ',
'Content-type: text/plain'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var data = "{\n \"startingDate\": \"2020-12-01\",\n \"endingDate\": \"2020-12-31\",\n \"numberOfGuests\": \"1\",\n \"version\": 2,\n \"components\": [\n {\n \"listingFeeSettingId\": 17643,\n \"name\": \"childrenExtraFee\",\n \"isOverriddenByUser\": 1,\n \"value\": 500\n }\n ]\n}";
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.hostaway.com/v1/listings/90632/calendar/priceDetails");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIyODY3MyIsImp0aSI6IjJjYjk4NWRlNDIzYmExZTBiMzdiZjgzNjdjOWExZDE0ZmIwNDE3YjIxNGQ0Yjk4OGJkYzE5NjU3NjI4YmFiZDQ0YTQxNGRlZmI5NTYyMGRhIiwiaWF0IjoxNjY3MzEyNjUxLCJuYmYiOjE2NjczMTI2NTEsImV4cCI6MTczMDQ3MTA1MSwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjI3MTd9.JSvlt8VuBvPygoSjBeShiG0SQgwleninXSMuD4S4NwpsvljtHmsfM5CF1uQT-FTVeRuc8BdxNVPFuobWovQIEOlh6dYZJtaYv8PECp-EzgJCZKyv7-sY6cEC9s8Kf8hmJP3uOc-T90gxmOmOWm5zeL09HzWrdOqF_b-WgMifBtQ");
xhr.setRequestHeader("Content-type", "text/plain");
xhr.send(data);
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "{\n \"startingDate\": \"2020-12-01\",\n \"endingDate\": \"2020-12-31\",\n \"numberOfGuests\": \"1\",\n \"version\": 2,\n \"components\": [\n {\n \"listingFeeSettingId\": 17643,\n \"name\": \"childrenExtraFee\",\n \"isOverriddenByUser\": 1,\n \"value\": 500\n }\n ]\n}");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/listings/90632/calendar/priceDetails")
.method("POST", body)
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIyODY3MyIsImp0aSI6IjJjYjk4NWRlNDIzYmExZTBiMzdiZjgzNjdjOWExZDE0ZmIwNDE3YjIxNGQ0Yjk4OGJkYzE5NjU3NjI4YmFiZDQ0YTQxNGRlZmI5NTYyMGRhIiwiaWF0IjoxNjY3MzEyNjUxLCJuYmYiOjE2NjczMTI2NTEsImV4cCI6MTczMDQ3MTA1MSwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjI3MTd9.JSvlt8VuBvPygoSjBeShiG0SQgwleninXSMuD4S4NwpsvljtHmsfM5CF1uQT-FTVeRuc8BdxNVPFuobWovQIEOlh6dYZJtaYv8PECp-EzgJCZKyv7-sY6cEC9s8Kf8hmJP3uOc-T90gxmOmOWm5zeL09HzWrdOqF_b-WgMifBtQ")
.addHeader("Content-type", "text/plain")
.build();
Response response = client.newCall(request).execute();
import http.client
import json
conn = http.client.HTTPSConnection("api.hostaway.com")
payload = {
"startingDate": "2020-12-01",
"endingDate": "2020-12-31",
"numberOfGuests": "1",
"version": 2,
"components": [
{
"listingFeeSettingId": 17643,
"name": "childrenExtraFee",
"isOverriddenByUser": 1,
"value": 500
}
]
}
headers = {
'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIyODY3MyIsImp0aSI6IjJjYjk4NWRlNDIzYmExZTBiMzdiZjgzNjdjOWExZDE0ZmIwNDE3YjIxNGQ0Yjk4OGJkYzE5NjU3NjI4YmFiZDQ0YTQxNGRlZmI5NTYyMGRhIiwiaWF0IjoxNjY3MzEyNjUxLCJuYmYiOjE2NjczMTI2NTEsImV4cCI6MTczMDQ3MTA1MSwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjI3MTd9.JSvlt8VuBvPygoSjBeShiG0SQgwleninXSMuD4S4NwpsvljtHmsfM5CF1uQT-FTVeRuc8BdxNVPFuobWovQIEOlh6dYZJtaYv8PECp-EzgJCZKyv7-sY6cEC9s8Kf8hmJP3uOc-T90gxmOmOWm5zeL09HzWrdOqF_b-WgMifBtQ',
'Content-type': 'application/json',
'Cache-control': 'no-cache'
}
payload_json = json.dumps(payload)
conn.request("POST", "/v1/listings/90632/calendar/priceDetails", payload_json, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
POST https://api.hostaway.com/v1/listings/{listingId}/calendar/priceDetails
Json Parameter | Required | Type | Description |
---|---|---|---|
startingDate |
yes | date | Arrival date |
endingDate |
yes | date | Departure date |
numberOfGuests |
yes | int | Number of guest |
markup |
no | float | Markup must be more then 1.0 |
reservationCouponId |
no | int | Reservation Coupon ID |
version |
yes | int | Please use version 2 (version = 2) |
components |
no | array | Components for midifying or adding extras (please check example) |
Response
Price details object.
Json Parameter | Required | Type | Description |
---|---|---|---|
totalPrice |
yes | float | Calculated total price |
components |
yes | array | Price components |
Price component object.
Json Parameter | Required | Type | Description |
---|---|---|---|
listingFeeSettingId |
no | int | Listing fee setting ID |
type |
yes | string | Type of component (price, tax, fee, discount) |
name |
yes | string | Name of component |
title |
yes | string | Title of component |
alias |
yes | string | Alias of component |
quantity |
no | int | Quantity of component (only if component is quantity selectable) |
value |
yes | float | Price of component |
total |
yes | float | Total amount of component |
isIncludedInTotalPrice |
yes | int | Included or not included in total price |
isOverriddenByUser |
yes | int | Is component changed or not by the client |
isMandatory |
yes | int | Сomponent is mandatory for creating reservation or not |
isDeleted |
yes | int | Сomponent is deleted or not by the client |
{
"status": "success",
"result": {
"totalPrice": 313600,
"originalTotalPrice": 0,
"selectedComponentsAmount": 0,
"components": [
{
"id": null,
"listingFeeSettingId": null,
"type": "price",
"name": "baseRate",
"title": "Base rate",
"alias": null,
"quantity": null,
"value": 315000,
"total": 315000,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 0,
"isQuantitySelectable": 0,
"isMandatory": null,
"isDeleted": 0
},
{
"id": null,
"listingFeeSettingId": null,
"type": "discount",
"name": "monthlyDiscount",
"title": "Monthly discount",
"alias": null,
"quantity": null,
"value": -31500,
"total": -31500,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 0,
"isQuantitySelectable": 0,
"isMandatory": null,
"isDeleted": 0
},
{
"id": null,
"listingFeeSettingId": null,
"type": "fee",
"name": "cleaningFee",
"title": "Cleaning fee",
"alias": null,
"quantity": null,
"value": 500,
"total": 500,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 0,
"isQuantitySelectable": 0,
"isMandatory": null,
"isDeleted": 0
},
{
"id": null,
"listingFeeSettingId": 17643,
"type": "fee",
"name": "childrenExtraFee",
"title": "Children Extra fee",
"alias": null,
"quantity": null,
"value": 500,
"total": 500,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 1,
"isQuantitySelectable": 0,
"isMandatory": null,
"isDeleted": 0
},
{
"id": null,
"listingFeeSettingId": null,
"type": "tax",
"name": "salesTax",
"title": "Sales tax",
"alias": null,
"quantity": null,
"value": 28400,
"total": 28400,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 0,
"isQuantitySelectable": 0,
"isMandatory": null,
"isDeleted": 0
},
{
"id": null,
"listingFeeSettingId": null,
"type": "tax",
"name": "vat",
"title": "VAT / GST",
"alias": null,
"quantity": null,
"value": 200,
"total": 200,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 0,
"isQuantitySelectable": 0,
"isMandatory": null,
"isDeleted": 0
},
{
"id": null,
"listingFeeSettingId": null,
"type": "fee",
"name": "damageDeposit",
"title": "Damage deposit",
"alias": null,
"quantity": null,
"value": 500,
"total": 500,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 0,
"isQuantitySelectable": 0,
"isMandatory": null,
"isDeleted": 0
}
],
"extraComponents": [],
"selectedComponents": []
}
}
Create reservation with price components
After calculation total price you can use array of price components (compoments object in the response) for creating new reservation with price breakdown. Please check create reservation with price details
There are two step for creating reservation with price details components:
During component pricing, you can use the following options:
After calculation total price you get price components in the response (components object). You should use components object for filling financeField object in reservation object.
If you want to change component in price breakdown you should use isOverriddenByUser
= 1 and value
field for setting value of the component.
If component is quantity selectable you should use isQuantitySelectable
= 1 and quantity
field for setting quantity of components.
If you want to remove component from the breakdown and recalculate price without it, you should use isDeleted
= 1
If you want to add extra fee you should add additional object in components with name
and listingFeeSettingId
values. It the component is quantity selectable you should set isQuantitySelectable
= 1 and quantity
value.
Update reservation with price components
You can also update price details component in reservation by updating reservation.
Please note that all fields must be submitted in the request because not specified fields will be deleted.
Get financeFields from price breakdown you can by retrieving a reservation then update the value and pass with ID with reservation update request.
If you change component in price breakdown you should also adapt total price on your side and send new totalPrice.
Also please set isOverriddenByUser
= 1 if value was changed manually without price calculation because it guarantees that system will not change this value automatically
curl --location --request PUT 'https://api.hostaway.com/v1/reservations/14150462' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIyODY3MyIsImp0aSI6IjJjYjk4NWRlNDIzYmExZTBiMzdiZjgzNjdjOWExZDE0ZmIwNDE3YjIxNGQ0Yjk4OGJkYzE5NjU3NjI4YmFiZDQ0YTQxNGRlZmI5NTYyMGRhIiwiaWF0IjoxNjY3MzEyNjUxLCJuYmYiOjE2NjczMTI2NTEsImV4cCI6MTczMDQ3MTA1MSwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjI3MTd9.JSvlt8VuBvPygoSjBeShiG0SQgwleninXSMuD4S4NwpsvljtHmsfM5CF1uQT-FTVeRuc8BdxNVPFuobWovQIEOlh6dYZJtaYv8PECp-EzgJCZKyv7-sY6cEC9s8Kf8hmJP3uOc-T90gxmOmOWm5zeL09HzWrdOqF_b-WgMifBtQ' \
--header 'Content-type: application/json' \
--data-raw '{
"financeField": [
{
"id": 13303244,
"value": 91002,
"isOverriddenByUser": 1
}
],
"totalPrice": 91002
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.hostaway.com/v1/reservations/14150462',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{
"financeField": [
{
"id": 13303244,
"value": 91002,
"isOverriddenByUser": 1
}
],
"totalPrice": 91002
}',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIyODY3MyIsImp0aSI6IjJjYjk4NWRlNDIzYmExZTBiMzdiZjgzNjdjOWExZDE0ZmIwNDE3YjIxNGQ0Yjk4OGJkYzE5NjU3NjI4YmFiZDQ0YTQxNGRlZmI5NTYyMGRhIiwiaWF0IjoxNjY3MzEyNjUxLCJuYmYiOjE2NjczMTI2NTEsImV4cCI6MTczMDQ3MTA1MSwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjI3MTd9.JSvlt8VuBvPygoSjBeShiG0SQgwleninXSMuD4S4NwpsvljtHmsfM5CF1uQT-FTVeRuc8BdxNVPFuobWovQIEOlh6dYZJtaYv8PECp-EzgJCZKyv7-sY6cEC9s8Kf8hmJP3uOc-T90gxmOmOWm5zeL09HzWrdOqF_b-WgMifBtQ',
'Content-type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var data = JSON.stringify({
"financeField": [
{
"id": 13303244,
"value": 91002,
"isOverriddenByUser": 1
}
],
"totalPrice": 91002
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("PUT", "https://api.hostaway.com/v1/reservations/14150462");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIyODY3MyIsImp0aSI6IjJjYjk4NWRlNDIzYmExZTBiMzdiZjgzNjdjOWExZDE0ZmIwNDE3YjIxNGQ0Yjk4OGJkYzE5NjU3NjI4YmFiZDQ0YTQxNGRlZmI5NTYyMGRhIiwiaWF0IjoxNjY3MzEyNjUxLCJuYmYiOjE2NjczMTI2NTEsImV4cCI6MTczMDQ3MTA1MSwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjI3MTd9.JSvlt8VuBvPygoSjBeShiG0SQgwleninXSMuD4S4NwpsvljtHmsfM5CF1uQT-FTVeRuc8BdxNVPFuobWovQIEOlh6dYZJtaYv8PECp-EzgJCZKyv7-sY6cEC9s8Kf8hmJP3uOc-T90gxmOmOWm5zeL09HzWrdOqF_b-WgMifBtQ");
xhr.setRequestHeader("Content-type", "application/json");
xhr.send(data);
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"financeField\": [\n {\n \"id\": 13303244,\n \"value\": 91002,\n \"isOverriddenByUser\": 1\n }\n ],\n \"totalPrice\": 91002\n}");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/reservations/14150462")
.method("PUT", body)
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIyODY3MyIsImp0aSI6IjJjYjk4NWRlNDIzYmExZTBiMzdiZjgzNjdjOWExZDE0ZmIwNDE3YjIxNGQ0Yjk4OGJkYzE5NjU3NjI4YmFiZDQ0YTQxNGRlZmI5NTYyMGRhIiwiaWF0IjoxNjY3MzEyNjUxLCJuYmYiOjE2NjczMTI2NTEsImV4cCI6MTczMDQ3MTA1MSwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjI3MTd9.JSvlt8VuBvPygoSjBeShiG0SQgwleninXSMuD4S4NwpsvljtHmsfM5CF1uQT-FTVeRuc8BdxNVPFuobWovQIEOlh6dYZJtaYv8PECp-EzgJCZKyv7-sY6cEC9s8Kf8hmJP3uOc-T90gxmOmOWm5zeL09HzWrdOqF_b-WgMifBtQ")
.addHeader("Content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
import http.client
import json
conn = http.client.HTTPSConnection("api.hostaway.com")
payload = json.dumps({
"financeField": [
{
"id": 13303244,
"value": 91002,
"isOverriddenByUser": 1
}
],
"totalPrice": 91002
})
headers = {
'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIyODY3MyIsImp0aSI6IjJjYjk4NWRlNDIzYmExZTBiMzdiZjgzNjdjOWExZDE0ZmIwNDE3YjIxNGQ0Yjk4OGJkYzE5NjU3NjI4YmFiZDQ0YTQxNGRlZmI5NTYyMGRhIiwiaWF0IjoxNjY3MzEyNjUxLCJuYmYiOjE2NjczMTI2NTEsImV4cCI6MTczMDQ3MTA1MSwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjI3MTd9.JSvlt8VuBvPygoSjBeShiG0SQgwleninXSMuD4S4NwpsvljtHmsfM5CF1uQT-FTVeRuc8BdxNVPFuobWovQIEOlh6dYZJtaYv8PECp-EzgJCZKyv7-sY6cEC9s8Kf8hmJP3uOc-T90gxmOmOWm5zeL09HzWrdOqF_b-WgMifBtQ',
'Content-type': 'application/json'
}
conn.request(