Last updated

Managing licences

The Licences API enables you to present the relevant licence requirements elements to your connected properties. You can do that by following these high-level steps:

  1. Retrieve licence requirements for a property.
  2. Present the appropriate licence requirements to the property.
  3. Send the licence information of a property or room type.
  4. Retrieve existing licence information per property or room type to verify success.

Retrieving licence requirements

You can retrieve the same licence requirements data in two ways depending on the information that is available to you:

Retrieving licence requirements by property ID

GET
https://supply-xml.booking.com/licenses/rules/properties/{property_id}

Query parameters

The following table describes the required query elements for this endpoint:

ParameterDescriptionTypeRequired/OptionalNotes
property_idSpecifies the property ID for which you want to retrieve licence requirements.stringrequired

Retrieving licence requirements without property ID

GET
https://supply-xml.booking.com/licenses/rules

Query parameters

The following table describes the required query elements for this endpoint:

ParameterDescriptionTypeRequired/OptionalNotes
latSpecifies the latitude of the property.floatrequired
longSpecifies the longitude of the property.floatrequired
country_codeSpecifies the country code of the property.stringrequiredTo retrieve a list of the available country codes, see retrieving country codes
property_type_idSpecifies the property type id.intrequiredTo retrieve a list of valid property types, see Property Class Type Codes.

Example call with query parameters

GET
https://supply-xml.booking.com/licenses/rules?lat={latitude}&long={longitude}&country_code={country_code}&property_type_id={property_type_id}

Licence requirements response

These endpoints enable you to retrieve the regional licence requirements for a property, which you need to:

  • Present the licence requirements to a property within your user interface.
  • Send the licence information to Booking.com.

The minimal information you need to set up the licence requirements is:

  • Whether the licence requirements are on the property or room level (level): It is either property or room type level, never both.
  • The possible variants of a licence and their ID (id): This refers to possible variations of the licence requirements within a region. You must provide all possibilities to your properties.
  • All the licence requirements with their corresponding values.

Response body example

The following is a successful response body example for property-level licence requirements:

{
  "data": {
      "name": "japan",
      "level": "property",
      "variants": [
          {
              "id": 42,
              "content": [],
              "name": "japan_v1"
          },
          {
              "content": [
                  {
                      "name": "issue_date",
                      "dataType": "date",
                      "required": true
                  },
                  {
                      "dataType": "string",
                      "name": "number",
                      "format": "^[0-9A-Za-z]{10}$",
                      "required": false
                  }
              ],
              "id": 39,
              "name": "minpaku_shinpo_license_v1"
          },
          {
              "id": 40,
              "content": [
                  {
                      "name": "issue_date",
                      "dataType": "date",
                      "required": true
                  },
                  {
                      "name": "number",
                      "dataType": "string",
                      "required": true
                  }
              ],
              "name": "minpaku_tokku_license_v1"
          },
          {
              "name": "ryokan_license_v1",
              "content": [
                  {
                      "required": true,
                      "name": "issue_date",
                      "dataType": "date"
                  },
                  {
                      "dataType": "string",
                      "name": "number",
                      "required": false
                  }
              ],
              "id": 41
          }
      ],
      "active": true,
      "id": 32
  },
  "meta": {
      "ruid": "UmFuZG9tSVYkc2RlIyh9Ya3WbzHWV9oINucqsqdROrvtS9rIpvdyAOxIbeRs6frXvuFyeZSyZQqQwMdjjl6rcNDDXD3GD92hsDQb660wuG3S8pxmcUPe5w=="
  },
  "warnings": [],
  "errors": []
}

The following is a successful response body example for room-level licence requirements:

{
    "meta": {
        "ruid": "UmFuZG9tSVYkc2RlIyh9YRVJicqEeLs1OoMxTc7Y+FITilxK+BbS8riILs03PNInVTmid8OsNX07muIUr/n1NTOnFG49M6sI8EVF3JITE0bIUe9mBnraMQ=="
    },
    "warnings": [],
    "data": {
        "variants": [
            {
                "id": 22,
                "name": "paris_v1",
                "content": [
                    {
                        "possibleValues": [
                            "private_person",
                            "professional_company"
                        ],
                        "dataType": "string",
                        "required": true,
                        "name": "management_type"
                    },
                    {
                        "name": "number",
                        "required": true,
                        "dataType": "string",
                        "format": "^[0-9]{13}$"
                    },
                    {
                        "dataType": "string",
                        "possibleValues": [
                            "primary",
                            "secondary",
                            "other"
                        ],
                        "required": true,
                        "name": "residence_type"
                    }
                ]
            }
        ],
        "name": "paris",
        "id": 17,
        "level": "room",
        "active": true
    },
    "errors": []
}

Response body elements

The following table describes the response elements:

ElementDescriptionTypeNotes
dataContains the response data.object
: variantsContains all the possible variants of licence requirements in the region of the specified property.array
:: idSpecifies the unique ID of the licence requirements variant.integer
:: nameSpecifies the name of the licence requirements variant.string
:: contentContains the mandatory and optional elements that you need to set up licence requirements.array
::: requiredIndicates whether the licence element is mandatoryboolean
::: dataTypeSpecifies the data type of the licence element.string
::: nameSpecifies the name of the licence element.string
::: formatSpecifies the format in which the licence element value should appear.string
::: possibleValuesContains the possible values for the licence element it is associated with.array
: idSpecifies the ID of the main licence.integer
: activeIndicates whether the licence requirements are active or not.booleanYou can ignore this element.
: levelSpecifies whether the licence requirements are on the property or room level.string
: nameSpecifies the name of the property's region in which the licence requirements apply.string
metaContains the meta data that comes with the response.object
: ruidSpecifies the unique ID of the request.stringYou can send this ID to Booking.com customer support if you run into an issue. This can help to understand what went wrong.
warningsContains potential warnings. These can help you improve your requests.array
errorsContains potential errors. These can help you understand what went wrong with your request.array

Managing property-level licences

This section describes all the possible actions related to managing licences for a property through the Licences API.

Quick actions:

Sending licence information of a property

PUT https://supply-xml.booking.com/licenses/data/properties/{property_id}

The PUT /data/properties/{property_id} request enables you to send the appropriate licence information of a property to Booking.com.

Path parameters

The following table describes the required path elements for this endpoint:

ParameterDescriptionTypeRequired/OptionalNotes
property_idSpecifies the property ID for which you want to send the licence information.stringrequired

Request body parameters

ParameterDescriptionTypeRequired/OptionalNotes
dataContains the request body elements.objectrequired
: contentDataContains the licence requirements in the form of name and value pairs.arrayrequired
:: nameSpecifies the name of the licence requirements element.stringrequiredYou can have multiple licence elements (with corresponding values). This varies depending on the property region.
:: valueSpecifies the value corresponding to the name of the licence requirements element.stringrequiredYou must follow the data type and format specified by dataType and format respectively.
: variantIdSpecifies the ID of the licence variant, which is applicable to the specified property.stringrequired

Request body example

{
    "data": {
      "contentData": [
        {
          "name": "issue_date",
          "value": "2020-05-01"
        },
        {
          "name": "number",
          "value": "A123456789"
        }
      ],
      "variantId": 39
    }
  }

Response body example

The following is a successful response body example:

{
  "meta": {
      "ruid": "UmFuZG9tSVYkc2RlIyh9Ya3WbzHWV9oIS2wUEwGUyzk1LtPWGnHLXF8LvpWuxaR6kqjAJV6MUfTVZB/XTjfzyIYDmxbUfGao5aDqJEed4LVH8of5dFKEQw=="
  },
  "data": {
      "success": 1
  },
  "errors": [],
  "warnings": []
}

Response body elements

The following table describes the response elements:

ElementDescriptionTypeNotes
dataContains the response data.object
: successIndicates whether the request was successful.boolean
metaContains the meta data that comes with the response.object
: ruidSpecifies the unique ID of the request.stringYou can send this ID to Booking.com customer support if you run into an issue. This can help to understand what went wrong.
warningsContains potential warnings. These can help you improve your requests.array
errorsContains potential errors. These can help you understand what went wrong with your request.array

Retrieving property licence information

GET
https://supply-xml.booking.com/licenses/data/properties/{property_id}

The GET /data/properties/{property_id} request enables you to retrieve the existing licence information for a property by specifying their id.

Path parameters

The following table describes the required path elements for this endpoint:

ParameterDescriptionTypeRequired/OptionalNotes
property_idSpecifies the property ID for which you want to retrieve licence information.stringrequired

Response body example

The following is a successful response body example:

{
  "warnings": [],
  "meta": {
    "ruid": "UmFuZG9tSVYkc2RlIyh9YZSPD851yI7p72LK9h7sjamfHUFYIolonBz1VH3T3AnQLd321In8d74fyp5D7Kc+D5dghtTmY0+ap879E5pefN+kD+1KBSqpYQ=="
  },
  "errors": [],
  "data": {
    "variantId": 39,
    "contentData": [
      {
        "name": "number",
        "value": "A123456789",
        "dataType": "string"
      },
      {
        "value": "2020-05-01",
        "name": "issue_date",
        "dataType": "date"
      }
    ]
  }
}

Response body elements

The following table describes the response elements:

ElementDescriptionTypeNotes
dataContains the response data.object
: variantIdSpecifies the ID of the licence variant.integer
: contentDataContains the licence elements in the form of name and value pairs.arrayrequired
:: nameSpecifies the name of the licence element.stringrequired
:: valueSpecifies the value corresponding to the licence element name.stringrequired
metaContains the meta data that comes with the response.object
: ruidSpecifies the unique ID of the request.stringYou can send this ID to Booking.com customer support if you run into an issue. This can help to understand what went wrong.
warningsContains potential warnings. These can help you improve your requests.array
errorsContains potential errors. These can help you understand what went wrong with your request.array

Managing room-type licences

This section describes all the possible actions related to managing licences for a room type through the Licences API.

Quick actions:

Sending licence information of a room type

PUT https://supply-xml.booking.com/licenses/data/properties/{property_id}/rooms/{room_id}

The PUT /data/properties/{property_id}/rooms/{room_id} request enables you to send the appropriate licence information of a room type to Booking.com.

Path parameters

The following table describes the required path elements for this endpoint:

ParameterDescriptionTypeRequired/OptionalNotes
property_idSpecifies the property ID for which you want to send the room-level licence information.stringrequired
room_idSpecifies the room type ID for which you want to send the licence information.stringrequired

Request body parameters

ParameterDescriptionTypeRequired/OptionalNotes
dataContains the request body elements.objectrequired
: contentDataContains the licence requirements in the form of name and value pairs.arrayrequired
:: nameSpecifies the name of the licence requirements element.stringrequiredYou can have multiple licence elements (with corresponding values). This varies depending on the property region.
:: valueSpecifies the value corresponding to the name of the licence requirements element.stringrequiredYou must follow the data type and format specified by dataType and format respectively.
: variantIdSpecifies the ID of the licence variant, which is applicable to the specified room type.stringrequired

Request body example

{
    "data": {
      "contentData": [
        {
          "name": "management_type",
          "value": "private_person"
        },
        {
          "name": "residence_type",
          "value": "primary"
        },
        {
          "name": "number",
          "value": "1234567890123"
        }
      ],
      "variantId": 22
    }
  }
  

Response body example

The following is a successful response body example:

{
  "meta": {
      "ruid": "UmFuZG9tSVYkc2RlIyh9Ya951VT0vsBCAFA/RugA75pfw5rz5ytfk2B7PgcnO+tBltJb/hDGmUcAAzpmaLpbmMD6WMO7gYxQ5r52nuzjm5XfyVH8ICbwcg=="
  },
  "data": {
      "success": 1
  },
  "errors": [],
  "warnings": []
}

Response body elements

The following table describes the response elements:

ElementDescriptionTypeNotes
dataContains the response data.object
: successIndicates whether the request was successful.boolean
metaContains the meta data that comes with the response.object
: ruidSpecifies the unique ID of the request.stringYou can send this ID to Booking.com customer support if you run into an issue. This can help to understand what went wrong.
warningsContains potential warnings. These can help you improve your requests.array
errorsContains potential errors. These can help you understand what went wrong with your request.array

Retrieving room type licence information

GET
https://supply-xml.booking.com/licenses/data/properties/{property_id}/rooms/{room_id}

The GET /data/properties/{property_id}/rooms/{room_id} request enables you to retrieve the licence information of a room type.

Path parameters

The following table describes the required query elements for this endpoint:

ParameterDescriptionTypeRequired/OptionalNotes
property_idSpecifies the property ID for which you want to retrieve the room-level licence information.stringrequired
room_idSpecifies the room type ID for which you want to retrieve licence information.stringrequired

Response body example

The following is a successful response body example:

{
    "meta": {
      "ruid": "UmFuZG9tSVYkc2RlIyh9YXTBNY4IOVJhfZ05YX5/i3BeIsA5ZVO6ajB+IPq4p7oawQeL7vr4M4BqBKHR0dtOQKlLOraXGARBH8Qz+5PgsKoYY7TOoAwi7g=="
    },
    "warnings": [],
    "data": {
      "contentData": [
        {
          "dataType": "string",
          "name": "number",
          "value": "1234567890123"
        },
        {
          "value": "private_person",
          "name": "management_type",
          "dataType": "string"
        },
        {
          "dataType": "string",
          "name": "residence_type",
          "value": "primary"
        }
      ],
      "variantId": 22
    },
    "errors": []
  }
  
  

Response body elements

The following table describes the response elements:

ElementDescriptionTypeNotes
dataContains the response data.object
: variantIdSpecifies the ID of the licence variant.integer
: contentDataContains the licence elements in the form of name and value pairs.arrayrequired
:: nameSpecifies the name of the licence element.stringrequired
:: valueSpecifies the value corresponding to the licence element name.stringrequired
metaContains the meta data that comes with the response.object
: ruidSpecifies the unique ID of the request.stringYou can send this ID to Booking.com customer support if you run into an issue. This can help to understand what went wrong.
warningsContains potential warnings. These can help you improve your requests.array
errorsContains potential errors. These can help you understand what went wrong with your request.array