createUnitSpaces mutation
Creates one or more unit spaces, including the type, description, amenities, and order of the space in the list of like spaces. Creating spaces is optional; however, if spaces are created for a unit, bed groups defined for the unit are ignored.
Note: Be sure to retrieve the unit and space IDs in the response because you need them to manage the unit and spaces later (using
updateUnit
,updateUnitSpaces
, anddeleteUnitSpace
).
In addition, 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 createUnitSpaces(5}
Example
This example creates a bedroom with a king and twin bed.
- Request
- Response
1mutation {2 createUnitSpaces(3 input: {4 propertyId: 152400945 unitId: 3256669136 bedrooms: [7 {8 order: 19 text: [10 {11 key: "space-name"12 values: [{ locale: "en-US", value: "Bedroom" }]13 }14 ]15 bedGroups: [16 {17 beds: [18 { type: "KingBed", size: "King", quantity: 1 }19 { type: "TwinBed", size: "Twin", quantity: 1 }20 ]21 }22 ]23 }24 ]25 livingRooms: [26 {27 order: 128 text: [29 {30 key: "LivingRm 1"31 values: [{ locale: "en-US", value: "LivingRm 1" }]32 }33 ]34 bedGroups: [35 { beds: [{ quantity: 1, size: "Twin", type: "SofaBed" }] }36 ]37 }38 ]39 }40 ) {41 spaces {42 bedrooms {43 id44 order45 text {46 key47 values {48 locale49 value50 }51 }52 bedGroups {53 beds {54 type55 size56 quantity57 }58 }59 }60 livingRooms {61 id62 order63 text {64 key65 values {66 locale67 value68 }69 }70 bedGroups {71 beds {72 type73 size74 quantity75 }76 }77 }78 }79 }80}
Arguments
Name | Description |
---|---|
| Required. Type: CreateUnitSpacesInput |
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.
| ||||||||||||||
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:
| ||||||||||||||
Bedroom | Object | |||||||||||||
Details about this bedroom.
| ||||||||||||||
BedType | Object | |||||||||||||
BedTypeInput | InputObject | |||||||||||||
Details about the bed. Use the
| ||||||||||||||
CreateUnitSpacesBedroomInput | InputObject | |||||||||||||
Details about a bedroom space.
| ||||||||||||||
CreateUnitSpacesInput | InputObject | |||||||||||||
Details about the spaces to create in the unit.
| ||||||||||||||
CreateUnitSpacesLivingRoomInput | InputObject | |||||||||||||
Details about a living room space.
| ||||||||||||||
CreateUnitSpacesPayload | Object | |||||||||||||
Details about the unit's spaces after they are created. Be sure to retrieve the
unit and space IDs in the payload because you need them in order to update the
unit and spaces later (using the
| ||||||||||||||
ID | ID | |||||||||||||
The | ||||||||||||||
Int | Int | |||||||||||||
The | ||||||||||||||
LivingRoom | Object | |||||||||||||
Details about a living room space.
| ||||||||||||||
Locale | Locale | |||||||||||||
A type that represents a string that conforms to the BCP-47 (RFC 5646) standard. Example: en-GB. | ||||||||||||||
LocalizedString | Object | |||||||||||||
LocalizedStringInput | InputObject | |||||||||||||
String | String | |||||||||||||
The | ||||||||||||||
Text | Object | |||||||||||||
Key-value pairs that specify free text elements.
| ||||||||||||||
TextInput | InputObject | |||||||||||||
Key-value pairs that specify free text elements.
| ||||||||||||||
UnitSpaces | Object | |||||||||||||
Spaces available in the unit (as created by
|