Product management
ReferenceProduct management

updateUnitSpaces mutation

Updates space details and amenities. For example, you might need to add a bed or a room. When updating a space, you must specify the Expedia unit ID and space ID, not the Expedia property ID.

To remove a bed from a bed group, remove its group definition completely. To remove a bed group from a space, specify an empty bed group.

Use the metadata query to retrieve the list of allowed values for the various fields in each unit (such as bed type). This helper query is especially important when defining amenities for a unit space. Be sure to review the details in the metadata query's reference page for an explanation of how to read amenity metadata.

Syntax

1mutation {
2 updateUnitSpaces(
5}

Examples

One bedroom with two beds, living room with two full sofa beds

1mutation {
2 updateUnitSpaces(
3 input: {
4 clientMutationId: "123456"
5 propertyId: 15240094
6 unitId: 325671275
7 bedrooms: [
8 {
9 order: 1
10 id: "280c5afb-64a2-4d49-b7e5-e7df2a4563dd"
11 text: [
12 {
13 key: "Bedroom 1"
14 values: [{ locale: "en-US", value: "Bedroom 1 with options" }]
15 }
16 ]
17 bedGroups: [
18 {
19 beds: [
20 { quantity:1, size:"Queen", type:"QueenBed"}
21 { quantity:1, size:"Full", type:"FullBed"}
22 ]
23 }
24 ]
25 }
26 ]
27 livingRooms: [
28 {
29 order: 1
30 id: "34ed706b-e41a-4ede-84b0-9091c50a3477"
31 text: [
32 {
33 key: "LivingRm 1"
34 values: [{ locale: "en-US", value: "LivingRm 1" }]
35 }
36 ]
37 bedGroups: [
38 { beds: [{ quantity: 2, size: "Full", type: "SofaBed" }] }
39 ]
40 }
41 ]
42 }
43 ) {
44 clientMutationId
45 spaces {
46 bedrooms {
47 id
48 order
49 text {
50 key
51 values {
52 locale
53 value
54 }
55 }
56 bedGroups {
57 beds {
58 type
59 size
60 quantity
61 }
62 }
63 }
64 livingRooms {
65 id
66 order
67 text {
68 key
69 values {
70 locale
71 value
72 }
73 }
74 bedGroups {
75 beds {
76 type
77 size
78 quantity
79 }
80 }
81 }
82 }
83 }
84}

One bedroom with a full or a king bed

1mutation {
2 updateUnitSpaces(
3 input: {
4 clientMutationId: "123456"
5 propertyId: 15240094
6 unitId: 325671275
7 bedrooms: [
8 {
9 order: 1
10 id: "280c5afb-64a2-4d49-b7e5-e7df2a4563dd"
11 text: [
12 {
13 key: "Bedroom 1"
14 values: [{ locale: "en-US", value: "Bedroom 1 with options" }]
15 }
16 ]
17 bedGroups: [
18 { beds: [{ quantity: 1, size: "King", type: "KingBed" }] }
19 { beds: [{ quantity: 1, size: "Full", type: "FullBed" }] }
20 ]
21 }
22 ]
23 livingRooms: [
24 {
25 order: 1
26 id: "34ed706b-e41a-4ede-84b0-9091c50a3477"
27 text: [
28 {
29 key: "LivingRm 1"
30 values: [{ locale: "en-US", value: "LivingRm 1" }]
31 }
32 ]
33 bedGroups: [
34 { beds: [{ quantity: 2, size: "Full", type: "SofaBed" }] }
35 ]
36 }
37 ]
38 }
39 ) {
40 clientMutationId
41 spaces {
42 bedrooms {
43 id
44 order
45 text {
46 key
47 values {
48 locale
49 value
50 }
51 }
52 bedGroups {
53 beds {
54 type
55 size
56 quantity
57 }
58 }
59 }
60 livingRooms {
61 id
62 order
63 text {
64 key
65 values {
66 locale
67 value
68 }
69 }
70 bedGroups {
71 beds {
72 type
73 size
74 quantity
75 }
76 }
77 }
78 }
79 }
80}

Arguments

NameDescription

input

Required.
Type: UpdateUnitSpacesInput

Types


Name
Type
BedGroup
Object

Bed types offered in the room. Vacation rentals are limited to a single bed group with multiple bed types. Conventional lodging may have two bed groups to represent alternatives. For example, a hotel might have a room type with 1 king bed or 2 full beds.

FieldDescription
bedsNot nullable.

Bed types offered in the room.

Type: Array of non nullable BedType
BedGroupInput
InputObject

Bed types offered in the room. Vacation rentals are limited to a single bed group with multiple bed types. Conventional lodging may have two bed groups to represent alternatives. For example, a hotel might have a room type with 1 king bed or 2 full beds. To remove a bed group from a space, send null (empty array) for bed groups, though at least one bed group must be defined for a unit. Note the following:

  • When bedding is not provided when a unit is created, one twin bed is defined for the unit (default).
  • When a space is created for a unit, bedding on the unit level is removed and will only be present within the space. Once a unit has a space defined, bedding can only be managed within the space (using updateUnitSpaces or deleteUnitSpace).
FieldDescription
bedsNot nullable.

Bed types offered in the room.

Type: Array of non nullable BedTypeInput
Bedroom
Object

Details about this bedroom.

FieldDescription
bedGroupsNot nullable.

Bed types offered in the room.

Type: Array of non nullable BedGroup
idNot nullable.

ID of this bedroom.

Type: ID
orderNot nullable.

Where the bedroom appears in the list of bedrooms (minimum value is 1).

Type: Int
text

Text that describes this bedroom.

Type: Array of non nullable Text
BedType
Object

Details about the bed.

FieldDescription
quantityNot nullable.

Number of beds in the bed group.

Type: Int
size

Bed size, such as FULL, KING, or TWIN.

Type: String
typeNot nullable.

Bed type, such as KINGBed or SofaBed.

Type: String
BedTypeInput
InputObject

Details about the bed. Use the metadata query to retrieve the list of supported values for the input fields.

FieldDescription
quantityNot nullable.

Number of beds in the bed group. To remove a bed from a bed group, set this value to 0.

Type: Int
size

Bed size.

Type: String
typeNot nullable.

Bed type.

Type: String
ID
ID

The ID scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "4") or integer (such as 4) input value will be accepted as an ID.

Int
Int

The Int scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.

LivingRoom
Object

Details about a living room space.

FieldDescription
bedGroupsNot nullable.

Bed types offered in the living room.

Type: Array of non nullable BedGroup
idNot nullable.

Space ID of this living room.

Type: ID
orderNot nullable.

Where the living room appears in the list of living rooms (minimum value is 1).

Type: Int
text

Description of the living room.

Type: Array of non nullable Text
Locale
Locale

A type that represents a string that conforms to the BCP-47 (RFC 5646) standard. Example: en-GB.

LocalizedString
Object

Localized text and its locale code.

FieldDescription
localeNot nullable.

Locale code used to localize the text, which conforms to the BCP-47 (RFC 5646) standard, such as fr-FR.

Type: Locale
valueNot nullable.

Localized text.

Type: String
LocalizedStringInput
InputObject

Localized text and its locale code.

FieldDescription
localeNot nullable.

Locale code used to localize the text, which conforms to the BCP-47 (RFC 5646) standard, such as fr-FR. Use the metadata query to retrieve the list of supported locales.

Type: Locale
value

Localized text string.

Type: String
String
String

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.

Text
Object

Key-value pairs that specify free text elements.

FieldDescription
keyNot nullable.

Name of text element.

Type: String
valuesNot nullable.

Localized value of text element.

Type: Array of non nullable LocalizedString
TextInput
InputObject

Key-value pairs that specify free text elements.

FieldDescription
keyNot nullable.

Name of the text element. Use the metadata query to retrieve the list of supported text keys when creating or updating a property.

Type: String
valuesNot nullable.

Localized value of the text element.

Type: Array of non nullable LocalizedStringInput
UnitSpaces
Object

Spaces available in the unit (as created by createUnitSpaces).

FieldDescription
bedrooms

Bedrooms available in the unit.

Type: Array of non nullable Bedroom
livingRooms

Living rooms available in the unit.

Type: Array of non nullable LivingRoom
UpdateUnitSpacesBedroomInput
InputObject

Bedroom space details to update. To remove a bed from a bed group, remove its group definition completely. To remove a bed group from a space, specify an empty bed group.

FieldDescription
bedGroups

Bed types offered in the room.

Type: Array of non nullable BedGroupInput
idNot nullable.

Space ID of the bedroom to update.

Type: ID
order

Where the bedroom appears in the list of bedrooms (minimum value is 1).

Type: Int
text

Description of this bedroom.

Type: Array of non nullable TextInput
UpdateUnitSpacesInput
InputObject

Space details to update.

FieldDescription
bedrooms

Bedroom space details to update.

Type: Array of non nullable UpdateUnitSpacesBedroomInput
clientMutationId

Partner's transaction ID that uniquely identifies the request, which can be used to associate requests and responses for troubleshooting purposes. This ID must be unique across requests and cannot be reused. However, if a request needs to be retried, such as because it failed or timed out, the ID provided in the original request should be used. The ID can be in any format as long as it uniquely identifies the request.

Type: String
livingRooms

Living room details to update.

Type: Array of non nullable UpdateUnitSpacesLivingRoomInput
propertyIdNot nullable.

Expedia ID of the property to which the unit belongs.

Type: ID
unitIdNot nullable.

ID of the unit to which the space belongs.

Type: ID
UpdateUnitSpacesLivingRoomInput
InputObject

Living room details to update.

FieldDescription
bedGroups

Bed types offered in the living room.

Type: Array of non nullable BedGroupInput
idNot nullable.

Space ID of the living room to update.

Type: ID
order

Where the living room appears in the list of living rooms (minimum value is 1).

Type: Int
text

Description of the living room.

Type: Array of non nullable TextInput
UpdateUnitSpacesPayload
Object

Details about the space after it has been updated.

FieldDescription
clientMutationId

Partner's transaction ID that identifies the request, which can be used to correlate with partner's transaction logs. This ID must be unique across requests and cannot be reused.

Type: String
spacesNot nullable.

Space details.

Type: UnitSpaces