Hotel B2B Distribution APIs
Introduction
This B2B API provides a set of endpoints for partners to retrieve static property data, retrieve available property rates for given search criteria and complete the booking flow.
Workflow
For Importing Static Data
- Fetch Countries: Start by obtaining a comprehensive list of all available countries.
- Fetch Cities: Use the country code to fetch all cities associated with the selected country.
- Fetch Hotels: With the city code, retrieve a list of all hotels located within the selected city.
- Fetch Hotel Rooms: With the hotel ID, retrieve a list of all hotel rooms for a particular hotel.
- Fetch Master Lists: Fetch a master list of Property Types, Brands, Chains, Amenities, and Room Amenities for mapping IDs to respective names, as needed.
For Integrating as Metasearch Partners
- Fetch Cheapest Rates: When customer make a search at partners' site, can call this API to get availability and cheapest price for customer.
- Fetch All Rates: Optionally in this workflow, When customer interested to a hotel and clicked into it, can call this API to get more available options for customer.
- Redirect customer to Wego's site when they clicked on any Wego's rates on partners' site to resume the flow..
For Integrating as OTA partners:
- Fetch Cheapest Rates: When customer make a search at partners' site, can call this API to get availability and cheapest price for customer.
- Fetch All Rates: When customer interested to a hotel and clicked into it, can call this API to get more available options for customer.
- Price-check: When customer decided to book a certain rate, call this API to ensure the rate is still bookable, else ask customer to choose another room rates.
- Book: When customer confirm to book, call this API to lock the deal. And please note cancellation charges might applied accordingly.
- Cancel: Post booking flow, if customer wish to cancel the bookings, please call this API.
- Retrieve: This API helps partners to get the latest bookings details and status. This is useful when the API request timed-out and partners dint get the updated details.
FAQ
- Caching of the pricing and availability.
Pricing and availability could be change constantly, we recommend not to cache more than 30 minutes. If caching will be implemented at partners side, we recommend not to cache by locale and currency too.
- Timeout for API calls.
For benefit of user experience, we recommend to set timeout 30 seconds for
fetch cheapest rates
, fetch all rates
and price-check
method, and 60
seconds for book
, cancel
, and retrieve
method.
- How to construct landing url if the customer clicks through.
The landing url will be provided in the API response, and partners could append additional params for customer's preferred currency and language in below format:-
- for language, append
&ulang=(USER-LANGUAGE)
. - for currency, append
&wego_currency=(USER-CURRENCY)
.
- Currency supported at Wego site.
Below is the currency supported at Wego:-
USD, AED, AOA, ARS, AUD, AZN, BDT, BHD, BRL, BWP, CAD, CDF, CHF, CLP, CNY, COP, DZD, EGP, ETB, EUR, GBP, GHS, HKD, IDR, INR, IQD, IRR, JOD, JPY, KES, KRW, KWD, LBP, LKR, LYD, MAD, MOP, MUR, MXN, MYR, MZN, NAD, NGN, NZD, OMR, PHP, PKR, PLN, QAR, RUB, RWF, SAR, SDG, SEK, SGD, SYP, THB, TND, TRY, TWD, TZS, UGX, VND, XAF, XOF, ZAR, ZMW
- Locale supported at Wego site.
Below is the locale supported at Wego site:-
ar, de, en, es, fa, fr, id, it, ja, ko, ms, nl, pl, pt, ru, sv, th, tr, vi, zh-cn, zh-hk, zh-tw
- Search criteria Wego could support.
There is some search Wego wouldn't support, please see below search restriction:-
- maximum night allowed: 60
- max days in advance: 365
- max rooms allowed per search: 8 rooms
- max adults and children per room: 9
- For partners to understand customers' behaviour on Wego's site.
Wego's site support Pixel tracking for attribution, capable of tracking pre-conversion and conversion event, partner could append additional params into landing url for tracking purpose.
Error Handling
If the API encounters an error while processing your request, an HTTP response code will be returned, along with an error code and message in the API response.
HTTP Status Codes
Status Code | Status Meaning | Status Definition |
---|---|---|
400 | Bad Request | The request could not be understood by the system, malformed syntax. |
401 | Unauthorized | If ApiKey not found or IP address restrictions violated. |
403 | Forbidden | If the authenticated client is not allowed to access the resource. |
429 | Too Many Requests | If the client has sent too many requests in a period of time. |
500 | Internal Server Error | Unrecoverable problem in the processing of the API call. |
503 | Service Unavailable | Due to maintenance is that either planned or ad-hoc, service is temporary unavailable. |
Error Codes
Code | Message |
---|---|
10001 | Invalid client_id or client_secret or grant_type or scope |
10002 | Application expired |
10011 | Authorization required |
10012 | Authorization required |
10013 | Authorization required |
10014 | Authorization error |
10015 | Authorization error |
10016 | Authorization error |
10017 | Authorization failed |
10021 | Rate limit exceeded |
10022 | Rate limit exceeded |
40001 | Invalid headers |
40002 | Invalid query |
40003 | Invalid body |
40004 | Invalid params |
4000 | Session invalid or expired |
4005 | Prebook id invalid or expired |
40105 | Invalid rate id |
40401 | Path not found |
40402 | Rate expired |
40403 | Booking not found |
5004 | Room sold out |
50301 | Service unavailable |
50004 | Cancel booking error |
50005 | Booking is already cancelled |
40101 | Unauthorized |
40301 | Forbidden |
9999 | Unexpected error |
Authentication
- OAuth 2.0: OAuth2
Security Scheme Type: | oauth2 |
---|---|
OAuth Flow (clientCredentials): | Token URL: https://api.wegostaging.com/oauth/token Scopes:
|