Last updated

codegroups (B.XML)

This call is intended to be used by the Connectivity Partner in order to retrieve an XML list of all codes (or codes from specified 'codegroups') that are used in Booking.com APIs. Since applicable information for each 'codegroup' varies, Connectivity Partners should be flexible to accept the addition of new elements/attributes and changes as the data may be updated over time.

Step 1: Request for a list of API codes

POST https://supply-xml.booking.com/hotels/xml/codegroups

Request — HTTP Message Body Model (All 'codegroups')

<?xml version="1.0" encoding="UTF-8"?>
<request>
  <username>providermachinelogin</username>
  <password>********</password>
</request>

Request — HTTP Message Body Model (Selected 'codegroups' only)

<?xml version="1.0" encoding="UTF-8"?>
<request>
  <username>providermachinelogin</username>
  <password>********</password>
  <minified>yes</minified>
  <codegroups>
    <codegroup>BCL</codegroup>
    <codegroup>UIT</codegroup>
  </codegroups>
</request>

Request — Node Overview

Node NameNest LevelParent NodeValue RangeData TypeNode Multiplicity
codegroupL2codegroups[see below]string0..X
codegroupsL1request----0..1
minifiedL1request[see below]boolean0..1
passwordL1request--string1
requestL0NULL(root)----1
usernameL1request--string1
  • The request body consists of a mandatory request root element. This is the parent node to the required username and password nodes, as well as the optional minified and codegroups nodes.

  • The mandatory child node username contains the authorized machine account login of the Connectivity Partner.

  • The mandatory child node password contains the authorized machine account password of the Connectivity Partner.

  • The optional child node minified accepts boolean values which may be represented as: '1', 'yes', or 'true' as valid input for 'True' -- and: '0', 'no', or 'false' as valid input for 'False'. By default 'minified' output is enabled ('True') and no XML structural whitespace characters are returned.

  • The optional child node codegroups contains the optional child node(s) of codegroup.

  • The optional grandchild node codegroup accepts one valid, specified code for a code group. If it is an OTA code group implemented on Booking.com, this would be the corresponding OTA 2014B-1.0 code for the group. At the time of writing, accepted OTA codegroup codes are: 'ACC', 'CHG', 'CUI', 'ERR', 'FTT', 'HAC', 'ITT', 'MPT', 'OTC', 'PCT', 'PTT', 'RMA', 'TRP', and 'UIT'. Please note that these codegroups can contain extended Booking.com specific codes, usually beginning at code 5000+. Accepted Booking.com specific code groups generally start with the letters 'BC'. At the time of writing, accepted Booking.com codegroup codes are: 'BCBT', 'BCCP', 'BCIO', 'BCJT', 'BCL', 'BCPT', and 'BCRT'. The multiplicity of this node can be up to the number of valid codegroup codes (21 at the time of writing).

cURL model

curl -H "Host: providerhostname" \
-H "Connection: keep-alive" \
-H "Content-Length: XXX" \
-H "Cache-Control: no-cache" \
-H "Origin: XXXXXXXXXXXXX" \
-H "User-Agent: Provider User-Agent name" \
-H "Content-Type: text/xml;charset=UTF-8" \
-H "Accept: */*" \
-H "Accept-Encoding: gzip,deflate" \
--http1.1 \
-d @messagebody.xml -X POST \
'https://supply-xml.booking.com/hotels/xml/codegroups'

Step 2: Response of a list of codes per code group

TypeHTTP MethodMessage SenderMessage Receiver
ResponsePOSTBooking.comConnectivity Partner

Response — HTTP Message Body Sample

<codegroups>
  <codegroup>
    <codegroup_description>Language Codes</codegroup_description>
    <codegroup_name>BCL</codegroup_name>
    <codes>
      <code>
        <description>Arabic</description>
        <origin>Booking</origin>
        <value>ar</value>
      </code>
      <code>
        <description>Azerbaijani</description>
        <origin>Booking</origin>
        <value>az</value>
      </code>
      <code>
        <description>Bulgarian</description>
        <origin>Booking</origin>
        <value>bg</value>
      </code>
       . . .
    </codes>
  </codegroup>
  <codegroup>
    <codegroup_description>Unique ID Codes</codegroup_description>
    <codegroup_name>UIT</codegroup_name>
    <codes>
      <code>
        <description>Hotel</description>
        <origin>OTA</origin>
        <value>10</value>
      </code>
    </codes>
  </codegroup>
</codegroups>
<!-- RUID: [XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX] -->

Response — Node Overview

Node NameNest LevelParent NodeValue RangeData TypeNode Multiplicity
codegroupL1codegroups--string0..X
codegroupsL0NULL(root)----1
codegroup_createdL2codegroup[see below]string0..1
codegroup_descriptionL2codegroup--string1
codegroup_nameL2codegroup--string1
codeL3codes[see below]--1..X
codesL2codegroup----1
createdL4code[see below]string0..1
descriptionL4code--string0..1
notesL4code--string0..1
originL4code--string1
valueL4code--string[see below]
XXXXXXL4code[see below]string0..1
  • The response body consists of a codegroups root element. This is the parent node to the codegroup node, whose multiplicity is determined by the number of codegroups available, or the number of codegroups requested.

  • The child node codegroup contains the nodes codegroup_description, codegroup_name, codes, and the optional node of codegroup_created.

  • The optional grandchild node codegroup_created contains a 'YYYY-MM-DD' value when the value has been set to something other than a default date/time of first release. This can then be used by the provider for monitoring new codegroup additions/changes on Booking.com.

  • The grandchild node codegroup_description contains human readable text describing the given codegroup.

  • The grandchild node codegroup_name contains the code of the codegroup requested.

  • The grandchild node codes contains the code node(s) for the specified codegroup.

  • The great-grandchild node code contains the description, origin, and value nodes, as well as optional created and other code-specific nodes (XXXXXX) which contain specific information relevant to the code.

  • The optional great-great-grandchild node created contains a 'YYYY-MM-DD' value when the value has been set to something other than a default date/time of first release. This can then be used by the provider for monitoring new code additions to Booking.com.

  • The optional great-great-grandchild node description contains the human readable description of what the specific code represents.

  • The optional great-grandchild node notes provides additional, relevant information about the code not in the description.

  • The great-great-grandchild node origin contains the information of where the code was sourced. At the time of writing, either 'OTA' for the Open Travel Alliance or 'Booking' for Booking.com.

  • The great-great-grandchild node value contains the value (the code) to be used in a supported API. Its human readable explanation can be found in its sibling node description.

  • XXXXXX on the table represents any other descriptive information child nodes of the code node. For example, the PCT group contains both an ota_description and bcom_description as part of its code element so that providers may see how the OTA description is mapped to Booking.com description. See table below.

Unique code child nodes per codegroup

code child elementcodegroup
after_deadline_nightsBCCP
bcom_descriptionPCT
cancellation_typeBCCP
deadline_hoursBCCP
leg_elements_optionalTRP
maps_to_bcom_mealplanMPT
notesHAC & RMA
ota_descriptionPCT
percent_after_deadlineBCCP
percent_after_reservationBCCP
policy_typeFTT
value_typeRMA

Errors/Warnings

Requesting unknown codegroup information will generate errors:

<codegroups error="Invalid parameters: invalid codegroup(s) requested inside 'codegroup' element(s): 'ACDC'"
          type="user">
  <error_data>invalid codegroup(s) requested inside 'codegroup' element(s): 'ACDC'</error_data>
</codegroups>
<!-- RUID: [XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX] -->

If an error/warning is encountered, and basic troubleshooting methods has been found ineffective, please provide the error/warning message along with the RUID of the response message to your Booking.com support contact.