Skip to content

rooms-api-bulk

Create, update and delete multiple units

Create units

Request

Create one or more units

Headers
Content-Typestringrequired

Specifies the expected content type. Currently supports application/json.

Value:"application/json"
Accept-Versionstring

Specify the version number to get the API functionality specific to that version. Currently supports the value: 1.0

Value:"1.0"
Bodyapplication/jsonrequired
unitsArray of objects, [ 1 .. 100 ] items(UnitCreateRequest)required

List of units to create. All units must belong to the same property. Maximum 100 units per request.

curl -i -X POST \
  https://developers.booking.com/_mock/connectivity/docs/openapispecs/rooms-api/rooms-api-specification-bulk/rooms-api/units \
  -H 'Accept-Version: 1.0' \
  -H 'Content-Type: application/json' \
  -d '{
    "units": [
      {
        "property_id": 123456,
        "correlation_id": "corr-01",
        "configuration": {
          "unit_type_id": 31,
          "rooms": [
            {
              "type": "BEDROOM_SUBROOM",
              "bed_configurations": [
                {
                  "beds": [
                    {
                      "bed_type_id": 6,
                      "bed_count": 1
                    },
                    {
                      "bed_type_id": 1,
                      "bed_count": 1
                    }
                  ],
                  "is_default_configuration": true
                }
              ]
            },
            {
              "type": "BEDROOM_SUBROOM",
              "bed_configurations": [
                {
                  "beds": [
                    {
                      "bed_type_id": 1,
                      "bed_count": 3
                    }
                  ],
                  "is_default_configuration": true
                }
              ]
            },
            {
              "type": "LIVING_ROOM_SUBROOM",
              "bed_configurations": [
                {
                  "beds": [
                    {
                      "bed_type_id": 5,
                      "bed_count": 1
                    }
                  ],
                  "is_default_configuration": true
                }
              ]
            }
          ]
        },
        "unit_name_id": 4180,
        "number_of_units": 5,
        "smoking_policy": "SMOKING_AND_NONSMOKING",
        "size": {
          "value": 155,
          "unit": "SQM"
        },
        "partner_reference_name": "Two-bedroom villa with living room",
        "floor_numbers_located_on": [
          2
        ],
        "occupancy_details": {
          "max_guests": 5,
          "max_adults": 5,
          "max_children": 4,
          "max_infants": 4,
          "max_infants_on_top": 0
        },
        "extra_beds_configuration": {
          "extra_beds": 1,
          "cribs": 0,
          "is_crib_and_extra_bed_allowed": false
        }
      },
      {
        "property_id": 123456,
        "correlation_id": "corr-02",
        "configuration": {
          "unit_type_id": 1,
          "rooms": [
            {
              "type": "BEDROOM_SUBROOM",
              "bed_configurations": [
                {
                  "beds": [
                    {
                      "bed_type_id": 3,
                      "bed_count": 1
                    }
                  ],
                  "is_default_configuration": true
                }
              ]
            },
            {
              "type": "LIVING_ROOM_SUBROOM"
            }
          ]
        },
        "unit_name_id": 865,
        "number_of_units": 3,
        "smoking_policy": "NONSMOKING",
        "size": {
          "value": 75,
          "unit": "SQM"
        },
        "partner_reference_name": "One-bedroom apartment",
        "occupancy_details": {
          "max_guests": 3,
          "max_adults": 3,
          "max_children": 2,
          "max_infants": 0,
          "max_infants_on_top": 2
        },
        "extra_beds_configuration": {
          "extra_beds": 1,
          "cribs": 1,
          "is_crib_and_extra_bed_allowed": true
        }
      }
    ]
  }'

Responses

Units created successfully

Bodyapplication/json
dataobject(BulkUnitsCreateResponse)
warningsArray of objects(ApiError)
errorsArray of objects(ApiError)
metaobject(ResponseMeta)
Response
Successful creation of two units
{ "data": { "units": [ … ] }, "errors": [], "warnings": [], "meta": { "ruid": "test-ruid" } }