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
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("PUT", "/v1/reservations/14150462", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Delete finance field components
To remove a component, you need to pass a flag isDeleted equals to 1
Also, it is needed to adapt totalPrice if it affects total price
Please check example.
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,
"isDeleted": 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,
"isDeleted": 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,
"isDeleted": 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 \"isDeleted\": 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,
"isDeleted": 1
}
],
"totalPrice": 91002
})
headers = {
'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIyODY3MyIsImp0aSI6IjJjYjk4NWRlNDIzYmExZTBiMzdiZjgzNjdjOWExZDE0ZmIwNDE3YjIxNGQ0Yjk4OGJkYzE5NjU3NjI4YmFiZDQ0YTQxNGRlZmI5NTYyMGRhIiwiaWF0IjoxNjY3MzEyNjUxLCJuYmYiOjE2NjczMTI2NTEsImV4cCI6MTczMDQ3MTA1MSwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjI3MTd9.JSvlt8VuBvPygoSjBeShiG0SQgwleninXSMuD4S4NwpsvljtHmsfM5CF1uQT-FTVeRuc8BdxNVPFuobWovQIEOlh6dYZJtaYv8PECp-EzgJCZKyv7-sY6cEC9s8Kf8hmJP3uOc-T90gxmOmOWm5zeL09HzWrdOqF_b-WgMifBtQ',
'Content-type': 'application/json'
}
conn.request("PUT", "/v1/reservations/14150462", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Finance fields
Finance field Object
{
"id": 13303299,
"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": 1000
}
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | Unique ID |
units |
yes | int | Number of units (for multi unit reservation) |
listingFeeSettingId |
yes | int | Fee ID please check ListingFeeSetting |
type |
yes | string | Type of field (price, tax, fee, discount) |
name |
yes | string | Name of field (e.g. BaseRate, CleaningFee) read only |
title |
yes | string | Title of field |
alias |
yes | string | Alias of field (Fee alias) |
value |
yes | float | Value of field (please use total field for amount value) |
isIncludedInTotalPrice |
yes | int | Is component included in total price |
isOverriddenByUser |
yes | int | Component was set manually by user |
isMandatory |
yes | int | Fee is mandatory |
isQuantitySelectable |
yes | int | Is quantity selectable |
isDeleted |
yes | int | Unique ID |
‘quantity’ | yes | int | Quantity |
total |
yes | float | Total amount |
Retrieve finance fields
Request
GET https://api.hostaway.com/v1/financeField/{reservationId}
curl --location --request GET 'https://api.hostaway.com/v1/financeField/14150462' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIyODY3MyIsImp0aSI6IjJjYjk4NWRlNDIzYmExZTBiMzdiZjgzNjdjOWExZDE0ZmIwNDE3YjIxNGQ0Yjk4OGJkYzE5NjU3NjI4YmFiZDQ0YTQxNGRlZmI5NTYyMGRhIiwiaWF0IjoxNjY3MzEyNjUxLCJuYmYiOjE2NjczMTI2NTEsImV4cCI6MTczMDQ3MTA1MSwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjI3MTd9.JSvlt8VuBvPygoSjBeShiG0SQgwleninXSMuD4S4NwpsvljtHmsfM5CF1uQT-FTVeRuc8BdxNVPFuobWovQIEOlh6dYZJtaYv8PECp-EzgJCZKyv7-sY6cEC9s8Kf8hmJP3uOc-T90gxmOmOWm5zeL09HzWrdOqF_b-WgMifBtQ' \
--header 'Content-type: application/json' \
--data-raw '{
"value": 1000,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 1
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.hostaway.com/v1/financeField/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 => 'GET',
CURLOPT_POSTFIELDS =>'{
"value": 1000,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 1
}',
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({
"value": 1000,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 1
});
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/financeField/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 \"value\": 1000,\n \"isIncludedInTotalPrice\": 1,\n \"isOverriddenByUser\": 1\n}");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/financeField/14150462")
.method("GET", 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({
"value": 1000,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 1
})
headers = {
'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIyODY3MyIsImp0aSI6IjJjYjk4NWRlNDIzYmExZTBiMzdiZjgzNjdjOWExZDE0ZmIwNDE3YjIxNGQ0Yjk4OGJkYzE5NjU3NjI4YmFiZDQ0YTQxNGRlZmI5NTYyMGRhIiwiaWF0IjoxNjY3MzEyNjUxLCJuYmYiOjE2NjczMTI2NTEsImV4cCI6MTczMDQ3MTA1MSwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjI3MTd9.JSvlt8VuBvPygoSjBeShiG0SQgwleninXSMuD4S4NwpsvljtHmsfM5CF1uQT-FTVeRuc8BdxNVPFuobWovQIEOlh6dYZJtaYv8PECp-EzgJCZKyv7-sY6cEC9s8Kf8hmJP3uOc-T90gxmOmOWm5zeL09HzWrdOqF_b-WgMifBtQ',
'Content-type': 'application/json'
}
conn.request("GET", "/v1/financeField/14150462", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Response
{
"status": "success",
"result": [
{
"id": 13303244,
"units": 1,
"listingFeeSettingId": null,
"type": "price",
"name": "baseRate",
"title": "Base rate",
"alias": null,
"value": null,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 0,
"isMandatory": null,
"isQuantitySelectable": 0,
"isDeleted": 1,
"total": 0
},
{
"id": 13303299,
"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": 1000
}
]
}
Update finance field
It is recommended to set isOverriddenByUser
= 1 if you want to change finance field otherwise it can be replaced by the value from the channel as example or due recalculations on our end. But please keep in mind that if you have changed this value and mark as override it can’t be updated even if we need to recalculate it.
Request
PUT https://api.hostaway.com/v1/financeField/{reservationId}/{financeFieldId}
curl --location --request PUT 'https://api.hostaway.com/v1/financeField/14150462/13303299' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIyODY3MyIsImp0aSI6IjJjYjk4NWRlNDIzYmExZTBiMzdiZjgzNjdjOWExZDE0ZmIwNDE3YjIxNGQ0Yjk4OGJkYzE5NjU3NjI4YmFiZDQ0YTQxNGRlZmI5NTYyMGRhIiwiaWF0IjoxNjY3MzEyNjUxLCJuYmYiOjE2NjczMTI2NTEsImV4cCI6MTczMDQ3MTA1MSwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjI3MTd9.JSvlt8VuBvPygoSjBeShiG0SQgwleninXSMuD4S4NwpsvljtHmsfM5CF1uQT-FTVeRuc8BdxNVPFuobWovQIEOlh6dYZJtaYv8PECp-EzgJCZKyv7-sY6cEC9s8Kf8hmJP3uOc-T90gxmOmOWm5zeL09HzWrdOqF_b-WgMifBtQ' \
--header 'Content-type: application/json' \
--data-raw '{
"value": 1000,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 1
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.hostaway.com/v1/financeField/14150462/13303299',
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 =>'{
"value": 1000,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 1
}',
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({
"value": 1000,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 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/financeField/14150462/13303299");
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 \"value\": 1000,\n \"isIncludedInTotalPrice\": 1,\n \"isOverriddenByUser\": 1\n}");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/financeField/14150462/13303299")
.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({
"value": 1000,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 1
})
headers = {
'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIyODY3MyIsImp0aSI6IjJjYjk4NWRlNDIzYmExZTBiMzdiZjgzNjdjOWExZDE0ZmIwNDE3YjIxNGQ0Yjk4OGJkYzE5NjU3NjI4YmFiZDQ0YTQxNGRlZmI5NTYyMGRhIiwiaWF0IjoxNjY3MzEyNjUxLCJuYmYiOjE2NjczMTI2NTEsImV4cCI6MTczMDQ3MTA1MSwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjI3MTd9.JSvlt8VuBvPygoSjBeShiG0SQgwleninXSMuD4S4NwpsvljtHmsfM5CF1uQT-FTVeRuc8BdxNVPFuobWovQIEOlh6dYZJtaYv8PECp-EzgJCZKyv7-sY6cEC9s8Kf8hmJP3uOc-T90gxmOmOWm5zeL09HzWrdOqF_b-WgMifBtQ',
'Content-type': 'application/json'
}
conn.request("PUT", "/v1/financeField/14150462/13303299", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Response
{
"status": "success",
"result": {
"id": 13303244,
"units": 1,
"listingFeeSettingId": null,
"type": "price",
"name": "baseRate",
"title": "Base rate",
"alias": null,
"value": 1000,
"isIncludedInTotalPrice": 1,
"isOverriddenByUser": 1,
"isMandatory": null,
"isQuantitySelectable": 0,
"isDeleted": 1,
"total": 0
}
}
Reservation Payment Cards
Reservation payment card object
{
"id": 57,
"userId": null,
"reservationId": 154242,
"ccName": "Mikhail Ivanov",
"ccNumberEndingDigits": "4242",
"ccExpirationYear": "2024",
"ccExpirationMonth": "12",
"ccCvc": "351",
"isDefault": 1,
"isVirtual": 1,
"isAddedByGuest": null,
"paymentProviderMessage": "",
"paymentProvider": null,
"isCcDecryptable": 0
}
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | Unique ID of the reservation on Hostaway |
userId |
no | int | Unique ID of the user on Hostaway if the card was added by user |
reservationId |
yes | int | Unique ID of the reservation on Hostaway |
ccName |
yes | string | Card holder name |
ccNumberEndingDigits |
no | string | CC number ending digits |
ccExpirationYear |
no | string | CVC expiration year |
ccExpirationMonth |
no | string | CVC expiration month |
ccCvc |
no | string | CVC code |
isDefault |
yes | int | Default payment card or not |
isAddedByGuest |
no | int | Credit card was added by Guest |
paymentProviderMessage |
no | string | Payment provider error messages if we get an error |
paymentProvider |
no | string | Payment provider name (stripe, braintree, authorizeNet) |
isCcDecryptable |
no | int | cc number is decryptable. please use card details endpoint to decrypt. |
isVirtual |
no | int | Is it a virtual credit card or not. |
Retrieve reservation payment cards
Request
curl -X GET \
https://api.hostaway.com/v1/paymentCards/154242 \
-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/paymentCards/154242",
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/paymentCards/154242");
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/paymentCards/154242")
.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/paymentCards/154242"
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/paymentCards/154242
Response
{
"status": "success",
"result": [
{
"id": 5700,
"userId": null,
"reservationId": 154242,
"ccName": "Mikhail Ivanov",
"ccNumberEndingDigits": "4242",
"ccExpirationYear": "2024",
"ccExpirationMonth": "12",
"ccCvc": "345",
"isDefault": 1,
"isVirtual": 1,
"isAddedByGuest": null,
"paymentProviderMessage": null,
"paymentProvider": "stripe",
"isCcDecryptable": 0
},
{
"id": 5678,
"userId": null,
"reservationId": 154242,
"ccName": "Mikhail Ivanov",
"ccNumberEndingDigits": "0042",
"ccExpirationYear": "2026",
"ccExpirationMonth": "12",
"ccCvc": "325",
"isDefault": 0,
"isVirtual": null,
"isAddedByGuest": 1,
"paymentProviderMessage": "Your card was declined",
"paymentProvider": "stripe",
"isCcDecryptable": 0
}
]
}
Add credit card
Request
curl -X POST \
https://api.hostaway.com/v1/paymentCards/154242 \
-H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiNjNhMWY4MzIwZTU5Zjc5YTJlNzMxNzBkYzU5MDk5MzdlNTU2NGVmNWQwOTgzNjk3N2ZjMjZiYmQ4MWJlYWFjNzI0OTk5Y2ZiZWQ1N2FiMmYiLCJpYXQiOjE2Mzc0ODc0ODYsIm5iZiI6MTYzNzQ4NzQ4NiwiZXhwIjoxNzAwNTU5NDg2LCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6Mn0.Mt3I5myc1G1aJ3Rls5JYGggFiNh3LH9I88AJYmucXjd3qeE-jICpg49eIvBHSv6KGGqzl-ApuV3_3j5pSIbHXjUYqmXvE6WeU-kcRMCnZ3V4yDQ4Zh_-m5kKCEn4gx4A_flWf4EhS7UJL24FPS3y5CWIQR2rvWJUPnMs_obV1s4' \
-d '{
"ccName": "Mikhail Ivanov",
"ccNumber": "4242424242424242",
"ccExpirationYear": "2024",
"ccExpirationMonth": "12",
"ccCvc": "345",
"isDefault": 1
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/paymentCards/154242",
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 \"ccName\": \"Mikhail Ivanov\",\n \"ccNumber\": \"4242424242424242\",\n \"ccExpirationYear\": \"2024\",\n \"ccExpirationMonth\": \"12\",\n \"ccCvc\": \"123\",\n \"isDefault\": 1\n}",
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 = "{\n \"ccName\": \"Mikhail Ivanov\",\n \"ccNumber\": \"4242424242424242\",\n \"ccExpirationYear\": \"2024\",\n \"ccExpirationMonth\": \"12\",\n \"ccCvc\": \"123\",\n \"isDefault\": 1\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/paymentCards/154242");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIiwiaWF0IjoxNTI2NjQ0MzE0LCJuYmYiOjE1MjY2NDQzMTQsImV4cCI6MTU0MjE5NjMxNCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.hVv1ybL5Ifl6VatEBXxJz4sNa7f2RPGlSGCK5YNiSDNBeW9FjgfzbKFW4GaKGXNBYk2b7TpxhwF_3RbBRE0Y817TIiwUNZEhMCz5do4Kp9ZX6nrHlvJiqdLYZXhaHUlU8vq-80a0xTmgVnjRH20JeA0q9t8gxcfYJUQfQMOb59Q");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send(data);
OkHttpClient client = new OkHttpClient();
RequestBody body = RequestBody.create(mediaType, "{\n \"ccName\": \"Mikhail Ivanov\",\n \"ccNumber\": \"4242424242424242\",\n \"ccExpirationYear\": \"2024\",\n \"ccExpirationMonth\": \"12\",\n \"ccCvc\": \"123\",\n \"isDefault\": 1\n}");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/paymentCards/154242")
.post(body)
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIiwiaWF0IjoxNTI2NjQ0MzE0LCJuYmYiOjE1MjY2NDQzMTQsImV4cCI6MTU0MjE5NjMxNCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.hVv1ybL5Ifl6VatEBXxJz4sNa7f2RPGlSGCK5YNiSDNBeW9FjgfzbKFW4GaKGXNBYk2b7TpxhwF_3RbBRE0Y817TIiwUNZEhMCz5do4Kp9ZX6nrHlvJiqdLYZXhaHUlU8vq-80a0xTmgVnjRH20JeA0q9t8gxcfYJUQfQMOb59Q")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import requests
import json
url = "https://api.hostaway.com/v1/paymentCards/154242"
payload = {
"ccName": "Mikhail Ivanov",
"ccNumber": "4242424242424242",
"ccExpirationYear": "2024",
"ccExpirationMonth": "12",
"ccCvc": "123",
"isDefault": 1
}
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIiwiaWF0IjoxNTI2NjQ0MzE0LCJuYmYiOjE1MjY2NDQzMTQsImV4cCI6MTU0MjE5NjMxNCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.hVv1ybL5Ifl6VatEBXxJz4sNa7f2RPGlSGCK5YNiSDNBeW9FjgfzbKFW4GaKGXNBYk2b7TpxhwF_3RbBRE0Y817TIiwUNZEhMCz5do4Kp9ZX6nrHlvJiqdLYZXhaHUlU8vq-80a0xTmgVnjRH20JeA0q9t8gxcfYJUQfQMOb59Q",
'Content-type': 'application/json',
'Cache-control': 'no-cache',
}
payload_json = json.dumps(payload)
response = requests.request("POST", url, data=payload_json, headers=headers)
print(response.text)
POST https://api.hostaway.com/v1/paymentCards/154242
Response
{
"status": "success",
"result": {
"id": 61,
"userId": null,
"reservationId": 154242,
"ccName": "Mikhail Ivanov",
"ccNumberEndingDigits": "4242",
"ccExpirationYear": "2024",
"ccExpirationMonth": "12",
"ccCvc": "123",
"isDefault": 1,
"isVirtual": null,
"isAddedByGuest": null,
"paymentProviderMessage": null,
"paymentProvider": "stripe",
"isCcDecryptable": 0
}
}
Add payment method ID
Creates a PaymentMethod object. Read the Stripe.js (for Stripe) or other payment providers reference to learn how to create PaymentMethods via js in the guest browser. Instead of creating a PaymentMethod directly, payment provider recommend using the PaymentIntents API (if the card will be added by guest) to accept a payment immediately or the SetupIntent API to collect payment method details ahead of a future payment.
Request
curl -X POST \
https://api.hostaway.com/v1/paymentCards/154242/addPaymentMethodId \
-H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiNjNhMWY4MzIwZTU5Zjc5YTJlNzMxNzBkYzU5MDk5MzdlNTU2NGVmNWQwOTgzNjk3N2ZjMjZiYmQ4MWJlYWFjNzI0OTk5Y2ZiZWQ1N2FiMmYiLCJpYXQiOjE2Mzc0ODc0ODYsIm5iZiI6MTYzNzQ4NzQ4NiwiZXhwIjoxNzAwNTU5NDg2LCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6Mn0.Mt3I5myc1G1aJ3Rls5JYGggFiNh3LH9I88AJYmucXjd3qeE-jICpg49eIvBHSv6KGGqzl-ApuV3_3j5pSIbHXjUYqmXvE6WeU-kcRMCnZ3V4yDQ4Zh_-m5kKCEn4gx4A_flWf4EhS7UJL24FPS3y5CWIQR2rvWJUPnMs_obV1s4' \
-d '{
"paymentMethodId": "pm_1K3ghZBNAGlZm6vSWWxrN4xY"
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/paymentCards/154242/addPaymentMethodId",
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 \"paymentMethodId\": \"pm_1K3ghZBNAGlZm6vSWWxrN4xY\"\n}",
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 = "{\n \"paymentMethodId\": \"pm_1K3ghZBNAGlZm6vSWWxrN4xY\"\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/paymentCards/154242/addPaymentMethodId");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIiwiaWF0IjoxNTI2NjQ0MzE0LCJuYmYiOjE1MjY2NDQzMTQsImV4cCI6MTU0MjE5NjMxNCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.hVv1ybL5Ifl6VatEBXxJz4sNa7f2RPGlSGCK5YNiSDNBeW9FjgfzbKFW4GaKGXNBYk2b7TpxhwF_3RbBRE0Y817TIiwUNZEhMCz5do4Kp9ZX6nrHlvJiqdLYZXhaHUlU8vq-80a0xTmgVnjRH20JeA0q9t8gxcfYJUQfQMOb59Q");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send(data);
OkHttpClient client = new OkHttpClient();
RequestBody body = RequestBody.create(mediaType, "{\n \"paymentMethodId\": \"pm_1K3ghZBNAGlZm6vSWWxrN4xY\"\n}");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/paymentCards/154242/addPaymentMethodId")
.post(body)
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIiwiaWF0IjoxNTI2NjQ0MzE0LCJuYmYiOjE1MjY2NDQzMTQsImV4cCI6MTU0MjE5NjMxNCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.hVv1ybL5Ifl6VatEBXxJz4sNa7f2RPGlSGCK5YNiSDNBeW9FjgfzbKFW4GaKGXNBYk2b7TpxhwF_3RbBRE0Y817TIiwUNZEhMCz5do4Kp9ZX6nrHlvJiqdLYZXhaHUlU8vq-80a0xTmgVnjRH20JeA0q9t8gxcfYJUQfQMOb59Q")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import requests
import json
url = "https://api.hostaway.com/v1/paymentCards/154242/addPaymentMethodId"
payload = {
"paymentMethodId": "pm_1K3ghZBNAGlZm6vSWWxrN4xY"
}
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIiwiaWF0IjoxNTI2NjQ0MzE0LCJuYmYiOjE1MjY2NDQzMTQsImV4cCI6MTU0MjE5NjMxNCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.hVv1ybL5Ifl6VatEBXxJz4sNa7f2RPGlSGCK5YNiSDNBeW9FjgfzbKFW4GaKGXNBYk2b7TpxhwF_3RbBRE0Y817TIiwUNZEhMCz5do4Kp9ZX6nrHlvJiqdLYZXhaHUlU8vq-80a0xTmgVnjRH20JeA0q9t8gxcfYJUQfQMOb59Q",
'Content-type': 'application/json',
'Cache-control': 'no-cache',
}
payload_json = json.dumps(payload)
response = requests.request("POST", url, data=payload_json, headers=headers)
print(response.text)
POST https://api.hostaway.com/v1/paymentCards/154242/addPaymentMethodId
Response
{
"status": "success",
"result": {
"id": 61,
"userId": null,
"reservationId": 154242,
"ccName": null,
"ccNumberEndingDigits": "4242",
"ccExpirationYear": "2024",
"ccExpirationMonth": "12",
"ccCvc": null,
"isDefault": 1,
"isAddedByGuest": null,
"paymentProviderMessage": null,
"paymentProvider": "stripe",
"isCcDecryptable": 0
}
}
Get card details
Hostaway cannot store guest credit card data and therefore the liability of storing such personal data falls into you as the client. In order to provide access to viewing guest card data, you will need to sign our Service Contract & Confidentiality agreement. Please send an email to support@hostaway.com to request this agreement.
Important: Please note that ONLY reservations received AFTER the Secret Key has been downloaded will have the option to decrypt credit card details. Credit card details for reservations made before the moment you downloaded the Secret Key will not be eligible for the reveal credit card option
Please also check Viewing Guest Credit Card Information
Request
curl -X GET \
https://api.hostaway.com/v1/paymentCards/154242/cardDetails/622 \
-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/paymentCards/154242/cardDetails/622",
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/paymentCards/154242/cardDetails/622");
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/paymentCards/154242/cardDetails/622")
.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/paymentCards/154242/cardDetails/622"
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/paymentCards/154242/cardDetails/622
Response
You need to decrypt ccNumber by the secret key. Only if isCcDecryptable equals 1.
{
"status": "success",
"result": {
"ccNumber": "Y2JJL2kyT1VGWFAweWlXWm1iaVNFSXdaUEM3N2ZsWVQ5clFlakFJMW9OYnh6WWx4R2dwVFJUWHcxZTYxZE1tMG9CYTZQZ2RLT1k0VDkydTFPb3hnckJZTTE4OTBhUklOVzU1aGVibVZ1TFFSVXRNN0FvMVJmdGU5SnluRWJhN1B4MUFoVnJyRHpPbTIzUnBxUnkxRnNIMmE2N1NsYmNQaTV2ZVVDazJRV24zemY2c0E0bkxFVnRFVlRQS1lJdFJnemx4ZDFGUzkvaHJLdkpUTEtkdnA3bE52QVFONitpUDlZRS9MajRnakl0UC9uT3ZWWGVLbjc1d2Y3M1ZFMHV6b0ZHSit5Ym1EZXJwVWRhakh4UTBxc1pqMzk2OEZBRUI5SDFXNldTMW9kUzNRNlEyLzc1U3FObmw0RmlUY0ZNM2JIWHErby9za2ZKc1RFa3RsUFo5bjFnc3FnMmZ1UFhiUlBZVG9TRVkvVDRLY0xhcTdUc0F2OFo0NFlRL0YwYkFhNGZoRFYrMTJUazNMSlNZZmtwNEF5bENFQng5SU5sY2U4bmlpT1p3NjVoSWhnMmtOUXBmSVNaVEFWUm9aM3I2V2dpUGVxdEVHRjRpdStic1Rrd2ZYeTVJZkJRTHAzZGdaN2U1K3d6UTg3cExZb2RPYVdVNE1vTnNnWTN1eklVYlQxcVhnNjJjNzJhTnozSWd5T3N4UU5qWmFwVTZnQW1kcHdycE91U0duVzhKOVpMWmFIUGJlV2FiTXpmRnJMaW9wQnZvVm11dE9JQ2gzUy9GY1Ntb0pCWU5Pc29wN1RZYzRuRnA0WFUxRHF0ZS9CKy93NUtVSUpTVGEvczFRd0l3ekZLQnpUK0YvWlFYQUpqVWhMVDNHTUYzYUpreXluSXlvUW5LSG5vZG84aFk9IHwgQ0NsVzF0OElzOEdZS0FuVkhYRFRIcUFLMCtOamQ1bTNTWjJ2bzNJbkhJTFluMjRRTHI2SENIa1ZjYXM2MHhSSUZ0SVRUSGRwaHQ5SlBaUVFjTm9qU2dseUtNZ3g0NHEyYkpJb1JuR2dRdnlPOVlNK3I5OFA4bE5Bb1ZOZktyMjlSa2R5T0dYdTJIbm1BR1Q5RUw5SWwzcWJxZDBhazJiVVR3a1oyaFRIMmF6UUpJRCtCcGl1c0ppN1BPa1lWd0Rya20rV2FQWUNCVndVaERTb1VyanQwN0RKK01aQ043VHM3enV2U0hFMm0vamxYMFdYbk02Yk1CTCs4WUM5VnRuZVZIM2tFT0Rvc1h5b041T0NzQS9pYUFYNm5lTXVmK21NQ3I3SVF6bEFGS1FNSUNZSmg4SE5NelB6S1pxWEtTK3FvblFSTkw5U1BBYzdaMEIrQVY3VU93PT0=",
"ccName": "Mikhail Ivanov",
"ccExpirationMonth": "12",
"ccExpirationYear": "2025",
"ccCvc": "356"
}
}
Set default payment card
Request
curl -X PUT \
https://api.hostaway.com/v1/paymentCards/154242/defaultPaymentMethod/622 \
-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/paymentCards/154242/defaultPaymentMethod/622",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
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("PUT", "https://api.hostaway.com/v1/paymentCards/154242/defaultPaymentMethod/622");
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/paymentCards/154242/defaultPaymentMethod/622")
.put(null)
.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/paymentCards/154242/defaultPaymentMethod/622"
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIiwiaWF0IjoxNTI2NjQ0MzE0LCJuYmYiOjE1MjY2NDQzMTQsImV4cCI6MTU0MjE5NjMxNCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.hVv1ybL5Ifl6VatEBXxJz4sNa7f2RPGlSGCK5YNiSDNBeW9FjgfzbKFW4GaKGXNBYk2b7TpxhwF_3RbBRE0Y817TIiwUNZEhMCz5do4Kp9ZX6nrHlvJiqdLYZXhaHUlU8vq-80a0xTmgVnjRH20JeA0q9t8gxcfYJUQfQMOb59Q",
'Cache-control': "no-cache",
}
response = requests.request("PUT", url, headers=headers)
print(response.text)
PUT https://api.hostaway.com/v1/paymentCards/154242/defaultPaymentMethod/622
Response
{
"status": "success",
"result": {
"id": 622,
"userId": null,
"reservationId": 154242,
"ccName": "Mikhail Ivanov",
"ccNumberEndingDigits": "4242",
"ccExpirationYear": "2024",
"ccExpirationMonth": "12",
"ccCvc": "123",
"isDefault": 1,
"isVirtual": null,
"isAddedByGuest": null,
"paymentProviderMessage": null,
"paymentProvider": null,
"isCcDecryptable": 0
}
}
Reservation Payment Methods
Retrieve reservations payment methods
Request
curl -X GET \
https://api.hostaway.com/v1/reservations/paymentMethods \
-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/reservations/paymentMethods",
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/reservations/paymentMethods");
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/reservations/paymentMethods")
.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/reservations/paymentMethods"
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/reservations/paymentMethods
Response
{
"status": "success",
"result": {
"credit_card": "Credit card",
"vcc": "VCC",
"cash_stay": "Cash stay",
"paypal": "PayPal",
"venmo": "Venmo",
"bank_transfer": "Bank Transfer",
"stripe": "Stripe",
"braintree": "Braintree",
"other": "Other"
}
}
Reservation Rental agreement
Retrieve a reservation rental agreement
Request
curl -X GET \
https://api.hostaway.com/v1/reservations/13/rentalAgreement \
-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/rentalAgreement",
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/rentalAgreement");
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/rentalAgreement")
.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/rentalAgreement", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
GET https://api.hostaway.com/v1/reservations/{reservationId}/rentalAgreement
Response
A reservation object.
Reservation message templates
Retrieve a message templates list for the conversation with filled placeholders
Request
curl -X GET \
https://api.hostaway.com/v1/reservations/2/messageTemplates \
-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/reservations/2/messageTemplates",
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/reservations/2/messageTemplates");
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/reservations/2/messageTemplates")
.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/reservations/2/messageTemplates"
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/reservations/{reservationId}/messageTemplates
Response
An array of message template objects with filled placeholders.
Retrieve a message template for the conversation with filled placeholders
Request
curl -X GET \
https://api.hostaway.com/v1/reservations/2/messageTemplates/2 \
-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/reservations/2/messageTemplates/2",
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/reservations/2/messageTemplates/2");
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/reservations/2/messageTemplates/2")
.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/reservations/2/messageTemplates/2"
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/reservations/{reservationId}/messageTemplates/{messageTemplateId}
Response
An array of message template objects with filled placeholders.
Calendar
Calendar day object
{
"id": 46253,
"date": "2017-07-15",
"isAvailable": 0,
"isProcessed": 1,
"status": "reserved",
"price": 225,
"minimumStay": 1,
"maximumStay": 1125,
"closedOnArrival": null,
"closedOnDeparture": null,
"note": null,
"countAvailableUnits": null,
"availableUnitsToSell": null,
"countPendingUnits": null,
"countBlockingReservations": null,
"countBlockedUnits": null,
"desiredUnitsToSell": null,
"reservations": [
{
"id": 13,
"listingMapId": 40160,
"channelId": 2001,
"channelName": "airbnb",
"reservationId": "10450-40160-thread313906227-9586017324",
"externalPropertyId": null,
"externalRatePlanId": null,
"externalUnitId": null,
"externalRuid": null,
"manualIcalId": null,
"manualIcalName": null,
"isProcessed": 1,
"isManuallyChecked": 0,
"isInstantBooked": 0,
"hasPullError": 0,
"reservationDate": "2017-06-10 10:41:10",
"pendingExpireDate": null,
"guestName": "Andrew Peterson",
"guestFirstName": "Andrew",
"guestLastName": "Peterson",
"guestExternalAccountId": "84497323",
"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",
"numberOfGuests": 1,
"adults": 1,
"children": null,
"infants": null,
"pets": null,
"arrivalDate": "2017-07-15",
"departureDate": "2017-07-16",
"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",
"hostNote": null,
"guestNote": null,
"comment": null
}
]
}
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | |
date |
yes | date | |
isAvailable |
no | bool | It’s used to block/unblock single unit listings |
isProcessed |
no | bool | It’s an internal informational field to show if the calendar was successfully pushed to all connected channels. |
status |
no | string | List of acceptable statuses can be found here: https://api.hostaway.com/dictionary/calendarDay |
price |
no | float | |
minimumStay |
no | int | Must be positive integer |
maximumStay |
no | int | Must be positive integer |
closedOnArrival |
no | bool | |
closedOnDeparture |
no | bool | |
note |
no | string | |
countAvailableUnits |
no | int | How many units of this unit type exist (max available, only for multi unit listing) |
availableUnitsToSell |
no | int | How many units are left (available) to sell (only for multi unit listing) |
countPendingUnits |
no | int | Number of rooms blocked by pending reservations (only for multi unit listing) |
countBlockingReservations |
no | int | Deprecated field (will be replaced with countReservedUnits, only for multi unit listing) |
countBlockedUnits |
no | int | Number of of units manually blocked (only for multi unit listing) |
desiredUnitsToSell |
no | int | This is the field to update to decide how many units for that unit type to be sold |
reservations |
no | array |
Calendar day statuses
Status | Description |
---|---|
available |
|
blocked |
|
mblocked |
blocked by aggregate multi-units (deprecated) |
hardBlock |
reserved for future usage |
conflicted |
deprecated |
reserved |
blocked by reservation |
pending |
has pending reservation |
mreserved |
blocked by aggregate multi-unit reservation (deprecated) |
Retrieve a calendar
Calendar is just an array of calendar day objects for dates selected.
Request
curl -X GET \
'https://api.hostaway.com/v1/listings/40160/calendar?startDate=2018-09-01&endDate=2018-09-30&includeResources=1' \
-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/listings/40160/calendar?startDate=2018-09-01&endDate=2018-09-30&includeResources=",
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/listings/40160/calendar?startDate=2018-09-01&endDate=2018-09-30&includeResources=");
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/listings/40160/calendar?startDate=2018-09-01&endDate=2018-09-30&includeResources=")
.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/listings/40160/calendar?startDate=2018-09-01&endDate=2018-09-30&includeResources=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
GET https://api.hostaway.com/v1/listings/{listingId}/calendar
Query Parameter | Required | Type | Description |
---|---|---|---|
startDate |
no | date | |
endDate |
no | date | |
includeResources |
no | int | if includeResources flag is 1 then response objects are supplied with supplementary resources, default is 0. |
Response
An array of calendar day objects.
Update the calendar
To block/unblock calendar (for multi-unit and single-unit listings):
- Single units set “isAvailable” to 0
- Multi-units set “desiredUnitsToSell” to 0
Request
curl -X PUT \
https://api.hostaway.com/v1/listings/40160/calendar \
-H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIiwiaWF0IjoxNDk4NTc5NzQ0LCJuYmYiOjE0OTg1Nzk3NDQsImV4cCI6MTUxNDM5MDk0NCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.TsbJaDOZ0VlEF4vBg7mqLX8DxEuu5rjtsmqix1IbsEcR7F9cdx8F3dDq2zOc6mw8FNAfXT8xp1r5qKu2AYoxv4ublZhxxW0Y6uPSFs0jv5Fh5lliNBJAeQqFOChOVEbYzdbfH_6uu4HHSL31si1RvpVccAjA1Ap9vXlSg3DcPgw' \
-H 'Cache-control: no-cache' \
-H 'Content-type: application/json' \
-d '{
"startDate": "2017-09-01",
"endDate": "2017-09-05",
"isAvailable": 1,
"isProcessed": 1,
"price": 20,
"minimumStay": 1,
"maximumStay": 1125,
"closedOnArrival": null,
"closedOnDeparture": null,
"note": "test"
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/listings/40160/calendar",
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 \"startDate\": \"2017-09-01\",\n \"endDate\": \"2017-09-05\",\n \"isAvailable\": 1,\n \"isProcessed\": 1,\n \"price\": 20,\n \"minimumStay\": 1,\n \"maximumStay\": 1125,\n \"closedOnArrival\": null,\n \"closedOnDeparture\": null,\n \"note\": \"test\"\n}",
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 = JSON.stringify({
"startDate": "2017-09-01",
"endDate": "2017-09-05",
"isAvailable": 1,
"isProcessed": 1,
"price": 20,
"minimumStay": 1,
"maximumStay": 1125,
"closedOnArrival": null,
"closedOnDeparture": null,
"note": "test"
});
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/40160/calendar");
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();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"startDate\": \"2017-09-01\",\n \"endDate\": \"2017-09-05\",\n \"isAvailable\": 1,\n \"isProcessed\": 1,\n \"price\": 20,\n \"minimumStay\": 1,\n \"maximumStay\": 1125,\n \"closedOnArrival\": null,\n \"closedOnDeparture\": null,\n \"note\": \"test\"\n}");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/listings/40160/calendar")
.put(body)
.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
import json
conn = http.client.HTTPSConnection("api.hostaway.com")
payload = {
"startDate": "2017-09-01",
"endDate": "2017-09-05",
"isAvailable": 1,
"isProcessed": 1,
"price": 20,
"minimumStay": 1,
"maximumStay": 1125,
"closedOnArrival": None,
"closedOnDeparture": None,
"note": "test"
}
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIiwiaWF0IjoxNDk4NTc5NzQ0LCJuYmYiOjE0OTg1Nzk3NDQsImV4cCI6MTUxNDM5MDk0NCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.TsbJaDOZ0VlEF4vBg7mqLX8DxEuu5rjtsmqix1IbsEcR7F9cdx8F3dDq2zOc6mw8FNAfXT8xp1r5qKu2AYoxv4ublZhxxW0Y6uPSFs0jv5Fh5lliNBJAeQqFOChOVEbYzdbfH_6uu4HHSL31si1RvpVccAjA1Ap9vXlSg3DcPgw",
'Content-type': "application/json",
'Cache-control': "no-cache"
}
payload_json = json.dumps(payload)
conn.request("PUT", "/v1/listings/40160/calendar", payload_json, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
PUT https://api.hostaway.com/v1/listings/{listingId}/calendar
A calendar day object should be provided in the request body.
Additionally starDate
and endDate
parameters should be specified to define dates interval to update.
Response
An array of affected calendar day objects or error response.
Update the calendar of multi unit listing
Request
curl -X PUT \
https://api.hostaway.com/v1/listings/40160/calendar \
-H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIiwiaWF0IjoxNDk4NTc5NzQ0LCJuYmYiOjE0OTg1Nzk3NDQsImV4cCI6MTUxNDM5MDk0NCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.TsbJaDOZ0VlEF4vBg7mqLX8DxEuu5rjtsmqix1IbsEcR7F9cdx8F3dDq2zOc6mw8FNAfXT8xp1r5qKu2AYoxv4ublZhxxW0Y6uPSFs0jv5Fh5lliNBJAeQqFOChOVEbYzdbfH_6uu4HHSL31si1RvpVccAjA1Ap9vXlSg3DcPgw' \
-H 'Cache-control: no-cache' \
-H 'Content-type: application/json' \
-d '{
"startDate": "2017-09-01",
"endDate": "2017-09-05",
"desiredUnitsToSell": 3,
"price": 20,
"minimumStay": 1,
"maximumStay": 1125,
"closedOnArrival": null,
"closedOnDeparture": null,
"note": "test"
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/listings/40160/calendar",
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 \"startDate\": \"2017-09-01\",\n \"endDate\": \"2017-09-05\",\n \"desiredUnitsToSell\": 3,\n \"price\": 20,\n \"minimumStay\": 1,\n \"maximumStay\": 1125,\n \"closedOnArrival\": null,\n \"closedOnDeparture\": null,\n \"note\": \"test\"\n}",
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 = JSON.stringify({
"startDate": "2017-09-01",
"endDate": "2017-09-05",
"desiredUnitsToSell": 2,
"price": 20,
"minimumStay": 1,
"maximumStay": 1125,
"closedOnArrival": null,
"closedOnDeparture": null,
"note": "test"
});
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/40160/calendar");
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();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"startDate\": \"2017-09-01\",\n \"endDate\": \"2017-09-05\",\n \"isAvailable\": 1,\n \"isProcessed\": 1,\n \"price\": 20,\n \"minimumStay\": 1,\n \"maximumStay\": 1125,\n \"closedOnArrival\": null,\n \"closedOnDeparture\": null,\n \"note\": \"test\"\n}");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/listings/40160/calendar")
.put(body)
.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
import json
conn = http.client.HTTPSConnection("api.hostaway.com")
payload = {
"startDate": "2017-09-01",
"endDate": "2017-09-05",
"desiredUnitsToSell": 1,
"price": 20,
"minimumStay": 1,
"maximumStay": 1125,
"closedOnArrival": None,
"closedOnDeparture": None,
"note": "test"
}
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIiwiaWF0IjoxNDk4NTc5NzQ0LCJuYmYiOjE0OTg1Nzk3NDQsImV4cCI6MTUxNDM5MDk0NCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.TsbJaDOZ0VlEF4vBg7mqLX8DxEuu5rjtsmqix1IbsEcR7F9cdx8F3dDq2zOc6mw8FNAfXT8xp1r5qKu2AYoxv4ublZhxxW0Y6uPSFs0jv5Fh5lliNBJAeQqFOChOVEbYzdbfH_6uu4HHSL31si1RvpVccAjA1Ap9vXlSg3DcPgw",
'Content-type': "application/json",
'Cache-control': "no-cache"
}
conn.request("PUT", "/v1/listings/40160/calendar", json.dumps(payload), headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
PUT https://api.hostaway.com/v1/listings/{listingId}/calendar
A calendar day object should be provided in the request body.
Additionally starDate
and endDate
parameters should be specified to define dates interval to update.
DesiredUnitsToSell - Number of available units of this day. Regarding this value we try to calculate how many units we need to block.
Response
An array of affected calendar day objects or error response.
Batch calendar update
Request
curl -X PUT \
http://api.hostaway.com/v1/listings/40160/calendarIntervals \
-H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjJjZGRkYzNiZWU3OGEyZTA5NDgzNmZiYzE3MTQ3M2EwNjlkYTZlYzRjNmRlZDc1NTAzMWYzMzNmODVjYmQyMzI0Y2E4MTk0NzNkYzkxNjYzIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6IjJjZGRkYzNiZWU3OGEyZTA5NDgzNmZiYzE3MTQ3M2EwNjlkYTZlYzRjNmRlZDc1NTAzMWYzMzNmODVjYmQyMzI0Y2E4MTk0NzNkYzkxNjYzIiwiaWF0IjoxNDk5NzczMjk4LCJuYmYiOjE0OTk3NzMyOTgsImV4cCI6MTUxNTY3MDg5OCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.RYS6Gi7iLyhHRAzNRPPMUd5jYlGJ5Psq2ejFLDM5wmD1alAB6CdkTIuyrDrtJzkcAyPBpjKBAtDzGzsVrEUxMU90FJG8UO-AXrhxMN0GVtcWqpT5ndCSx0aWEv2TMAOwLX0uU5BSCSzM0jmS2c21gNzRqW2-kMgLfMwMzkVZhas' \
-H 'Cache-control: no-cache' \
-H 'Content-type: application/json' \
-d '[
{
"startDate": "2017-10-05",
"endDate": "2017-10-06",
"isAvailable": 1,
"price": 20,
"minimumStay": 1,
"maximumStay": 1125,
"closedOnArrival": null,
"closedOnDeparture": null,
"note": "test"
},
{
"startDate": "2017-10-10",
"endDate": "2017-10-11",
"isAvailable": 1,
"price": 21,
"minimumStay": 1,
"maximumStay": 1125,
"closedOnArrival": null,
"closedOnDeparture": null,
"note": "test"
}
]'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://api.hostaway.com/v1/listings/40160/calendarIntervals",
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{\n\t \"startDate\": \"2017-10-05\",\n\t \"endDate\": \"2017-10-06\",\n\t \"isAvailable\": 1,\n\t \"price\": 20,\n\t \"minimumStay\": 1,\n\t \"maximumStay\": 1125,\n\t \"closedOnArrival\": null,\n\t \"closedOnDeparture\": null,\n\t \"note\": \"test\"\n\t},\n\t{\n\t \"startDate\": \"2017-10-10\",\n\t \"endDate\": \"2017-10-11\",\n\t \"isAvailable\": 1,\n\t \"price\": 21,\n\t \"minimumStay\": 1,\n\t \"maximumStay\": 1125,\n\t \"closedOnArrival\": null,\n\t \"closedOnDeparture\": null,\n\t \"note\": \"test\"\n\t}\n]",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjJjZGRkYzNiZWU3OGEyZTA5NDgzNmZiYzE3MTQ3M2EwNjlkYTZlYzRjNmRlZDc1NTAzMWYzMzNmODVjYmQyMzI0Y2E4MTk0NzNkYzkxNjYzIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6IjJjZGRkYzNiZWU3OGEyZTA5NDgzNmZiYzE3MTQ3M2EwNjlkYTZlYzRjNmRlZDc1NTAzMWYzMzNmODVjYmQyMzI0Y2E4MTk0NzNkYzkxNjYzIiwiaWF0IjoxNDk5NzczMjk4LCJuYmYiOjE0OTk3NzMyOTgsImV4cCI6MTUxNTY3MDg5OCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.RYS6Gi7iLyhHRAzNRPPMUd5jYlGJ5Psq2ejFLDM5wmD1alAB6CdkTIuyrDrtJzkcAyPBpjKBAtDzGzsVrEUxMU90FJG8UO-AXrhxMN0GVtcWqpT5ndCSx0aWEv2TMAOwLX0uU5BSCSzM0jmS2c21gNzRqW2-kMgLfMwMzkVZhas",
"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([
{
"startDate": "2017-10-05",
"endDate": "2017-10-06",
"isAvailable": 1,
"price": 20,
"minimumStay": 1,
"maximumStay": 1125,
"closedOnArrival": null,
"closedOnDeparture": null,
"note": "test"
},
{
"startDate": "2017-10-10",
"endDate": "2017-10-11",
"isAvailable": 1,
"price": 21,
"minimumStay": 1,
"maximumStay": 1125,
"closedOnArrival": null,
"closedOnDeparture": null,
"note": "test"
}
]);
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("PUT", "http://api.hostaway.com/v1/listings/40160/calendarIntervals");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjJjZGRkYzNiZWU3OGEyZTA5NDgzNmZiYzE3MTQ3M2EwNjlkYTZlYzRjNmRlZDc1NTAzMWYzMzNmODVjYmQyMzI0Y2E4MTk0NzNkYzkxNjYzIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6IjJjZGRkYzNiZWU3OGEyZTA5NDgzNmZiYzE3MTQ3M2EwNjlkYTZlYzRjNmRlZDc1NTAzMWYzMzNmODVjYmQyMzI0Y2E4MTk0NzNkYzkxNjYzIiwiaWF0IjoxNDk5NzczMjk4LCJuYmYiOjE0OTk3NzMyOTgsImV4cCI6MTUxNTY3MDg5OCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.RYS6Gi7iLyhHRAzNRPPMUd5jYlGJ5Psq2ejFLDM5wmD1alAB6CdkTIuyrDrtJzkcAyPBpjKBAtDzGzsVrEUxMU90FJG8UO-AXrhxMN0GVtcWqpT5ndCSx0aWEv2TMAOwLX0uU5BSCSzM0jmS2c21gNzRqW2-kMgLfMwMzkVZhas");
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{\n\t \"startDate\": \"2017-10-05\",\n\t \"endDate\": \"2017-10-06\",\n\t \"isAvailable\": 1,\n\t \"price\": 20,\n\t \"minimumStay\": 1,\n\t \"maximumStay\": 1125,\n\t \"closedOnArrival\": null,\n\t \"closedOnDeparture\": null,\n\t \"note\": \"test\"\n\t},\n\t{\n\t \"startDate\": \"2017-10-10\",\n\t \"endDate\": \"2017-10-11\",\n\t \"isAvailable\": 1,\n\t \"price\": 21,\n\t \"minimumStay\": 1,\n\t \"maximumStay\": 1125,\n\t \"closedOnArrival\": null,\n\t \"closedOnDeparture\": null,\n\t \"note\": \"test\"\n\t}\n]");
Request request = new Request.Builder()
.url("http://api.hostaway.com/v1/listings/40160/calendarIntervals")
.put(body)
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjJjZGRkYzNiZWU3OGEyZTA5NDgzNmZiYzE3MTQ3M2EwNjlkYTZlYzRjNmRlZDc1NTAzMWYzMzNmODVjYmQyMzI0Y2E4MTk0NzNkYzkxNjYzIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6IjJjZGRkYzNiZWU3OGEyZTA5NDgzNmZiYzE3MTQ3M2EwNjlkYTZlYzRjNmRlZDc1NTAzMWYzMzNmODVjYmQyMzI0Y2E4MTk0NzNkYzkxNjYzIiwiaWF0IjoxNDk5NzczMjk4LCJuYmYiOjE0OTk3NzMyOTgsImV4cCI6MTUxNTY3MDg5OCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.RYS6Gi7iLyhHRAzNRPPMUd5jYlGJ5Psq2ejFLDM5wmD1alAB6CdkTIuyrDrtJzkcAyPBpjKBAtDzGzsVrEUxMU90FJG8UO-AXrhxMN0GVtcWqpT5ndCSx0aWEv2TMAOwLX0uU5BSCSzM0jmS2c21gNzRqW2-kMgLfMwMzkVZhas")
.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 = [
{
"startDate": "2017-10-05",
"endDate": "2017-10-06",
"isAvailable": 1,
"price": 20,
"minimumStay": 1,
"maximumStay": 1125,
"closedOnArrival": None,
"closedOnDeparture": None,
"note": "test"
},
{
"startDate": "2017-10-10",
"endDate": "2017-10-11",
"isAvailable": 1,
"price": 21,
"minimumStay": 1,
"maximumStay": 1125,
"closedOnArrival": None,
"closedOnDeparture": None,
"note": "test"
}
]
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjJjZGRkYzNiZWU3OGEyZTA5NDgzNmZiYzE3MTQ3M2EwNjlkYTZlYzRjNmRlZDc1NTAzMWYzMzNmODVjYmQyMzI0Y2E4MTk0NzNkYzkxNjYzIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6IjJjZGRkYzNiZWU3OGEyZTA5NDgzNmZiYzE3MTQ3M2EwNjlkYTZlYzRjNmRlZDc1NTAzMWYzMzNmODVjYmQyMzI0Y2E4MTk0NzNkYzkxNjYzIiwiaWF0IjoxNDk5NzczMjk4LCJuYmYiOjE0OTk3NzMyOTgsImV4cCI6MTUxNTY3MDg5OCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.RYS6Gi7iLyhHRAzNRPPMUd5jYlGJ5Psq2ejFLDM5wmD1alAB6CdkTIuyrDrtJzkcAyPBpjKBAtDzGzsVrEUxMU90FJG8UO-AXrhxMN0GVtcWqpT5ndCSx0aWEv2TMAOwLX0uU5BSCSzM0jmS2c21gNzRqW2-kMgLfMwMzkVZhas",
'Content-type': "application/json",
'Cache-control': "no-cache",
}
conn.request("PUT", "/v1/listings/40160/calendarIntervals", json.dumps(payload), headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
PUT https://api.hostaway.com/v1/listings/{listingId}/calendarIntervals
An array of calendar day objects should be provided in the request body.
Additionally starDate
and endDate
parameters should be specified to define dates interval to update.
Number of intervals to send in one request can’t be more than 200.
Response
An empty success response or error response.
Conversations
ConversationMessage object
{
"accountId": 10450,
"listingMapId": 40160,
"reservationId": 2,
"conversationId": 1406,
"communicationId": null,
"airbnbThreadMessageId": null,
"body": "hello guest",
"communicationType": "email",
"status": "sent",
"isIncoming": 0,
"isSeen": 0,
"sentUsingHostaway": 0,
"hash": "299855b5f40bd4e65fd83e5382a571e2",
"listingTimeZoneName": "Europe/Moscow",
"communicationEvent": null,
"communicationTimeDelta": null,
"communicationApplyListingTimeZone": null,
"communicationAlwaysTrigger": null,
"date": "2018-07-16 10:12:52",
"sentChannelDate": "2018-07-16 10:13:52",
"attachments": [
{
"accountId": 10450,
"listingMapId": null,
"reservationId": 2,
"taskId": null,
"name": "download.jpeg",
"url": "https://www.image.com/img.jpeg",
"isPublic": 1,
"communicationId": null,
"conversationMessageId": 3,
"extension": "jpeg",
"mimeType": "image/jpeg",
"isImage": null,
"id": 6
}
],
"insertedOn": "2018-07-16 10:12:52",
"updatedOn": "2018-07-16 10:12:52",
"id": 326
}
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | Identifier of conversation object |
accountId |
yes | int | Identifier of account |
listingMapId |
yes | int | Identifier of listing object. |
reservationId |
no | int | Identifier of reservation object |
conversationId |
yes | int | Identifier of conversation object |
communicationId |
no | int | Identifier of communication |
airbnbThreadMessageId |
no | string | reference to channel conversation/thread |
body |
yes | string | message contents |
communicationType |
yes | string | communication gateway (email / channel / sms / whatsapp) |
status |
no | string | message status (awaiting, cancelled_by_user, cancelled_by_system, sent, paused, failed) |
isIncoming |
no | bool | is incoming message |
isSeen |
no | bool | is message seen |
sentUsingHostaway |
no | bool | is message sent from hostaway dashboard |
hash : |
no | string | message checksum |
listingTimeZoneName |
no | string | Listing time zone name |
communicationEvent |
no | string | Event triggered communication if any |
communicationTimeDelta |
no | int | Communication time delta |
communicationApplyListingTimeZone |
no | int | 1 or 0 |
communicationAlwaysTrigger |
no | int | 1 or 0 |
date |
no | date (YYYY-MM-DD HH:MM:SS) | the message scheduled date |
sentChannelDate |
no | date (YYYY-MM-DD HH:MM:SS) | the message send to channel date |
attachments |
no | array | attachments of this message |
insertedOn |
no | date (YYYY-MM-DD HH:MM:SS) | the message inserted on |
updatedOn |
no | date (YYYY-MM-DD HH:MM:SS) | the message updated on |
Conversation object
{
"accountId": 10450,
"listingMapId": 10450,
"reservationId": 2,
"type": "host-guest-email",
"recipientEmail": "mail@test.com",
"recipientName": "John Smith",
"recipientPicture": null,
"hostEmail": "c-55107f63824f6e631b3d7bc73cdd7281@host.dev.hostaway.info",
"guestEmail": "c-a62f4669949b0ada2a34d42acdab0b0a@guest.dev.hostaway.info",
"hasUnreadMessages": 0,
"messageSentOn": "2018-06-28 11:24:40",
"messageReceivedOn": null,
"conversationMessages": [
{
"id": 326,
"accountId": 10450,
"listingMapId": 40160,
"reservationId": 2,
"conversationId": 1406,
"communicationId": null,
"channelThreadMessageId": null,
"body": "hello guest",
"isIncoming": 0,
"isSeen": 0,
"sentUsingHostaway": 1,
"hash": "299855b5f40bd4e65fd83e5382a571e2",
"listingTimeZoneName": "Europe/Berlin",
"communicationEvent": null,
"communicationTimeDelta": null,
"communicationApplyListingTimeZone": null,
"communicationAlwaysTrigger": null,
"insertedOn": "2018-06-28 11:24:40",
"updatedOn": "2018-06-28 11:24:40"
}
],
"Reservation": {
"listingMapId": 40160,
"listingName": "",
"channelId": 2000,
"source": "reservation",
"channelName": "direct",
"reservationId": "10450-40160-2000-1089253764",
"hostawayReservationId": "2",
"channelReservationId": "10450-40160-2000-1089253764",
"externalPropertyId": null,
"externalRatePlanId": null,
"externalUnitId": null,
"assigneeUserId": null,
"customerIcalId": null,
"customerIcalName": null,
"isProcessed": 0,
"isManuallyChecked": 0,
"isInstantBooked": 0,
"reservationDate": "2018-05-18 12:20:42",
"pendingExpireDate": null,
"guestName": "John Smith",
"guestFirstName": null,
"guestLastName": null,
"guestExternalAccountId": null,
"guestZipCode": null,
"guestAddress": null,
"guestCity": "Melbourne",
"guestCountry": "Australia",
"guestEmail": "mail@test.com",
"guestPicture": null,
"guestRecommendations": 0,
"guestTrips": 0,
"guestWork": null,
"isGuestIdentityVerified": 0,
"isGuestVerifiedByEmail": 0,
"isGuestVerifiedByWorkEmail": 0,
"isGuestVerifiedByFacebook": 0,
"isGuestVerifiedByGovernmentId": 0,
"isGuestVerifiedByPhone": 0,
"isGuestVerifiedByReviews": 0,
"numberOfGuests": 1,
"adults": null,
"children": null,
"infants": null,
"pets": null,
"arrivalDate": "2018-06-13",
"departureDate": "2018-06-14",
"previousArrivalDate": null,
"previousDepartureDate": null,
"checkInTime": 8,
"checkOutTime": 22,
"nights": 1,
"phone": null,
"totalPrice": 50.32,
"taxAmount": null,
"channelCommissionAmount": null,
"hostawayCommissionAmount": null,
"cleaningFee": 40.32,
"securityDepositFee": null,
"isPaid": null,
"paymentMethod": null,
"stripeGuestId": null,
"currency": "USD",
"status": "new",
"cancellationDate": null,
"cancelledBy": null,
"hostNote": null,
"guestNote": null,
"doorCode": null,
"doorCodeVendor": null,
"doorCodeInstruction": null,
"comment": null,
"confirmationCode": null,
"isStarred": 0,
"isArchived": 0,
"isPinned": 0,
"insertedOn": "2018-05-18 12:20:42",
"updatedOn": "2018-06-28 11:24:40",
"id": 2
},
"id": 1406
}
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | Identifier of conversation object |
listingMapId |
yes | int | Identifier of listing object. |
reservationId |
yes | string | Identifier of reservation object |
type |
yes | string | conversation type |
recipientEmail |
no | string | recipient email |
recipientPicture |
no | string | recipient picture Url |
hostEmail |
yes | string | host email |
guestEmail |
yes | string | guest email |
hasUnreadMessages |
no | bool | is there unread messages in conversation or not |
messageSentOn |
no | date (YYYY-MM-DD HH:MM:SS) | last message sent moment |
messageReceivedOn |
no | date (YYYY-MM-DD HH:MM:SS) | last message received moment |
conversationMessages |
no | array of conversationMessages | the latest message in conversation |
Reservation |
no | Reservation Object | the reservation related to the conversation |
Retrieve a conversations list
Request
curl -X GET \
'https://api.hostaway.com/v1/conversations?reservationId=&limit=&offset=&includeResources=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/conversations?reservationId=&limit=&offset=&includeResources=",
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/conversations?reservationId=&limit=&offset=&includeResources=");
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/conversations?reservationId=&limit=&offset=&includeResources=")
.get()
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIiwiaWF0IjoxNTI2NjQ0MzE0LCJuYmYiOjE1MjY2NDQzMTQsImV4cCI6MTU0MjE5NjMxNCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.hVv1ybL5Ifl6VatEBXxJz4sNa7f2RPGlSGCK5YNiSDNBeW9FjgfzbKFW4GaKGXNBYk2b7TpxhwF_3RbBRE0Y817TIiwUNZEhMCz5do4Kp9ZX6nrHlvJiqdLYZXhaHUlU8vq-80a0xTmgVnjRH20JeA0q9t8gxcfYJUQfQMOb59Q")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import requests
import json
url = "https://api.hostaway.com/v1/conversations"
querystring = {"reservationId": "", "limit": "", "offset": "", "includeResources": ""}
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIiwiaWF0IjoxNTI2NjQ0MzE0LCJuYmYiOjE1MjY2NDQzMTQsImV4cCI6MTU0MjE5NjMxNCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.hVv1ybL5Ifl6VatEBXxJz4sNa7f2RPGlSGCK5YNiSDNBeW9FjgfzbKFW4GaKGXNBYk2b7TpxhwF_3RbBRE0Y817TIiwUNZEhMCz5do4Kp9ZX6nrHlvJiqdLYZXhaHUlU8vq-80a0xTmgVnjRH20JeA0q9t8gxcfYJUQfQMOb59Q",
'Cache-control': "no-cache",
}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
GET https://api.hostaway.com/v1/conversations
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. |
reservationId |
no | int | reservation id |
includeResources |
no | int | if includeResources flag is 1 then response objects are supplied with supplementary resources, default is 0. |
Response
An array of conversation objects.
Retrieve a conversations list for the reservation
Request
curl -X GET \
https://api.hostaway.com/v1/reservations/2/conversations \
-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/reservations/2/conversations",
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/reservations/2/conversations");
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/reservations/2/conversations")
.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/reservations/2/conversations"
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/reservations/{reservationId}/conversations
Response
Array of conversation objects.
Retrieve a conversation object
Request
curl -X GET \
https://api.hostaway.com/v1/conversations/1406?includeResources= \
-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/conversations/1406?includeResources=",
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/conversations/1406?includeResources=");
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/conversations/1406?includeResources=")
.get()
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIiwiaWF0IjoxNTI2NjQ0MzE0LCJuYmYiOjE1MjY2NDQzMTQsImV4cCI6MTU0MjE5NjMxNCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.hVv1ybL5Ifl6VatEBXxJz4sNa7f2RPGlSGCK5YNiSDNBeW9FjgfzbKFW4GaKGXNBYk2b7TpxhwF_3RbBRE0Y817TIiwUNZEhMCz5do4Kp9ZX6nrHlvJiqdLYZXhaHUlU8vq-80a0xTmgVnjRH20JeA0q9t8gxcfYJUQfQMOb59Q")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import requests
import json
url = "https://api.hostaway.com/v1/conversations/1406"
querystring = {"includeResourses": "0"}
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIiwiaWF0IjoxNTI2NjQ0MzE0LCJuYmYiOjE1MjY2NDQzMTQsImV4cCI6MTU0MjE5NjMxNCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.hVv1ybL5Ifl6VatEBXxJz4sNa7f2RPGlSGCK5YNiSDNBeW9FjgfzbKFW4GaKGXNBYk2b7TpxhwF_3RbBRE0Y817TIiwUNZEhMCz5do4Kp9ZX6nrHlvJiqdLYZXhaHUlU8vq-80a0xTmgVnjRH20JeA0q9t8gxcfYJUQfQMOb59Q",
'Cache-control': "no-cache"
}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
GET https://api.hostaway.com/v1/conversations/{conversationId}
Query Parameter | Required | Type | Description |
---|---|---|---|
includeResources |
no | int | if includeResources flag is 1 then response object is supplied with supplementary resources, default is 0. |
Response
A conversation object.
Retrieve conversation messages list
Request
curl -X GET \
'https://api.hostaway.com/v1/conversations/1406/messages?limit=&offset=includeScheduledMessages=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/conversations/1406/messages?limit=&offset=&includeScheduledMessages=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/conversations/1406/messages?limit=&offset=&includeScheduledMessages=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/conversations/1406/messages?limit=&offset=&includeScheduledMessages=1")
.get()
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIiwiaWF0IjoxNTI2NjQ0MzE0LCJuYmYiOjE1MjY2NDQzMTQsImV4cCI6MTU0MjE5NjMxNCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.hVv1ybL5Ifl6VatEBXxJz4sNa7f2RPGlSGCK5YNiSDNBeW9FjgfzbKFW4GaKGXNBYk2b7TpxhwF_3RbBRE0Y817TIiwUNZEhMCz5do4Kp9ZX6nrHlvJiqdLYZXhaHUlU8vq-80a0xTmgVnjRH20JeA0q9t8gxcfYJUQfQMOb59Q")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import requests
import json
url = "https://api.hostaway.com/v1/conversations/1406/messages"
querystring = {"limit": "", "offset": "", "includeScheduledMessages": "1"}
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIiwiaWF0IjoxNTI2NjQ0MzE0LCJuYmYiOjE1MjY2NDQzMTQsImV4cCI6MTU0MjE5NjMxNCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.hVv1ybL5Ifl6VatEBXxJz4sNa7f2RPGlSGCK5YNiSDNBeW9FjgfzbKFW4GaKGXNBYk2b7TpxhwF_3RbBRE0Y817TIiwUNZEhMCz5do4Kp9ZX6nrHlvJiqdLYZXhaHUlU8vq-80a0xTmgVnjRH20JeA0q9t8gxcfYJUQfQMOb59Q",
'Cache-control': "no-cache",
}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
GET https://api.hostaway.com/v1/conversations/{conversationId}/messages
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. |
includeScheduledMessages |
no | int | Return messages of all the statuses or not |
Response
Array of conversation message objects. By default the server returns messages in the status sent
. If you want to get all messages (failed, awaiting, etc.) you should use includeScheduledMessages
parameter.
Retrieve conversation message
Request
curl -X GET \
https://api.hostaway.com/v1/conversations/1406/messages/325 \
-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/conversations/1406/messages/325",
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/conversations/1406/messages/325");
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/conversations/1406/messages/325")
.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/conversations/1406/messages/325"
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/conversations/{conversationId}/messages/{conversationMessageId}
Response
A conversation message object.
Send conversation message
Request
curl -X POST \
https://api.hostaway.com/v1/conversations/1406/messages \
-H 'Cache-control: no-cache' \
-H 'Content-type: application/json' \
-H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIiwiaWF0IjoxNTI2NjQ0MzE0LCJuYmYiOjE1MjY2NDQzMTQsImV4cCI6MTU0MjE5NjMxNCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.hVv1ybL5Ifl6VatEBXxJz4sNa7f2RPGlSGCK5YNiSDNBeW9FjgfzbKFW4GaKGXNBYk2b7TpxhwF_3RbBRE0Y817TIiwUNZEhMCz5do4Kp9ZX6nrHlvJiqdLYZXhaHUlU8vq-80a0xTmgVnjRH20JeA0q9t8gxcfYJUQfQMOb59Q' \
-d '{
"body": "hello guest",
"communicationType": "email"
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/conversations/1406/messages",
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 \"body\": \"hello guest\"\n,\"communicationType\":\"email\"}",
CURLOPT_HTTPHEADER => array(
"Cache-control: no-cache",
"Content-type: application/json",
"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 = JSON.stringify({
"body": "hello guest",
"communicationType": "channel"
});
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/conversations/1406/messages");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIiwiaWF0IjoxNTI2NjQ0MzE0LCJuYmYiOjE1MjY2NDQzMTQsImV4cCI6MTU0MjE5NjMxNCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.hVv1ybL5Ifl6VatEBXxJz4sNa7f2RPGlSGCK5YNiSDNBeW9FjgfzbKFW4GaKGXNBYk2b7TpxhwF_3RbBRE0Y817TIiwUNZEhMCz5do4Kp9ZX6nrHlvJiqdLYZXhaHUlU8vq-80a0xTmgVnjRH20JeA0q9t8gxcfYJUQfQMOb59Q");
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 \"body\": \"hello guest\"\n}");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/conversations/1406/messages")
.post(body)
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIiwiaWF0IjoxNTI2NjQ0MzE0LCJuYmYiOjE1MjY2NDQzMTQsImV4cCI6MTU0MjE5NjMxNCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.hVv1ybL5Ifl6VatEBXxJz4sNa7f2RPGlSGCK5YNiSDNBeW9FjgfzbKFW4GaKGXNBYk2b7TpxhwF_3RbBRE0Y817TIiwUNZEhMCz5do4Kp9ZX6nrHlvJiqdLYZXhaHUlU8vq-80a0xTmgVnjRH20JeA0q9t8gxcfYJUQfQMOb59Q")
.addHeader("Content-type", "application/json")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import requests
import json
url = "https://api.hostaway.com/v1/conversations/1406/messages"
payload = {
"body": "hello guest",
"communicationType": "channel"
}
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIiwiaWF0IjoxNTI2NjQ0MzE0LCJuYmYiOjE1MjY2NDQzMTQsImV4cCI6MTU0MjE5NjMxNCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.hVv1ybL5Ifl6VatEBXxJz4sNa7f2RPGlSGCK5YNiSDNBeW9FjgfzbKFW4GaKGXNBYk2b7TpxhwF_3RbBRE0Y817TIiwUNZEhMCz5do4Kp9ZX6nrHlvJiqdLYZXhaHUlU8vq-80a0xTmgVnjRH20JeA0q9t8gxcfYJUQfQMOb59Q",
'Content-type': "application/json",
'Cache-control': "no-cache",
}
response = requests.request("POST", url, data=json.dumps(payload), headers=headers)
print(response.text)
POST https://api.hostaway.com/v1/conversations/{conversationId}/messages
A conversation message object should be provided in the request body.
- the
body
only parameter can be specified. - by default
communicationType
parameter isemail
, possible options: email / channel / sms / whatsapp
Response
The created conversation message object or error response.
Message templates
Message template object
{
"id": 2,
"accountId": 10450,
"listingMapId": "40160",
"channelId": "1",
"messageTemplateGroupId": "1",
"name": "greeting",
"description": "greeting of guest",
"message": "Hello {{guest_name}}",
"color": "1"
}
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | Identifier of conversation object |
accountId |
yes | int | Identifier of account object |
listingMapId |
no | int | Identifier of listing object. |
channelId |
no | int | Identifier of channel object. Please check here for valid channel values: Channels |
messageTemplateGroupId |
no | int | Identifier of message template group object |
name |
yes | string | template name |
description |
no | string | description of message template |
message |
no | string | template message |
color |
no | int | color number |
Retrieve a message templates list
Request
curl -X GET \
https://api.hostaway.com/v1/messageTemplates \
-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/messageTemplates",
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/messageTemplates");
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/messageTemplates")
.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/messageTemplates"
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/messageTemplates
Query Parameter | Required | Type | Description |
---|---|---|---|
messageTemplateGroupId |
no | int | message template grpup id. |
channelId |
no | int | channel id. Please check here for valid channel values: Channels |
listingMapId |
no | int | listing map id |
reservationId |
no | int | reservation id |
Response
An array of message template objects with placeholders. * placeholders get filled when reservationId is provided
Retrieve a message template
Request
curl -X GET \
https://api.hostaway.com/v1/messageTemplates/2 \
-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/messageTemplates/2",
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/messageTemplates/2");
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/messageTemplates/2")
.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/messageTemplates/2"
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/messageTemplates/{messageTemplateId}
Response
A Message template object with placeholders.
Amenities
Amenity object
{
"id": 1,
"name": "Cable TV"
}
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | |
name |
yes | string |
Retrieve an amenities list
Request
curl -X GET \
https://api.hostaway.com/v1/amenities \
-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/amenities",
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",
"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("GET", "https://api.hostaway.com/v1/amenities");
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/amenities")
.get()
.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 requests
url = "https://api.hostaway.com/v1/amenities"
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6ImQzMzBjODU4ZDUwMWY5ZTk2ZmNhMzY4NGFjODQ5MTMzODIxZjIyZWZhZDk2YmYxZjNjMDY0OGJjNjVlMDJkZWM0MDNiMzMwNzhhYTIyN2JmIiwiaWF0IjoxNDk4NTc5NzQ0LCJuYmYiOjE0OTg1Nzk3NDQsImV4cCI6MTUxNDM5MDk0NCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.TsbJaDOZ0VlEF4vBg7mqLX8DxEuu5rjtsmqix1IbsEcR7F9cdx8F3dDq2zOc6mw8FNAfXT8xp1r5qKu2AYoxv4ublZhxxW0Y6uPSFs0jv5Fh5lliNBJAeQqFOChOVEbYzdbfH_6uu4HHSL31si1RvpVccAjA1Ap9vXlSg3DcPgw",
'Content-type': "application/json",
'Cache-control': "no-cache"
}
response = requests.request("GET", url, headers=headers)
print(response.text)
GET https://api.hostaway.com/v1/amenities
Response
An array of amenity objects.
Bed types
Bed type object
{
"id": 1,
"name": "Full Bunk Bed"
}
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | |
name |
yes | string |
Retrieve a bed types list
Request
curl -X GET \
https://api.hostaway.com/v1/bedTypes \
-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/bedTypes",
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",
"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("GET", "https://api.hostaway.com/v1/bedTypes");
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/bedTypes")
.get()
.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("GET", "/v1/bedTypes", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
GET https://api.hostaway.com/v1/bedTypes
Response
An array of bed type objects.
Property Types
Property Type Object
{
"id": 1,
"name": "Apartment"
}
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | |
name |
yes | string |
Retrieve a property types list
Request
curl -X GET \
https://api.hostaway.com/v1/propertyTypes \
-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/propertyTypes",
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",
"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("GET", "https://api.hostaway.com/v1/propertyTypes");
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/propertyTypes")
.get()
.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("GET", "/v1/propertyTypes", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
GET https://api.hostaway.com/v1/propertyTypes
Response
An array of property type objects.
Reservation webhook logs
Reservation webhook log object
{
"id": 2,
"accountId": 10450,
"listingMapId": 40160,
"reservationId": 1234,
"reservationWebhookId": 89,
"currentReservationStatus": "new",
"previousReservationStatus": null,
"url": "https://webhook.site/6e73ba6d-789e-ds4d64-9f68-a2e1134d1c6f3",
"login": "my_login",
"password": "****",
"responseStatus": 200,
"responseBody": ""
}
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | Identifier of reservationWebhookLog object |
accountId |
yes | int | Identifier of account object |
listingMapId |
yes | int | Identifier of listing object |
reservationId |
yes | int | Identifier of reservation object |
reservationWebhookId |
yes | int | Identifier of Reservation Webhook |
currentReservationStatus |
yes | string | Reservation status |
previousReservationStatus |
no | string | Previous reservation status |
url |
yes | string | URL |
login |
no | string | Login for basic auth (if login and password provided we’ll send basic auth header) |
password |
no | string | Password for basic auth |
responseStatus |
yes | int | Response status |
responseBody |
no | string | Response body |
Retrieve a webhook log list
curl -X GET \
'https://api.hostaway.com/v1/reservationWebhooklogs?limit=&offset=&reservationId=&listingMapId=' \
-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/reservationWebhooklogs?limit=&offset=&reservationId=&listingMapId=",
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/reservationWebhooklogs?limit=&offset=&reservationId=&listingMapId=");
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/reservationWebhooklogs?limit=&offset=&reservationId=&listingMapId=")
.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/reservationWebhooklogs?limit=&offset=&reservationId=&listingMapId="
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/reservationWebhooklogs?limit=&offset=&reservationId=&listingMapId=
Response
Array of reservation webhook logs objects.
Unified webhook logs
Unified webhook log object
{
"id": 2,
"accountId": 10450,
"listingMapId": 40160,
"webhookNotificationSettingId": 5,
"isEnabled": 1,
"url": "http://api.guestentry.com/api/hostaway/v1/43003/webhook",
"login": "login",
"password": "****",
"object": "conversationMessage",
"objectId": 123456789,
"event": "message.received",
"responseStatus": 200,
"responseBody": ""
}
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | Identifier of unifiedWebhookLog object |
accountId |
yes | int | Identifier of account object |
listingMapId |
yes | int | Identifier of listing object |
webhookNotificationSettingId |
yes | int | Identifier of webhook setting object |
isEnabled |
yes | int | Webhook enable flag |
url |
yes | string | URL |
login |
no | string | Login for basic auth (if login and password provided we’ll send basic auth header) |
password |
no | string | Password for basic auth |
object |
yes | string | Object type |
objectId |
yes | int | Object identifier |
event |
yes | string | Event type |
responseStatus |
yes | int | Response status |
responseBody |
no | string | Response body |
Retrieve a unified webhook log list
curl -X GET \
'https://api.hostaway.com/v1/unifiedWebhookLogs?limit=&offset=&unifiedWebhookId=&listingMapId=' \
-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/unifiedWebhookLogs?limit=&offset=&unifiedWebhookId=&listingMapId=",
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/unifiedWebhookId?limit=&offset=&unifiedWebhookId=&listingMapId=");
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/unifiedWebhookId?limit=&offset=&unifiedWebhookId=&listingMapId=")
.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/unifiedWebhookId?limit=&offset=&unifiedWebhookId=&listingMapId="
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/unifiedWebhookId?limit=&offset=&unifiedWebhookId=&listingMapId=
Response
Array of unified webhook logs objects.
ConversationMessage webhook logs
ConversationMessage webhook log object
{
"id": 2,
"accountId": 10450,
"listingMapId": 40160,
"reservationId": 1234,
"conversationMessageId": 89,
"conversationMessageWebhookId": 129,
"url": "https://webhook.site/6e73ba6d-789e-ds4d64-9f68-a2e1134d1c6f3",
"login": "my_login",
"password": "****",
"responseStatus": 200,
"responseBody": ""
}
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | Identifier of conversationMessageWebhookLog object |
accountId |
yes | int | Identifier of account object |
listingMapId |
yes | int | Identifier of listing object |
reservationId |
yes | int | Identifier of reservation object |
conversationMessageId |
yes | int | Identifier of ConversationMessage object |
conversationMessageWebhookId |
yes | int | Identifier of ConversationMessageWebhook object |
url |
yes | string | URL |
login |
no | string | Login for basic auth (if login and password provided we’ll send basic auth header) |
password |
no | string | Password for basic auth |
responseStatus |
yes | int | Response status |
responseBody |
no | string | Response body |
Retrieve a ConversationMessage webhook log list
curl -X GET \
'https://api.hostaway.com/v1/conversationMessageWebhooklogs?limit=&offset=&reservationId=&listingMapId=' \
-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/conversationMessageWebhooklogs?limit=&offset=&reservationId=&listingMapId=",
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/conversationMessageWebhooklogs?limit=&offset=&reservationId=&listingMapId=");
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/conversationMessageWebhooklogs?limit=&offset=&reservationId=&listingMapId=")
.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/conversationMessageWebhooklogs?limit=&offset=&reservationId=&listingMapId="
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/conversationMessageWebhooklogs?limit=&offset=&reservationId=&listingMapId=
Response
Array of conversation message webhook logs objects.
Custom reservation field (deprecated, use new custom field endpoints instead)
Custom reservation field object
{
"id": 2,
"accountId": 10450,
"name": "Custom field name",
"varName": "reservation_123123",
"possibleValues": null,
"type": "text",
"objectType": "reservation",
"isPublic": 1,
"sortOrder": 1
}
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | Identifier of conversation object |
accountId |
yes | int | Identifier of account object |
name |
yes | int | Field name |
varName |
yes | int | Field var name |
possibleValues |
no | array | Possible values if field type Dropdown |
type |
yes | string | Custom field type |
objectType |
yes | string | Object type |
isPublic |
yes | int | Public field or not |
sortOrder |
yes | int | Sort order |
Retrieve custom reservation fields
curl -X GET \
'https://api.hostaway.com/v1/reservations/customFields' \
-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/reservations/customFields",
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/reservations/customFields");
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/reservations/customFields")
.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/reservations/customFields"
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/reservations/customFields
Response
Array of custom field objects.
Custom field (new)
Custom field object
{
"id": 2,
"accountId": 10450,
"name": "Custom field name",
"varName": "reservation_123123",
"possibleValues": null,
"type": "text",
"objectType": "reservation",
"isPublic": 1,
"sortOrder": 1
}
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | Identifier of conversation object |
accountId |
yes | int | Identifier of account object |
name |
yes | int | Field name |
varName |
yes | int | Field var name |
possibleValues |
no | string | Possible values if field type Dropdown (in json) |
type |
yes | string | Custom field type (one of text, textarea, number, dropdown) |
objectType |
yes | string | Object type (one of reservation, task, listing) |
isPublic |
yes | int | Public field or not |
sortOrder |
yes | int | Sort order |
Retrieve custom fields
Query params:
name | default | options |
---|---|---|
limit |
100 | max is 500 |
offset |
0 | |
objectType |
null | one of the following: reservation, listing, task |
If object type query param is not specified all custom fields are returned
curl -X GET \
'https://api.hostaway.com/v1/customFields?limit=&offset=&objectType=' \
-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/customFields?limit=&offset=&objectType=",
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/customFields?limit=&offset=&objectType=");
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/customFields?limit=&offset=&objectType=")
.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/customFields?limit=&offset=&objectType="
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/reservations/customFields
Response
Array of custom field objects.
Create a custom field
You can create a custom field by this endpoint. See new custom field object description for available options.
To create a custom field of dropdown
type, pass possibleValues
field as follows: [{"value":"custom field value","label":"custom field label"}]
curl --location --request POST 'https://api.hostaway.com/v1/customFields' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImFjM2QxN2Q1Y2YyYmRiYWM2YjFhODRhNTA0MmU4Nzc0NTU4Y2MzZDkwYTViYTJkYjU2MTAyOWjGdDA3MTQ2N2IzODA5NmI5MzhhNWY5NDU1In0.eyJhdWQiOiIxIiwianRpIjoiYWMzZDE3ZDVjZjJiZGJhYzZiMWE4NGE1MDQyZTg3NzQ1NThjYzNkOTBhNWJhMmRiNTYxMDI5YmQ4MDcxNDY3YjM4MDk2YjkzOGE1Zjk0NTUiLCJpYXQiOjE1NjgyMDk3MzIsIm5iZiI6MTU2ODIwOTczMiwiZXhwIjoxNjMxMzY4MTMyLCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdfQ.U41DnBKE4JrL167fY7gcIV4x5BefNlNjJIN1hI8BspT16XZKfuTW4E4pqN4WdqkNDp5WKZjh8Jz_qrnJVL_XYK99JufN4ABTNkPVGjxEp_6L5yTikgX77llYrUv9liCybwwM69iW6UNMjsJ3RjJkS_C-3LkJVdYKc-945Co8P-Y' \
--header 'Content-type: text/plain' \
--data-raw '{
"name": "Test 1",
"varName": "public_test",
"possibleValues": null,
"type": "text",
"objectType": "reservation",
"isPublic": 1,
"sortOrder": null
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.hostaway.com/v1/customFields',
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 =>'{
"name": "Test 1",
"varName": "public_test",
"possibleValues": null,
"type": "text",
"objectType": "reservation",
"isPublic": 1,
"sortOrder": null
}',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImFjM2QxN2Q1Y2YyYmRiYWM2YjFhODRhNTA0MmU4Nzc0NTU4Y2MzZDkwYTViYTJkYjU2MTAyOWjGdDA3MTQ2N2IzODA5NmI5MzhhNWY5NDU1In0.eyJhdWQiOiIxIiwianRpIjoiYWMzZDE3ZDVjZjJiZGJhYzZiMWE4NGE1MDQyZTg3NzQ1NThjYzNkOTBhNWJhMmRiNTYxMDI5YmQ4MDcxNDY3YjM4MDk2YjkzOGE1Zjk0NTUiLCJpYXQiOjE1NjgyMDk3MzIsIm5iZiI6MTU2ODIwOTczMiwiZXhwIjoxNjMxMzY4MTMyLCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdfQ.U41DnBKE4JrL167fY7gcIV4x5BefNlNjJIN1hI8BspT16XZKfuTW4E4pqN4WdqkNDp5WKZjh8Jz_qrnJVL_XYK99JufN4ABTNkPVGjxEp_6L5yTikgX77llYrUv9liCybwwM69iW6UNMjsJ3RjJkS_C-3LkJVdYKc-945Co8P-Y',
'Content-type: text/plain'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var data = "{\n \"name\": \"Test 1\",\n \"varName\": \"public_test\",\n \"possibleValues\": null,\n \"type\": \"text\",\n \"objectType\": \"reservation\",\n \"isPublic\": 1,\n \"sortOrder\": null\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/customFields");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImFjM2QxN2Q1Y2YyYmRiYWM2YjFhODRhNTA0MmU4Nzc0NTU4Y2MzZDkwYTViYTJkYjU2MTAyOWjGdDA3MTQ2N2IzODA5NmI5MzhhNWY5NDU1In0.eyJhdWQiOiIxIiwianRpIjoiYWMzZDE3ZDVjZjJiZGJhYzZiMWE4NGE1MDQyZTg3NzQ1NThjYzNkOTBhNWJhMmRiNTYxMDI5YmQ4MDcxNDY3YjM4MDk2YjkzOGE1Zjk0NTUiLCJpYXQiOjE1NjgyMDk3MzIsIm5iZiI6MTU2ODIwOTczMiwiZXhwIjoxNjMxMzY4MTMyLCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdfQ.U41DnBKE4JrL167fY7gcIV4x5BefNlNjJIN1hI8BspT16XZKfuTW4E4pqN4WdqkNDp5WKZjh8Jz_qrnJVL_XYK99JufN4ABTNkPVGjxEp_6L5yTikgX77llYrUv9liCybwwM69iW6UNMjsJ3RjJkS_C-3LkJVdYKc-945Co8P-Y");
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 \"name\": \"Test 1\",\n \"varName\": \"public_test\",\n \"possibleValues\": null,\n \"type\": \"text\",\n \"objectType\": \"reservation\",\n \"isPublic\": 1,\n \"sortOrder\": null\n}");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/customFields")
.method("POST", body)
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImFjM2QxN2Q1Y2YyYmRiYWM2YjFhODRhNTA0MmU4Nzc0NTU4Y2MzZDkwYTViYTJkYjU2MTAyOWjGdDA3MTQ2N2IzODA5NmI5MzhhNWY5NDU1In0.eyJhdWQiOiIxIiwianRpIjoiYWMzZDE3ZDVjZjJiZGJhYzZiMWE4NGE1MDQyZTg3NzQ1NThjYzNkOTBhNWJhMmRiNTYxMDI5YmQ4MDcxNDY3YjM4MDk2YjkzOGE1Zjk0NTUiLCJpYXQiOjE1NjgyMDk3MzIsIm5iZiI6MTU2ODIwOTczMiwiZXhwIjoxNjMxMzY4MTMyLCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdfQ.U41DnBKE4JrL167fY7gcIV4x5BefNlNjJIN1hI8BspT16XZKfuTW4E4pqN4WdqkNDp5WKZjh8Jz_qrnJVL_XYK99JufN4ABTNkPVGjxEp_6L5yTikgX77llYrUv9liCybwwM69iW6UNMjsJ3RjJkS_C-3LkJVdYKc-945Co8P-Y")
.addHeader("Content-type", "text/plain")
.build();
Response response = client.newCall(request).execute();
import requests
url = "https://api.hostaway.com/v1/customFields"
headers = {
"Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImFjM2QxN2Q1Y2YyYmRiYWM2YjFhODRhNTA0MmU4Nzc0NTU4Y2MzZDkwYTViYTJkYjU2MTAyOWjGdDA3MTQ2N2IzODA5NmI5MzhhNWY5NDU1In0.eyJhdWQiOiIxIiwianRpIjoiYWMzZDE3ZDVjZjJiZGJhYzZiMWE4NGE1MDQyZTg3NzQ1NThjYzNkOTBhNWJhMmRiNTYxMDI5YmQ4MDcxNDY3YjM4MDk2YjkzOGE1Zjk0NTUiLCJpYXQiOjE1NjgyMDk3MzIsIm5iZiI6MTU2ODIwOTczMiwiZXhwIjoxNjMxMzY4MTMyLCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdfQ.U41DnBKE4JrL167fY7gcIV4x5BefNlNjJIN1hI8BspT16XZKfuTW4E4pqN4WdqkNDp5WKZjh8Jz_qrnJVL_XYK99JufN4ABTNkPVGjxEp_6L5yTikgX77llYrUv9liCybwwM69iW6UNMjsJ3RjJkS_C-3LkJVdYKc-945Co8P-Y",
"Content-type": "text/plain",
}
data = {
"name": "Test 1",
"varName": "public_test",
"possibleValues": None,
"type": "text",
"objectType": "reservation",
"isPublic": 1,
"sortOrder": None,
}
response = requests.post(url, json=data, headers=headers)
print(response.text)
Response
Custom field object
Update a custom field
You can update a custom field by this endpoint. See new custom field object description for available options.
You shouldn’t edit a custom field of dropdown
type. It is possible to change a custom field of dropdown
type to another type, but it is not recommended
curl --location --request PUT 'https://api.hostaway.com/v1/customFields/2' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImFjM2QxN2Q1Y2YyYmRiYWM2YjFhODRhNTA0MmU4Nzc0NTU4Y2MzZDkwYTViYTJkYjU2MTAyOWjGdDA3MTQ2N2IzODA5NmI5MzhhNWY5NDU1In0.eyJhdWQiOiIxIiwianRpIjoiYWMzZDE3ZDVjZjJiZGJhYzZiMWE4NGE1MDQyZTg3NzQ1NThjYzNkOTBhNWJhMmRiNTYxMDI5YmQ4MDcxNDY3YjM4MDk2YjkzOGE1Zjk0NTUiLCJpYXQiOjE1NjgyMDk3MzIsIm5iZiI6MTU2ODIwOTczMiwiZXhwIjoxNjMxMzY4MTMyLCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdfQ.U41DnBKE4JrL167fY7gcIV4x5BefNlNjJIN1hI8BspT16XZKfuTW4E4pqN4WdqkNDp5WKZjh8Jz_qrnJVL_XYK99JufN4ABTNkPVGjxEp_6L5yTikgX77llYrUv9liCybwwM69iW6UNMjsJ3RjJkS_C-3LkJVdYKc-945Co8P-Y' \
--header 'Content-type: text/plain' \
--data-raw '{
"name": "Test 1",
"varName": "public_test",
"possibleValues": null,
"type": "dropdown",
"objectType": "reservation",
"isPublic": 1,
"sortOrder": null
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.hostaway.com/v1/customFields/2',
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 =>'{
"name": "Test 1",
"varName": "public_test",
"possibleValues": null,
"type": "dropdown",
"objectType": "reservation",
"isPublic": 1,
"sortOrder": null
}',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImFjM2QxN2Q1Y2YyYmRiYWM2YjFhODRhNTA0MmU4Nzc0NTU4Y2MzZDkwYTViYTJkYjU2MTAyOWjGdDA3MTQ2N2IzODA5NmI5MzhhNWY5NDU1In0.eyJhdWQiOiIxIiwianRpIjoiYWMzZDE3ZDVjZjJiZGJhYzZiMWE4NGE1MDQyZTg3NzQ1NThjYzNkOTBhNWJhMmRiNTYxMDI5YmQ4MDcxNDY3YjM4MDk2YjkzOGE1Zjk0NTUiLCJpYXQiOjE1NjgyMDk3MzIsIm5iZiI6MTU2ODIwOTczMiwiZXhwIjoxNjMxMzY4MTMyLCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdfQ.U41DnBKE4JrL167fY7gcIV4x5BefNlNjJIN1hI8BspT16XZKfuTW4E4pqN4WdqkNDp5WKZjh8Jz_qrnJVL_XYK99JufN4ABTNkPVGjxEp_6L5yTikgX77llYrUv9liCybwwM69iW6UNMjsJ3RjJkS_C-3LkJVdYKc-945Co8P-Y',
'Content-type: text/plain'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var data = "{\n \"name\": \"Test 1\",\n \"varName\": \"public_test\",\n \"possibleValues\": null,\n \"type\": \"dropdown\",\n \"objectType\": \"reservation\",\n \"isPublic\": 1,\n \"sortOrder\": null\n}";
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/customFields/2");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImFjM2QxN2Q1Y2YyYmRiYWM2YjFhODRhNTA0MmU4Nzc0NTU4Y2MzZDkwYTViYTJkYjU2MTAyOWjGdDA3MTQ2N2IzODA5NmI5MzhhNWY5NDU1In0.eyJhdWQiOiIxIiwianRpIjoiYWMzZDE3ZDVjZjJiZGJhYzZiMWE4NGE1MDQyZTg3NzQ1NThjYzNkOTBhNWJhMmRiNTYxMDI5YmQ4MDcxNDY3YjM4MDk2YjkzOGE1Zjk0NTUiLCJpYXQiOjE1NjgyMDk3MzIsIm5iZiI6MTU2ODIwOTczMiwiZXhwIjoxNjMxMzY4MTMyLCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdfQ.U41DnBKE4JrL167fY7gcIV4x5BefNlNjJIN1hI8BspT16XZKfuTW4E4pqN4WdqkNDp5WKZjh8Jz_qrnJVL_XYK99JufN4ABTNkPVGjxEp_6L5yTikgX77llYrUv9liCybwwM69iW6UNMjsJ3RjJkS_C-3LkJVdYKc-945Co8P-Y");
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 \"name\": \"Test 1\",\n \"varName\": \"public_test\",\n \"possibleValues\": null,\n \"type\": \"dropdown\",\n \"objectType\": \"reservation\",\n \"isPublic\": 1,\n \"sortOrder\": null\n}");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/customFields/2")
.method("PUT", body)
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImFjM2QxN2Q1Y2YyYmRiYWM2YjFhODRhNTA0MmU4Nzc0NTU4Y2MzZDkwYTViYTJkYjU2MTAyOWjGdDA3MTQ2N2IzODA5NmI5MzhhNWY5NDU1In0.eyJhdWQiOiIxIiwianRpIjoiYWMzZDE3ZDVjZjJiZGJhYzZiMWE4NGE1MDQyZTg3NzQ1NThjYzNkOTBhNWJhMmRiNTYxMDI5YmQ4MDcxNDY3YjM4MDk2YjkzOGE1Zjk0NTUiLCJpYXQiOjE1NjgyMDk3MzIsIm5iZiI6MTU2ODIwOTczMiwiZXhwIjoxNjMxMzY4MTMyLCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdfQ.U41DnBKE4JrL167fY7gcIV4x5BefNlNjJIN1hI8BspT16XZKfuTW4E4pqN4WdqkNDp5WKZjh8Jz_qrnJVL_XYK99JufN4ABTNkPVGjxEp_6L5yTikgX77llYrUv9liCybwwM69iW6UNMjsJ3RjJkS_C-3LkJVdYKc-945Co8P-Y")
.addHeader("Content-type", "text/plain")
.build();
Response response = client.newCall(request).execute();
import requests
url = "https://api.hostaway.com/v1/customFields/2"
headers = {
"Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImFjM2QxN2Q1Y2YyYmRiYWM2YjFhODRhNTA0MmU4Nzc0NTU4Y2MzZDkwYTViYTJkYjU2MTAyOWjGdDA3MTQ2N2IzODA5NmI5MzhhNWY5NDU1In0.eyJhdWQiOiIxIiwianRpIjoiYWMzZDE3ZDVjZjJiZGJhYzZiMWE4NGE1MDQyZTg3NzQ1NThjYzNkOTBhNWJhMmRiNTYxMDI5YmQ4MDcxNDY3YjM4MDk2YjkzOGE1Zjk0NTUiLCJpYXQiOjE1NjgyMDk3MzIsIm5iZiI6MTU2ODIwOTczMiwiZXhwIjoxNjMxMzY4MTMyLCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdfQ.U41DnBKE4JrL167fY7gcIV4x5BefNlNjJIN1hI8BspT16XZKfuTW4E4pqN4WdqkNDp5WKZjh8Jz_qrnJVL_XYK99JufN4ABTNkPVGjxEp_6L5yTikgX77llYrUv9liCybwwM69iW6UNMjsJ3RjJkS_C-3LkJVdYKc-945Co8P-Y",
"Content-type": "text/plain",
}
data = {
"name": "Test 1",
"varName": "public_test",
"possibleValues": None,
"type": "dropdown",
"objectType": "reservation",
"isPublic": 1,
"sortOrder": None,
}
response = requests.put(url, json=data, headers=headers)
print(response.text)
Response
Custom field object
Delete a custom field
You can delete a custom field by this endpoint. This endpoint might return error if removing the custom field is not allowed.
curl --location --request DELETE 'https://api.hostaway.com/v1/customFields/2' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImFjM2QxN2Q1Y2YyYmRiYWM2YjFhODRhNTA0MmU4Nzc0NTU4Y2MzZDkwYTViYTJkYjU2MTAyOWjGdDA3MTQ2N2IzODA5NmI5MzhhNWY5NDU1In0.eyJhdWQiOiIxIiwianRpIjoiYWMzZDE3ZDVjZjJiZGJhYzZiMWE4NGE1MDQyZTg3NzQ1NThjYzNkOTBhNWJhMmRiNTYxMDI5YmQ4MDcxNDY3YjM4MDk2YjkzOGE1Zjk0NTUiLCJpYXQiOjE1NjgyMDk3MzIsIm5iZiI6MTU2ODIwOTczMiwiZXhwIjoxNjMxMzY4MTMyLCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdfQ.U41DnBKE4JrL167fY7gcIV4x5BefNlNjJIN1hI8BspT16XZKfuTW4E4pqN4WdqkNDp5WKZjh8Jz_qrnJVL_XYK99JufN4ABTNkPVGjxEp_6L5yTikgX77llYrUv9liCybwwM69iW6UNMjsJ3RjJkS_C-3LkJVdYKc-945Co8P-Y' \
--data-raw ''
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.hostaway.com/v1/customFields/2',
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(
'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImFjM2QxN2Q1Y2YyYmRiYWM2YjFhODRhNTA0MmU4Nzc0NTU4Y2MzZDkwYTViYTJkYjU2MTAyOWjGdDA3MTQ2N2IzODA5NmI5MzhhNWY5NDU1In0.eyJhdWQiOiIxIiwianRpIjoiYWMzZDE3ZDVjZjJiZGJhYzZiMWE4NGE1MDQyZTg3NzQ1NThjYzNkOTBhNWJhMmRiNTYxMDI5YmQ4MDcxNDY3YjM4MDk2YjkzOGE1Zjk0NTUiLCJpYXQiOjE1NjgyMDk3MzIsIm5iZiI6MTU2ODIwOTczMiwiZXhwIjoxNjMxMzY4MTMyLCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdfQ.U41DnBKE4JrL167fY7gcIV4x5BefNlNjJIN1hI8BspT16XZKfuTW4E4pqN4WdqkNDp5WKZjh8Jz_qrnJVL_XYK99JufN4ABTNkPVGjxEp_6L5yTikgX77llYrUv9liCybwwM69iW6UNMjsJ3RjJkS_C-3LkJVdYKc-945Co8P-Y'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var data = "";
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/customFields/2");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImFjM2QxN2Q1Y2YyYmRiYWM2YjFhODRhNTA0MmU4Nzc0NTU4Y2MzZDkwYTViYTJkYjU2MTAyOWjGdDA3MTQ2N2IzODA5NmI5MzhhNWY5NDU1In0.eyJhdWQiOiIxIiwianRpIjoiYWMzZDE3ZDVjZjJiZGJhYzZiMWE4NGE1MDQyZTg3NzQ1NThjYzNkOTBhNWJhMmRiNTYxMDI5YmQ4MDcxNDY3YjM4MDk2YjkzOGE1Zjk0NTUiLCJpYXQiOjE1NjgyMDk3MzIsIm5iZiI6MTU2ODIwOTczMiwiZXhwIjoxNjMxMzY4MTMyLCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdfQ.U41DnBKE4JrL167fY7gcIV4x5BefNlNjJIN1hI8BspT16XZKfuTW4E4pqN4WdqkNDp5WKZjh8Jz_qrnJVL_XYK99JufN4ABTNkPVGjxEp_6L5yTikgX77llYrUv9liCybwwM69iW6UNMjsJ3RjJkS_C-3LkJVdYKc-945Co8P-Y");
xhr.send(data);
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/customFields/2")
.method("DELETE", body)
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImFjM2QxN2Q1Y2YyYmRiYWM2YjFhODRhNTA0MmU4Nzc0NTU4Y2MzZDkwYTViYTJkYjU2MTAyOWjGdDA3MTQ2N2IzODA5NmI5MzhhNWY5NDU1In0.eyJhdWQiOiIxIiwianRpIjoiYWMzZDE3ZDVjZjJiZGJhYzZiMWE4NGE1MDQyZTg3NzQ1NThjYzNkOTBhNWJhMmRiNTYxMDI5YmQ4MDcxNDY3YjM4MDk2YjkzOGE1Zjk0NTUiLCJpYXQiOjE1NjgyMDk3MzIsIm5iZiI6MTU2ODIwOTczMiwiZXhwIjoxNjMxMzY4MTMyLCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdfQ.U41DnBKE4JrL167fY7gcIV4x5BefNlNjJIN1hI8BspT16XZKfuTW4E4pqN4WdqkNDp5WKZjh8Jz_qrnJVL_XYK99JufN4ABTNkPVGjxEp_6L5yTikgX77llYrUv9liCybwwM69iW6UNMjsJ3RjJkS_C-3LkJVdYKc-945Co8P-Y")
.build();
Response response = client.newCall(request).execute();
import requests
url = "https://api.hostaway.com/v1/customFields/2"
headers = {
"Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImFjM2QxN2Q1Y2YyYmRiYWM2YjFhODRhNTA0MmU4Nzc0NTU4Y2MzZDkwYTViYTJkYjU2MTAyOWjGdDA3MTQ2N2IzODA5NmI5MzhhNWY5NDU1In0.eyJhdWQiOiIxIiwianRpIjoiYWMzZDE3ZDVjZjJiZGJhYzZiMWE4NGE1MDQyZTg3NzQ1NThjYzNkOTBhNWJhMmRiNTYxMDI5YmQ4MDcxNDY3YjM4MDk2YjkzOGE1Zjk0NTUiLCJpYXQiOjE1NjgyMDk3MzIsIm5iZiI6MTU2ODIwOTczMiwiZXhwIjoxNjMxMzY4MTMyLCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdfQ.U41DnBKE4JrL167fY7gcIV4x5BefNlNjJIN1hI8BspT16XZKfuTW4E4pqN4WdqkNDp5WKZjh8Jz_qrnJVL_XYK99JufN4ABTNkPVGjxEp_6L5yTikgX77llYrUv9liCybwwM69iW6UNMjsJ3RjJkS_C-3LkJVdYKc-945Co8P-Y",
"Content-type": "text/plain",
}
response = requests.delete(url, headers=headers)
print(response.text)
Common information endpoints
Country codes and countries list
Request
curl --request GET \
--url https://api.hostaway.com/v1/countries \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIn0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIiwiaWF0IjoxNTQzODcyMDMzLCJuYmYiOjE1NDM4NzIwMzMsImV4cCI6MTU1OTQyNDAzMywic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.Fx-hyFdOENc_n_2GPPpYlGHXSwGck01EpQ7IMz-kTSpzZ-sNxPYf2bK9wnCYApCFqSYQsmNaUcEN7spUz-6sT0sFpBCNhOVqm_lK6vvHkGn8Z9ScfowSWcdrl6E8BAQxGDRxLQx4RgVAlBdZsN0HgHRVuB49bjTnpTWlQs0N-iM' \
--header 'Cache-control: no-cache'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/countries",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIn0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIiwiaWF0IjoxNTQzODcyMDMzLCJuYmYiOjE1NDM4NzIwMzMsImV4cCI6MTU1OTQyNDAzMywic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.Fx-hyFdOENc_n_2GPPpYlGHXSwGck01EpQ7IMz-kTSpzZ-sNxPYf2bK9wnCYApCFqSYQsmNaUcEN7spUz-6sT0sFpBCNhOVqm_lK6vvHkGn8Z9ScfowSWcdrl6E8BAQxGDRxLQx4RgVAlBdZsN0HgHRVuB49bjTnpTWlQs0N-iM",
"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/countries");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIn0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIiwiaWF0IjoxNTQzODcyMDMzLCJuYmYiOjE1NDM4NzIwMzMsImV4cCI6MTU1OTQyNDAzMywic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.Fx-hyFdOENc_n_2GPPpYlGHXSwGck01EpQ7IMz-kTSpzZ-sNxPYf2bK9wnCYApCFqSYQsmNaUcEN7spUz-6sT0sFpBCNhOVqm_lK6vvHkGn8Z9ScfowSWcdrl6E8BAQxGDRxLQx4RgVAlBdZsN0HgHRVuB49bjTnpTWlQs0N-iM");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send(data);
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/countries")
.get()
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIn0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIiwiaWF0IjoxNTQzODcyMDMzLCJuYmYiOjE1NDM4NzIwMzMsImV4cCI6MTU1OTQyNDAzMywic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.Fx-hyFdOENc_n_2GPPpYlGHXSwGck01EpQ7IMz-kTSpzZ-sNxPYf2bK9wnCYApCFqSYQsmNaUcEN7spUz-6sT0sFpBCNhOVqm_lK6vvHkGn8Z9ScfowSWcdrl6E8BAQxGDRxLQx4RgVAlBdZsN0HgHRVuB49bjTnpTWlQs0N-iM")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import requests
url = "https://api.hostaway.com/v1/countries"
payload = ""
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIn0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIiwiaWF0IjoxNTQzODcyMDMzLCJuYmYiOjE1NDM4NzIwMzMsImV4cCI6MTU1OTQyNDAzMywic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.Fx-hyFdOENc_n_2GPPpYlGHXSwGck01EpQ7IMz-kTSpzZ-sNxPYf2bK9wnCYApCFqSYQsmNaUcEN7spUz-6sT0sFpBCNhOVqm_lK6vvHkGn8Z9ScfowSWcdrl6E8BAQxGDRxLQx4RgVAlBdZsN0HgHRVuB49bjTnpTWlQs0N-iM",
'Cache-control': "no-cache"
}
response = requests.request("GET", url, data=payload, headers=headers)
print(response.text)
GET https://api.hostaway.com/v1/countries
Response
An associative array which keys are ISO 3166-1 alpha-2 country codes and values are full country names in English, sorted by values.
Example:
{
"status": "success",
"result": {
"AF": "Afghanistan",
"AX": "Åland Islands",
... ,
"ZM": "Zambia",
"ZW": "Zimbabwe"
}
}
Currency codes and currencies list
Request
curl --request GET \
--url https://api.hostaway.com/v1/currencies \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIn0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIiwiaWF0IjoxNTQzODcyMDMzLCJuYmYiOjE1NDM4NzIwMzMsImV4cCI6MTU1OTQyNDAzMywic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.Fx-hyFdOENc_n_2GPPpYlGHXSwGck01EpQ7IMz-kTSpzZ-sNxPYf2bK9wnCYApCFqSYQsmNaUcEN7spUz-6sT0sFpBCNhOVqm_lK6vvHkGn8Z9ScfowSWcdrl6E8BAQxGDRxLQx4RgVAlBdZsN0HgHRVuB49bjTnpTWlQs0N-iM' \
--header 'Cache-control: no-cache'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/currencies",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIn0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIiwiaWF0IjoxNTQzODcyMDMzLCJuYmYiOjE1NDM4NzIwMzMsImV4cCI6MTU1OTQyNDAzMywic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.Fx-hyFdOENc_n_2GPPpYlGHXSwGck01EpQ7IMz-kTSpzZ-sNxPYf2bK9wnCYApCFqSYQsmNaUcEN7spUz-6sT0sFpBCNhOVqm_lK6vvHkGn8Z9ScfowSWcdrl6E8BAQxGDRxLQx4RgVAlBdZsN0HgHRVuB49bjTnpTWlQs0N-iM",
"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/currencies");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIn0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIiwiaWF0IjoxNTQzODcyMDMzLCJuYmYiOjE1NDM4NzIwMzMsImV4cCI6MTU1OTQyNDAzMywic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.Fx-hyFdOENc_n_2GPPpYlGHXSwGck01EpQ7IMz-kTSpzZ-sNxPYf2bK9wnCYApCFqSYQsmNaUcEN7spUz-6sT0sFpBCNhOVqm_lK6vvHkGn8Z9ScfowSWcdrl6E8BAQxGDRxLQx4RgVAlBdZsN0HgHRVuB49bjTnpTWlQs0N-iM");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send(data);
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/currencies")
.get()
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIn0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIiwiaWF0IjoxNTQzODcyMDMzLCJuYmYiOjE1NDM4NzIwMzMsImV4cCI6MTU1OTQyNDAzMywic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.Fx-hyFdOENc_n_2GPPpYlGHXSwGck01EpQ7IMz-kTSpzZ-sNxPYf2bK9wnCYApCFqSYQsmNaUcEN7spUz-6sT0sFpBCNhOVqm_lK6vvHkGn8Z9ScfowSWcdrl6E8BAQxGDRxLQx4RgVAlBdZsN0HgHRVuB49bjTnpTWlQs0N-iM")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import requests
url = "https://api.hostaway.com/v1/currencies"
payload = ""
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIn0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIiwiaWF0IjoxNTQzODcyMDMzLCJuYmYiOjE1NDM4NzIwMzMsImV4cCI6MTU1OTQyNDAzMywic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.Fx-hyFdOENc_n_2GPPpYlGHXSwGck01EpQ7IMz-kTSpzZ-sNxPYf2bK9wnCYApCFqSYQsmNaUcEN7spUz-6sT0sFpBCNhOVqm_lK6vvHkGn8Z9ScfowSWcdrl6E8BAQxGDRxLQx4RgVAlBdZsN0HgHRVuB49bjTnpTWlQs0N-iM",
'Cache-control': "no-cache"
}
response = requests.request("GET", url, data=payload, headers=headers)
print(response.text)
GET https://api.hostaway.com/v1/currencies
Response
An associative array which keys are ISO 4217 currency codes and values are full currency names in English, sorted by keys.
Example:
{
"status": "success",
"result": {
"AUD": "AUD - Australian Dollar",
"BRL": "BRL - Brazilian Real",
... ,
"USD": "USD - United States Dollar",
"ZAR": "ZAR - South African Rand"
}
}
Language codes and languages list
Request
curl --request GET \
--url https://api.hostaway.com/v1/languages \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIn0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIiwiaWF0IjoxNTQzODcyMDMzLCJuYmYiOjE1NDM4NzIwMzMsImV4cCI6MTU1OTQyNDAzMywic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.Fx-hyFdOENc_n_2GPPpYlGHXSwGck01EpQ7IMz-kTSpzZ-sNxPYf2bK9wnCYApCFqSYQsmNaUcEN7spUz-6sT0sFpBCNhOVqm_lK6vvHkGn8Z9ScfowSWcdrl6E8BAQxGDRxLQx4RgVAlBdZsN0HgHRVuB49bjTnpTWlQs0N-iM' \
--header 'Cache-control: no-cache'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/languages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIn0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIiwiaWF0IjoxNTQzODcyMDMzLCJuYmYiOjE1NDM4NzIwMzMsImV4cCI6MTU1OTQyNDAzMywic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.Fx-hyFdOENc_n_2GPPpYlGHXSwGck01EpQ7IMz-kTSpzZ-sNxPYf2bK9wnCYApCFqSYQsmNaUcEN7spUz-6sT0sFpBCNhOVqm_lK6vvHkGn8Z9ScfowSWcdrl6E8BAQxGDRxLQx4RgVAlBdZsN0HgHRVuB49bjTnpTWlQs0N-iM",
"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/languages");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIn0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIiwiaWF0IjoxNTQzODcyMDMzLCJuYmYiOjE1NDM4NzIwMzMsImV4cCI6MTU1OTQyNDAzMywic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.Fx-hyFdOENc_n_2GPPpYlGHXSwGck01EpQ7IMz-kTSpzZ-sNxPYf2bK9wnCYApCFqSYQsmNaUcEN7spUz-6sT0sFpBCNhOVqm_lK6vvHkGn8Z9ScfowSWcdrl6E8BAQxGDRxLQx4RgVAlBdZsN0HgHRVuB49bjTnpTWlQs0N-iM");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send(data);
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/languages")
.get()
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIn0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIiwiaWF0IjoxNTQzODcyMDMzLCJuYmYiOjE1NDM4NzIwMzMsImV4cCI6MTU1OTQyNDAzMywic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.Fx-hyFdOENc_n_2GPPpYlGHXSwGck01EpQ7IMz-kTSpzZ-sNxPYf2bK9wnCYApCFqSYQsmNaUcEN7spUz-6sT0sFpBCNhOVqm_lK6vvHkGn8Z9ScfowSWcdrl6E8BAQxGDRxLQx4RgVAlBdZsN0HgHRVuB49bjTnpTWlQs0N-iM")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import requests
url = "https://api.hostaway.com/v1/languages"
payload = ""
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIn0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIiwiaWF0IjoxNTQzODcyMDMzLCJuYmYiOjE1NDM4NzIwMzMsImV4cCI6MTU1OTQyNDAzMywic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.Fx-hyFdOENc_n_2GPPpYlGHXSwGck01EpQ7IMz-kTSpzZ-sNxPYf2bK9wnCYApCFqSYQsmNaUcEN7spUz-6sT0sFpBCNhOVqm_lK6vvHkGn8Z9ScfowSWcdrl6E8BAQxGDRxLQx4RgVAlBdZsN0HgHRVuB49bjTnpTWlQs0N-iM",
'Cache-control': "no-cache"
}
response = requests.request("GET", url, data=payload, headers=headers)
print(response.text)
GET https://api.hostaway.com/v1/languages
Response
An associative array which keys are ISO 639-1 language codes and values are full language names in English, sorted by values.
Example:
{
"status": "success",
"result": {
"ab": "Abkhazian",
"aa": "Afar",
... ,
"za": "Zhuang, Chuang",
"zu": "Zulu"
}
}
Timezones list
Request
curl --request GET \
--url https://api.hostaway.com/v1/timezones \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIn0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIiwiaWF0IjoxNTQzODcyMDMzLCJuYmYiOjE1NDM4NzIwMzMsImV4cCI6MTU1OTQyNDAzMywic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.Fx-hyFdOENc_n_2GPPpYlGHXSwGck01EpQ7IMz-kTSpzZ-sNxPYf2bK9wnCYApCFqSYQsmNaUcEN7spUz-6sT0sFpBCNhOVqm_lK6vvHkGn8Z9ScfowSWcdrl6E8BAQxGDRxLQx4RgVAlBdZsN0HgHRVuB49bjTnpTWlQs0N-iM' \
--header 'Cache-control: no-cache'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/timezones",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIn0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIiwiaWF0IjoxNTQzODcyMDMzLCJuYmYiOjE1NDM4NzIwMzMsImV4cCI6MTU1OTQyNDAzMywic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.Fx-hyFdOENc_n_2GPPpYlGHXSwGck01EpQ7IMz-kTSpzZ-sNxPYf2bK9wnCYApCFqSYQsmNaUcEN7spUz-6sT0sFpBCNhOVqm_lK6vvHkGn8Z9ScfowSWcdrl6E8BAQxGDRxLQx4RgVAlBdZsN0HgHRVuB49bjTnpTWlQs0N-iM",
"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/timezones");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIn0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIiwiaWF0IjoxNTQzODcyMDMzLCJuYmYiOjE1NDM4NzIwMzMsImV4cCI6MTU1OTQyNDAzMywic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.Fx-hyFdOENc_n_2GPPpYlGHXSwGck01EpQ7IMz-kTSpzZ-sNxPYf2bK9wnCYApCFqSYQsmNaUcEN7spUz-6sT0sFpBCNhOVqm_lK6vvHkGn8Z9ScfowSWcdrl6E8BAQxGDRxLQx4RgVAlBdZsN0HgHRVuB49bjTnpTWlQs0N-iM");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send(data);
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/timezones")
.get()
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIn0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIiwiaWF0IjoxNTQzODcyMDMzLCJuYmYiOjE1NDM4NzIwMzMsImV4cCI6MTU1OTQyNDAzMywic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.Fx-hyFdOENc_n_2GPPpYlGHXSwGck01EpQ7IMz-kTSpzZ-sNxPYf2bK9wnCYApCFqSYQsmNaUcEN7spUz-6sT0sFpBCNhOVqm_lK6vvHkGn8Z9ScfowSWcdrl6E8BAQxGDRxLQx4RgVAlBdZsN0HgHRVuB49bjTnpTWlQs0N-iM")
.addHeader("Cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import requests
url = "https://api.hostaway.com/v1/timezones"
payload = ""
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIn0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImRlNTVlZTc1ZGI3YzhkZmYyMGE4MzU2ODFjMGNkNmY0OGE3ZDI5ODg4NmU4ZGI5ZmRhMDM2ODg5YTFhZDNjNWFkOTAzY2QyOGNmNTExZTBjIiwiaWF0IjoxNTQzODcyMDMzLCJuYmYiOjE1NDM4NzIwMzMsImV4cCI6MTU1OTQyNDAzMywic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.Fx-hyFdOENc_n_2GPPpYlGHXSwGck01EpQ7IMz-kTSpzZ-sNxPYf2bK9wnCYApCFqSYQsmNaUcEN7spUz-6sT0sFpBCNhOVqm_lK6vvHkGn8Z9ScfowSWcdrl6E8BAQxGDRxLQx4RgVAlBdZsN0HgHRVuB49bjTnpTWlQs0N-iM",
'Cache-control': "no-cache"
}
response = requests.request("GET", url, data=payload, headers=headers)
print(response.text)
GET https://api.hostaway.com/v1/timezones
Response
An associative array which keys are timezone names and values contain extended timezone description under “value” key and UTC difference under “diff” key, sorted by UTC difference.
Example:
{
"status": "success",
"result": {
"Pacific/Midway": {
"value": "(UTC -11:00) Pacific/Midway",
"diff": "-11:00"
},
"Pacific/Niue": {
"value": "(UTC -11:00) Pacific/Niue",
"diff": "-11:00"
},
... ,
"Pacific/Apia": {
"value": "(UTC +14:00) Pacific/Apia",
"diff": "+14:00"
},
"Pacific/Kiritimati": {
"value": "(UTC +14:00) Pacific/Kiritimati",
"diff": "+14:00"
}
}
}
Stripe
Retrieve Stripe publishable API key (deprecated)
Request
curl -X GET \
https://api.hostaway.com/v1/stripe/publishableKey \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c' \
-H 'Content-type: application/json'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.hostaway.com/v1/stripe/publishableKey',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c',
],
));
$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/stripe/publishableKey");
xhr.setRequestHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c");
xhr.send(data);
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/stripe/publishableKey")
.get()
.addHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c")
.build();
Response response = client.newCall(request).execute();
import requests
url = "https://api.hostaway.com/v1/stripe/publishableKey"
headers = {
'Authorization': "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
}
response = requests.request("GET", url, headers=headers)
print(response.text)
GET https://api.hostaway.com/v1/stripe/publishableKey
Response
Example:
{
"status": "success",
"result": {
"stripePublishableApiKey": "key_value"
}
}
Retrieve Stripe publishable API key
This endpoint provides Connect Stripe publishable API key.
Request
curl -X GET \
https://api.hostaway.com/v1/stripe/publishableKey/123 \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c' \
-H 'Content-type: application/json'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.hostaway.com/v1/stripe/publishableKey/123',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c',
],
));
$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/stripe/publishableKey/123");
xhr.setRequestHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c");
xhr.send(data);
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/stripe/publishableKey/123")
.get()
.addHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c")
.build();
Response response = client.newCall(request).execute();
import requests
url = "https://api.hostaway.com/v1/stripe/publishableKey/123"
headers = {
'Authorization': "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
}
response = requests.request("GET", url, headers=headers)
print(response.text)
GET https://api.hostaway.com/v1/stripe/publishableKey/{listingMapId}
Response
Example:
{
"status": "success",
"result": {
"stripePublishableApiKey": "key_value"
}
}
Create stripe setup intent (deprecated)
Request
curl -X POST \
https://api.hostaway.com/v1/stripe/createSetupIntent \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c' \
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/stripe/createSetupIntent",
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 eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
),
));
$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/stripe/createSetupIntent");
xhr.setRequestHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c");
xhr.send(data);
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/stripe/createSetupIntent")
.post(null)
.addHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c")
.build();
Response response = client.newCall(request).execute();
import requests
url = "https://api.hostaway.com/v1/stripe/createSetupIntent"
headers = {
'Authorization': "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
}
response = requests.request("POST", url, headers=headers)
print(response.text)
POST https://api.hostaway.com/v1/stripe/createSetupIntent
Response
Example:
{
"status": "success",
"result": {
"clientSecret": "seti_1FJaxuJjX5ptYS3JAMyMSkRQ_secret_FpFS6JXsMVAsiSbhjlF1RKcIHh4pEyz"
}
}
Create stripe setup intent
Request
curl -X POST \
https://api.hostaway.com/v1/stripe/createSetupIntent/123 \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c' \
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/stripe/createSetupIntent/123",
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 eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
),
));
$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/stripe/createSetupIntent/123");
xhr.setRequestHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c");
xhr.send(data);
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/stripe/createSetupIntent/123")
.post(null)
.addHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c")
.build();
Response response = client.newCall(request).execute();
import requests
url = "https://api.hostaway.com/v1/stripe/createSetupIntent/123"
headers = {
'Authorization': "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
}
response = requests.request("POST", url, headers=headers)
print(response.text)
POST https://api.hostaway.com/v1/stripe/createSetupIntent/{listingMapId}
Response
Example:
{
"status": "success",
"result": {
"clientSecret": "seti_1FJaxuJjX5ptYS3JAMyMSkRQ_secret_FpFS6JXsMVAsiSbhjlF1RKcIHh4pEyz"
}
}
Financial Reporting
Before using those endpoints please make sure financial reporting feature is enabled for your account
Finance Standard Fields
Get finance standard fields by reservation ID
Request
curl --request GET \
--url 'https://api.hostaway.com/v1/financeStandardField/reservation/755143' \
--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/financeStandardField/reservation/755143",
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/financeStandardField/reservation/755143");
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/financeStandardField/reservation/755143")
.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/financeStandardField/reservation/755143"
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/financeStandardField/reservation/{reservationId}
Response
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | |
accountId |
yes | int | |
listingMapId |
yes | int | |
channelId |
yes | int | Please check here for valid channel values: Channels |
reservationId |
yes | int | |
damageDeposit |
no | float | |
guestChannelFee |
no | float | |
hostChannelFee |
no | float | |
baseRate |
no | float | |
vat |
no | float | |
salesTax |
no | float | |
cityTax |
no | float | |
otherTaxes |
no | float | |
cleaningFeeValue |
no | float | |
additionalCleaningFee |
no | float | |
parkingFee |
no | float | |
towelChangeFee |
no | float | |
midstayCleaningFee |
no | float | |
roomRequestFee |
no | float | |
reservationChangeFee |
no | float | |
checkinFee |
no | float | |
lateCheckoutFee |
no | float | |
otherFees |
no | float | |
creditCardFee |
no | float | |
kitchenLinenFee |
no | float | |
linenPackageFee |
no | float | |
transferFee |
no | float | |
wristbandFee |
no | float | |
extraBedsFee |
no | float | |
serviceFee |
no | float | |
bedLinenFee |
no | float | |
bookingFee |
no | float | |
petFee |
no | float | |
skiPassFee |
no | float | |
tourismFee |
no | float | |
childrenExtraFee |
no | float | |
resortFee |
no | float | |
resortFeeAirbnb |
no | float | |
communityFeeAirbnb |
no | float | |
managementFeeAirbnb |
no | float | |
linenFeeAirbnb |
no | float | |
weeklyDiscount |
no | float | |
roomTax |
no | float | |
transientOccupancyTax |
no | float | |
lodgingTax |
no | float | |
hotelTax |
no | float | |
guestNightlyTax |
no | float | |
guestStayTax |
no | float | |
guestPerPersonPerNightTax |
no | float | |
propertyRentTax |
no | float | |
priceForExtraPerson |
no | float | |
monthlyDiscount |
no | float | |
cancellationPayout |
no | float | |
cancellationHostFee |
no | float | |
couponDiscount |
no | float | |
shareholderDiscount |
no | float | |
lastMinuteDiscount |
no | float | |
employeeDiscount |
no | float | |
otherSpecialDiscount |
no | float | |
paymentServiceProcessingFees |
no | float | |
bookingComCancellationGuestFee |
no | float | |
otaPaymentProcessingFee |
no | float | |
insuranceFee |
no | float | |
manuallySetFields |
no | string | JSON serialized string with manually set fields list |
customFeeValuesJson |
no | string | JSON serialized string with custom fees configuration |
insertedOn |
yes | date time | |
updatedOn |
yes | date time |
{
"status": "success",
"result": {
"id": 1,
"accountId": 10496,
"listingMapId": 40106,
"channelId": 2000,
"reservationId": 222000,
"damageDeposit": 0,
"guestChannelFee": null,
"hostChannelFee": null,
"baseRate": 1055,
"vat": null,
"salesTax": null,
"cityTax": null,
"otherTaxes": null,
"cleaningFeeValue": 40.32,
"additionalCleaningFee": null,
"parkingFee": null,
"towelChangeFee": null,
"midstayCleaningFee": null,
"roomRequestFee": null,
"reservationChangeFee": null,
"checkinFee": null,
"lateCheckoutFee": null,
"otherFees": null,
"creditCardFee": null,
"kitchenLinenFee": null,
"linenPackageFee": null,
"transferFee": null,
"wristbandFee": null,
"extraBedsFee": null,
"serviceFee": null,
"bedLinenFee": null,
"bookingFee": null,
"petFee": null,
"skiPassFee": null,
"tourismFee": null,
"childrenExtraFee": null,
"resortFee": null,
"resortFeeAirbnb": null,
"communityFeeAirbnb": null,
"managementFeeAirbnb": null,
"linenFeeAirbnb": null,
"weeklyDiscount": 0,
"roomTax": null,
"transientOccupancyTax": null,
"lodgingTax": null,
"hotelTax": null,
"guestNightlyTax": null,
"guestStayTax": null,
"guestPerPersonPerNightTax": null,
"propertyRentTax": null,
"priceForExtraPerson": 0,
"monthlyDiscount": 0,
"cancellationPayout": null,
"cancellationHostFee": null,
"couponDiscount": 0,
"shareholderDiscount": null,
"lastMinuteDiscount": null,
"employeeDiscount": null,
"otherSpecialDiscount": null,
"paymentServiceProcessingFees": 0,
"bookingComCancellationGuestFee": null,
"otaPaymentProcessingFee": null,
"insuranceFee": null,
"manuallySetFields": "[\"baseRate\"]",
"customFeeValuesJson": "[{\"feeType\":\"creditCardFee\",\"feeAppliedPer\":\"reservation\",\"accountId\":10638,\"isQuantitySelectable\":false,\"isMandatory\":false,\"feeTitle\":null,\"amountType\":\"flat\",\"listingMapId\":86249,\"insertedOn\":\"2021-07-01 07:13:25\",\"amount\":15,\"updatedOn\":\"2021-07-01 07:27:17\",\"id\":1214,\"name\":\"creditCardFee\",\"title\":null,\"isIncludedInTotalPrice\":true,\"isOverriddenByUser\":false,\"value\":15,\"quantity\":1,\"feeId\":1214}]",
"insertedOn": "2021-09-17 17:22:52",
"updatedOn": "2021-09-17 17:22:52"
}
}
Finance Calculated Fields
Get finance calculated fields by reservation ID
Request
curl --request GET \
--url 'https://api.hostaway.com/v1/financeCalculatedField/reservation/755143' \
--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/financeCalculatedField/reservation/755143",
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/financeCalculatedField/reservation/755143");
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/financeCalculatedField/reservation/755143")
.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/financeCalculatedField/reservation/755143"
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/financeCalculatedField/reservation/{reservationId}
Response
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | |
accountId |
yes | int | |
listingMapId |
yes | int | |
financeCustomFormulaId |
no | int | |
channelId |
yes | int | Please check here for valid channel values: Channels |
reservationId |
yes | int | |
formulaName |
yes | string | |
formulaValue |
yes | string | |
formulaFilled |
yes | string | |
formulaResult |
yes | float | |
insertedOn |
yes | date time | |
updatedOn |
yes | date time |
{
"status": "success",
"result": [
{
"id": 10630,
"accountId": 10638,
"listingMapId": 60633,
"financeCustomFormulaId": null,
"channelId": 2000,
"reservationId": 755143,
"formulaName": "totalTax",
"formulaValue": "vat + hotelTax + lodgingTax + salesTax + transientOccupancyTax + cityTax + roomTax + otherTaxes",
"formulaFilled": "0 + 0 + 0 + 0 + 0 + 0 + 0 + 0",
"formulaResult": 0,
"insertedOn": "2020-05-25 11:35:16",
"updatedOn": "2020-06-04 14:29:06"
},
{
"id": 10631,
"accountId": 10638,
"listingMapId": 60633,
"financeCustomFormulaId": null,
"channelId": 2000,
"reservationId": 755143,
"formulaName": "totalGuestFees",
"formulaValue": "cleaningFeeValue",
"formulaFilled": "400",
"formulaResult": 400,
"insertedOn": "2020-05-25 11:35:16",
"updatedOn": "2020-06-04 14:29:06"
}
]
}
Finance Custom Formulas
Get finance custom formulas
Request
curl --request GET \
--url 'https://api.hostaway.com/v1/financeCustomFormula' \
--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/financeCustomFormula",
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/financeCustomFormula");
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/financeCustomFormula")
.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/financeCustomFormula"
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/financeCustomFormula
Response
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | |
accountId |
yes | int | |
listingMapId |
yes | int | |
channelIds |
yes | int[] | Array of channel IDs to apply formula to (empty = all channels). Please check here for valid channel values: Channels |
formulaName |
yes | string | |
formulaValue |
yes | string | |
isOverride |
yes | int | |
insertedOn |
yes | date time | |
updatedOn |
yes | date time |
{
"status": "success",
"result": [
{
"id": 9723,
"accountId": 10496,
"listingMapId": 60636,
"channelIds": [
2000
],
"formulaName": "totalGuestFees",
"formulaValue": "cleaningFeeValue + 15",
"isOverride": 1,
"insertedOn": "2021-01-15 13:45:33",
"updatedOn": "2021-09-13 13:45:26"
},
{
"id": 9723,
"accountId": 10496,
"listingMapId": 60636,
"channelIds": [
2000, 2018
],
"formulaName": "testFormula",
"formulaValue": "baseRate + 123",
"isOverride": 0,
"insertedOn": "2021-01-15 13:45:33",
"updatedOn": "2021-09-13 13:45:26"
}
],
"count": "1",
"offset": null
}
Finance Standard Report
Retrieve standard fields report
Request
curl --request POST \
--url 'https://api.hostaway.com/v1/finance/report/standard' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c' \
--header 'Cache-control: no-cache' \
--form 'listingMapIds[0]=123' \
--form 'fromDate=2019-01-30' \
--form 'toDate=2019-02-25' \
--form 'dateType=arrivalDate' \
--form 'channelIds[0]=2007' \
--form 'statuses[0]=new' \
--form 'format=csv' \
--form 'sortBy=arrivalDate' \
--form 'sortOrder=asc' \
--form 'delimiter=tab'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/finance/report/standard",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_POSTFIELDS => array(
'listingMapIds' => array(123),
'fromDate' => '2019-01-30',
'toDate' => '2019-02-25',
'dateType' => 'arrivalDate',
'channelIds' => array(2007),
'statuses' => array('new'),
'format' => 'csv',
'sortBy' => 'arrivalDate',
'sortOrder' => 'asc',
'delimiter' => 'tab'
),
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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 = new FormData();
data.append("listingMapIds[0]", "123");
data.append("fromDate", "2019-01-30");
data.append("toDate", "2019-02-25");
data.append("dateType", "arrivalDate");
data.append("channelIds[0]", "2007");
data.append("statuses[0]", "new");
data.append("format", "csv");
data.append("sortBy", "arrivalDate");
data.append("sortOrder", "asc");
data.append("delimiter", "tab");
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/finance/report/standard");
xhr.setRequestHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send(data);
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("listingMapIds[0]", "123")
.addFormDataPart("fromDate", "2019-01-30")
.addFormDataPart("toDate", "2019-02-25")
.addFormDataPart("dateType", "arrivalDate")
.addFormDataPart("channelIds[0]", "2007")
.addFormDataPart("statuses[0]", "new")
.addFormDataPart("format", "csv")
.addFormDataPart("sortBy", "arrivalDate")
.addFormDataPart("sortOrder", "asc")
.addFormDataPart("delimiter", "tab")
.build();
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/finance/report/standard")
.method("POST", body)
.addHeader("Content-type", "application/json")
.addHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c")
.build();
Response response = client.newCall(request).execute();
import requests
url = "https://api.hostaway.com/v1/finance/report/standard"
headers = {
'Authorization': "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
'Cache-control': "no-cache",
}
payload = 'listingMapIds%5B0%5D=123&fromDate=2019-01-30&toDate=2019-02-25&dateType=arrivalDate&channelIds%5B0%5D=2007&statuses%5B0%5D=new&format=csv&sortBy=arrivalDate&sortOrder=asc&delimiter=tab'
response = requests.request("POST", url, headers=headers, data = payload)
print(response.text)
POST https://api.hostaway.com/v1/finance/report/standard
Parameters can be sent using POST form data:
Parameter | Required | Type | Description |
---|---|---|---|
listingMapIds[] |
no | int[] | Array of Listing IDs |
fromDate |
no | date string | Y-m-d |
toDate |
no | date string | Y-m-d |
dateType |
no | float | Can be one of the following: arrivalDate, departureDate, reservationDate |
channelIds[] |
no | int[] | Array of channel ids Please check here for valid channel values: Channels |
statuses[] |
no | string[] | Array of reservation statuses |
format |
no | string | csv |
sortBy |
no | string | Field to sort by |
sortOrder |
no | string | Can be one of the following: asc, desc |
delimiter |
no | string | Can be one of the following: comma, tab |
Response
CSV text with report data
"Reservation ID" Channel Status Arrival Departure Listing Owner Description Amount
724558 direct new 2019-02-01 2019-02-02 "(60636) Great place" john1 "Damage deposit" 7000
724558 direct new 2019-02-01 2019-02-02 "(60636) Great place" john1 "Guest channel fee" 0
Finance Consolidated Report
Retrieve Consolidated report
Request
curl --request POST \
--url 'https://api.hostaway.com/v1/finance/report/consolidated' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c' \
--header 'Cache-control: no-cache' \
--form 'listingMapIds[0]=123' \
--form 'fromDate=2019-01-30' \
--form 'toDate=2019-02-25' \
--form 'dateType=arrivalDate' \
--form 'channelIds[0]=2007' \
--form 'statuses[0]=new' \
--form 'format=csv' \
--form 'sortBy=arrivalDate' \
--form 'sortOrder=asc' \
--form 'delimiter=tab'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/finance/report/consolidated",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_POSTFIELDS => array(
'listingMapIds' => array(123),
'fromDate' => '2019-01-30',
'toDate' => '2019-02-25',
'dateType' => 'arrivalDate',
'channelIds' => array(2007),
'statuses' => array('new'),
'format' => 'csv',
'sortBy' => 'arrivalDate',
'sortOrder' => 'asc',
'delimiter' => 'tab'
),
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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 = new FormData();
data.append("listingMapIds[0]", "123");
data.append("fromDate", "2019-01-30");
data.append("toDate", "2019-02-25");
data.append("dateType", "arrivalDate");
data.append("channelIds[0]", "2007");
data.append("statuses[0]", "new");
data.append("format", "csv");
data.append("sortBy", "arrivalDate");
data.append("sortOrder", "asc");
data.append("delimiter", "tab");
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/finance/report/consolidated");
xhr.setRequestHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send(data);
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("listingMapIds[0]", "123")
.addFormDataPart("fromDate", "2019-01-30")
.addFormDataPart("toDate", "2019-02-25")
.addFormDataPart("dateType", "arrivalDate")
.addFormDataPart("channelIds[0]", "2007")
.addFormDataPart("statuses[0]", "new")
.addFormDataPart("format", "csv")
.addFormDataPart("sortBy", "arrivalDate")
.addFormDataPart("sortOrder", "asc")
.addFormDataPart("delimiter", "tab")
.build();
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/finance/report/consolidated")
.method("POST", body)
.addHeader("Content-type", "application/json")
.addHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c")
.build();
Response response = client.newCall(request).execute();
import requests
url = "https://api.hostaway.com/v1/finance/report/consolidated"
headers = {
'Authorization': "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
'Cache-control': "no-cache",
}
payload = 'listingMapIds%5B0%5D=123&fromDate=2019-01-30&toDate=2019-02-25&dateType=arrivalDate&channelIds%5B0%5D=2007&statuses%5B0%5D=new&format=csv&sortBy=arrivalDate&sortOrder=asc&delimiter=tab'
response = requests.request("POST", url, headers=headers, data = payload)
print(response.text)
POST https://api.hostaway.com/v1/finance/report/consolidated
Parameters can be sent using POST form data:
Parameter | Required | Type | Description |
---|---|---|---|
listingMapIds[] |
no | int[] | Array of Listing IDs |
fromDate |
no | date string | Y-m-d |
toDate |
no | date string | Y-m-d |
dateType |
no | float | Can be one of the following: arrivalDate, departureDate, reservationDate |
channelIds[] |
no | int[] | Array of channel ids Please check here for valid channel values: Channels |
statuses[] |
no | string[] | Array of reservation statuses |
format |
yes | string | csv or json |
sortBy |
no | string | Field to sort by |
sortOrder |
no | string | Can be one of the following: asc, desc |
delimiter |
no | string | Can be one of the following: comma, tab |
Response
CSV/JSON with report data
"Reservation ID","Channel name","Reservation status","Arrival date","Departure date","Listing name","Total guest fees","Total tax","Accommodation fee","PM Commission","Owner payout",pmCommissionAbc,"Base rate","Price for extra person","Cleaning fee value","City / Tourism tax","Hotel tax","Lodging tax","Room tax","Sales tax","Transient occupancy tax","VAT / GST","Other taxes","Property rent tax","Guest per person per night tax","Guest stay tax","Guest nightly tax","Guest channel fee","Host channel fee","Monthly discount","Weekly discount","Damage deposit","Cancellation fee","Cancellation payout","Cancellation host fee","Sub total price"
755143,direct,cancelled,2019-03-06,2019-03-09,"(123) apartment with Balcony",400,0,2503,420.6,2503,43,2103,0,400,0,0,0,0,0,0,0,0,0,99,21,0,0,0,0,0,7000,0,0,0,2503
777736,bookingengine,new,2019-03-12,2019-03-14,"(123) apartment with Balcony",400,0,1802,280.4,1802,43,1402,0,400,0,0,0,0,0,0,0,0,0,66,21,0,0,0,0,0,7000,0,0,0,1802
848020,direct,modified,2019-04-09,2019-04-11,"(123) apartment with Balcony",400,0,1802,280.4,1802,43,1402,0,400,0,0,0,0,0,0,0,0,0,66,21,0,0,0,0,0,7000,0,0,0,1802
Totals,0,0,0,0,0,61923,1354.254,372465.254,61837.6,372366.254,12613.678,309088,43900,61923,19.576,0,0,0,0,0,100.678,0,10875,3833,1192,1050,1,99,0,-2611.8,924001,0,0,0,371210
{
"status": "success",
"result": {
"columns": [
{
"name": "id",
"title": "Reservation ID",
"valueType": "number"
},
{
"name": "channelName",
"title": "Channel name",
"valueType": "string"
},
{
"name": "status",
"title": "Reservation status",
"valueType": "string"
},
{
"name": "arrivalDate",
"title": "Arrival date",
"valueType": "string"
},
{
"name": "departureDate",
"title": "Departure date",
"valueType": "string"
},
{
"name": "listingName",
"title": "Listing name",
"valueType": "string"
},
{
"name": "totalGuestFees",
"title": "Total guest fees",
"valueType": "money"
},
{
"name": "totalTax",
"title": "Total tax",
"valueType": "money"
},
{
"name": "accommodationFee",
"title": "Accommodation fee",
"valueType": "money"
},
{
"name": "pmCommission",
"title": "PM Commission",
"valueType": "money"
},
{
"name": "ownerPayout",
"title": "Owner payout",
"valueType": "money"
},
{
"name": "pmCommissionAbc",
"title": "pmCommissionAbc",
"valueType": "money"
},
{
"name": "baseRate",
"title": "Base rate",
"valueType": "money"
},
{
"name": "priceForExtraPerson",
"title": "Price for extra person",
"valueType": "money"
},
{
"name": "cleaningFeeValue",
"title": "Cleaning fee value",
"valueType": "money"
},
{
"name": "cityTax",
"title": "City / Tourism tax",
"valueType": "money"
},
{
"name": "hotelTax",
"title": "Hotel tax",
"valueType": "money"
},
{
"name": "lodgingTax",
"title": "Lodging tax",
"valueType": "money"
},
{
"name": "roomTax",
"title": "Room tax",
"valueType": "money"
},
{
"name": "salesTax",
"title": "Sales tax",
"valueType": "money"
},
{
"name": "transientOccupancyTax",
"title": "Transient occupancy tax",
"valueType": "money"
},
{
"name": "vat",
"title": "VAT / GST",
"valueType": "money"
},
{
"name": "otherTaxes",
"title": "Other taxes",
"valueType": "money"
},
{
"name": "propertyRentTax",
"title": "Property rent tax",
"valueType": "money"
},
{
"name": "guestPerPersonPerNightTax",
"title": "Guest per person per night tax",
"valueType": "money"
},
{
"name": "guestStayTax",
"title": "Guest stay tax",
"valueType": "money"
},
{
"name": "guestNightlyTax",
"title": "Guest nightly tax",
"valueType": "money"
},
{
"name": "guestChannelFee",
"title": "Guest channel fee",
"valueType": "money"
},
{
"name": "hostChannelFee",
"title": "Host channel fee",
"valueType": "money"
},
{
"name": "monthlyDiscount",
"title": "Monthly discount",
"valueType": "money"
},
{
"name": "weeklyDiscount",
"title": "Weekly discount",
"valueType": "money"
},
{
"name": "damageDeposit",
"title": "Damage deposit",
"valueType": "money"
},
{
"name": "cancellationFee",
"title": "Cancellation fee",
"valueType": "money"
},
{
"name": "cancellationPayout",
"title": "Cancellation payout",
"valueType": "money"
},
{
"name": "cancellationHostFee",
"title": "Cancellation host fee",
"valueType": "money"
},
{
"name": "subTotalPrice",
"title": "Sub total price",
"valueType": "money"
}
],
"rows": [
[
"755143",
"direct",
"cancelled",
"2019-03-06",
"2019-03-09",
"(456) apartment with Balcony",
400,
0,
2503,
420.6,
2503,
43,
2103,
0,
400,
0,
0,
0,
0,
0,
0,
0,
0,
0,
99,
21,
0,
0,
0,
0,
0,
7000,
0,
0,
0,
2503
],
[
"777736",
"bookingengine",
"new",
"2019-03-12",
"2019-03-14",
"(123) apartment with Balcony",
400,
0,
1802,
280.4,
1802,
43,
1402,
0,
400,
0,
0,
0,
0,
0,
0,
0,
0,
0,
66,
21,
0,
0,
0,
0,
0,
7000,
0,
0,
0,
1802
]
],
"totals": [
"Totals",
0,
0,
0,
0,
0,
61923,
1354.254,
372465.254,
61837.6,
372366.254,
12613.678,
309088,
43900,
61923,
19.576,
0,
0,
0,
0,
0,
100.678,
0,
10875,
3833,
1192,
1050,
1,
99,
0,
-2611.8,
924001,
0,
0,
0,
371210
],
"currency": "RUB"
}
}
Finance Calculated Report
Retrieve Calculated report
Request
curl --request POST \
--url 'https://api.hostaway.com/v1/finance/report/calculated' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c' \
--header 'Cache-control: no-cache' \
--form 'listingMapIds[0]=123' \
--form 'fromDate=2019-01-30' \
--form 'toDate=2019-02-25' \
--form 'dateType=arrivalDate' \
--form 'channelIds[0]=2007' \
--form 'statuses[0]=new' \
--form 'format=csv' \
--form 'sortBy=arrivalDate' \
--form 'sortOrder=asc' \
--form 'delimiter=tab'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/finance/report/calculated",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_POSTFIELDS => array(
'listingMapIds' => array(123),
'fromDate' => '2019-01-30',
'toDate' => '2019-02-25',
'dateType' => 'arrivalDate',
'channelIds' => array(2007),
'statuses' => array('new'),
'format' => 'csv',
'sortBy' => 'arrivalDate',
'sortOrder' => 'asc',
'delimiter' => 'tab'
),
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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 = new FormData();
data.append("listingMapIds[0]", "123");
data.append("fromDate", "2019-01-30");
data.append("toDate", "2019-02-25");
data.append("dateType", "arrivalDate");
data.append("channelIds[0]", "2007");
data.append("statuses[0]", "new");
data.append("format", "csv");
data.append("sortBy", "arrivalDate");
data.append("sortOrder", "asc");
data.append("delimiter", "tab");
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/finance/report/calculated");
xhr.setRequestHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send(data);
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("listingMapIds[0]", "123")
.addFormDataPart("fromDate", "2019-01-30")
.addFormDataPart("toDate", "2019-02-25")
.addFormDataPart("dateType", "arrivalDate")
.addFormDataPart("channelIds[0]", "2007")
.addFormDataPart("statuses[0]", "new")
.addFormDataPart("format", "csv")
.addFormDataPart("sortBy", "arrivalDate")
.addFormDataPart("sortOrder", "asc")
.addFormDataPart("delimiter", "tab")
.build();
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/finance/report/calculated")
.method("POST", body)
.addHeader("Content-type", "application/json")
.addHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c")
.build();
Response response = client.newCall(request).execute();
import requests
url = "https://api.hostaway.com/v1/finance/report/calculated"
headers = {
'Authorization': "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
'Cache-control': "no-cache",
}
payload = 'listingMapIds%5B0%5D=123&fromDate=2019-01-30&toDate=2019-02-25&dateType=arrivalDate&channelIds%5B0%5D=2007&statuses%5B0%5D=new&format=csv&sortBy=arrivalDate&sortOrder=asc&delimiter=tab'
response = requests.request("POST", url, headers=headers, data = payload)
print(response.text)
POST https://api.hostaway.com/v1/finance/report/calculated
Parameters can be sent using POST form data:
Parameter | Required | Type | Description |
---|---|---|---|
listingMapIds[] |
no | int[] | Array of Listing IDs |
fromDate |
no | date string | Y-m-d |
toDate |
no | date string | Y-m-d |
dateType |
no | float | Can be one of the following: arrivalDate, departureDate, reservationDate |
channelIds[] |
no | int[] | Array of channel ids Please check here for valid channel values: Channels |
statuses[] |
no | string[] | Array of reservation statuses |
format |
yes | string | csv |
sortBy |
no | string | Field to sort by |
sortOrder |
no | string | Can be one of the following: asc, desc |
delimiter |
no | string | Can be one of the following: comma, tab |
Response
CSV with report data
"Reservation ID",Guest,Channel,Status,Booked,Arrival,Departure,Listing,Owner,Description,Formula,"Formula values",Amount
7910766,Test,wordpress,new,"2020-05-20 11:23:52",2020-05-26,2020-05-27,"(63325) Great place 2 · Great place",john1,totalTax,"vat + hotelTax + lodgingTax + salesTax + transientOccupancyTax + cityTax + roomTax + otherTaxes","0 + 0 + 0 + 0 + 0 + 0 + 0 + 0",0
7910766,Test,wordpress,new,"2020-05-20 11:23:52",2020-05-26,2020-05-27,"(63325) Great place 2 · Great place",john1,totalGuestFees,cleaningFeeValue,400,400
7910766,Test
Listing Financials Report
Retrieve Listing Financials Report
Request
curl --request POST \
--url 'https://api.hostaway.com/v1/finance/report/listingFinancials' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c' \
--header 'Cache-control: no-cache' \
--form 'listingMapIds[0]=123' \
--form 'fromDate=2019-01-30' \
--form 'toDate=2019-02-25' \
--form 'dateType=arrivalDate' \
--form 'channelIds[0]=2007' \
--form 'statuses[0]=new' \
--form 'format=csv' \
--form 'sortBy=arrivalDate' \
--form 'sortOrder=asc' \
--form 'delimiter=tab'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/finance/report/listingFinancials",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_POSTFIELDS => array(
'listingMapIds' => array(123),
'fromDate' => '2019-01-30',
'toDate' => '2019-02-25',
'dateType' => 'arrivalDate',
'channelIds' => array(2007),
'statuses' => array('new'),
'format' => 'csv',
'sortBy' => 'arrivalDate',
'sortOrder' => 'asc',
'delimiter' => 'tab'
),
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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 = new FormData();
data.append("listingMapIds[0]", "123");
data.append("fromDate", "2019-01-30");
data.append("toDate", "2019-02-25");
data.append("dateType", "arrivalDate");
data.append("channelIds[0]", "2007");
data.append("statuses[0]", "new");
data.append("format", "csv");
data.append("sortBy", "arrivalDate");
data.append("sortOrder", "asc");
data.append("delimiter", "tab");
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/finance/report/listingFinancials");
xhr.setRequestHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send(data);
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("listingMapIds[0]", "123")
.addFormDataPart("fromDate", "2019-01-30")
.addFormDataPart("toDate", "2019-02-25")
.addFormDataPart("dateType", "arrivalDate")
.addFormDataPart("channelIds[0]", "2007")
.addFormDataPart("statuses[0]", "new")
.addFormDataPart("format", "csv")
.addFormDataPart("sortBy", "arrivalDate")
.addFormDataPart("sortOrder", "asc")
.addFormDataPart("delimiter", "tab")
.build();
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/finance/report/listingFinancials")
.method("POST", body)
.addHeader("Content-type", "application/json")
.addHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c")
.build();
Response response = client.newCall(request).execute();
import requests
url = "https://api.hostaway.com/v1/finance/report/listingFinancials"
headers = {
'Authorization': "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
'Cache-control': "no-cache",
}
payload = 'listingMapIds%5B0%5D=123&fromDate=2019-01-30&toDate=2019-02-25&dateType=arrivalDate&channelIds%5B0%5D=2007&statuses%5B0%5D=new&format=csv&sortBy=arrivalDate&sortOrder=asc&delimiter=tab'
response = requests.request("POST", url, headers=headers, data = payload)
print(response.text)
POST https://api.hostaway.com/v1/finance/report/listingFinancials
Parameters can be sent using POST form data:
Parameter | Required | Type | Description |
---|---|---|---|
listingMapIds[] |
no | int[] | Array of Listing IDs |
fromDate |
no | date string | Y-m-d |
toDate |
no | date string | Y-m-d |
dateType |
no | float | Can be one of the following: arrivalDate, departureDate, reservationDate |
channelIds[] |
no | int[] | Array of channel ids Please check here for valid channel values: Channels |
statuses[] |
no | string[] | Array of reservation statuses |
format |
yes | string | csv or json |
sortBy |
no | string | Field to sort by |
sortOrder |
no | string | Can be one of the following: asc, desc |
delimiter |
no | string | Can be one of the following: comma, tab |
Response
CSV/JSON with report data
"Listing name","Total guest fees","Total tax","Accommodation fee","PM Commission","Owner payout",pmCommissionAbc,"Base rate","Price for extra person","Cleaning fee value","City / Tourism tax","Hotel tax","Lodging tax","Room tax","Sales tax","Transient occupancy tax","VAT / GST","Other taxes","Property rent tax","Guest per person per night tax","Guest stay tax","Guest nightly tax","Guest channel fee","Host channel fee","Monthly discount","Weekly discount","Damage deposit","Cancellation fee","Cancellation payout","Cancellation host fee","Sub total price"
"(123) Great place",400,0,1150,150,1150,43,750,0,400,0,0,0,0,0,0,0,0,75,10,10,10,0,0,0,0,7000,0,0,0,1150
"(123) A building - Calm place Otteveny",0,0,267,53.4,267,43,267,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,267
Totals,400,0,1417,203.4,1417,86,1017,0,400,0,0,0,0,0,0,0,0,75,10,10,10,0,0,0,0,7000,0,0,0,1417
{
"status": "success",
"result": {
"columns": [
{
"name": "listingName",
"title": "Listing name",
"valueType": "string"
},
{
"name": "totalGuestFees",
"title": "Total guest fees",
"valueType": "money"
},
{
"name": "totalTax",
"title": "Total tax",
"valueType": "money"
},
{
"name": "accommodationFee",
"title": "Accommodation fee",
"valueType": "money"
},
{
"name": "pmCommission",
"title": "PM Commission",
"valueType": "money"
},
{
"name": "ownerPayout",
"title": "Owner payout",
"valueType": "money"
},
{
"name": "pmCommissionAbc",
"title": "pmCommissionAbc",
"valueType": "money"
},
{
"name": "baseRate",
"title": "Base rate",
"valueType": "money"
},
{
"name": "priceForExtraPerson",
"title": "Price for extra person",
"valueType": "money"
},
{
"name": "cleaningFeeValue",
"title": "Cleaning fee value",
"valueType": "money"
},
{
"name": "cityTax",
"title": "City / Tourism tax",
"valueType": "money"
},
{
"name": "hotelTax",
"title": "Hotel tax",
"valueType": "money"
},
{
"name": "lodgingTax",
"title": "Lodging tax",
"valueType": "money"
},
{
"name": "roomTax",
"title": "Room tax",
"valueType": "money"
},
{
"name": "salesTax",
"title": "Sales tax",
"valueType": "money"
},
{
"name": "transientOccupancyTax",
"title": "Transient occupancy tax",
"valueType": "money"
},
{
"name": "vat",
"title": "VAT / GST",
"valueType": "money"
},
{
"name": "otherTaxes",
"title": "Other taxes",
"valueType": "money"
},
{
"name": "propertyRentTax",
"title": "Property rent tax",
"valueType": "money"
},
{
"name": "guestPerPersonPerNightTax",
"title": "Guest per person per night tax",
"valueType": "money"
},
{
"name": "guestStayTax",
"title": "Guest stay tax",
"valueType": "money"
},
{
"name": "guestNightlyTax",
"title": "Guest nightly tax",
"valueType": "money"
},
{
"name": "guestChannelFee",
"title": "Guest channel fee",
"valueType": "money"
},
{
"name": "hostChannelFee",
"title": "Host channel fee",
"valueType": "money"
},
{
"name": "monthlyDiscount",
"title": "Monthly discount",
"valueType": "money"
},
{
"name": "weeklyDiscount",
"title": "Weekly discount",
"valueType": "money"
},
{
"name": "damageDeposit",
"title": "Damage deposit",
"valueType": "money"
},
{
"name": "cancellationFee",
"title": "Cancellation fee",
"valueType": "money"
},
{
"name": "cancellationPayout",
"title": "Cancellation payout",
"valueType": "money"
},
{
"name": "cancellationHostFee",
"title": "Cancellation host fee",
"valueType": "money"
},
{
"name": "subTotalPrice",
"title": "Sub total price",
"valueType": "money"
}
],
"rows": [
[
"(123) Great place",
400,
0,
1150,
150,
1150,
43,
750,
0,
400,
0,
0,
0,
0,
0,
0,
0,
0,
75,
10,
10,
10,
0,
0,
0,
0,
7000,
0,
0,
0,
1150
],
[
"(123) A building - Calm place Otteveny",
0,
0,
267,
53.4,
267,
43,
267,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
267
]
],
"totals": [
"Totals",
400,
0,
1417,
203.4,
1417,
86,
1017,
0,
400,
0,
0,
0,
0,
0,
0,
0,
0,
75,
10,
10,
10,
0,
0,
0,
0,
7000,
0,
0,
0,
1417
],
"currency": "RUB"
}
}
Tax Settings
Tax settings used to calculate various financial reporting values
Account Tax Settings
Get account tax settings
Request
curl --request GET \
--url 'https://api.hostaway.com/v1/accountTaxSettings' \
--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/accountTaxSettings",
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/accountTaxSettings");
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/accountTaxSettings")
.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/accountTaxSettings"
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/accountTaxSettings
Response
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | |
accountId |
yes | int | |
taxType |
yes | string | Can be one of the following: salesTax, hotelTax, vat, lodgingTax, occupancyTax, cityTax, roomTax, otherTaxes |
taxAppliedPer |
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 |
applyTo |
yes | string | Json list of following strings: baseRate, cleaningFee |
insertedOn |
yes | date time | |
updatedOn |
yes | date time |
{
"status": "success",
"result": [
{
"id": 1,
"accountId": 10638,
"taxType": "roomTax",
"taxAppliedPer": "reservation",
"amount": 1234,
"amountType": "percent",
"applyTo": "[\"baseRate\",\"cleaningFee\"]",
"insertedOn": "2020-05-27 13:57:58",
"updatedOn": "2020-05-27 13:58:50"
},
{
"id": 2,
"accountId": 10638,
"taxType": "cityTax",
"taxAppliedPer": "reservation",
"amount": 1234,
"amountType": "percent",
"applyTo": "[\"baseRate\",\"cleaningFee\"]",
"insertedOn": "2020-05-27 13:57:58",
"updatedOn": "2020-05-27 13:58:50"
}
]
}
Listing Tax Settings
Get listing tax settings
Request
curl --request GET \
--url 'https://api.hostaway.com/v1/listingTaxSettings/{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/listingTaxSettings/{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/listingTaxSettings/{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/listingTaxSettings/{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/listingTaxSettings/{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/listingTaxSettings/{listingId}
Response
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | |
accountId |
yes | int | |
listingMapId |
yes | int | |
taxType |
yes | string | Can be one of the following: salesTax, hotelTax, vat, lodgingTax, occupancyTax, cityTax, roomTax, otherTaxes |
taxAppliedPer |
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 |
applyTo |
yes | string | Json list of following strings: baseRate, cleaningFee |
insertedOn |
yes | date time | |
updatedOn |
yes | date time |
{
"status": "success",
"result": [
{
"id": 1,
"accountId": 10638,
"listingMapId": 60701,
"taxType": "roomTax",
"taxAppliedPer": "reservation",
"amount": 1234,
"amountType": "percent",
"applyTo": "[\"baseRate\",\"cleaningFee\"]",
"insertedOn": "2020-05-27 13:57:58",
"updatedOn": "2020-05-27 13:58:50"
},
{
"id": 2,
"accountId": 10638,
"listingMapId": 60701,
"taxType": "cityTax",
"taxAppliedPer": "reservation",
"amount": 1234,
"amountType": "percent",
"applyTo": "[\"baseRate\",\"cleaningFee\"]",
"insertedOn": "2020-05-27 13:57:58",
"updatedOn": "2020-05-27 13:58:50"
}
]
}
Owner Statement
Owner statement reports represent financial values for property owners
Get Owner Statements list
Get Owner Statements list
Request
curl --request GET \
--url 'https://api.hostaway.com/v1/ownerStatements' \
--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/ownerStatements",
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/ownerStatements");
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/ownerStatements")
.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/ownerStatements"
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/ownerStatements
Response
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | |
statementName |
yes | string |
{
"status": "success",
"result": [
{
"id": 1,
"statementName": "statement-test-1"
},
{
"id": 1,
"statementName": "statement-test-2"
}
]
}
Get Owner Statement by id
Get Owner Statement data by id
Request
curl --request GET \
--url 'https://api.hostaway.com/v1/ownerStatement/1' \
--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/ownerStatement/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(
"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/ownerStatement/1");
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/ownerStatement/1")
.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/ownerStatement/1"
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/ownerStatement/{ownerStatementId}
Response
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | |
accountId |
yes | string | Account ID |
statementName |
yes | string | Name of owner statement |
invoiceName |
no | int | Nam of invoice |
filterParametersJson |
no | array | Parameters of filter used to generate owner statement financial data |
summaryDataJson |
no | array | Financial summary data |
financeDataJson |
no | object | Financial data with reservations |
propertyManagerName |
no | string | |
propertyManagerEmail |
no | string | |
propertyManagerAddress |
no | string | |
propertyManagerPhone |
no | string | |
propertyOwnerName |
no | string | |
propertyOwnerEmail |
no | string | |
propertyOwnerAddress |
no | string | |
propertyOwnerPhone |
no | string | |
grandTotalJson |
no | object | Array of grand total amounts |
notes |
no | string | |
insertedOn |
yes | string | |
updatedOn |
yes | string | |
expenses |
no | array | Array of expenses |
accessByUsers |
no | array | Array of user IDs that have access to the statement |
{
"status": "success",
"result": {
"id": 1,
"accountId": "123",
"statementName": "owner-statement-test-1",
"invoiceName": "33",
"filterParametersJson": {
"listingMapIds": [
40269,
40270
],
"quickDate": "mtd",
"fromDate": "2021-03-01",
"toDate": "2021-03-19",
"statuses": [
"new",
"modified"
],
"dateType": "arrivalDate",
"tags": [
123,
456
],
"channelIds": [
2005,
2008
],
"columns": [
"numberOfNights",
"listingName",
"channelName",
"OwnerReportTwo",
"id",
"guestName"
],
"summaryDataFormulaNames": [
"ownerPayout",
"pmCommission",
"rentalRevenue",
"totalGuestFees",
"kamilTestFormula"
]
},
"summaryDataJson": [
{
"formulaName": "ownerPayout",
"totalValue": 37681.7531
},
{
"formulaName": "pmCommission",
"totalValue": 0
},
{
"formulaName": "rentalRevenue",
"totalValue": 27477.7531
},
{
"formulaName": "totalGuestFees",
"totalValue": 1600
},
{
"formulaName": "kamilTestFormula",
"totalValue": 10244
}
],
"financeDataJson": {
"columns": [
{
"name": "baseRate",
"title": "Base rate",
"valueType": "money"
},
{
"name": "pmCommission",
"title": "PM Commission",
"valueType": "money"
},
{
"name": "id",
"title": "Reservation ID",
"valueType": "number"
},
{
"name": "guestName",
"title": "Guest name",
"valueType": "string"
},
{
"name": "channelName",
"title": "Channel name",
"valueType": "string"
},
{
"name": "status",
"title": "Reservation status",
"valueType": "string"
},
{
"name": "paymentMethod",
"title": "Payment method",
"valueType": "string"
},
{
"name": "isPaid",
"title": "Paid",
"valueType": "string"
},
{
"name": "arrivalDate",
"title": "Arrival date",
"valueType": "string"
},
{
"name": "departureDate",
"title": "Departure date",
"valueType": "string"
},
{
"name": "listingName",
"title": "Listing name",
"valueType": "string"
},
{
"name": "totalGuestFees",
"title": "Total guest fees",
"valueType": "money"
},
{
"name": "totalTax",
"title": "Total tax",
"valueType": "money"
},
{
"name": "rentalRevenue",
"title": "Rental revenue",
"valueType": "money"
},
{
"name": "ownerPayout",
"title": "Owner payout",
"valueType": "money"
},
{
"name": "anotherformula",
"title": "anotherformula",
"valueType": "money"
},
{
"name": "someFormulaUpdate",
"title": "someFormulaUpdate",
"valueType": "money"
},
{
"name": "someFormulaUpdateNew",
"title": "someFormulaUpdateNew",
"valueType": "money"
},
{
"name": "anotherFormulai",
"title": "anotherFormulai",
"valueType": "money"
},
{
"name": "oneMoreFormula",
"title": "oneMoreFormula",
"valueType": "money"
},
{
"name": "testListingFormula",
"title": "testListingFormula",
"valueType": "money"
},
{
"name": "OwnerReportTwo",
"title": "OwnerReportTwo",
"valueType": "money"
},
{
"name": "testFormulaToCheckIsOverride",
"title": "testFormulaToCheckIsOverride",
"valueType": "money"
},
{
"name": "kamilTestFormula",
"title": "kamilTestFormula",
"valueType": "money"
},
{
"name": "kamiltestformulatwo",
"title": "kamiltestformulatwo",
"valueType": "money"
},
{
"name": "priceForExtraPerson",
"title": "Price for extra person",
"valueType": "money"
},
{
"name": "cleaningFeeValue",
"title": "Cleaning fee value",
"valueType": "money"
},
{
"name": "additionalCleaningFee",
"title": "Additional cleaning fee",
"valueType": "money"
},
{
"name": "parkingFee",
"title": "Parking fee",
"valueType": "money"
},
{
"name": "towelChangeFee",
"title": "Towel change fee",
"valueType": "money"
},
{
"name": "midstayCleaningFee",
"title": "Midstay cleaning fee",
"valueType": "money"
},
{
"name": "roomRequestFee",
"title": "Room request fee",
"valueType": "money"
},
{
"name": "reservationChangeFee",
"title": "Reservation change fee",
"valueType": "money"
},
{
"name": "checkinFee",
"title": "Checkin fee",
"valueType": "money"
},
{
"name": "lateCheckoutFee",
"title": "Late checkout fee",
"valueType": "money"
},
{
"name": "otherFees",
"title": "Other fees",
"valueType": "money"
},
{
"name": "creditCardFee",
"title": "Credit Card fee",
"valueType": "money"
},
{
"name": "kitchenLinenFee",
"title": "Kitchen Linen fee",
"valueType": "money"
},
{
"name": "linenPackageFee",
"title": "Linen Package fee",
"valueType": "money"
},
{
"name": "transferFee",
"title": "Transfer fee",
"valueType": "money"
},
{
"name": "wristbandFee",
"title": "Wristband fee",
"valueType": "money"
},
{
"name": "extraBedsFee",
"title": "Extra Beds fee",
"valueType": "money"
},
{
"name": "serviceFee",
"title": "Service fee",
"valueType": "money"
},
{
"name": "bedLinenFee",
"title": "Bed Linen fee",
"valueType": "money"
},
{
"name": "bookingFee",
"title": "Booking fee",
"valueType": "money"
},
{
"name": "petFee",
"title": "Pet fee",
"valueType": "money"
},
{
"name": "skiPassFee",
"title": "Ski Pass fee",
"valueType": "money"
},
{
"name": "tourismFee",
"title": "Tourism fee",
"valueType": "money"
},
{
"name": "childrenExtraFee",
"title": "Children Extra fee",
"valueType": "money"
},
{
"name": "resortFee",
"title": "Resort fee",
"valueType": "money"
},
{
"name": "cityTax",
"title": "City / Tourism tax",
"valueType": "money"
},
{
"name": "hotelTax",
"title": "Hotel tax",
"valueType": "money"
},
{
"name": "lodgingTax",
"title": "Lodging tax",
"valueType": "money"
},
{
"name": "roomTax",
"title": "Room tax",
"valueType": "money"
},
{
"name": "salesTax",
"title": "Sales tax",
"valueType": "money"
},
{
"name": "transientOccupancyTax",
"title": "Transient occupancy tax",
"valueType": "money"
},
{
"name": "vat",
"title": "VAT / GST",
"valueType": "money"
},
{
"name": "otherTaxes",
"title": "Other taxes",
"valueType": "money"
},
{
"name": "propertyRentTax",
"title": "Property rent tax",
"valueType": "money"
},
{
"name": "guestPerPersonPerNightTax",
"title": "Guest per person per night tax",
"valueType": "money"
},
{
"name": "guestStayTax",
"title": "Guest stay tax",
"valueType": "money"
},
{
"name": "guestNightlyTax",
"title": "Guest nightly tax",
"valueType": "money"
},
{
"name": "guestChannelFee",
"title": "Guest channel fee",
"valueType": "money"
},
{
"name": "hostChannelFee",
"title": "Host channel fee",
"valueType": "money"
},
{
"name": "monthlyDiscount",
"title": "Monthly discount",
"valueType": "money"
},
{
"name": "weeklyDiscount",
"title": "Weekly discount",
"valueType": "money"
},
{
"name": "shareholderDiscount",
"title": "Shareholder discount",
"valueType": "money"
},
{
"name": "lastMinuteDiscount",
"title": "Last minute discount",
"valueType": "money"
},
{
"name": "employeeDiscount",
"title": "Employee discount",
"valueType": "money"
},
{
"name": "otherSpecialDiscount",
"title": "Other special discount",
"valueType": "money"
},
{
"name": "damageDeposit",
"title": "Damage deposit",
"valueType": "money"
},
{
"name": "cancellationPayout",
"title": "Cancellation payout",
"valueType": "money"
},
{
"name": "cancellationHostFee",
"title": "Cancellation host fee",
"valueType": "money"
},
{
"name": "couponDiscount",
"title": "Coupon discount",
"valueType": "money"
},
{
"name": "couponName",
"title": "Coupon name",
"valueType": "string"
},
{
"name": "paymentServiceProcessingFees",
"title": "Payment service processing fees",
"valueType": "money"
},
{
"name": "subTotalPrice",
"title": "Sub total price",
"valueType": "money"
},
{
"name": "reservationDate",
"title": "Reservation date",
"valueType": "string"
},
{
"name": "resortFeeAirbnb",
"title": "Resort fee Airbnb",
"valueType": "money"
},
{
"name": "managementFeeAirbnb",
"title": "Management fee Airbnb",
"valueType": "money"
},
{
"name": "communityFeeAirbnb",
"title": "Community fee Airbnb",
"valueType": "money"
},
{
"name": "linenFeeAirbnb",
"title": "Linen fee Airbnb",
"valueType": "money"
},
{
"name": "nights",
"title": "Number of nights",
"valueType": "number"
},
{
"name": "numberOfGuests",
"title": "Number of guests",
"valueType": "number"
}
],
"rows": [],
"currency": null,
"totals": [
"Totals"
]
},
"propertyManagerName": "Demo Hostaway22",
"propertyManagerEmail": "demo22@hostaway.com",
"propertyManagerAddress": "Khreshchatyk street, 922",
"propertyManagerPhone": "+123456789",
"propertyOwnerName": "22",
"propertyOwnerEmail": "demo33@hostaway.com",
"propertyOwnerAddress": "22",
"propertyOwnerPhone": "+123456789",
"grandTotalJson": {
"expensesTotal": 126.7474,
"grandTotalAmount": 17643.5474,
"formulasTotal": [
{
"name": "baseRate",
"amount": 0
},
{
"name": "pmCommission",
"amount": 17516.8
}
]
},
"notes": "12343",
"insertedOn": "2021-03-16 20:28:47",
"updatedOn": "2021-03-31 12:40:38",
"expenses": [
{
"id": 9,
"listingMapId": null,
"reservationId": null,
"expenseDate": "2020-01-01",
"concept": "test",
"amount": 3
}
],
"accessByUsers": [
123,
456
]
}
}
Expense
Expense represents financial expense values
Expense Object
{
"id": 123,
"accountId": 10638,
"ownerStatementId": 6,
"listingMapId": 123,
"reservationId": 456,
"expenseDate": "2021-10-22",
"concept": "test",
"amount": 123,
"isDeleted": 0,
"ownerUserId": null,
"insertedOn": "2022-01-01 00:00:00",
"updatedOn": "2022-01-01 00:00:00",
"ownerStatementIds": [
6
],
"categories": [],
"categoriesNames": [],
"attachments": [],
"listingName": null,
"guestName": null,
"ownerStatementNames": [
"test"
],
"ownerStatementExpenseId": 2
}
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | |
accountId |
yes | int | Account ID |
ownerStatementId |
no | int | Related owner statement ID |
listingMapId |
no | int | ID of listing map |
reservationId |
no | int | ID of the reservation |
expenseDate |
yes | string | Date of expense |
concept |
yes | string | Reason of expense, max 255 characters |
amount |
yes | float | Financial amount of expense |
isDeleted |
yes | int | IF 1 then it is marked as deleted and not considered in owner statements |
ownerUserId |
no | int | |
insertedOn |
yes | string | |
updatedOn |
yes | string | |
ownerStatementIds |
no | array | |
categories |
no | array | |
categoriesNames |
no | array | |
attachments |
no | array | |
listingName |
no | string | |
guestName |
no | string | Related reservation ID guest name |
ownerStatementNames |
no | array | List of owner statement names that contain the expense |
ownerStatementExpenseId |
yes | int | Just a copy of id field |
Get expenses list
Get expenses list
Query params:
name | default | options |
---|---|---|
limit |
100 | amount of records to retrieve, 500 is max |
offset |
0 | amount of records to skip |
format |
json | one of the following: json, csv |
Request
curl --request GET \
--url 'https://api.hostaway.com/v1/expenses' \
--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/expenses",
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/expenses");
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/expenses")
.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/expenses"
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/expenses
Response
List of expense objects
{
"status": "success",
"result": [
{
"id": 123,
"accountId": 10638,
"ownerStatementId": 6,
"listingMapId": 123,
"reservationId": 456,
"expenseDate": "2021-10-22",
"concept": "test",
"amount": 123,
"isDeleted": 0,
"ownerUserId": null,
"insertedOn": "2022-01-01 00:00:00",
"updatedOn": "2022-01-01 00:00:00",
"ownerStatementIds": [
6
],
"categories": [],
"categoriesNames": [],
"attachments": [],
"listingName": null,
"guestName": null,
"ownerStatementNames": [
"test"
],
"ownerStatementExpenseId": 2
},
{
"id": 3,
"accountId": 10638,
"ownerStatementId": 16,
"listingMapId": 123,
"reservationId": 456,
"expenseDate": "2021-10-21",
"concept": "test",
"amount": 555,
"isDeleted": 0,
"ownerUserId": 123,
"insertedOn": "2022-10-19 13:44:00",
"updatedOn": "2023-02-10 15:30:48",
"ownerStatementIds": [
16,
5,
6
],
"categories": [],
"categoriesNames": [],
"attachments": [],
"ownerUserEmail": "test@test.com",
"ownerUserFirstName": "Test",
"ownerUserLastName": "User",
"ownerUserName": "Test User (test@test.com)",
"listingName": null,
"guestName": null,
"ownerStatementNames": [
"test1",
"test2",
"test3"
],
"ownerStatementExpenseId": 3
}
]
}
Get expense by ID
Get expense by id
Request
curl --request GET \
--url 'https://api.hostaway.com/v1/expenses/1' \
--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/expenses/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(
"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/expenses/1");
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/expenses/1")
.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/expenses/1"
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/expenses/1
Response
Expense object
{
"status": "success",
"result": {
"id": 1,
"accountId": 10638,
"ownerStatementId": 5,
"listingMapId": 123,
"reservationId": 456,
"expenseDate": "2021-10-21",
"concept": "test",
"amount": 123,
"isDeleted": 0,
"ownerUserId": null,
"insertedOn": "2022-01-01 00:00:00",
"updatedOn": "2022-01-01 00:00:00",
"ownerStatementIds": [
5,
6
],
"categories": [
1
],
"categoriesNames": [
"test"
],
"attachments": [],
"listingName": null,
"guestName": null,
"ownerStatementNames": [
"test4",
"test2"
],
"ownerStatementExpenseId": 1
}
}
Create expense
Create expense
Request
curl --location --request POST 'https://api.hostaway.com/v1/expenses' \
--header 'jwt;' \
--header 'Content-type: application/json' \
--data-raw '{
"ownerStatementId": null,
"listingMapId": 123,
"reservationId": null,
"expenseDate": "2021-10-21",
"concept": "test",
"amount": 123,
"isDeleted": 0,
"ownerUserId": null,
"ownerStatementIds": [
5,
6
],
"categories": [
1
],
"attachments": []
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.hostaway.com/v1/expenses',
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 =>'{
"ownerStatementId": null,
"listingMapId": 123,
"reservationId": null,
"expenseDate": "2021-10-21",
"concept": "test",
"amount": 123,
"isDeleted": 0,
"ownerUserId": null,
"ownerStatementIds": [
5,
6
],
"categories": [
1
],
"attachments": []
}',
CURLOPT_HTTPHEADER => array(
'jwt: ',
'Content-type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var data = JSON.stringify({
"ownerStatementId": null,
"listingMapId": 123,
"reservationId": null,
"expenseDate": "2021-10-21",
"concept": "test",
"amount": 123,
"isDeleted": 0,
"ownerUserId": null,
"ownerStatementIds": [
5,
6
],
"categories": [
1
],
"attachments": []
});
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/expenses");
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 \"ownerStatementId\": null,\n \"listingMapId\": 123,\n \"reservationId\": null,\n \"expenseDate\": \"2021-10-21\",\n \"concept\": \"test\",\n \"amount\": 123,\n \"isDeleted\": 0,\n \"ownerUserId\": null,\n \"ownerStatementIds\": [\n 5,\n 6\n ],\n \"categories\": [\n 1\n ],\n \"attachments\": []\n}");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/expenses")
.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({
"ownerStatementId": None,
"listingMapId": 123,
"reservationId": None,
"expenseDate": "2021-10-21",
"concept": "test",
"amount": 123,
"isDeleted": 0,
"ownerUserId": None,
"ownerStatementIds": [
5,
6
],
"categories": [
1
],
"attachments": []
})
headers = {
'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImNhMmJhMjAyZGMwYzU0ZWZlYmVkNTJmZjhkNjZjNjZhODBjMmVhYmQ0ZDU4ODVmZmRmMGI1YjkzODBjN2I2MzU3ZTE2NDk4YTVmNTQyOWQ4IiwiaWF0IjoxNjkxNjUzNDc2LCJuYmYiOjE2OTE2NTM0NzYsImV4cCI6MTc1NDgxMTg3Niwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjF9.cr4vNqZ1WuR5IOY-SoVitOv8PBdhMnMrUp2WZx8E6Adet-9rYI3KB3wMzxjTShXp_63TGGKYsdmNQ6DQOuB4PbN8qH1jsacmwn0cY4ynxfLaG5n9bdJ5DxLHe8EGv-MD2HIM1-zrK1bMBYTx6idti0L2IK6S6xxJCHQ5fBfsuyc'',
'Content-type': 'application/json'
}
conn.request("POST", "/v1/expenses", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
POST https://api.hostaway.com/v1/expenses
Response
Created expense object
{
"status": "success",
"result": {
"id": 1,
"accountId": 10638,
"ownerStatementId": 5,
"listingMapId": 123,
"reservationId": 456,
"expenseDate": "2021-10-21",
"concept": "test",
"amount": 123,
"isDeleted": 0,
"ownerUserId": null,
"insertedOn": "2022-01-01 00:00:00",
"updatedOn": "2022-01-01 00:00:00",
"ownerStatementIds": [
5,
6
],
"categories": [
1
],
"categoriesNames": [
"test"
],
"attachments": [],
"listingName": null,
"guestName": null,
"ownerStatementNames": [
"test4",
"test2"
],
"ownerStatementExpenseId": 1
}
}
Delete expense by ID
Delete expense by id
Request
curl --request DELETE \
--url 'https://api.hostaway.com/v1/expenses/1' \
--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/expenses/1",
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 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("DELETE", "https://api.hostaway.com/v1/expenses/1");
xhr.setRequestHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send(data);
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/expenses/1")
.method("DELETE", body)
.addHeader("jwt", "")
.build();
Response response = client.newCall(request).execute();
import requests
url = "https://api.hostaway.com/v1/expenses/1"
headers = {
'Authorization': "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
'Cache-control': "no-cache",
}
response = requests.request("DELETE", url, headers=headers)
print(response.text)
DELETE https://api.hostaway.com/v1/expenses/1
Response
{
"status": "success",
"result": {}
}
Update expense by ID
Update expense by id
Request
curl --location --request PUT 'https://api.hostaway.com/v1/expenses/1' \
--header 'jwt;' \
--header 'Content-type: application/json' \
--data-raw '{
"ownerStatementId": null,
"listingMapId": 123,
"reservationId": null,
"expenseDate": "2021-10-21",
"concept": "test",
"amount": 123,
"isDeleted": 0,
"ownerUserId": null,
"ownerStatementIds": [
5,
6
],
"categories": [
1
],
"attachments": []
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.hostaway.com/v1/expenses/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 =>'{
"ownerStatementId": null,
"listingMapId": 123,
"reservationId": null,
"expenseDate": "2021-10-21",
"concept": "test",
"amount": 123,
"isDeleted": 0,
"ownerUserId": null,
"ownerStatementIds": [
5,
6
],
"categories": [
1
],
"attachments": []
}',
CURLOPT_HTTPHEADER => array(
'jwt: ',
'Content-type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var data = JSON.stringify({
"ownerStatementId": null,
"listingMapId": 123,
"reservationId": null,
"expenseDate": "2021-10-21",
"concept": "test",
"amount": 123,
"isDeleted": 0,
"ownerUserId": null,
"ownerStatementIds": [
5,
6
],
"categories": [
1
],
"attachments": []
});
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/expenses/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 \"ownerStatementId\": null,\n \"listingMapId\": 123,\n \"reservationId\": null,\n \"expenseDate\": \"2021-10-21\",\n \"concept\": \"test\",\n \"amount\": 123,\n \"isDeleted\": 0,\n \"ownerUserId\": null,\n \"ownerStatementIds\": [\n 5,\n 6\n ],\n \"categories\": [\n 1\n ],\n \"attachments\": []\n}");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/expenses/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({
"ownerStatementId": None,
"listingMapId": 123,
"reservationId": None,
"expenseDate": "2021-10-21",
"concept": "test",
"amount": 123,
"isDeleted": 0,
"ownerUserId": None,
"ownerStatementIds": [
5,
6
],
"categories": [
1
],
"attachments": []
})
headers = {
'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImNhMmJhMjAyZGMwYzU0ZWZlYmVkNTJmZjhkNjZjNjZhODBjMmVhYmQ0ZDU4ODVmZmRmMGI1YjkzODBjN2I2MzU3ZTE2NDk4YTVmNTQyOWQ4IiwiaWF0IjoxNjkxNjUzNDc2LCJuYmYiOjE2OTE2NTM0NzYsImV4cCI6MTc1NDgxMTg3Niwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjF9.cr4vNqZ1WuR5IOY-SoVitOv8PBdhMnMrUp2WZx8E6Adet-9rYI3KB3wMzxjTShXp_63TGGKYsdmNQ6DQOuB4PbN8qH1jsacmwn0cY4ynxfLaG5n9bdJ5DxLHe8EGv-MD2HIM1-zrK1bMBYTx6idti0L2IK6S6xxJCHQ5fBfsuyc'',
'Content-type': 'application/json'
}
conn.request("PUT", "/v1/expenses/1", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
PUT https://api.hostaway.com/v1/expenses/1
Response
Updated expense object
{
"status": "success",
"result": {
"id": 1,
"accountId": 10638,
"ownerStatementId": 5,
"listingMapId": 123,
"reservationId": 456,
"expenseDate": "2021-10-21",
"concept": "test",
"amount": 123,
"isDeleted": 0,
"ownerUserId": null,
"insertedOn": "2022-01-01 00:00:00",
"updatedOn": "2022-01-01 00:00:00",
"ownerStatementIds": [
5,
6
],
"categories": [
1
],
"categoriesNames": [
"test"
],
"attachments": [],
"listingName": null,
"guestName": null,
"ownerStatementNames": [
"test4",
"test2"
],
"ownerStatementExpenseId": 1
}
}
Review
Review object
{
"id": 1,
"accountId": 1,
"listingMapId": 1,
"reservationId": 1,
"autoReviewId": null,
"timeDelta": null,
"scheduledDateTime": null,
"channelId": 2005,
"type": "guest-to-host",
"status": "awaiting",
"rating": null,
"externalReviewId": null,
"externalReservationId": null,
"publicReview": null,
"privateFeedback": null,
"revieweeResponse": null,
"isRevieweeRecommended": null,
"isCancelled": 0,
"autoReviewTemplateId": null,
"reviewCategory": [],
"departureDate": "2021-05-11 22:00:00",
"arrivalDate": "2021-05-06 08:00:00",
"listingName": "Beautiful and cozy apartment close to city center",
"guestName": "Andrew Peterson"
}
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | |
accountId |
yes | int | |
listingMapId |
yes | int | |
reservationId |
yes | int | |
autoReviewId |
yes | int | |
timeDelta |
yes | int | |
scheduledDateTime |
yes | int | |
channelId |
yes | int | Please check here for valid channel values: Channels |
type |
yes | string | |
status |
yes | string | |
raiting |
yes | int | |
externalReviewId |
yes | int | |
externalReservationId |
yes | int | |
publicReview |
yes | int | |
privateFeedback |
yes | int | |
revieweeResponse |
yes | string | |
isRevieweeRecommended |
yes | int | |
isCancelled |
yes | int | |
autoReviewTemplateId |
yes | int | |
departureDate |
yes | date | |
arrivalDate |
yes | date | |
listingName |
yes | string | |
guestName |
yes | string |
Get reviews list
Get Reviews list
Request
curl --request GET \
--url https://api.hostaway.com/v1/reviews \
--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/reviews",
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/reviews");
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/reviews")
.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/reviews"
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/reviews
Query Parameter | Required | Type | Description |
---|---|---|---|
listingMapIds |
no | int[] | Array of Listing IDs |
limit |
no | int | Maximum number of items in the list. |
offset |
no | int | Number of items to skip from beginning of the list. |
sortBy |
no | string | One of: id, guestName, arrivalDate, departureDate. |
sortOrder |
no | string | Asc or desc |
reservationId |
no | int | |
type |
no | string | One of: guest-to-host, host-to-guest |
statuses |
no | array | awaiting, pending, scheduled, submitted, published, expired |
departureDateStart |
no | date | |
departureDateEnd |
no | date |
Response
An array of review objects.
{
"status": "success",
"result": [
{
"id": 1,
"accountId": 1,
"listingMapId": 1,
"reservationId": 1,
"autoReviewId": null,
"timeDelta": null,
"scheduledDateTime": null,
"channelId": 2005,
"type": "guest-to-host",
"status": "awaiting",
"rating": null,
"externalReviewId": null,
"externalReservationId": null,
"publicReview": null,
"privateFeedback": null,
"revieweeResponse": null,
"isRevieweeRecommended": null,
"isCancelled": 0,
"autoReviewTemplateId": null,
"reviewCategory": [],
"departureDate": "2021-05-11 22:00:00",
"arrivalDate": "2021-05-06 08:00:00",
"listingName": "Beautiful and cozy apartment close to city center",
"guestName": "Andrew Peterson"
}
],
"count": 1,
"offset": null
}
Get review
Get review object
Request
curl --request GET \
--url https://api.hostaway.com/v1/reviews/1 \
--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/reviews/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(
"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/reviews/1");
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/reviews/1")
.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/reviews/1"
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/reviews/{reviewId}
Response
A review object.
User
Get Users list
Get Users list
Request
curl --request GET \
--url https://api.hostaway.com/v1/users \
--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/users",
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/users");
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/users")
.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/users"
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/users
Response
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | |
accountId |
yes | int | |
userGroupId |
yes | int | |
userGroupName |
yes | string | |
email |
yes | string | |
verificationCode |
yes | string | |
secondEmail |
yes | string | |
firstName |
yes | string | |
lastName |
yes | string | |
title |
yes | string | |
country |
yes | string | |
city |
yes | string | |
phone |
yes | string | |
emergencyPhone |
yes | string | |
preferredContactMethod |
yes | string | |
noteBeforeContact |
yes | string | |
address |
yes | string | |
postalCode |
yes | string | |
profilePictureUrl |
yes | string | |
timezone |
yes | string | |
createListing |
yes | int | |
readListing |
yes | int | |
updateListing |
yes | int | |
deleteListing |
yes | int | |
createReservation |
yes | int | |
readReservation |
yes | int | |
updateReservation |
yes | int | |
deleteReservation |
yes | int | |
readCalendar |
yes | int | |
updateCalendar |
yes | int | |
readBookingEngine |
yes | int | |
updateBookingEngine |
yes | int | |
readRevenueManagement |
yes | int | |
readChannelManager |
yes | int | |
updateChannelManager |
yes | int | |
createTask |
yes | int | |
readTask |
yes | int | |
updateTask |
yes | int | |
deleteTask |
yes | int | |
createAutomation |
yes | int | |
readAutomation |
yes | int | |
updateAutomation |
yes | int | |
deleteAutomation |
yes | int | |
readMessage |
yes | int | |
updateMessage |
yes | int | |
updateIntegration |
yes | int | |
createGuestInvoicing |
yes | int | |
readGuestInvoicing |
yes | int | |
updateGuestInvoicing |
yes | int | |
deleteGuestInvoicing |
yes | int | |
receiveReservationNotificationEmail |
yes | int | |
isDisabledByHostaway |
yes | int | |
isDisabledByAccount |
yes | int | |
hasAccessToNewListings |
yes | int | |
createReview |
yes | int | |
readReview |
yes | int | |
updateReview |
yes | int | |
deleteReview |
yes | int | |
createOwnerStatement |
yes | int | |
readOwnerStatement |
yes | int | |
updateOwnerStatement |
yes | int | |
deleteOwnerStatement |
yes | int | |
createGuestbook |
yes | int | |
readGuestbook |
yes | int | |
updateGuestbook |
yes | int | |
deleteGuestbook |
yes | int | |
isAdmin |
yes | int | |
accessFinancialData |
yes | int | |
accessContactData |
yes | int | |
accessGuestNotes |
yes | int | |
accessTagManagement |
yes | int | |
readAnalytics |
yes | int | |
readListingsFinancials |
yes | int | |
readOccupancyReport |
yes | int |
{
"status": "success",
"result": [
{
"id": 1,
"accountId": 1,
"userGroupId": 1,
"userGroupName": null,
"email": "user@example.com",
"icalKey": null,
"passwordUpdatedOn": null,
"verificationCode": "",
"secondEmail": "",
"firstName": "Andrew",
"lastName": "Peterson",
"title": "",
"country": "",
"city": "",
"phone": "1234567",
"emergencyPhone": "",
"preferredContactMethod": "phone",
"noteBeforeContact": "",
"address": "",
"postalCode": "",
"profilePictureUrl": "",
"timezone": "UTC",
"createListing": 1,
"readListing": 0,
"updateListing": 1,
"deleteListing": 0,
"createReservation": 1,
"readReservation": 0,
"updateReservation": 0,
"deleteReservation": 1,
"readCalendar": 1,
"updateCalendar": 0,
"readBookingEngine": 1,
"updateBookingEngine": 0,
"readRevenueManagement": 1,
"readChannelManager": 0,
"updateChannelManager": 1,
"createTask": 0,
"readTask": 1,
"updateTask": 0,
"deleteTask": 1,
"createAutomation": 0,
"readAutomation": 1,
"updateAutomation": 0,
"deleteAutomation": 1,
"readMessage": 0,
"updateMessage": 1,
"updateIntegration": 0,
"createGuestInvoicing": 0,
"readGuestInvoicing": 0,
"updateGuestInvoicing": 0,
"deleteGuestInvoicing": 0,
"receiveReservationNotificationEmail": 1,
"isDisabledByHostaway": 0,
"isDisabledByAccount": 0,
"hasAccessToNewListings": 0,
"createReview": 0,
"readReview": 0,
"updateReview": 0,
"deleteReview": 0,
"createOwnerStatement": 1,
"readOwnerStatement": 1,
"updateOwnerStatement": 1,
"deleteOwnerStatement": 1,
"createGuestbook": 0,
"readGuestbook": 0,
"updateGuestbook": 0,
"deleteGuestbook": 0,
"isAdmin": 0,
"accessFinancialData": 0,
"accessContactData": 0,
"accessGuestNotes": 1,
"accessTagManagement": 0,
"readAnalytics": 0,
"readListingsFinancials": 0,
"readOccupancyReport": 0,
"lastLoginOn": null,
"listingMapIds": null
}
]
}
Get User by ID
Get User by ID
Request
curl --request GET \
--url https://api.hostaway.com/v1/user/{userId} \
--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/user/{userId}",
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/user/{userId}");
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/user/{userId}")
.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/user/{userId}"
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/user/{userId}
Response
A User object
Group
Get Groups list
Get list of groups
Request
curl --request GET \
--url https://api.hostaway.com/v1/userGroups \
--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/userGroups",
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/userGroups");
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/userGroups")
.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/userGroups"
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/userGroups
Response
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | |
accountId |
yes | int | |
name |
yes | string | |
description |
yes | string | |
createListing |
yes | int | |
readListing |
yes | int | |
updateListing |
yes | int | |
deleteListing |
yes | int | |
createReservation |
yes | int | |
readReservation |
yes | int | |
updateReservation |
yes | int | |
deleteReservation |
yes | int | |
readCalendar |
yes | int | |
updateCalendar |
yes | int | |
readBookingEngine |
yes | int | |
updateBookingEngine |
yes | int | |
readRevenueManagement |
yes | int | |
readChannelManager |
yes | int | |
updateChannelManager |
yes | int | |
createTask |
yes | int | |
readTask |
yes | int | |
updateTask |
yes | int | |
deleteTask |
yes | int | |
createAutomation |
yes | int | |
readAutomation |
yes | int | |
updateAutomation |
yes | int | |
deleteAutomation |
yes | int | |
readMessage |
yes | int | |
updateMessage |
yes | int | |
updateIntegration |
yes | int | |
createGuestInvoicing |
yes | int | |
readGuestInvoicing |
yes | int | |
updateGuestInvoicing |
yes | int | |
deleteGuestInvoicing |
yes | int | |
receiveReservationNotificationEmail |
yes | int | |
isAdmin |
yes | int | |
accessFinancialData |
yes | int | |
accessContactData |
yes | int | |
hasAccessToNewListings |
yes | int | |
createReview |
yes | int | |
readReview |
yes | int | |
updateReview |
yes | int | |
deleteReview |
yes | int | |
createOwnerStatement |
yes | int | |
readOwnerStatement |
yes | int | |
updateOwnerStatement |
yes | int | |
deleteOwnerStatement |
yes | int | |
createGuestbook |
yes | int | |
readGuestbook |
yes | int | |
updateGuestbook |
yes | int | |
deleteGuestbook |
yes | int | |
readAnalytics |
yes | int | |
readListingsFinancials |
yes | int | |
readOccupancyReport |
yes | int |
{
"status": "success",
"result": [
{
"id": 1,
"accountId": 1,
"name": "Group",
"description": "Group description",
"createListing": 1,
"readListing": 1,
"updateListing": 1,
"deleteListing": 1,
"createReservation": 1,
"readReservation": 1,
"updateReservation": 1,
"deleteReservation": 0,
"readCalendar": 1,
"updateCalendar": 1,
"readBookingEngine": 1,
"updateBookingEngine": 1,
"readRevenueManagement": 1,
"readChannelManager": 1,
"updateChannelManager": 1,
"createTask": 1,
"readTask": 1,
"updateTask": 1,
"deleteTask": 1,
"createAutomation": 1,
"readAutomation": 1,
"updateAutomation": 1,
"deleteAutomation": 1,
"readMessage": 1,
"updateMessage": 1,
"updateIntegration": 1,
"createGuestInvoicing": 0,
"readGuestInvoicing": 0,
"updateGuestInvoicing": 0,
"deleteGuestInvoicing": 0,
"receiveReservationNotificationEmail": 0,
"isAdmin": 0,
"accessFinancialData": 0,
"accessContactData": 0,
"hasAccessToNewListings": 0,
"createReview": 0,
"readReview": 0,
"updateReview": 0,
"deleteReview": 0,
"createOwnerStatement": 0,
"readOwnerStatement": 0,
"updateOwnerStatement": 0,
"deleteOwnerStatement": 0,
"createGuestbook": 0,
"readGuestbook": 0,
"updateGuestbook": 0,
"deleteGuestbook": 0,
"readAnalytics": 0,
"readListingsFinancials": 0,
"readOccupancyReport": 0
}
]
}
Guest payment
Guest charge object
{
"id": 1,
"listingMapId": 40100,
"reservationId": 143523935,
"autopaymentId": 34231,
"type": "charge",
"title": "Accommodation payment",
"description": "Accommodation payment description",
"currency": "USD",
"paymentMethod": "credit_card_online",
"amount": 10,
"capturedAmount": null,
"status": "paid",
"paymentProvider": "stripe",
"paymentProviderMessage": "Charged successfully. Payment Provider charge ID: ch_3MveEFDdSZWWDFSS0dTZrWVI",
"paymentProviderInvoiceId": null,
"paymentProviderChargeId": "ch_3MveEFDdSZGFDS2S0dTZrWVI",
"scheduledDate": "2023-04-11 11:09:44",
"chargeDate": null,
"holdReleaseDate": null,
"isManual": 0,
"autoChargeId": 22312,
"triggerEvent": "arrival",
"triggerTimeDelta": -72,
"flatFee": null,
"percentageFee": 100,
"transactions": []
}
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | Hostaway charge ID |
listingMapId |
yes | int | ListingMap ID |
reservationId |
yes | int | Reservation ID |
autopaymentId |
yes | int | Auto payment ID |
type |
yes | string | Type of charge (charge or preAuth) |
title |
yes | string | Charge title |
description |
yes | string | Charge description |
currency |
yes | string | Currency (USD, EUR etc.) |
paymentMethod |
yes | string | Payment method (credit_card_online, credit_card, bank_transfer etc.) |
amount |
yes | float | Amount of charge |
capturedAmount |
yes | float | Captured amount (only for preAuth type) |
status |
yes | string | Status of charge (awaiting, paid, failed, pause, cancelled, awaitingHold, etc.) |
paymentProvider |
yes | string | Payment provider (stripe, braintree, authorizeNet, offline) |
paymentProviderMessage |
yes | string | Payment provider status message |
paymentProviderInvoiceId |
yes | string | Payment provider Invoice ID |
paymentProviderChargeId |
yes | string | Payment provider Charge ID |
scheduledDate |
yes | datetime | Scheduled date if the payment is scheduled |
chargeDate |
yes | date | Charge date |
holdReleaseDate |
yes | date | Hold release date (only for preAuth type) |
isManual |
yes | int | Is charge created manually |
autoChargeId |
yes | int | Autocharge ID |
triggerEvent |
yes | string | Trigger event of autopayment (reservation, arrival, departure) |
triggerTimeDelta |
yes | int | Time delta in hours |
flatFee |
yes | int | Flat fee amount if the charge is flat |
percentageFee |
yes | int | Percentage amount if the charge is percentage |
transactions |
yes | array | Array of transactions |
Guest charge transaction object
{
"id": 1,
"reservationId": 1,
"paymentProviderInvoiceId": "in_***",
"amount": 10,
"currency": "USD",
"status": "paid",
"paymentProvider": "stripe",
"paymentProviderMessage": "Charged successfully. Payment Provider charge ID: ch_***",
"balanceTransactionId": "txn_***"
}
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | Hostaway transaction ID |
reservationId |
yes | int | Hostaway reservation ID |
paymentProviderInvoiceId |
yes | string | Payment provider Invoice ID |
amount |
yes | float | Amount of payment |
currency |
yes | string | Currency (USD, EUR, etc.) |
status |
yes | string | Status of payment (paid, failed) |
paymentProvider |
yes | string | Payment provider (stripe, braintree, authorizeNet) |
paymentProviderMessage |
yes | string | Payment provider status message |
balanceTransactionId |
yes | string | Payment provider balance transaction |
Get guest charges list
Get charges list
Request
curl --request GET \
--url https://api.hostaway.com/v1/guestPayments/charges?reservationId=175239893 \
--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/guestPayments/charges?reservationId=175239893",
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/guestPayments/charges");
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/guestPayments/charges")
.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/guestPayments/charges"
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/guestPayments/charges
Query Parameter | Required | Type | Description |
---|---|---|---|
reservationId |
no | int | Reservation ID |
listingMapId |
no | int | Listing ID |
paymentProvider |
no | string | Payment provider (stripe, braintree, authorizeNet, offline) |
paymentMethod |
no | string | Payment method (credit_card_online, credit_card, bank_transfer etc.) |
limit |
no | int | Maximum number of items in the list. |
offset |
no | int | Number of items to skip from beginning of the list. |
Response
An array of guest charges objects.
{
"status": "success",
"result": [
{
"id": 1,
"listingMapId": 40100,
"reservationId": 1435239,
"autopaymentId": 34231,
"type": "charge",
"title": "Charge",
"description": "Charge description",
"currency": "USD",
"paymentMethod": "credit_card_online",
"amount": 10,
"capturedAmount": null,
"status": "awaiting",
"paymentProvider": null,
"paymentProviderMessage": null,
"paymentProviderInvoiceId": null,
"paymentProviderChargeId": null,
"scheduledDate": null,
"chargeDate": null,
"holdReleaseDate": null,
"isManual": 0,
"autoChargeId": null,
"triggerEvent": null,
"triggerTimeDelta": 0,
"flatFee": null,
"percentageFee": null,
"transactions": []
}
],
"count": 1,
"offset": null
}
Get charge object
Get charge object
Request
curl --request GET \
--url https://api.hostaway.com/v1/guestPayments/charges/{guestChargeId} \
--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/guestPayments/charges/{guestChargeId}",
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/guestPayments/charges/{guestChargeId}");
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/guestPayments/charges/{guestChargeId}")
.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/guestPayments/charges/{guestChargeId}"
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/guestPayments/charges/{guestChargeId}
Response
Guest charge object.
{
"status": "success",
"result": {
"id": 1,
"listingMapId": 40100,
"reservationId": 1435239,
"autopaymentId": 34231,
"type": "charge",
"title": "Charge",
"description": "Charge description",
"currency": "USD",
"paymentMethod": "credit_card_online",
"amount": 10,
"capturedAmount": null,
"status": "awaiting",
"paymentProvider": null,
"paymentProviderMessage": null,
"paymentProviderInvoiceId": null,
"paymentProviderChargeId": null,
"scheduledDate": null,
"chargeDate": null,
"holdReleaseDate": null,
"isManual": 0,
"autoChargeId": null,
"triggerEvent": null,
"triggerTimeDelta": 0,
"flatFee": null,
"percentageFee": null,
"transactions": []
}
}
Create offline charge
Create offline charge
Request
curl --location --request POST 'https://api.hostaway.com/v1/guestPayments/charges/{reservationId:\d+}' \
--header 'jwt;' \
--header 'Content-type: application/json' \
--data-raw '{
"title": "My charge",
"description": "optional field",
"amount": 100,
"paymentMethod": "cash",
"status": "paid",
"scheduledDate": "2023-08-15 18:56:49"
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.hostaway.com/v1/guestPayments/charges/{reservationId:\d+}',
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 =>'{
"title": "My charge",
"description": "optional field",
"amount": 100,
"paymentMethod": "cash",
"status": "paid",
"scheduledDate": "2023-08-15 18:56:49"
}',
CURLOPT_HTTPHEADER => array(
'jwt: ',
'Content-type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var data = JSON.stringify({
"title": "My charge",
"description": "optional field",
"amount": 100,
"paymentMethod": "cash",
"status": "paid",
"scheduledDate": "2023-08-15 18:56:49"
});
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/guestPayments/charges/{reservationId:\d+}");
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, "{\"title\": \"My charge\", \"description\": \"optional field\", \"amount\": 100, \"paymentMethod\": \"cash\", \"status\": \"paid\", \"scheduledDate\": \"2023-08-15 18:56:49\"}");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/guestPayments/charges/{reservationId:\d+}")
.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", undefined)
payload = json.dumps({
"title": "My charge",
"description": "optional field",
"amount": 100,
"paymentMethod": "cash",
"status": "paid",
"scheduledDate": "2023-08-15 18:56:49"
})
headers = {
'jwt': '',
'Content-type': 'application/json'
}
conn.request("POST", "/v1/guestPayments/charges/{reservationId:\d+}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
POST https://api.hostaway.com/v1/guestPayments/charges/{reservationId:\d+}
A charge object should be provided in the request body.
All fields but “description” are mandatory.
Possible values for field “status”: awaiting,paid.
Possible values for field “paymentMethod”: credit_card,vcc,cash,paypal,venmo,bank_transfer,bank_check,ota,other.
Response
Created charge object
{
"status": "success",
"result": {
"id": 1,
"listingMapId": 142792,
"reservationId": 16140478,
"autopaymentId": null,
"type": "charge",
"title": "My charge",
"description": null,
"currency": "USD",
"paymentMethod": "cash",
"amount": 100,
"capturedAmount": 0,
"status": "paid",
"paymentProvider": "offline",
"paymentProviderMessage": null,
"paymentProviderInvoiceId": null,
"paymentProviderChargeId": null,
"scheduledDate": "2023-08-15 18:56:49",
"chargeDate": "2023-08-21 09:25:36",
"holdReleaseDate": null,
"isManual": 0,
"autoChargeId": null,
"triggerEvent": null,
"triggerTimeDelta": 0,
"flatFee": 0,
"percentageFee": 0,
"transactions": []
}
}
Update offline charge
Update offline charge
Request
curl --location --request PUT 'https://api.hostaway.com/v1/guestPayments/charges/{reservationId:\d+}/{chargeId:\d+}' \
--header 'jwt;' \
--header 'Content-type: application/json' \
--data-raw '{
"title": "optional for update",
"description": "optional field",
"amount": 100,
"paymentMethod": "cash",
"status": "paid",
"scheduledDate": "2023-08-15 18:56:49"
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.hostaway.com/v1/guestPayments/charges/{reservationId:\d+}/{chargeId:\d+}',
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_PUTFIELDS =>'{
"title": "My charge",
"description": "optional field",
"amount": 100,
"paymentMethod": "cash",
"status": "paid",
"scheduledDate": "2023-08-15 18:56:49"
}',
CURLOPT_HTTPHEADER => array(
'jwt: ',
'Content-type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var data = JSON.stringify({
"title": "My charge",
"description": "optional field",
"amount": 100,
"paymentMethod": "cash",
"status": "paid",
"scheduledDate": "2023-08-15 18:56:49"
});
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/guestPayments/charges/{reservationId:\d+}/{chargeId:\d+}");
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, "{\"title\": \"My charge\", \"description\": \"optional field\", \"amount\": 100, \"paymentMethod\": \"cash\", \"status\": \"paid\", \"scheduledDate\": \"2023-08-15 18:56:49\"}");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/guestPayments/charges/{reservationId:\d+}/{chargeId:\d+}")
.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", undefined)
payload = json.dumps({
"title": "My charge",
"description": "optional field",
"amount": 100,
"paymentMethod": "cash",
"status": "paid",
"scheduledDate": "2023-08-15 18:56:49"
})
headers = {
'jwt': '',
'Content-type': 'application/json'
}
conn.request("PUT", "/v1/guestPayments/charges/{reservationId:\d+}/{chargeId:\d+}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
PUT https://api.hostaway.com/v1/guestPayments/charges/{reservationId:\d+}/{chargeId:\d+}
A charge object with the all fields should be provided in the request body.
Only charges in the status awaiting
can be updated with this API request.
Charges with credit_card_online
payment method can’t be updated via API regardless of the status.
All object fields are required when using this endpoint
Possible values for field status
: paid
,cancelled
.
Possible values for field paymentMethod
: credit_card,vcc,cash,paypal,venmo,bank_transfer,bank_check,ota,other.
Response
Updated charge object
{
"status": "success",
"result": {
"id": 1,
"listingMapId": 142792,
"reservationId": 16140478,
"autopaymentId": null,
"type": "charge",
"title": "My charge",
"description": null,
"currency": "USD",
"paymentMethod": "cash",
"amount": 100,
"capturedAmount": 0,
"status": "paid",
"paymentProvider": "offline",
"paymentProviderMessage": null,
"paymentProviderInvoiceId": null,
"paymentProviderChargeId": null,
"scheduledDate": "2023-08-15 18:56:49",
"chargeDate": "2023-08-21 09:25:36",
"holdReleaseDate": null,
"isManual": 0,
"autoChargeId": null,
"triggerEvent": null,
"triggerTimeDelta": 0,
"flatFee": 0,
"percentageFee": 0,
"transactions": []
}
}
Get auto-payment rules
Get auto payment rules
Request
curl --request GET \
--url https://api.hostaway.com/v1/guestPayments/autoPayment \
--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/guestPayments/autoPayment",
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/guestPayments/autoPayment");
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/guestPayments/autoPayment")
.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/guestPayments/autoPayment"
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/guestPayments/autoPayment
Response
Guest auto invoice auto charge list
{
"status":"success",
"result":[
{
"id":1,
"accountId":10498,
"guestAutoInvoiceId":34591,
"type":"charge",
"title":"Test guest auto charge reservation",
"description":null,
"triggerEvent":"reservation",
"triggerTimeDelta":2,
"paymentMethod":"credit_card_online",
"paymentProvider":"stripe",
"flatFee":null,
"percentageFee":33,
"isRestOfPay":0,
"insertedOn":"2023-07-31 10:17:00",
"updatedOn":"2023-07-31 10:17:00"
},
{
"id":2,
"accountId":10498,
"guestAutoInvoiceId":34591,
"type":"charge",
"title":"Test guest auto charge arrival",
"description":null,
"triggerEvent":"arrival",
"triggerTimeDelta":1,
"paymentMethod":"credit_card_online",
"paymentProvider":"stripe",
"flatFee":null,
"percentageFee":33,
"isRestOfPay":0,
"insertedOn":"2023-07-31 10:17:00",
"updatedOn":"2023-07-31 10:17:00"
},
{
"id":3,
"accountId":10498,
"guestAutoInvoiceId":34591,
"type":"charge",
"title":"Test guest auto charge departure",
"description":null,
"triggerEvent":"departure",
"triggerTimeDelta":3,
"paymentMethod":"credit_card_online",
"paymentProvider":"stripe",
"flatFee":null,
"percentageFee":33,
"isRestOfPay":0,
"insertedOn":"2023-07-31 10:17:00",
"updatedOn":"2023-07-31 10:17:00"
}
],
"count":3,
"offset":null
}
Guest auto payment auto charge object
{
"id": 1,
"accountId": 10498,
"guestAutoInvoiceId": 34591,
"type": "charge",
"title": "Test guest auto charge reservation",
"description": null,
"triggerEvent": "reservation",
"triggerTimeDelta": 2,
"paymentMethod": "credit_card_online",
"paymentProvider": "stripe",
"flatFee": null,
"percentageFee": 33,
"isRestOfPay": 0,
"insertedOn": "2023-07-31 10:17:00",
"updatedOn": "2023-07-31 10:17:00"
}
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | Hostaway auto payment auto charge ID |
accountId |
yes | int | Account ID |
guestAutoInvoiceId |
yes | int | Hostaway auto payment ID |
type |
yes | string | Type of charge (charge or preAuth) |
title |
yes | string | Charge title |
description |
yes | string | Charge description |
triggerEvent |
yes | string | Trigger event of autopayment (reservation, arrival, departure) |
triggerTimeDelta |
yes | string | Time delta in hours |
paymentMethod |
yes | string | Payment method (credit_card_online, credit_card, bank_transfer etc.) |
paymentProvider |
yes | string | Payment provider (stripe, braintree, authorizeNet, offline) |
flatFee |
yes | int | Flat fee amount if the charge is flat |
percentageFee |
yes | int | Percentage amount if the charge is percentage |
isRestOfPay |
yes | int | Flag that indicates if auto charge should charge the rest of the reservation amount |
Coupons
To apply a coupon to a reservation, first select the desired coupon name from coupons list, then use it in a request to price details endpoint to retrieve quote price for provided reservation parameters, and, lastly, use this price along with an additional JSON field called couponName
in create reservation endpoint. As a result, an internal link between the coupon and the reservation will be created, it can be verified by checking value of reservationCouponId
field of the resulting reservation object, it should be non-null. Please note that using couponName
in reservation creation won’t affect the reservation price specified in request, it will only decrement coupon uses for specified coupon.
Coupon object
{
"id": 1,
"accountId": 10490,
"userId": null,
"isActive": 1,
"isExpired": 0,
"name": "COUPON42",
"type": "percentage",
"amount": 5.43,
"minimumNights": 2,
"checkInDateStart": "2020-01-01",
"checkInDateEnd": "2021-12-31",
"numberOfUsesInitial": 100,
"numberOfUsesUsed": 20,
"validityDateStart": "2020-01-01",
"validityDateEnd": null
}
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | |
accountId |
yes | int | |
userId |
no | int | |
isActive |
yes | int | |
isExpired |
yes | int | |
name |
yes | string | Can contain only uppercase latin letters and digits |
type |
yes | int | Can be percentage or flatFee |
amount |
yes | float | Percentage or flat amount, depending on type |
minimumNights |
yes | int | |
checkInDateStart |
no | string | |
checkInDateEnd |
no | string | |
numberOfUsesInitial |
yes | int | Can be -1 if number of uses is unlimited |
numberOfUsesUsed |
yes | int | |
validityDateStart |
no | string | |
validityDateEnd |
no | string |
Retrieve a coupons list
Request
curl --request GET \
--url 'https://api.hostaway.com/v1/coupons' \
-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/coupons",
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/coupons",
"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/coupons")
.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/coupons"
querystring = {
}
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/coupons
Response
An array of coupon objects.
Create reservation coupon object
Request
curl --location --request POST 'https://api.hostaway.com/v1/reservationCoupons' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIyODY3MyIsImp0aSI6ImFmMjM3NWZiYjJkZmNiM2Y3YmJhZTk2MTFkY2YxYTc1ZGU5MjllZTQ0YWIxYjcwZmE4NzQzYjNlNGE1M2I5ZDBiNzk2NmVhZDk2MDQ5Nzg3IiwiaWF0IjoxNjY3MzEyMTYwLCJuYmYiOjE2NjczMTIxNjAsImV4cCI6MTczMDQ3MDU2MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjI3MTd9.ArIr26BPlgMDbexpkR-J2Xi_NrLdCXi186YTOYlZHlTMzXrfopeY2T9tzKC6oNNRoedEGKCVrSrDiEnt00fErNETaRiYj2wH7dwoHpmOgEqfajhQImUFlC_uHuMgtyoN1slzX9oj80px156RaZEK6Dnxf1qXsFhWsb0YETQFohc' \
--header 'Content-Type: text/plain' \
--data-raw '{
"couponName": "COUPONNAME",
"listingMapId": 40100,
"startingDate": "2023-01-01",
"endingDate": "2023-12-31"
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.hostaway.com/v1/reservationCoupons',
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 =>'{
"couponName": "COUPONNAME",
"listingMapId": 40100,
"startingDate": "2023-01-01",
"endingDate": "2023-12-31"
}',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIyODY3MyIsImp0aSI6ImFmMjM3NWZiYjJkZmNiM2Y3YmJhZTk2MTFkY2YxYTc1ZGU5MjllZTQ0YWIxYjcwZmE4NzQzYjNlNGE1M2I5ZDBiNzk2NmVhZDk2MDQ5Nzg3IiwiaWF0IjoxNjY3MzEyMTYwLCJuYmYiOjE2NjczMTIxNjAsImV4cCI6MTczMDQ3MDU2MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjI3MTd9.ArIr26BPlgMDbexpkR-J2Xi_NrLdCXi186YTOYlZHlTMzXrfopeY2T9tzKC6oNNRoedEGKCVrSrDiEnt00fErNETaRiYj2wH7dwoHpmOgEqfajhQImUFlC_uHuMgtyoN1slzX9oj80px156RaZEK6Dnxf1qXsFhWsb0YETQFohc',
'Content-Type: text/plain'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIyODY3MyIsImp0aSI6ImFmMjM3NWZiYjJkZmNiM2Y3YmJhZTk2MTFkY2YxYTc1ZGU5MjllZTQ0YWIxYjcwZmE4NzQzYjNlNGE1M2I5ZDBiNzk2NmVhZDk2MDQ5Nzg3IiwiaWF0IjoxNjY3MzEyMTYwLCJuYmYiOjE2NjczMTIxNjAsImV4cCI6MTczMDQ3MDU2MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjI3MTd9.ArIr26BPlgMDbexpkR-J2Xi_NrLdCXi186YTOYlZHlTMzXrfopeY2T9tzKC6oNNRoedEGKCVrSrDiEnt00fErNETaRiYj2wH7dwoHpmOgEqfajhQImUFlC_uHuMgtyoN1slzX9oj80px156RaZEK6Dnxf1qXsFhWsb0YETQFohc");
myHeaders.append("Content-Type", "text/plain");
var raw = "{\n \"couponName\": \"COUPONNAME\",\n \"listingMapId\": 40100,\n \"startingDate\": \"2023-01-01\",\n \"endingDate\": \"2023-12-31\"\n}";
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.hostaway.com/v1/reservationCoupons", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "{\n \"couponName\": \"COUPONNAME\",\n \"listingMapId\": 40100,\n \"startingDate\": \"2023-01-01\",\n \"endingDate\": \"2023-12-31\"\n}");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/reservationCoupons")
.method("POST", body)
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIyODY3MyIsImp0aSI6ImFmMjM3NWZiYjJkZmNiM2Y3YmJhZTk2MTFkY2YxYTc1ZGU5MjllZTQ0YWIxYjcwZmE4NzQzYjNlNGE1M2I5ZDBiNzk2NmVhZDk2MDQ5Nzg3IiwiaWF0IjoxNjY3MzEyMTYwLCJuYmYiOjE2NjczMTIxNjAsImV4cCI6MTczMDQ3MDU2MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjI3MTd9.ArIr26BPlgMDbexpkR-J2Xi_NrLdCXi186YTOYlZHlTMzXrfopeY2T9tzKC6oNNRoedEGKCVrSrDiEnt00fErNETaRiYj2wH7dwoHpmOgEqfajhQImUFlC_uHuMgtyoN1slzX9oj80px156RaZEK6Dnxf1qXsFhWsb0YETQFohc")
.addHeader("Content-Type", "text/plain")
.build();
Response response = client.newCall(request).execute();
import requests
url = "https://api.hostaway.com/v1/reservationCoupons"
payload = {
"couponName": "COUPONNAME",
"listingMapId": 40100,
"startingDate": "2023-01-01",
"endingDate": "2023-12-31"
}
headers = {
'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIyODY3MyIsImp0aSI6ImFmMjM3NWZiYjJkZmNiM2Y3YmJhZTk2MTFkY2YxYTc1ZGU5MjllZTQ0YWIxYjcwZmE4NzQzYjNlNGE1M2I5ZDBiNzk2NmVhZDk2MDQ5Nzg3IiwiaWF0IjoxNjY3MzEyMTYwLCJuYmYiOjE2NjczMTIxNjAsImV4cCI6MTczMDQ3MDU2MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXSwic2VjcmV0SWQiOjI3MTd9.ArIr26BPlgMDbexpkR-J2Xi_NrLdCXi186YTOYlZHlTMzXrfopeY2T9tzKC6oNNRoedEGKCVrSrDiEnt00fErNETaRiYj2wH7dwoHpmOgEqfajhQImUFlC_uHuMgtyoN1slzX9oj80px156RaZEK6Dnxf1qXsFhWsb0YETQFohc',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.text)
POST https://api.hostaway.com/v1/reservationCoupons
Json request body fields
Json Parameter | Required | Type | Description |
---|---|---|---|
couponName |
yes | string | Coupon name |
listingMapId |
yes | int | Listing ID |
startingDate |
yes | string | Arrival date |
endingDate |
no | float | Departure date |
Response
An array with reservationCouponId value which you should use for calculating total price with breakdown. calculate reservation total price and breakdown
Response body fields
Name | Type | Description |
---|---|---|
reservationCouponId |
int | ReservationCoupon ID object |
Reservation coupon object
Represents relation between Coupon and Reservation objects, used
in calculate reservation total price and breakdown as reservationCouponId
parameter
{
"id": 1,
"userId": null,
"listingMapId": 1,
"reservationId": 0,
"couponId": 123,
"couponName": "C234FGGH",
"reservationBasePrice": 500,
"couponPrice": 200
}
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | Reservation Coupon ID, use this to calculate reservation total price and breakdown |
userId |
no | int | User ID |
listingMapId |
no | int | Listing Map ID |
reservationId |
no | int | Reservation ID |
couponId |
yes | string | Coupon ID |
couponName |
yes | string | Coupon name |
reservationBasePrice |
no | float | Reservation base price BEFORE coupon applied |
couponPrice |
no | float | Reservation base price AFTER coupon applied |
Retrieve a reservation coupons list
Request
curl --request GET \
--url 'https://api.hostaway.com/v1/reservationCoupons' \
-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/reservationCoupons",
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/reservationCoupons",
"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/reservationCoupons")
.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/reservationCoupons"
querystring = {
}
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/reservationCoupons
Response
An array of reservation coupon objects.
Webhooks
Get reservation webhooks list
Get reservation webhooks list
Request
curl --request GET \
--url https://api.hostaway.com/v1/webhooks/reservations \
--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/webhooks/reservations",
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/webhooks/reservations");
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/webhooks/reservations")
.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/webhooks/reservations"
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/webhooks/reservations
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. |
Response
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | |
accountId |
yes | int | |
listingMapId |
no | int | |
channelId |
no | int | Please check here for valid channel values: Channels |
isEnabled |
yes | bool | |
url |
yes | string | |
type |
yes | string | |
insertedOn |
yes | string | |
updatedOn |
yes | string | |
listingName |
yes | string | |
login |
no | string | Login for basic auth (if login and password provided we’ll send basic auth header) |
password |
no | string | Password for basic auth |
{
"status": "success",
"result": [
{
"id": 1,
"accountId": 1,
"listingMapId": null,
"channelId": null,
"isEnabled": 1,
"url": "http://httpbin.org/post",
"type": "manual",
"insertedOn": "2021-08-05 10:08:01",
"updatedOn": "2021-08-05 10:08:01",
"listingName": null,
"login": "my_login",
"password": "****"
}
]
}
Retrieve a reservation webhook
Request
curl -X GET \
https://api.hostaway.com/v1/webhooks/reservations/1 \
-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/webhooks/reservations/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(
"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/webhooks/reservations/1");
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/webhooks/reservations/1")
.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/webhooks/reservations/1", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
GET https://api.hostaway.com/v1/webhooks/reservations/{webhookId}
Response
A reservation webhook object.
Create a reservation webhook
Request
curl -X POST \
https://api.hostaway.com/v1/webhooks/reservations \
-H 'Cache-control: no-cache' \
-H 'Content-type: application/json' \
-H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0In0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0IiwiaWF0IjoxNTI4MjgzMjgwLCJuYmYiOjE1MjgyODMyODAsImV4cCI6MTU0MzgzNTI4MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.pzzHM2Qebad--FC8iwWZrFpblWQyiCKiroaEyrXKPWTXug3soe-62HK1bzZVlLQEJa166AtkevdEjXkOhQ6yRMJh3LlINrOKpLOSZKeTyMIydtYCdXJyWqgl3b3llAk8dZyQ8L8J_oyV9sRWMhy7MuIgAyFf1ITdVS2Z94KdyII' \
-d '{
"listingMapId": null,
"channelId": null,
"isEnabled": "1",
"url": "http://httpbin.org/post",
"login": "my_login",
"password": "****"
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/webhooks/reservations",
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\": null,\n \"listingMapId\": null,\n \"isEnabled\": 1,\n \"url\": \"http://httpbin.org/post\",\n \"login\": \"my_login\",\n \"password\": \"****\",\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": null,
"channelId": null,
"isEnabled": "1",
"url": "http://httpbin.org/post",
"login": "my_login",
"password": "****"
});
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/webhooks/reservations");
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\": null,\n \"listingMapId\": null,\n \"isEnabled\": 1,\n \"url\": \"http://httpbin.org/post\", \n \"login\": \"my_login\",\n \"password\": \"****\",\n }");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/webhooks/reservations")
.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 = {
"channelId": None,
"listingMapId": None,
"isEnabled": 1,
"url": "http://httpbin.org/post",
"login": "my_login",
"password": "****"
}
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0In0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0IiwiaWF0IjoxNTI4MjgzMjgwLCJuYmYiOjE1MjgyODMyODAsImV4cCI6MTU0MzgzNTI4MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.pzzHM2Qebad--FC8iwWZrFpblWQyiCKiroaEyrXKPWTXug3soe-62HK1bzZVlLQEJa166AtkevdEjXkOhQ6yRMJh3LlINrOKpLOSZKeTyMIydtYCdXJyWqgl3b3llAk8dZyQ8L8J_oyV9sRWMhy7MuIgAyFf1ITdVS2Z94KdyII",
'Content-type': "application/json",
'Cache-control': "no-cache"
}
payload_json = json.dumps(payload)
conn.request("POST", "/v1/webhooks/reservations", payload_json, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
POST https://api.hostaway.com/v1/webhooks/reservations
A reservation webhook object should be provided in the request body.
Response
The created reservation webhook object or error response.
Update a reservation webhook
Request
curl -X PUT \
https://api.hostaway.com/v1/webhooks/reservations/1 \
-H 'Cache-control: no-cache' \
-H 'Content-type: application/json' \
-H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0In0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0IiwiaWF0IjoxNTI4MjgzMjgwLCJuYmYiOjE1MjgyODMyODAsImV4cCI6MTU0MzgzNTI4MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.pzzHM2Qebad--FC8iwWZrFpblWQyiCKiroaEyrXKPWTXug3soe-62HK1bzZVlLQEJa166AtkevdEjXkOhQ6yRMJh3LlINrOKpLOSZKeTyMIydtYCdXJyWqgl3b3llAk8dZyQ8L8J_oyV9sRWMhy7MuIgAyFf1ITdVS2Z94KdyII' \
-d '{
"listingMapId": null,
"channelId": null,
"isEnabled": 0,
"url": "http://httpbin.org/post",
"login": "my_login",
"password": "****"
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/webhooks/reservations/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 \"channelId\": null,\n \"listingMapId\": null,\n \"isEnabled\": 1,\n \"url\": \"http://httpbin.org/post\",\n \"login\": \"my_login\",\n \"password\": \"****\",\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": null,
"channelId": null,
"isEnabled": "0",
"url": "http://httpbin.org/post",
"login": "my_login",
"password": "****"
});
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/webhooks/reservations/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\": null,\n \"listingMapId\": null,\n \"isEnabled\": 1,\n \"url\": \"http://httpbin.org/post\",\n \"login\": \"my_login\",\n \"password\": \"****\",\n }");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/webhooks/reservations/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 = {
"channelId": None,
"listingMapId": None,
"isEnabled": 1,
"url": "http://httpbin.org/post",
"login": "my_login",
"password": "****"
}
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0In0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0IiwiaWF0IjoxNTI4MjgzMjgwLCJuYmYiOjE1MjgyODMyODAsImV4cCI6MTU0MzgzNTI4MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.pzzHM2Qebad--FC8iwWZrFpblWQyiCKiroaEyrXKPWTXug3soe-62HK1bzZVlLQEJa166AtkevdEjXkOhQ6yRMJh3LlINrOKpLOSZKeTyMIydtYCdXJyWqgl3b3llAk8dZyQ8L8J_oyV9sRWMhy7MuIgAyFf1ITdVS2Z94KdyII",
'Content-type': "application/json",
'Cache-control': "no-cache",
}
payload_json = json.dumps(payload)
conn.request("PUT", "/v1/webhooks/reservations/1", payload_json, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
PUT https://api.hostaway.com/v1/webhooks/reservations/{webhookId}
A reservation webhook object should be provided in the request body.
Response
The updated reservation webhook object or error response.
Delete a reservation webhook
Request
curl -X DELETE \
https://api.hostaway.com/v1/webhooks/reservations/1 \
-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/webhooks/reservations/1",
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/webhooks/reservations/1");
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/webhooks/reservations/1")
.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/webhooks/reservations/1", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
DELETE https://api.hostaway.com/v1/webhooks/reservations/{webhookId}
Response
An empty success response or error response.
Get conversation message webhooks list
Get conversation message webhooks list
Request
curl --request GET \
--url https://api.hostaway.com/v1/webhooks/conversationMessages \
--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/webhooks/conversationMessages",
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/webhooks/conversationMessages");
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/webhooks/conversationMessages")
.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/webhooks/conversationMessages"
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/webhooks/conversationMessages
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. |
Response
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | |
accountId |
yes | int | |
listingMapId |
no | int | |
channelId |
no | int | Please check here for valid channel values: Channels |
isEnabled |
yes | bool | |
url |
yes | string | |
type |
yes | string | |
insertedOn |
yes | string | |
updatedOn |
yes | string | |
listingName |
yes | string | |
login |
no | string | Login for basic auth (if login and password provided we’ll send basic auth header) |
password |
no | string | Password for basic auth |
{
"status": "success",
"result": [
{
"id": 1,
"accountId": 1,
"listingMapId": null,
"channelId": null,
"isEnabled": 1,
"url": "http://httpbin.org/post",
"insertedOn": "2021-08-10 08:29:16",
"updatedOn": "2021-08-10 08:29:16",
"listingName": null,
"login": "my_login",
"password": "****"
}
]
}
Retrieve a conversation message webhook
Request
curl -X GET \
https://api.hostaway.com/v1/webhooks/conversationMessages/1 \
-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/webhooks/conversationMessages/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(
"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/webhooks/conversationMessages/1");
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/webhooks/conversationMessages/1")
.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/webhooks/conversationMessages/1", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
GET https://api.hostaway.com/v1/webhooks/conversationMessages/{webhookId}
Response
A conversation message webhook object.
Create a conversation message webhook
Request
curl -X POST \
https://api.hostaway.com/v1/webhooks/conversationMessages \
-H 'Cache-control: no-cache' \
-H 'Content-type: application/json' \
-H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0In0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0IiwiaWF0IjoxNTI4MjgzMjgwLCJuYmYiOjE1MjgyODMyODAsImV4cCI6MTU0MzgzNTI4MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.pzzHM2Qebad--FC8iwWZrFpblWQyiCKiroaEyrXKPWTXug3soe-62HK1bzZVlLQEJa166AtkevdEjXkOhQ6yRMJh3LlINrOKpLOSZKeTyMIydtYCdXJyWqgl3b3llAk8dZyQ8L8J_oyV9sRWMhy7MuIgAyFf1ITdVS2Z94KdyII' \
-d '{
"listingMapId": null,
"channelId": null,
"isEnabled": "1",
"url": "http://httpbin.org/post",
"login": "my_login",
"password": "****"
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/webhooks/conversationMessages",
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\": null,\n \"listingMapId\": null,\n \"isEnabled\": 1,\n \"url\": \"http://httpbin.org/post\",\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": null,
"channelId": null,
"isEnabled": "1",
"url": "http://httpbin.org/post",
"login": "my_login",
"password": "****",
});
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/webhooks/conversationMessages");
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\": null,\n \"listingMapId\": null,\n \"isEnabled\": 1,\n \"url\": \"http://httpbin.org/post\", \n}");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/webhooks/conversationMessages")
.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 = {
"channelId": None,
"listingMapId": None,
"isEnabled": 1,
"url": "http://httpbin.org/post"
}
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0In0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0IiwiaWF0IjoxNTI4MjgzMjgwLCJuYmYiOjE1MjgyODMyODAsImV4cCI6MTU0MzgzNTI4MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.pzzHM2Qebad--FC8iwWZrFpblWQyiCKiroaEyrXKPWTXug3soe-62HK1bzZVlLQEJa166AtkevdEjXkOhQ6yRMJh3LlINrOKpLOSZKeTyMIydtYCdXJyWqgl3b3llAk8dZyQ8L8J_oyV9sRWMhy7MuIgAyFf1ITdVS2Z94KdyII",
'Content-type': "application/json",
'Cache-control': "no-cache"
}
payload_json = json.dumps(payload)
conn.request("POST", "/v1/webhooks/conversationMessages", payload_json, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
POST https://api.hostaway.com/v1/webhooks/conversationMessages
A conversation message webhook object should be provided in the request body.
Response
The created conversation message webhook object or error response.
Update a conversation message webhook
Request
curl -X PUT \
https://api.hostaway.com/v1/webhooks/conversationMessages/1 \
-H 'Cache-control: no-cache' \
-H 'Content-type: application/json' \
-H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0In0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0IiwiaWF0IjoxNTI4MjgzMjgwLCJuYmYiOjE1MjgyODMyODAsImV4cCI6MTU0MzgzNTI4MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.pzzHM2Qebad--FC8iwWZrFpblWQyiCKiroaEyrXKPWTXug3soe-62HK1bzZVlLQEJa166AtkevdEjXkOhQ6yRMJh3LlINrOKpLOSZKeTyMIydtYCdXJyWqgl3b3llAk8dZyQ8L8J_oyV9sRWMhy7MuIgAyFf1ITdVS2Z94KdyII' \
-d '{
"listingMapId": null,
"channelId": null,
"isEnabled": 0,
"url": "http://httpbin.org/post",
"login": "my_login",
"password": "****"
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/webhooks/conversationMessages/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 \"channelId\": null,\n \"listingMapId\": null,\n \"isEnabled\": 1,\n \"url\": \"http://httpbin.org/post\",\n \"login\": \"my_login\",\n \"password\": \"****\",\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": null,
"channelId": null,
"isEnabled": "0",
"url": "http://httpbin.org/post",
"login": "my_login",
"password": "****"
});
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/webhooks/conversationMessages/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\": null,\n \"listingMapId\": null,\n \"isEnabled\": 1,\n \"url\": \"http://httpbin.org/post\",\n \"login\": \"my_login\",\n \"password\": \"****\",\n }");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/webhooks/conversationMessages/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 = {
"channelId": None,
"listingMapId": None,
"isEnabled": 1,
"url": "http://httpbin.org/post",
"login": "my_login",
"password": "****"
}
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0In0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0IiwiaWF0IjoxNTI4MjgzMjgwLCJuYmYiOjE1MjgyODMyODAsImV4cCI6MTU0MzgzNTI4MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.pzzHM2Qebad--FC8iwWZrFpblWQyiCKiroaEyrXKPWTXug3soe-62HK1bzZVlLQEJa166AtkevdEjXkOhQ6yRMJh3LlINrOKpLOSZKeTyMIydtYCdXJyWqgl3b3llAk8dZyQ8L8J_oyV9sRWMhy7MuIgAyFf1ITdVS2Z94KdyII",
'Content-type': "application/json",
'Cache-control': "no-cache",
}
payload_json = json.dumps(payload)
conn.request("PUT", "/v1/webhooks/conversationMessages/1", payload_json, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
PUT https://api.hostaway.com/v1/webhooks/conversationMessages/{webhookId}
A conversation message webhook object should be provided in the request body.
Response
The updated conversation message webhook object or error response.
Delete a conversation message webhook
Request
curl -X DELETE \
https://api.hostaway.com/v1/webhooks/conversationMessages/1 \
-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/webhooks/conversationMessages/1",
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/webhooks/conversationMessages/1");
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/webhooks/conversationMessages/1")
.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/webhooks/conversationMessages/1", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
DELETE https://api.hostaway.com/v1/webhooks/conversationMessages/{webhookId}
Response
An empty success response or error response.
Unified webhooks
Unified webhooks is the new way to get updates from Hostaway platform. The idea behind unified webhooks is customers and partners can configure one or more endpoints that Hostaway platform will call and provide updates. The unified means that you don’t have to configure different endpoints for different objects or events. You configure it once, and we will call the endpoints as soon as we have an update for you.
The unified webhook system is not trying to “filter” events for you. For example, the old reservation webhook system will trigger reservation update event only if a reservation’s status was modified. So if reservation was modified and later modified again you will not get a webhook about the second one. With unified webhooks we will notify you everytime there is a reservation modification.
This means you have to filter events on your end. There are the cases when you can receive more than one notification about the same update. Make sure your system can handle that properly.
If you have the old (reservation/conversation) and the new (unified) webhooks configured we will trigger both of them for the backward compatibility.
We will be adding more events so if you receive a webhook with event that you don’t support yet just return 200 response. Otherwise, we will retry to deliver the message up to 3 times. Make sure you don’t have high error rate for webhooks. We expect to receive response about successful acknowledgement in 10 seconds. If processing takes more than that try to use queue technics. You can log the request, return 200 and process it later asynchronously.
Right now the system supports the following events:
- reservation created
- reservation updated
- new message received
Unified webhook object
{
"id": 2,
"isEnabled": 1,
"url": "https://api.example.com",
"login": null,
"password": null,
"alertingEmailAddress": null
}
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | Identifier of webhook object |
isEnabled |
yes | int | Is webhook enabled |
url |
yes | int | URL Hostaway will call |
login |
no | string | Basic auth login |
password |
no | string | Basic auth password |
alertingEmailAddress |
no | string | Alert email address |
Get a list of unified webhooks
Request
curl -X GET \
https://api.hostaway.com/v1/webhooks/unifiedWebhooks \
-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/webhooks/unifiedWebhooks",
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/webhooks/unifiedWebhooks");
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/webhooks/unifiedWebhooks")
.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/webhooks/unifiedWebhooks", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
GET https://api.hostaway.com/v1/webhooks/unifiedWebhooks
Response
A list reservation webhook object.
Create a unified webhook
Request
curl -X POST \
https://api.hostaway.com/v1/webhooks/unifiedWebhooks \
-H 'Cache-control: no-cache' \
-H 'Content-type: application/json' \
-H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0In0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0IiwiaWF0IjoxNTI4MjgzMjgwLCJuYmYiOjE1MjgyODMyODAsImV4cCI6MTU0MzgzNTI4MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.pzzHM2Qebad--FC8iwWZrFpblWQyiCKiroaEyrXKPWTXug3soe-62HK1bzZVlLQEJa166AtkevdEjXkOhQ6yRMJh3LlINrOKpLOSZKeTyMIydtYCdXJyWqgl3b3llAk8dZyQ8L8J_oyV9sRWMhy7MuIgAyFf1ITdVS2Z94KdyII' \
-d '{
"isEnabled": 1,
"url": "https://api.example.com",
"login": null,
"password": null,
"alertingEmailAddress": null
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/webhooks/unifiedWebhooks",
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 \"isEnabled\": 1,\n \"url\": \"https://api.example.com\",\n \"login\": null,\n \"password\": null}",
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({
"isEnabled": 1,
"url": "https://api.example.com",
"login": null,
"password": null,
"alertingEmailAddress": 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/webhooks/unifiedWebhooks");
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 \"isEnabled\": 1,\n \"url\": \"https://api.example.com\",\n \"login\": null,\n \"password\": null}");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/webhooks/unifiedWebhooks")
.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
conn = http.client.HTTPSConnection("api.hostaway.com")
payload = "{\n \"isEnabled\": 1,\n \"url\": \"https://api.example.com\",\n \"login\": null,\n \"password\": null}"
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0In0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0IiwiaWF0IjoxNTI4MjgzMjgwLCJuYmYiOjE1MjgyODMyODAsImV4cCI6MTU0MzgzNTI4MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.pzzHM2Qebad--FC8iwWZrFpblWQyiCKiroaEyrXKPWTXug3soe-62HK1bzZVlLQEJa166AtkevdEjXkOhQ6yRMJh3LlINrOKpLOSZKeTyMIydtYCdXJyWqgl3b3llAk8dZyQ8L8J_oyV9sRWMhy7MuIgAyFf1ITdVS2Z94KdyII",
'Content-type': "application/json",
'Cache-control': "no-cache"
}
conn.request("POST", "v1/webhooks/unifiedWebhooks", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
POST https://api.hostaway.com/v1/webhooks/unifiedWebhooks
A unified webhook object should be provided in the request body.
Response
The created unified webhook object or error response.
Read unified webhook
Request
curl -X GET \
https://api.hostaway.com/v1/webhooks/unifiedWebhooks/1 \
-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/webhooks/unifiedWebhooks/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(
"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/webhooks/unifiedWebhooks/1");
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/webhooks/unifiedWebhooks/1")
.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/webhooks/unifiedWebhooks/1", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
GET https://api.hostaway.com/v1/webhooks/unifiedWebhooks/{webhookId}
Response
A reservation webhook object.
Update a unified webhook
Request
curl -X PUT \
https://api.hostaway.com/v1/webhooks/unifiedWebhooks/1 \
-H 'Cache-control: no-cache' \
-H 'Content-type: application/json' \
-H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0In0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0IiwiaWF0IjoxNTI4MjgzMjgwLCJuYmYiOjE1MjgyODMyODAsImV4cCI6MTU0MzgzNTI4MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.pzzHM2Qebad--FC8iwWZrFpblWQyiCKiroaEyrXKPWTXug3soe-62HK1bzZVlLQEJa166AtkevdEjXkOhQ6yRMJh3LlINrOKpLOSZKeTyMIydtYCdXJyWqgl3b3llAk8dZyQ8L8J_oyV9sRWMhy7MuIgAyFf1ITdVS2Z94KdyII' \
-d '{
"isEnabled": 1,
"url": "https://api.example.com",
"login": null,
"password": null,
"alertingEmailAddress": null
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/webhooks/unifiedWebhooks/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 \"isEnabled\": 1,\n \"url\": \"https://api.example.com\",\n \"login\": null,\n \"password\": null}",
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({
"isEnabled": 1,
"url": "https://api.example.com",
"login": null,
"password": null,
"alertingEmailAddress": null
});
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/webhooks/unifiedWebhooks/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 \"isEnabled\": 1,\n \"url\": \"https://api.example.com\",\n \"login\": null,\n \"password\": null}");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/webhooks/unifiedWebhooks")
.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 = {
"isEnabled": 1,
"url": "https://api.example.com",
"login": None,
"password": None
}
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0In0.eyJhdWQiOiIxMDQ5MCIsImp0aSI6ImU3ZDRkNDM1ZDQ0M2UwYTJkYTYxOTE5Yzk0NWY3ODk0YThhYTMzZjM1MjM2ZWEzY2NiZjEwMzJmNTM2YzRiYjVhY2Y3YTkzYTNkN2ZhYjQ0IiwiaWF0IjoxNTI4MjgzMjgwLCJuYmYiOjE1MjgyODMyODAsImV4cCI6MTU0MzgzNTI4MCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.pzzHM2Qebad--FC8iwWZrFpblWQyiCKiroaEyrXKPWTXug3soe-62HK1bzZVlLQEJa166AtkevdEjXkOhQ6yRMJh3LlINrOKpLOSZKeTyMIydtYCdXJyWqgl3b3llAk8dZyQ8L8J_oyV9sRWMhy7MuIgAyFf1ITdVS2Z94KdyII",
'Content-type': "application/json",
'Cache-control': "no-cache",
}
payload_json = json.dumps(payload)
conn.request("PUT", "/v1/webhooks/unifiedWebhooks/1", payload_json, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
PUT https://api.hostaway.com/v1/webhooks/unifiedWebhooks/{unifiedWebhookId}
A unified webhook object should be provided in the request body.
Response
The created unified webhook object or an error response.
Delete unified webhook
Request
curl -X DELETE \
https://api.hostaway.com/v1/webhooks/unifiedWebhooks/1 \
-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/webhooks/unifiedWebhooks/1",
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"
),
));
$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/webhooks/unifiedWebhooks/1");
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/webhooks/unifiedWebhooks/1")
.delete()
.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("DELETE", "/v1/webhooks/unifiedWebhooks/1", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
DELETE https://api.hostaway.com/v1/webhooks/unifiedWebhooks/{webhookId}
Response
An empty success response or error response.
LOS pricing
This LOS API is not activated by default. Contact support@hostaway.com when you are interested in this function.
Limitations
General
Each the channel has their own limitations regarding number of prices and nights etc. When you create los records you should keep in mind with limitations.
We provide key samples from their documentations. If you need more information please check the documentation of the corresponding channel.
Booking.com
There is no way to express a default per night price, due to determining the difference between an unavailable length of stay and a default price length of stay.
All pricing is in the default currency for the hotel. A maximum of two decimal places is supported for each price value.
Maximum number of nights is 32. If you provider more than 32 nights, the remaining nights will be ignored and only the first 32 nights will be considred.
The maximum price you can set for a room is €50000 (or equivalent) per night. If you try to set a higher price, we set the price to zero, which automatically closes the room.
Documentation: https://connect.booking.com/user_guide/site/en-US/csv-los_pricing/
Airbnb
Up to 127 guests per stay
Up to 47 specific price points per record.
Stays may last up to 1125 nights unless the host specifies a maximum duration
Check-in date must be within 18 months (550 days) from the date of submission
A price of zero (0) means that particular combination of (date, number of guests, number of nights) is not available
Any date that is not provided is not available for check-in
To specify a minimum number of nights, set that number of nights as the first number-of-nights entry in the record, e.g: to disallow all stays lasting one or two nights, set the value of the first number of nights to 3
To specify a maximum length of stay, add an entry to the end of the record with a number of nights (maximum + 1) and a price of 0, e.g: to set a maximum of 45 nights, enter a value of 46 at the end of the record with a price of 0
If the last entry is not zero, longer stays than that are permitted and prices will be calculated
Prices for stays that fall between two specified points are calculated.
Each record specifies a check-in date, a number of guests, a number of nights, and a price. Note, prices can only be specified as integer values.
Documentation: not publicly available
Expedia
Length-of-stay pricing allows properties to define rates for lengths of stay from 1 to 28 days, per arrival date.
For each date of a year, properties can send up to 28 rates.
Documentation: https://developers.expediagroup.com/supply/lodging/docs/avail_and_rate_apis/avail_rates/learn/#per-day-length-of-stay-pricing
Vrbo (previously known as HomeAway)
Up to 180 explicit stay rates, which provides one pre-calculated rate for each combination of occupancy level and check-in date. Up to 735 check-in dates (with 10 occupancy levels for each) so that you can calculate extended rates for up to two years. This means you can include up to 7350 los records.
Documentation: not publicly available
LOS Object
For each length of stay record we store LOS
item on our end. After importing new or updating existing LOS
records Hostaway will export LOS records to the channels. The price on the channels may take up to 1 - 15 minutes to be applied. It depends on the channel. Usually it takes a couple of minutes.
After uploading LOS data to Hostaway you can check the work process by getting LOS records of the listing and check flags:
(the value 1 means that los exported, 0 means that not exported):
isSyncedAirbnb
isSyncedBooking
isSyncedExpedia
isSyncedVrbo
Channel error messages can be retrieved using syncErrorMessage
field
{
"id": 73,
"accountId": 1,
"listingMapId": 1,
"checkin": "2022-09-01",
"occupancy": 1,
"bookingcomRateId": "",
"prices": "1,100,2,200,28,2700,29,3100,36,7200",
"isSyncedAirbnb": 0,
"isSyncedBooking": 1,
"isSyncedExpedia": 0,
"isSyncedVrbo": 0,
"syncErrorMessage": null,
"insertedOn": "2021-09-08 18:29:54",
"updatedOn": "2021-09-14 08:37:34"
}
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | Identifier of los object |
accountId |
no | int | Identifier of account object |
listingMapId |
no | int | Identifier of listing object. |
checkin |
yes | date (YYYY-MM-DD) | Check in date |
occupancy |
yes | int | Occupancy of LOS record |
bookingcomRateId |
no | string | bookingcomRateId |
prices |
yes | string | Price table for this checkin in format lenghtOfStay,price,lenghtOfStay,price,lenghtOfStay,price please check format of the row here |
isSyncedAirbnb |
no | int | It’s an internal informational field to show if the item was successfully pushed to Airbnb |
isSyncedBooking |
no | int | It’s an internal informational field to show if the item was successfully pushed to Booking.com |
isSyncedExpedia |
no | int | It’s an internal informational field to show if the item was successfully pushed to Expedia |
isSyncedVrbo |
no | int | It’s an internal informational field to show if the item was successfully pushed to Vrbo |
syncErrorMessage |
no | string | Error messages from the channels if the record was failed to export to the channels |
insertedOn |
no | date (YYYY-MM-DD HH:MM:SS) | the record inserted date in UTC |
updatedOn |
no | date (YYYY-MM-DD HH:MM:SS) | the record updatedOn date in UTC |
Prices field in Los
Object
Rules
Each row must have the check-in date, occupancy, followed by a value set for every possible length of stay. There is no way to express a default per night price, due to determining the difference between an unavailable length of stay and a default price length of stay. All pricing is in the default currency for the hotel. A maximum of two decimal places is supported for each price value. Maximum number of nights is 32. If you provider more than 32 nights, the remaining nights will be ignored and only the first 32 nights will be considred. Only one Hostaway Listing
is allowed in one call i.e separate requests for each Hostaway Listing
have to made.
Occupancy
Occupancy is a way to specify “price per extra person”. If you don’t want to specify it, simply pass occupancy as 1. The channels will apply the price for any number of guests. If you want to charge an extra amount after a specific number of guests you should provide LOS records with an adjusted price.
Availability
- Check-in date must be within 18 months (550 days) from the date of submission
- A price of zero (0) means that particular combination of (date, number of guests, number of nights) is not available
- Any date that is not provided is not available for check-in
- The passed in records will fully replace the existing DB table and export to the channels (Airbnb, Booking, Expedia, Vrbo) again in 1-15 minutes. This time depends on the channels and the overall system load.
- It is allowed to update
Los
object records partially. This means that it is possible to update only one record for one checkin date.
{
"id": 73,
"accountId": 1,
"listingMapId": 1,
"checkin": "2022-09-01",
"occupancy": 1,
"bookingcomRateId": "",
"prices": "1,100.10,2,200.21,3,300.33,4,400.00,5,500.01,6,600.35,7,700.48,8,800.50,22,2200.60",
"isSyncedAirbnb": 0,
"isSyncedBooking": 1,
"isSyncedExpedia": 0,
"isSyncedVrbo": 0,
"insertedOn": "2021-09-08 18:29:54",
"updatedOn": "2021-09-14 08:37:34"
}
A maximum of two decimal places is supported for each price value (we pass decimal values only if the channel support it). It depends on the channels because some channels do not support decimal places and we convert your prices to integer values.
Here’s an example:
nights | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 22 |
---|---|---|---|---|---|---|---|---|---|
price | 100.10 | 200.21 | 300.33 | 400.00 | 500.01 | 600.35 | 700.48 | 800.50 | 2200.60 |
For one guest, the records for this would look like:
1,100.10,2,200.21,3,300.33,4,400.00,5,500.01,6,600.35,7,700.48,8,800.50,22,2200.60
<nights>, <price>, <nights>, <price>, <nights>, <price>....
Create or update LOS records
Request
curl -X POST \
https://api.hostaway.com/v1/los/86156 \
-H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiYjBlNGNmYzljNWRiYWZlNjViNDRhNjVhOTJiM2FiNDQ3ZmQ2ODAxZDg3OTM4NjE2OThkMzlhOTkxZDFkZmY2ZDQ2ODI1YWUzNTcyY2JmMWMiLCJpYXQiOjE2MzEwOTYxMjIsIm5iZiI6MTYzMTA5NjEyMiwiZXhwIjoxNjk0MTY4MTIyLCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6Nn0.CYvYVdgeVZ3IMeexoykRwGozV8k1TVL7AwxYGyGHcU6aYf37bP59PWqsHJPam8l3sSFJWWecJJTFCDIKwrKR6YY_GJcSzrK5_cQJ8x4EsXFrFi2K5mvPz9UlDGSCoFEyDCP5QmCmiULb71_A-Zj-q_KEVshFh1FXu5GIVpyKxlo' \
-H 'Cache-control: no-cache' \
-d '[
{
"checkin": "2021-01-01",
"occupancy": 1,
"prices": "1,100.10,2,200.25,28,2700.00,29,3100.00,36,7200.00"
},
{
"checkin": "2021-01-02",
"occupancy": 1,
"prices": "1,100.10,2,200.25,28,2700.00,29,3100.00,36,7200.00"
},
{
"checkin": "2021-01-03",
"occupancy": 1,
"prices": "1,100.10,2,200.25,28,2700.00,29,3100.00,36,7200.00"
}
]'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/los/86156",
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\t{\n \t\"checkin\": \"2021-01-01\",\n \t\"occupancy\": 1,\n \t\"prices\": \"1,100.10,2,200.25,28,2700.00,29,3100.00,36,7200.00\"\n\t},\n\t{\n \t\"checkin\": \"2021-01-02\",\n \t\"occupancy\": 1,\n \t\"prices\": \"1,100.10,2,200.25,28,2700.00,29,3100.00,36,7200.00\"\n\t}\n]",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiYjBlNGNmYzljNWRiYWZlNjViNDRhNjVhOTJiM2FiNDQ3ZmQ2ODAxZDg3OTM4NjE2OThkMzlhOTkxZDFkZmY2ZDQ2ODI1YWUzNTcyY2JmMWMiLCJpYXQiOjE2MzEwOTYxMjIsIm5iZiI6MTYzMTA5NjEyMiwiZXhwIjoxNjk0MTY4MTIyLCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6Nn0.CYvYVdgeVZ3IMeexoykRwGozV8k1TVL7AwxYGyGHcU6aYf37bP59PWqsHJPam8l3sSFJWWecJJTFCDIKwrKR6YY_GJcSzrK5_cQJ8x4EsXFrFi2K5mvPz9UlDGSCoFEyDCP5QmCmiULb71_A-Zj-q_KEVshFh1FXu5GIVpyKxlo",
"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 = "[\n\t{\n \t\"checkin\": \"2021-01-01\",\n \t\"occupancy\": 1,\n \t\"prices\": \"1,100.10,2,200.25,28,2700.00,29,3100.00,36,7200.00\"\n\t},\n\t{\n \t\"checkin\": \"2021-01-02\",\n \t\"occupancy\": 1,\n \t\"prices\": \"1,100.10,2,200.25,28,2700.00,29,3100.00,36,7200.00\"\n\t}\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/los/86156");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiYjBlNGNmYzljNWRiYWZlNjViNDRhNjVhOTJiM2FiNDQ3ZmQ2ODAxZDg3OTM4NjE2OThkMzlhOTkxZDFkZmY2ZDQ2ODI1YWUzNTcyY2JmMWMiLCJpYXQiOjE2MzEwOTYxMjIsIm5iZiI6MTYzMTA5NjEyMiwiZXhwIjoxNjk0MTY4MTIyLCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6Nn0.CYvYVdgeVZ3IMeexoykRwGozV8k1TVL7AwxYGyGHcU6aYf37bP59PWqsHJPam8l3sSFJWWecJJTFCDIKwrKR6YY_GJcSzrK5_cQJ8x4EsXFrFi2K5mvPz9UlDGSCoFEyDCP5QmCmiULb71_A-Zj-q_KEVshFh1FXu5GIVpyKxlo");
xhr.send(data);
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "[\n\t{\n \t\"checkin\": \"2021-01-01\",\n \t\"occupancy\": 1,\n \t\"prices\": \"1,100.10,2,200.25,28,2700.00,29,3100.00,36,7200.00\"\n\t},\n\t{\n \t\"checkin\": \"2021-01-02\",\n \t\"occupancy\": 1,\n \t\"prices\": \"1,100.10,2,200.25,28,2700.00,29,3100.00,36,7200.00\"\n\t}\n]");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/los/86156")
.post(body)
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiYjBlNGNmYzljNWRiYWZlNjViNDRhNjVhOTJiM2FiNDQ3ZmQ2ODAxZDg3OTM4NjE2OThkMzlhOTkxZDFkZmY2ZDQ2ODI1YWUzNTcyY2JmMWMiLCJpYXQiOjE2MzEwOTYxMjIsIm5iZiI6MTYzMTA5NjEyMiwiZXhwIjoxNjk0MTY4MTIyLCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6Nn0.CYvYVdgeVZ3IMeexoykRwGozV8k1TVL7AwxYGyGHcU6aYf37bP59PWqsHJPam8l3sSFJWWecJJTFCDIKwrKR6YY_GJcSzrK5_cQJ8x4EsXFrFi2K5mvPz9UlDGSCoFEyDCP5QmCmiULb71_A-Zj-q_KEVshFh1FXu5GIVpyKxlo")
.build();
Response response = client.newCall(request).execute();
import http.client
import json
conn = http.client.HTTPSConnection("api.hostaway.com")
payload = [
{
"checkin": "2021-01-01",
"occupancy": 1,
"prices": "1,100.10,2,200.25,28,2700.00,29,3100.00,36,7200.00"
},
{
"checkin": "2021-01-02",
"occupancy": 1,
"prices": "1,100.10,2,200.25,28,2700.00,29,3100.00,36,7200.00"
}
]
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiYjBlNGNmYzljNWRiYWZlNjViNDRhNjVhOTJiM2FiNDQ3ZmQ2ODAxZDg3OTM4NjE2OThkMzlhOTkxZDFkZmY2ZDQ2ODI1YWUzNTcyY2JmMWMiLCJpYXQiOjE2MzEwOTYxMjIsIm5iZiI6MTYzMTA5NjEyMiwiZXhwIjoxNjk0MTY4MTIyLCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6Nn0.CYvYVdgeVZ3IMeexoykRwGozV8k1TVL7AwxYGyGHcU6aYf37bP59PWqsHJPam8l3sSFJWWecJJTFCDIKwrKR6YY_GJcSzrK5_cQJ8x4EsXFrFi2K5mvPz9UlDGSCoFEyDCP5QmCmiULb71_A-Zj-q_KEVshFh1FXu5GIVpyKxlo",
'Cache-control': "no-cache"
}
payload_json = json.dumps(payload)
conn.request("POST", "/v1/los/1", payload_json, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
POST https://api.hostaway.com/v1/los/{listingMapId}
A los object should be provided in the request body (please check examples in the right column on different programming languages).
Response
The created los objects or error response.
Import CSV data
Transmission details
This data is sent as an HTTP POST, where the CSV data is provided as a form value of the name “CSV”. There should be no other form values included in the request. The CSV commas and line feeds must be URL encoded, in that each comma and newline is an escape sequence.
Request
curl -X POST \
https://api.hostaway.com/v1/los/86156 \
-H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiYjBlNGNmYzljNWRiYWZlNjViNDRhNjVhOTJiM2FiNDQ3ZmQ2ODAxZDg3OTM4NjE2OThkMzlhOTkxZDFkZmY2ZDQ2ODI1YWUzNTcyY2JmMWMiLCJpYXQiOjE2MzEwOTYxMjIsIm5iZiI6MTYzMTA5NjEyMiwiZXhwIjoxNjk0MTY4MTIyLCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6Nn0.CYvYVdgeVZ3IMeexoykRwGozV8k1TVL7AwxYGyGHcU6aYf37bP59PWqsHJPam8l3sSFJWWecJJTFCDIKwrKR6YY_GJcSzrK5_cQJ8x4EsXFrFi2K5mvPz9UlDGSCoFEyDCP5QmCmiULb71_A-Zj-q_KEVshFh1FXu5GIVpyKxlo' \
-H 'Cache-control: no-cache' \
-d CSV=2022-09-01%2C1%2C1%2C100%2C2%2C200%2C3%2C300%2C4%2C400%2C5%2C500%2C6%2C600%2C7%2C700%2C8%2C800%0A2022-09-02%2C1%2C1%2C100%2C2%2C200%2C3%2C300%2C4%2C400%2C5%2C500%2C6%2C600%2C7%2C700%2C8%2C800%0A2022-09-03%2C1%2C1%2C100%2C2%2C200%2C3%2C300%2C4%2C400%2C5%2C500%2C6%2C600%2C7%2C700%2C8%2C800%0A2022-09-04%2C1%2C1%2C100%2C2%2C200%2C3%2C300%2C4%2C400%2C5%2C500%2C6%2C600%2C7%2C700%2C8%2C800%0A2022-09-05%2C1%2C1%2C100%2C2%2C200%2C3%2C300%2C4%2C400%2C5%2C500%2C6%2C600%2C7%2C700%2C8%2C800
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/los/86156",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "CSV=2022-09-01%2C1%2C1%2C100%2C2%2C200%2C3%2C300%2C4%2C400%2C5%2C500%2C6%2C600%2C7%2C700%2C8%2C800%0A2022-09-02%2C1%2C1%2C100%2C2%2C200%2C3%2C300%2C4%2C400%2C5%2C500%2C6%2C600%2C7%2C700%2C8%2C800%0A2022-09-03%2C1%2C1%2C100%2C2%2C200%2C3%2C300%2C4%2C400%2C5%2C500%2C6%2C600%2C7%2C700%2C8%2C800%0A2022-09-04%2C1%2C1%2C100%2C2%2C200%2C3%2C300%2C4%2C400%2C5%2C500%2C6%2C600%2C7%2C700%2C8%2C800%0A2022-09-05%2C1%2C1%2C100%2C2%2C200%2C3%2C300%2C4%2C400%2C5%2C500%2C6%2C600%2C7%2C700%2C8%2C800",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiYjBlNGNmYzljNWRiYWZlNjViNDRhNjVhOTJiM2FiNDQ3ZmQ2ODAxZDg3OTM4NjE2OThkMzlhOTkxZDFkZmY2ZDQ2ODI1YWUzNTcyY2JmMWMiLCJpYXQiOjE2MzEwOTYxMjIsIm5iZiI6MTYzMTA5NjEyMiwiZXhwIjoxNjk0MTY4MTIyLCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6Nn0.CYvYVdgeVZ3IMeexoykRwGozV8k1TVL7AwxYGyGHcU6aYf37bP59PWqsHJPam8l3sSFJWWecJJTFCDIKwrKR6YY_GJcSzrK5_cQJ8x4EsXFrFi2K5mvPz9UlDGSCoFEyDCP5QmCmiULb71_A-Zj-q_KEVshFh1FXu5GIVpyKxlo",
"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 = "CSV=2022-09-01%2C1%2C1%2C100%2C2%2C200%2C3%2C300%2C4%2C400%2C5%2C500%2C6%2C600%2C7%2C700%2C8%2C800%0A2022-09-02%2C1%2C1%2C100%2C2%2C200%2C3%2C300%2C4%2C400%2C5%2C500%2C6%2C600%2C7%2C700%2C8%2C800%0A2022-09-03%2C1%2C1%2C100%2C2%2C200%2C3%2C300%2C4%2C400%2C5%2C500%2C6%2C600%2C7%2C700%2C8%2C800%0A2022-09-04%2C1%2C1%2C100%2C2%2C200%2C3%2C300%2C4%2C400%2C5%2C500%2C6%2C600%2C7%2C700%2C8%2C800%0A2022-09-05%2C1%2C1%2C100%2C2%2C200%2C3%2C300%2C4%2C400%2C5%2C500%2C6%2C600%2C7%2C700%2C8%2C800";
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/los/86156");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiYjBlNGNmYzljNWRiYWZlNjViNDRhNjVhOTJiM2FiNDQ3ZmQ2ODAxZDg3OTM4NjE2OThkMzlhOTkxZDFkZmY2ZDQ2ODI1YWUzNTcyY2JmMWMiLCJpYXQiOjE2MzEwOTYxMjIsIm5iZiI6MTYzMTA5NjEyMiwiZXhwIjoxNjk0MTY4MTIyLCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6Nn0.CYvYVdgeVZ3IMeexoykRwGozV8k1TVL7AwxYGyGHcU6aYf37bP59PWqsHJPam8l3sSFJWWecJJTFCDIKwrKR6YY_GJcSzrK5_cQJ8x4EsXFrFi2K5mvPz9UlDGSCoFEyDCP5QmCmiULb71_A-Zj-q_KEVshFh1FXu5GIVpyKxlo");
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, "CSV=2022-09-01%2C1%2C1%2C100%2C2%2C200%2C3%2C300%2C4%2C400%2C5%2C500%2C6%2C600%2C7%2C700%2C8%2C800%0A2022-09-02%2C1%2C1%2C100%2C2%2C200%2C3%2C300%2C4%2C400%2C5%2C500%2C6%2C600%2C7%2C700%2C8%2C800%0A2022-09-03%2C1%2C1%2C100%2C2%2C200%2C3%2C300%2C4%2C400%2C5%2C500%2C6%2C600%2C7%2C700%2C8%2C800%0A2022-09-04%2C1%2C1%2C100%2C2%2C200%2C3%2C300%2C4%2C400%2C5%2C500%2C6%2C600%2C7%2C700%2C8%2C800%0A2022-09-05%2C1%2C1%2C100%2C2%2C200%2C3%2C300%2C4%2C400%2C5%2C500%2C6%2C600%2C7%2C700%2C8%2C800");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/los/86156")
.post(body)
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiYjBlNGNmYzljNWRiYWZlNjViNDRhNjVhOTJiM2FiNDQ3ZmQ2ODAxZDg3OTM4NjE2OThkMzlhOTkxZDFkZmY2ZDQ2ODI1YWUzNTcyY2JmMWMiLCJpYXQiOjE2MzEwOTYxMjIsIm5iZiI6MTYzMTA5NjEyMiwiZXhwIjoxNjk0MTY4MTIyLCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6Nn0.CYvYVdgeVZ3IMeexoykRwGozV8k1TVL7AwxYGyGHcU6aYf37bP59PWqsHJPam8l3sSFJWWecJJTFCDIKwrKR6YY_GJcSzrK5_cQJ8x4EsXFrFi2K5mvPz9UlDGSCoFEyDCP5QmCmiULb71_A-Zj-q_KEVshFh1FXu5GIVpyKxlo")
.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 = "CSV=2022-09-01%2C1%2C1%2C100%2C2%2C200%2C3%2C300%2C4%2C400%2C5%2C500%2C6%2C600%2C7%2C700%2C8%2C800%0A2022-09-02%2C1%2C1%2C100%2C2%2C200%2C3%2C300%2C4%2C400%2C5%2C500%2C6%2C600%2C7%2C700%2C8%2C800%0A2022-09-03%2C1%2C1%2C100%2C2%2C200%2C3%2C300%2C4%2C400%2C5%2C500%2C6%2C600%2C7%2C700%2C8%2C800%0A2022-09-04%2C1%2C1%2C100%2C2%2C200%2C3%2C300%2C4%2C400%2C5%2C500%2C6%2C600%2C7%2C700%2C8%2C800%0A2022-09-05%2C1%2C1%2C100%2C2%2C200%2C3%2C300%2C4%2C400%2C5%2C500%2C6%2C600%2C7%2C700%2C8%2C800"
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiYjBlNGNmYzljNWRiYWZlNjViNDRhNjVhOTJiM2FiNDQ3ZmQ2ODAxZDg3OTM4NjE2OThkMzlhOTkxZDFkZmY2ZDQ2ODI1YWUzNTcyY2JmMWMiLCJpYXQiOjE2MzEwOTYxMjIsIm5iZiI6MTYzMTA5NjEyMiwiZXhwIjoxNjk0MTY4MTIyLCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6Nn0.CYvYVdgeVZ3IMeexoykRwGozV8k1TVL7AwxYGyGHcU6aYf37bP59PWqsHJPam8l3sSFJWWecJJTFCDIKwrKR6YY_GJcSzrK5_cQJ8x4EsXFrFi2K5mvPz9UlDGSCoFEyDCP5QmCmiULb71_A-Zj-q_KEVshFh1FXu5GIVpyKxlo",
'Content-type': "application/x-www-form-urlencoded",
'Cache-control': "no-cache",
}
conn.request("POST", "/v1/los/csv/1", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
POST https://api.hostaway.com/v1/los/csv/{listingMapId}
You must place elements in the following format:
{check-in date},{number of occupants},{nights},{price},{nights},{price},{nights},{price},{nights},{price}
Example of CSV field value
2022-09-01,1,1,100,2,200,3,300,4,400,5,500,6,600,7,700,8,800
2022-09-02,1,1,100,2,200,3,300,4,400,5,500,6,600,7,700,8,800
2022-09-03,1,1,100,2,200,3,300,4,400,5,500,6,600,7,700,8,800
2022-09-04,1,1,100,2,200,3,300,4,400,5,500,6,600,7,700,8,800
2022-09-05,1,1,100,2,200,3,300,4,400,5,500,6,600,7,700,8,800
Response
The created los objects or error response.
{
"status": "success",
"result": [
{
"id": 1,
"accountId": 1,
"listingMapId": 1,
"checkin": "2022-09-01",
"occupancy": 1,
"bookingcomRateId": "",
"prices": "1,100,2,200,3,300,4,400,5,500,6,600,7,700,8,800",
"isSyncedAirbnb": 0,
"isSyncedBooking": 0,
"isSyncedExpedia": 0,
"isSyncedVrbo": 0,
"syncErrorMessage": null,
"insertedOn": "2021-09-29 16:14:33",
"updatedOn": "2021-09-29 16:14:33"
},
{
"id": 2,
"accountId": 1,
"listingMapId": 1,
"checkin": "2022-09-02",
"occupancy": 1,
"bookingcomRateId": "",
"prices": "1,100,2,200,3,300,4,400,5,500,6,600,7,700,8,800",
"isSyncedAirbnb": 0,
"isSyncedBooking": 0,
"isSyncedExpedia": 0,
"isSyncedVrbo": 0,
"syncErrorMessage": null,
"insertedOn": "2021-09-29 16:14:33",
"updatedOn": "2021-09-29 16:14:33"
},
{
"id": 3,
"accountId": 1,
"listingMapId": 1,
"checkin": "2022-09-03",
"occupancy": 1,
"bookingcomRateId": "",
"prices": "1,100,2,200,3,300,4,400,5,500,6,600,7,700,8,800",
"isSyncedAirbnb": 0,
"isSyncedBooking": 0,
"isSyncedExpedia": 0,
"isSyncedVrbo": 0,
"syncErrorMessage": null,
"insertedOn": "2021-09-29 16:14:33",
"updatedOn": "2021-09-29 16:14:33"
},
{
"id": 4,
"accountId": 1,
"listingMapId": 1,
"checkin": "2022-09-04",
"occupancy": 1,
"bookingcomRateId": "",
"prices": "1,100,2,200,3,300,4,400,5,500,6,600,7,700,8,800",
"isSyncedAirbnb": 0,
"isSyncedBooking": 0,
"isSyncedExpedia": 0,
"isSyncedVrbo": 0,
"syncErrorMessage": null,
"insertedOn": "2021-09-29 16:14:33",
"updatedOn": "2021-09-29 16:14:33"
},
{
"id": 5,
"accountId": 1,
"listingMapId": 1,
"checkin": "2022-09-05",
"occupancy": 1,
"bookingcomRateId": "",
"prices": "1,100,2,200,3,300,4,400,5,500,6,600,7,700,8,800",
"isSyncedAirbnb": 0,
"isSyncedBooking": 0,
"isSyncedExpedia": 0,
"isSyncedVrbo": 0,
"syncErrorMessage": null,
"insertedOn": "2021-09-29 16:14:33",
"updatedOn": "2021-09-29 16:14:33"
}
]
}
Get LOS records list
To check the status of the synchronization process with channels, you can use these requests to get LOS objects
These flags are responsible for the status of synchronization with channels. (the value 1 means that los exported, 0 means that not exported):
isSyncedAirbnb
isSyncedBooking
isSyncedExpedia
isSyncedVrbo
Request
curl -X GET \
'https://api.hostaway.com/v1/los?listingMapId=1&checkinStart=2022-09-01&checkInEnd=2022-09-01&isSyncedAirbnb=0&isSyncedBooking=0&isSyncedExpedia=0&isSyncedVrbo=0&occupancy=1' \
-H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiYjBlNGNmYzljNWRiYWZlNjViNDRhNjVhOTJiM2FiNDQ3ZmQ2ODAxZDg3OTM4NjE2OThkMzlhOTkxZDFkZmY2ZDQ2ODI1YWUzNTcyY2JmMWMiLCJpYXQiOjE2MzEwOTYxMjIsIm5iZiI6MTYzMTA5NjEyMiwiZXhwIjoxNjk0MTY4MTIyLCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6Nn0.CYvYVdgeVZ3IMeexoykRwGozV8k1TVL7AwxYGyGHcU6aYf37bP59PWqsHJPam8l3sSFJWWecJJTFCDIKwrKR6YY_GJcSzrK5_cQJ8x4EsXFrFi2K5mvPz9UlDGSCoFEyDCP5QmCmiULb71_A-Zj-q_KEVshFh1FXu5GIVpyKxlo' \
-H 'Cache-control: no-cache'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.hostaway.com/v1/los?listingMapId=1&checkinStart=2022-09-01&checkInEnd=2022-09-01&isSyncedAirbnb=0&isSyncedBooking=0&isSyncedExpedia=0&isSyncedVrbo=0&occupancy=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(
"Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiYjBlNGNmYzljNWRiYWZlNjViNDRhNjVhOTJiM2FiNDQ3ZmQ2ODAxZDg3OTM4NjE2OThkMzlhOTkxZDFkZmY2ZDQ2ODI1YWUzNTcyY2JmMWMiLCJpYXQiOjE2MzEwOTYxMjIsIm5iZiI6MTYzMTA5NjEyMiwiZXhwIjoxNjk0MTY4MTIyLCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6Nn0.CYvYVdgeVZ3IMeexoykRwGozV8k1TVL7AwxYGyGHcU6aYf37bP59PWqsHJPam8l3sSFJWWecJJTFCDIKwrKR6YY_GJcSzrK5_cQJ8x4EsXFrFi2K5mvPz9UlDGSCoFEyDCP5QmCmiULb71_A-Zj-q_KEVshFh1FXu5GIVpyKxlo",
"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/los?listingMapId=1&checkinStart=2022-09-01&checkInEnd=2022-09-01&isSyncedAirbnb=0&isSyncedBooking=0&isSyncedExpedia=0&isSyncedVrbo=0&occupancy=1");
xhr.setRequestHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiYjBlNGNmYzljNWRiYWZlNjViNDRhNjVhOTJiM2FiNDQ3ZmQ2ODAxZDg3OTM4NjE2OThkMzlhOTkxZDFkZmY2ZDQ2ODI1YWUzNTcyY2JmMWMiLCJpYXQiOjE2MzEwOTYxMjIsIm5iZiI6MTYzMTA5NjEyMiwiZXhwIjoxNjk0MTY4MTIyLCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6Nn0.CYvYVdgeVZ3IMeexoykRwGozV8k1TVL7AwxYGyGHcU6aYf37bP59PWqsHJPam8l3sSFJWWecJJTFCDIKwrKR6YY_GJcSzrK5_cQJ8x4EsXFrFi2K5mvPz9UlDGSCoFEyDCP5QmCmiULb71_A-Zj-q_KEVshFh1FXu5GIVpyKxlo");
xhr.setRequestHeader("Cache-control", "no-cache");
xhr.send(data);
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/los?listingMapId=1&checkinStart=2022-09-01&checkInEnd=2022-09-01&isSyncedAirbnb=0&isSyncedBooking=0&isSyncedExpedia=0&isSyncedVrbo=0&occupancy=1")
.get()
.addHeader("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiYjBlNGNmYzljNWRiYWZlNjViNDRhNjVhOTJiM2FiNDQ3ZmQ2ODAxZDg3OTM4NjE2OThkMzlhOTkxZDFkZmY2ZDQ2ODI1YWUzNTcyY2JmMWMiLCJpYXQiOjE2MzEwOTYxMjIsIm5iZiI6MTYzMTA5NjEyMiwiZXhwIjoxNjk0MTY4MTIyLCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6Nn0.CYvYVdgeVZ3IMeexoykRwGozV8k1TVL7AwxYGyGHcU6aYf37bP59PWqsHJPam8l3sSFJWWecJJTFCDIKwrKR6YY_GJcSzrK5_cQJ8x4EsXFrFi2K5mvPz9UlDGSCoFEyDCP5QmCmiULb71_A-Zj-q_KEVshFh1FXu5GIVpyKxlo")
.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 eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIxIiwianRpIjoiYjBlNGNmYzljNWRiYWZlNjViNDRhNjVhOTJiM2FiNDQ3ZmQ2ODAxZDg3OTM4NjE2OThkMzlhOTkxZDFkZmY2ZDQ2ODI1YWUzNTcyY2JmMWMiLCJpYXQiOjE2MzEwOTYxMjIsIm5iZiI6MTYzMTA5NjEyMiwiZXhwIjoxNjk0MTY4MTIyLCJzdWIiOiIiLCJzY29wZXMiOlsiZ2VuZXJhbCJdLCJzZWNyZXRJZCI6Nn0.CYvYVdgeVZ3IMeexoykRwGozV8k1TVL7AwxYGyGHcU6aYf37bP59PWqsHJPam8l3sSFJWWecJJTFCDIKwrKR6YY_GJcSzrK5_cQJ8x4EsXFrFi2K5mvPz9UlDGSCoFEyDCP5QmCmiULb71_A-Zj-q_KEVshFh1FXu5GIVpyKxlo",
'Cache-control': "no-cache"
}
conn.request("GET", "v1,los", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
GET https://api.hostaway.com/v1/los?listingMapId=83546&checkinStart=2022-09-01&checkInEnd=2022-09-01&isSyncedAirbnb=0&isSyncedBooking=0&isSyncedExpedia=0&isSyncedVrbo=0&occupancy=1
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. |
listingMapId |
no | int | Identifier of listing object. |
occupancy |
no | int | Occupancy of LOS record |
checkinStart |
no | date (YYYY-MM-DD) | Check in date start for filtering |
checkInEnd |
no | date (YYYY-MM-DD) | Check in date end for filtering |
isSyncedAirbnb |
no | int | It’s an internal informational field to show if the item was successfully pushed to Airbnb |
isSyncedBooking |
no | int | It’s an internal informational field to show if the item was successfully pushed to Booking.com |
isSyncedExpedia |
no | int | It’s an internal informational field to show if the item was successfully pushed to Expedia |
isSyncedVrbo |
no | int | It’s an internal informational field to show if the item was successfully pushed to Vrbo |
Response
An array of los objects.
Seasonal rules
Seasonal rule object
{
"id": 1,
"title": "Seasonal rule",
"channelId": 2020,
"closedForCheckin": "['Monday']",
"closedForCheckout": "['Friday']",
"color": "Cable TV",
"minNightsSunday": null,
"minNightsMonday": null,
"minNightsTuesday": null,
"minNightsWednesday": null,
"minNightsThursday": null,
"minNightsFriday": null,
"minNightsSaturday": null,
"maxNightsSunday": null,
"maxNightsMonday": null,
"maxNightsTuesday": null,
"maxNightsWednesday": null,
"maxNightsThursday": null,
"maxNightsFriday": null,
"maxNightsSaturday": null,
"minNightsUnspecified": null,
"maxNightsUnspecified": null,
"pricingRules": null
}
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | |
title |
yes | string | |
channelId |
yes | int | Please check here for valid channel values: Channels |
closedForCheckin |
false | string | |
closedForCheckout |
false | string | |
color |
false | int | |
minNightsSunday |
false | int | |
minNightsMonday |
false | int | |
minNightsTuesday |
false | int | |
minNightsWednesday |
false | int | |
minNightsThursday |
false | int | |
minNightsFriday |
false | int | |
minNightsSaturday |
false | int | |
maxNightsSunday |
false | int | |
maxNightsMonday |
false | int | |
maxNightsTuesday |
false | int | |
maxNightsWednesday |
false | int | |
maxNightsThursday |
false | int | |
maxNightsFriday |
false | int | |
maxNightsSaturday |
false | int | |
minNightsUnspecified |
false | int | |
maxNightsUnspecified |
false | int | |
pricingRules |
false | string |
Retrieve seasonal rules
Request
curl -X GET \
https://api.hostaway.com/v1/seasonalRules \
-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/seasonalRules",
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/seasonalRules");
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/seasonalRules")
.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/seasonalRules"
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/seasonalRules
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. |
channelId |
no | int | Please check here for valid channel values: Channels |
Response
An array of seasonal rule objects.
{
"status": "success",
"result": [
{
"id": 1,
"title": "Seasonal rule",
"channelId": 2020,
"closedForCheckin": "['Monday']",
"closedForCheckout": "['Friday']",
"color": "Cable TV",
"minNightsSunday": null,
"minNightsMonday": null,
"minNightsTuesday": null,
"minNightsWednesday": null,
"minNightsThursday": null,
"minNightsFriday": null,
"minNightsSaturday": null,
"maxNightsSunday": null,
"maxNightsMonday": null,
"maxNightsTuesday": null,
"maxNightsWednesday": null,
"maxNightsThursday": null,
"maxNightsFriday": null,
"maxNightsSaturday": null,
"minNightsUnspecified": null,
"maxNightsUnspecified": null,
"pricingRules": null
}
]
}
Retrieve seasonal rules intervals
Request
curl -X GET \
https://api.hostaway.com/v1/seasonalRules/intervals\
-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/seasonalRules/intervals",
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/seasonalRules/intervals");
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/seasonalRules/intervals")
.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/seasonalRules/intervals"
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/seasonalRules/intervals
Query Parameter | Required | Type | Description |
---|---|---|---|
listingMapId |
yes | int | Listing ID |
startDate |
yes | date | |
endDate |
yes | date | |
channelId |
no | int | Please check here for valid channel values: Channels |
Response
An array of intervals.
{
"status": "success",
"result": [
{
"from": "2022-04-01",
"to": "2022-04-22",
"seasonalRule": {
"id": 1,
"title": "Seasonal rule",
"channelId": 2020,
"closedForCheckin": "['Monday']",
"closedForCheckout": "['Friday']",
"color": "Cable TV",
"minNightsSunday": null,
"minNightsMonday": null,
"minNightsTuesday": null,
"minNightsWednesday": null,
"minNightsThursday": null,
"minNightsFriday": null,
"minNightsSaturday": null,
"maxNightsSunday": null,
"maxNightsMonday": null,
"maxNightsTuesday": null,
"maxNightsWednesday": null,
"maxNightsThursday": null,
"maxNightsFriday": null,
"maxNightsSaturday": null,
"minNightsUnspecified": null,
"maxNightsUnspecified": null,
"pricingRules": null
}
}
]
}
Tasks
Task object
{
"id": 1,
"listingMapId": null,
"channelId": null,
"reservationId": null,
"autoTaskId": null,
"assigneeUserId": null,
"canBePickedByGroupId": null,
"supervisorUserId": null,
"createdByUserId": null,
"isUpdatedManually": 0,
"checklistTemplateId": null,
"reservationUnitId": 0,
"title": "Task title",
"description": null,
"canStartFrom": "2023-07-01 00:00:00",
"canStartFromListingTime": "2023-07-01 00:00:00",
"canStartFromEvent": "arrival",
"canStartFromEventDelta": 0,
"shouldEndBy": "2023-07-30 00:00:00",
"shouldEndByListingTime": "2023-07-30 00:00:00",
"shouldEndByEvent": "departure",
"shouldEndByEventDelta": 0,
"status": "pending",
"resolutionNote": null,
"feedbackScore": null,
"feedbackNote": null,
"startedAt": null,
"confirmedAt": null,
"completedAt": null,
"priority": null,
"cost": null,
"costCurrency": null,
"costDescription": null,
"color": null,
"expense": null,
"rank": 0,
"checklistItems": [],
"customFieldValue": [],
"categoriesMap": null
}
Property | Required | Type | Description |
---|---|---|---|
id |
yes | int | |
listingMapId |
no | int | Identifier of listing object |
channelId |
no | int | Identifier of the channel object. Please check here for valid channel values: Channels |
reservationId |
no | int | Identifier of reservation object |
autoTaskId |
no | int | Identifier of auto task object |
assigneeUserId |
no | int | Identifier of assignee user object |
canBePickedByGroupId |
no | int | Identifier of group object |
supervisorUserId |
no | int | Identifier of supervisor user object |
createdByUserId |
no | int | Identifier of user object |
isUpdatedManually |
no | int | Whether task is updated manually from dashboard |
checklistTemplateId |
no | int | Identifier of checklist template object |
reservationUnitId |
no | int | Identifier of reservation unit object |
title |
yes | string | Title |
description |
no | string | Description |
canStartFrom |
no | date | Start time |
canStartFromListingTime |
no | date | Start time in listing time zone |
canStartFromEvent |
no | string | If task is created from auto-task by event (arrival , departure , previousArrival , previousDeparture ) |
canStartFromEventDelta |
no | int | Event delta in hours |
shouldEndBy |
no | date | End time |
shouldEndByListingTime |
no | date | End time in listing time zone |
shouldEndByEvent |
no | string | If task is created from auto-task by event (arrival , departure , previousArrival , previousDeparture ) |
shouldEndByEventDelta |
no | int | Event delta in hours |
status |
no | string | Can be one of the following: pending , confirmed , inProgress , completed , cancelled |
resolutionNote |
no | string | Resolution note |
feedbackScore |
no | int | Feedback score |
feedbackNote |
no | string | Feedback note |
startedAt |
no | date | Time when task was started (inProgress status) |
confirmedAt |
no | date | Time when task was confirmed |
priority |
no | int | Priority |
cost |
no | float | Cost |
costCurrency |
no | string | Cost currency |
costDescription |
no | string | Cost description |
color |
no | string | Color in hex format (#000000) |
expense |
no | array | Array of expenses (if any) |
rank |
no | int | Rank |
checklistItems |
no | array | Checklist items (if any) |
customFieldValue |
no | array | Custom fields |
categoriesMap |
no | array | 1 - cleaning, 2 - maintenance, 3 - check-in, 4 - check-out, 5 - back office, 6 - other |
Retrieve tasks
Request
curl -X GET \
https://api.hostaway.com/v1/tasks \
-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/tasks",
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/tasks");
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/tasks")
.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/tasks"
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/tasks
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. |
channelId |
no | int | Please check here for valid channel values: Channels |
canStartFromEvent |
no | string | |
shouldEndByEvent |
no | string | |
reservationId |
no | int | |
match |
no | string | |
status |
no | string | |
canStartFromStart |
no | date | |
canStartFromEnd |
no | date | |
shouldEndByStart |
no | date | |
shouldEndByEnd |
no | date |
Response
An array of task objects.
{
"status": "success",
"result": [
{
"id": 1,
"listingMapId": null,
"channelId": null,
"reservationId": null,
"autoTaskId": null,
"assigneeUserId": null,
"canBePickedByGroupId": null,
"supervisorUserId": null,
"createdByUserId": null,
"isUpdatedManually": 0,
"checklistTemplateId": null,
"reservationUnitId": 0,
"title": "Task title",
"description": null,
"canStartFrom": "2023-07-01 00:00:00",
"canStartFromListingTime": "2023-07-01 00:00:00",
"canStartFromEvent": "arrival",
"canStartFromEventDelta": 0,
"shouldEndBy": "2023-07-30 00:00:00",
"shouldEndByListingTime": "2023-07-30 00:00:00",
"shouldEndByEvent": "departure",
"shouldEndByEventDelta": 0,
"status": "pending",
"resolutionNote": null,
"feedbackScore": null,
"feedbackNote": null,
"startedAt": null,
"confirmedAt": null,
"completedAt": null,
"priority": null,
"cost": null,
"costCurrency": null,
"costDescription": null,
"color": null,
"expense": null,
"rank": 0,
"checklistItems": [],
"customFieldValue": [],
"categoriesMap": null
}
]
}
Retrieve task
Request
curl -X GET \
https://api.hostaway.com/v1/tasks/{taskId} \
-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/tasks/{taskId}",
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/tasks/{taskId}");
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/tasks/{taskId}")
.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/tasks/{taskId}"
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/tasks/{taskId}
Response
A task object.
Create task
Create task
Request
curl --location --request POST 'https://api.hostaway.com/v1/tasks' \
--header 'jwt;' \
--header 'Content-type: application/json' \
--data-raw '{
"title": "New task",
"categoriesMap": [1]
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.hostaway.com/v1/tasks',
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 =>'{
"title": "New task",
"categoriesMap": [1]
}',
CURLOPT_HTTPHEADER => array(
'jwt: ',
'Content-type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var data = JSON.stringify({
"title": "New task",
"categoriesMap": [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/tasks");
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, "{\"title\": \"New task\",\"categoriesMap\": [1]}");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/tasks")
.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", undefined)
payload = json.dumps({
"title": "New task",
"categoriesMap": [1]
})
headers = {
'jwt': '',
'Content-type': 'application/json'
}
conn.request("POST", "/v1/tasks", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
POST https://api.hostaway.com/v1/tasks
A task object should be provided in the request body.
Response
Created task object
{
"status": "success",
"result": {
"id": 1,
"listingMapId": null,
"channelId": null,
"reservationId": null,
"autoTaskId": null,
"assigneeUserId": null,
"canBePickedByGroupId": null,
"supervisorUserId": null,
"createdByUserId": null,
"isUpdatedManually": 0,
"checklistTemplateId": null,
"reservationUnitId": 0,
"title": "Task title",
"description": null,
"canStartFrom": "2023-07-01 00:00:00",
"canStartFromListingTime": "2023-07-01 00:00:00",
"canStartFromEvent": "arrival",
"canStartFromEventDelta": 0,
"shouldEndBy": "2023-07-30 00:00:00",
"shouldEndByListingTime": "2023-07-30 00:00:00",
"shouldEndByEvent": "departure",
"shouldEndByEventDelta": 0,
"status": "pending",
"resolutionNote": null,
"feedbackScore": null,
"feedbackNote": null,
"startedAt": null,
"confirmedAt": null,
"completedAt": null,
"priority": null,
"cost": null,
"costCurrency": null,
"costDescription": null,
"color": null,
"expense": null,
"rank": 0,
"checklistItems": [],
"customFieldValue": [],
"categoriesMap": null
}
}
Update task
Update task
Request
curl --location --request PUT 'https://api.hostaway.com/v1/tasks/{taskId}' \
--header 'jwt;' \
--header 'Content-type: application/json' \
--data-raw '{
"title": "New task",
"categoriesMap": [1]
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.hostaway.com/v1/tasks/{taskId}',
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 =>'{
"title": "New task",
"categoriesMap": [1]
}',
CURLOPT_HTTPHEADER => array(
'jwt: ',
'Content-type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var data = JSON.stringify({
"title": "New task",
"categoriesMap": [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/tasks/{taskId}");
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, "{\"title\": \"New task\",\"categoriesMap\": [1]}");
Request request = new Request.Builder()
.url("https://api.hostaway.com/v1/tasks/{taskId}")
.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", undefined)
payload = json.dumps({
"title": "New task",
"categoriesMap": [1]
})
headers = {
'jwt': '',
'Content-type': 'application/json'
}
conn.request("PUT", "/v1/tasks/{taskId}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
PUT https://api.hostaway.com/v1/tasks/{taskId}
A task object should be provided in the request body.
Response
Updated task object
{
"status": "success",
"result": {
"id": 1,
"listingMapId": null,
"channelId": null,
"reservationId": null,
"autoTaskId": null,
"assigneeUserId": null,
"canBePickedByGroupId": null,
"supervisorUserId": null,
"createdByUserId": null,
"isUpdatedManually": 0,
"checklistTemplateId": null,
"reservationUnitId": 0,
"title": "Task title",
"description": null,
"canStartFrom": "2023-07-01 00:00:00",
"canStartFromListingTime": "2023-07-01 00:00:00",
"canStartFromEvent": "arrival",
"canStartFromEventDelta": 0,
"shouldEndBy": "2023-07-30 00:00:00",
"shouldEndByListingTime": "2023-07-30 00:00:00",
"shouldEndByEvent": "departure",
"shouldEndByEventDelta": 0,
"status": "pending",
"resolutionNote": null,
"feedbackScore": null,
"feedbackNote": null,
"startedAt": null,
"confirmedAt": null,
"completedAt": null,
"priority": null,
"cost": null,
"costCurrency": null,
"costDescription": null,
"color": null,
"expense": null,
"rank": 0,
"checklistItems": [],
"customFieldValue": [],
"categoriesMap": null
}
}
Delete task
Request
curl -X DELETE \
https://api.hostaway.com/v1/tasks/{taskId} \
-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/tasks/{taskId}",
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",
"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("DELETE", "https://api.hostaway.com/v1/tasks/{taskId}");
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/tasks/{taskId}")
.DELETE()
.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/tasks/{taskId}"
headers = {
'Authorization': "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIn0.eyJhdWQiOiIxMDQ1MCIsImp0aSI6IjljOGYzN2NjMzAzNWI5M2Q5MzJiMGZjZGYwOGYzNjc2NDA5MWNjMTI3MTY0ZWZhOGIzMTk1ZjRiOTU4YjNkZjYxZWNlZjVmOGJhMzkxZGYyIiwiaWF0IjoxNTI2NjQ0MzE0LCJuYmYiOjE1MjY2NDQzMTQsImV4cCI6MTU0MjE5NjMxNCwic3ViIjoiIiwic2NvcGVzIjpbImdlbmVyYWwiXX0.hVv1ybL5Ifl6VatEBXxJz4sNa7f2RPGlSGCK5YNiSDNBeW9FjgfzbKFW4GaKGXNBYk2b7TpxhwF_3RbBRE0Y817TIiwUNZEhMCz5do4Kp9ZX6nrHlvJiqdLYZXhaHUlU8vq-80a0xTmgVnjRH20JeA0q9t8gxcfYJUQfQMOb59Q",
'Cache-control': "no-cache",
}
response = requests.request("DELETE", url, headers=headers)
print(response.text)
DELETE https://api.hostaway.com/v1/tasks/{taskId}