Last updated

Step 4 - Create Contacts

Use the Contacts API to create, update, retrieve and delete contact details. In this step, we will create one contact of type general.

Prerequisites

You must have a property ID by completing step 2 successfully.

Creating a contact

PUT
https://supply-xml.booking.com/contacts-api/properties/{propertyID}/contacts

All parameters are required unless otherwise noted.

ParameterDescription
> contactsContains contact information. You must create one contact detail for the General contact type. Note that you can create at most one contact detail per property for the General contact type.
>> contact_profile_typeContains the contact type.
>>> typeSpecifies the type of contact. For a list of approved contact types, see ContactProfileType.
> address[Optional] Contains the address details of the contact including country, city and postal code details. Optional for all contact types. You can set only one address per contact type.
>> city_nameSpecifies the name of the city, town, or village. Required if address is specified.
>> state_prov_code[Optional] Contains the State/province details. The value specified in this field is not returned in the GET call.
>> country_codeSpecifies the two-letter country code. Required if address is specified. For more information on how to retrieve the country code details, see xml/countries endpoint.
>> postal_codeSpecifies the postal/zip code. Required if address is specified. Make sure the postal code is relevant to the country specified in the country_code.
>> address_lineSpecifies the full street name and number. Required if address is specified. Should not contain abbreviations (such as "Rd." for "Road") and should not exceed 255 characters.
>> language_codeSpecifies the Booking.com Language code for the address details. Required if address is specified. For a list of supported language codes, see Booking.com Language Code table.
> contact_personContains the contact person's name, gender, spoken language and job title.
>>language_codeSpecifies the contact's spoken language(s). For a list of supported language codes, see Booking.com Language Code table.
>> gender[Optional] Specifies the contact's gender. Accepts: Male, Female. Default: null. To set as empty, omit the entire attribute (instead of specifying "").
>> nameSpecifies the contact person's full name.
>> job_title[Optional] Specifies the contact person's job title code. For a list of supported job titles and their code, see Booking.com Job Title Code. By default, it is set to Unknown.
> phonesContains the phone number information.
>> phone_numberSpecifies the international phone number. Follows the format: \+[0-9]+
The phone number is also validated based on the formatting rules of the specified country code.
>> phone_tech_typeSpecifies the type of phone line/device. For a list of supported values, see PTT.
PhoneTechType 3 can have at most 3 entries.
PhoneTechType 1 and 5 can have at most 1 entry.
Extension can only be provided for PhoneTechType 1.
>> extension[Optional] The extension number that must be dialled in addition to the phone_number. Only accepted when phone_tech_type="1".
> emailContains the email address details. Make sure to specify a valid email address.

Sample request

{
    "contacts": [
        {
            "contact_profiles": [
                {
                    "type": "general"
                }
            ],
            "address": {
                "city_name": "Osaka",
                "country_code": "JP",
                "postal_code": "598-0046",
                "address_line": "Izumisano 163",
                "language_code": "ja"
            },
            "contact_person": {
                "gender": "female",
                "name": "Waddington Goldwin",
                "job_title": "Administration Employee",
                "language_code": "ja"
            },
            "phones": [
                {
                    "phone_number": "+81666666661",
                    "phone_tech_type": "1",
                    "extension": "1"
                }
            ],
            "email": "tests@booking.com"
        }
    ]
}

Sample response

A successful response looks as follows:

{
    "warnings":[],
    "errors":[],
    "meta":
        {
            "ruid":"XXXXXXXXXXXXXXXXXXXXXXXXXXXX"
         }
 }