REST API Method: rates-and-availability/update
Updates the rates and/or availability of a listing and/or its units (types of guest rooms, units, and plans). Requires the parameters specified below. Request must be a POST. This method is very similar to Booking.com's "Pricing and Availability" method.
URL
http://api.bookingmarkets.com/rates-and-availability/update?api_key=your_key
Formats:
- xml
- json
HTTP Method(s):
- POST
- GET (maximum of 2048 characters)
Requires Authentication:
true
API rate limited:
false
Parameters:
- listing token="XXX". Required. Identifies the listing for which the rates and/or availability are being updated. To obtain one, go to any of the sites in the BookingMarkets Network and then go to Host > Availability and Rates. You must be a manager of the listing, and the listing should be set to update its rates automatically. For testing purposes you can use the listingtoken czY2YnRPa0JFOE9QTXJpVU9ma0dWQT09
- unittype id="XXX" or room id="XXX". Required. Multiple occurrences possible if the listing has multiple types of guest rooms, units, or bed plans. Identifies the unit of the listing for which the rates and/or availability are being updated. To obtain the unit type ids, go to any of the sites of the BookingMarkets Network and then go to Host > Availability and Rates. You must be a manager of the listing, and the listing should be set to update its rates automatically. For testing purposes you can use the unitype ids 24944, 24945, and 24946.
- date value="YYYY-MM-DD" or date value1="YYYY-MM-DD" value2=... or date from="YYYY-MM-DD" to="YYYY-MM-DD. Required. Multiple occurrences possible. The date(s) which you are updating. The above formats may be mixed. For example: date value="..." from="..." to="...".
- baserate or price. Optional. The format should be XXX or XXX.XX. The price (also know as base rate) for the given type of unit for the given date. The currency used for pricing is always the same for the listing, and it can be set by visiting one of the sites of the BookingMarkets Network and then go to Host > Availability and Rates. You must be a manager of the listing, and the listing should be set to update its rates automatically.
- closed. Optional. If set to 1, this type of unit will be closed (also known as "sold out") for the given date. If set to 0, this type of unit will be opened (also known as "available") . All other information (price, minimumstay, unitstosell, etc.) is preserved.
- minimumstay. Optional. Should be >= 1 and <= 28. The minimum number of nights that travellers should book when booking a stay that includes the night of the given date.
- unitsavailable. Optional. Sets the amount of units of this type that can still be sold by the sites of the BookingMarkets Network.
- date value="YYYY-MM-DD" or date value1="YYYY-MM-DD" value2=... or date from="YYYY-MM-DD" to="YYYY-MM-DD. Required. Multiple occurrences possible. The date(s) which you are updating. The above formats may be mixed. For example: date value="..." from="..." to="...".
Response
- ok. The request was successfully processed.
- timestamp. Timestamp of the transaction in UnixTime (GMT).
- testlink. Encrypted link where the rates of the listing can be tested.
- error. The request wasn't successfully processed.
- errorcode. Error code.
- errormessage. Error message explaining the issue.
Examples
Request (XML):
http://api.bookingmarkets.com/rates-and-availability/update?api_key=your_key&xml=
<request>
<listing token="czY2YnRPa0JFOE9QTXJpVU9ma0dWQT09"/>
<unittype id="24944">
<date value="2020-10-10">
<baserate>45.50</baserate>
<closed>0</closed>
<unitsavailable>2</unitsavailable>
</date>
</unittype>
<unittype id="24945">
<date value1="2020-10-11" value2="2020-10-13">
<baserate>99</baserate>
<minimumstay>2</minimumstay>
</date>
<date from="2020-10-15" to="2020-10-20">
<closed>1</closed>
</date>
</unittype>
<unittype id="24946">
<date value="2020-10-10">
<unitsavailable>0</unitsavailable>
<closed>1</closed>
</date>
</unittype>
</request>
Successful Response:
<?xml version="1.0" encoding="UTF-8"?>
<ok>
<timestamp>1287186106</timestamp>
<testlink testurl="http://cal.am/KzB6YTMxNFZTb0lESnhMUjVIeUFMQT09">http://cal.am/KzB6YTMxNFZTb0lESnhMUjVIeUFMQT09</testlink>
</ok>
Failed Response:
<?xml version="1.0" encoding="UTF-8"?>
<error>
<errorcode>0400.0300.0300a</errorcode>
<errormessage>The format for one of the elements "minimumstay" is not correct: unittypeid: 3443 - date: 2010-10-10 - minimumstay: 3. Please check the documentation for the correct format.</errormessage>
</error>
Sandbox
You can test your application using the following test listing:
- Public listing: BookingMarkets APIs Test Listing in LetMeGo.
- Listing token: czY2YnRPa0JFOE9QTXJpVU9ma0dWQT09
- Unit type ids:
- 24944
- 24944
- 24944
- URL to test rates and availability: http://cal.am/KzB6YTMxNFZTb0lESnhMUjVIeUFMQT09
Have questions or need help? We are eager to help. Contact us!
0 Comments
Please sign in to post a comment.