Skip to main content
Version: 1.0.0

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

  1. Fetch Countries: Start by obtaining a comprehensive list of all available countries.
  2. Fetch Cities: Use the country code to fetch all cities associated with the selected country.
  3. Fetch Hotels: With the city code, retrieve a list of all hotels located within the selected city.
  4. Fetch Hotel Rooms: With the hotel ID, retrieve a list of all hotel rooms for a particular hotel.
  5. 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

  1. Fetch Cheapest Rates: When customer make a search at partners' site, can call this API to get availability and cheapest price for customer.
  2. 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.
  3. 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:

  1. Fetch Cheapest Rates: When customer make a search at partners' site, can call this API to get availability and cheapest price for customer.
  2. Fetch All Rates: When customer interested to a hotel and clicked into it, can call this API to get more available options for customer.
  3. 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.
  4. Book: When customer confirm to book, call this API to lock the deal. And please note cancellation charges might applied accordingly.
  5. Cancel: Post booking flow, if customer wish to cancel the bookings, please call this API.
  6. 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

  1. 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.

  1. 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.

  1. 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).
  1. 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

  1. 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

  1. 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
  1. 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 CodeStatus MeaningStatus Definition
400Bad RequestThe request could not be understood by the system, malformed syntax.
401UnauthorizedIf ApiKey not found or IP address restrictions violated.
403ForbiddenIf the authenticated client is not allowed to access the resource.
429Too Many RequestsIf the client has sent too many requests in a period of time.
500Internal Server ErrorUnrecoverable problem in the processing of the API call.
503Service UnavailableDue to maintenance is that either planned or ad-hoc, service is temporary unavailable.

Error Codes

CodeMessage
10001Invalid client_id or client_secret or grant_type or scope
10002Application expired
10011Authorization required
10012Authorization required
10013Authorization required
10014Authorization error
10015Authorization error
10016Authorization error
10017Authorization failed
10021Rate limit exceeded
10022Rate limit exceeded
40001Invalid headers
40002Invalid query
40003Invalid body
40004Invalid params
4000Session invalid or expired
4005Prebook id invalid or expired
40105Invalid rate id
40401Path not found
40402Rate expired
40403Booking not found
5004Room sold out
50301Service unavailable
50004Cancel booking error
50005Booking is already cancelled
40101Unauthorized
40301Forbidden
9999Unexpected error

Authentication

Security Scheme Type:

oauth2

OAuth Flow (clientCredentials):

Token URL: https://api.wegostaging.com/oauth/token

Scopes:

  • hotel.content: Grant retrieve hotel content

  • hotel.search: Grant search hotel rates

  • hotel.booking: Grant book hotel rates