Room Set (Create/Update)

This endpoint is used to create or update room details within a property unit. When a request is made to this endpoint, it processes the provided room configuration data and either creates a new room unit or updates an existing one.


Endpoint

POST

https://connect-sandbox.su-api.com/SUAPI/jservice/agoda/room/set
app-id: c2l0****20=
Authorization: Basic M0****W0
Header
Type
Required
Description

app-id

string

Yes

Your application ID. Required for authentication.

Authorization

string

Yes

Your API key. for authorization. Required for authentication.

Content-Type

string

Yes

Must be set to application/json.


Attributes

hotel_id alphanumeric (Required)

The unique property ID as assigned by the provider upon creation of the property.


channel_hotel_id string (Required)

Specifies the channel-specific hotel ID for the property.


channel_room_id string (Required only for Update)

Specifies the channel-specific room ID for the unit.

If you add channel_room_id in the request, it will update the specific room, and if not then it will create a new room on agoda.


room_request object (Required)

Contains the room-related configurations and details for the unit.


configuration object (Required)

Contains the configuration details for the unit type.


rooms array (Optional)

Contains details of the room types supported by the unit. An array of room objects.


type enumerated string (Required)

Specifies the room type supported by the unit.

Accepted values: BEDROOM_SUBROOM, LIVING_ROOM_SUBROOM.


bed_configurations object (Conditional)

Contains details of the bed configuration for the room.


beds array (Required)

Contains the bed type and total number of beds available in the room.


bed_type_id enumerated integer (Required)

Specifies the bed type ID.

Reference list: Agoda Master Data.


bed_count integer (Required)

Specifies the total number of beds of the specified type in the room.


unit_name string (Required)

Specifies the unit name ID that is part of the unit type.


description string (Required)

Detailed description of the room.


room_view_type enumerated integer (Optional)

Identifier for the room view type.

Reference list: Agoda Master Data.


number_of_units integer (Optional)

Specifies the total number of units available at the property.


number_of_bathrooms integer (Optional)

Specifies the total number of bathrooms available in the room.


size object (Optional)

Contains the unit size details.


value integer (Required)

Specifies the unit size in square meters (m2).


occupancy object (Optional)

Contains the occupancy details for the unit.


max_guests integer (Optional)

Specifies the maximum guest occupancy for the unit.


max_adults integer (Optional)

Specifies the maximum adult occupancy for the unit.


max_infants integer (Optional)

Specifies the maximum child occupancy for the unit.


max_children integer (Optional)

Specifies the maximum infants occupancy for the unit.


is_children_allowed boolean (Optional)

Specifies whether children can stay in this room or not.


free_children_count integer (Optional)

Number of children allowed to stay in this room for free (0–9).


extra_beds_configuration object (Optional)

Contains details for extra bed configuration in the unit.


extra_beds integer (Optional)

Specifies the number of extra beds available on request per unit.


is_crib_allowed boolean (Optional)

Specifies whether baby cots/cribs can be accommodated in this room or not.


rates object (Optional)

Contains details for rates configuration for the unit.


maximum_rate integer (Optional)

Maximum rate at which the room can be sold. Must be > minimum_rate and between 0–999999999.


minimum_rate integer (Optional)

Minimum rate at which the room can be sold. Must be < maximum_rate and between 0–999999999.


rack_rate integer (Optional)

Full price rate for the room type. Value must be between 0–999999999.


standard_rate integer (Optional)

Default rate used when updating rates manually in the extranet. Value must be between 0–999999999.


facilities object (Required)

Object containing available facilities at the room. Reference list: Agoda Master Data.


facility_id integer (Required)

Unique identifier for the facility.


is_available boolean (Required)

Indicates if the facility is available at the room.


images object (Optional)

Object containing room images.


url string (Required / Conditional)

URL of the image.


imageid string (Optional / Conditional)

Unique identifier of an existing image (su_imageid from Image API).


pms_imageid string (Optional / Conditional)

ID assigned to a specific image within the PMS (must exist in SU system).

Note: At least one of url, imageid, or pms_imageid must be included in the request.


tags string (Optional)

An image caption code in Agoda. Reference list: Agoda Master Data.


Sample Request

{
   "hotel_id": "AWSTEST",
   "channel_hotel_id": "76586479",
    "room_request": {
       "configuration": {
           "rooms": [
               {
                   "type": "BEDROOM_SUBROOM",
                   "bed_configurations": 
                    {
                        "beds": [
                            {
                                "bed_type_id": 1,
                                "bed_count": 255
                            }
                        ]
                    }
               },
               {
                   "type": "BEDROOM_SUBROOM",
                   "bed_configurations": 
                    {
                        "beds": [
                            {
                                "bed_type_id": 1,
                                "bed_count": 44
                            }
                        ]
                    }
               },
               {
                   "type": "LIVING_ROOM_SUBROOM",
                   "bed_configurations": 
                    {
                        "beds": [
                            {
                                "bed_type_id": 1,
                                "bed_count": 1
                            },
                            {
                                "bed_type_id": 2,
                                "bed_count": 2
                            }
                        ]
                    }
               }
           ]
       },
       "unit_name": 9,
       "description": "testttt",
       "room_view_type": "1",
       "number_of_units": 1,
       "number_of_bathrooms": 1,
       "size": {
           "value": 1,
       },
       "occupancy": {
           "max_guests": 10,
           "max_adults": 5,
           "max_children": 5,
           "max_infants": 5,
           "is_children_allowed": true,
           "free_children_count": 1,
       },
       "extra_beds_configuration": {
           "max_extra_beds": 1,
           "is_crib_allowed": true
       },
       "rates":{
           "maximum_rate": 200,
           "minimum_rate":100,
           "rack_rate":122,
           "standard_rate":122
       },
       "facilities": [
            {
                "facility_id": "5",
                "is_available": true
            },
            {
                "facility_id": "7",
                "is_available": true
            },
            {
                "facility_id": "761",
                "is_available": true
            }
        ],
        "images":[
            {
                "url": "https://www.xxxxxxx.com/xxxx/roadblue/xxxx.jpg",
                "tags": "2"
            },
            {
                "url": "https://www.xxxxxxx.com/xxxx/roadblue/xxxx.jpg",
                "tags": "4"
            },
            {
                "url": "https://www.xxxxxxx.com/xxxx/roadblue/xxxx.jpg",
                "tags": "4"
            }
        ]
   }
}

Response

Success Response

{
    "Status": "Success",
    "Data": {
        "channel_room_id": "1223171663"
    },
    "Message": "Room set successfully",
    "Ruid": "2d229477-8279-11f0-83db-23c3b5e6404a"
}

Error Response

{
    "Status": "Fail",
    "Errors": [
        {
            "Code": "1016",
            "ShortText": "hotel_id is required"
        },
        {
            "Code": "572",
            "ShortText": "channel_hotel_id - is invalid or not found!"
        }
        ],
    "Message": ""
}

Response Body Elements

Status string

Indicates the result of the API call.

Will be "Success" for successful operations.

Will be always "Fail" in case of an error response.


Data object

The response data, the root element.


Message string

The message in the response.


Code string

Specific error code that helps identify the type of error.

For example: "400" indicates a bad request.


ShortText string

A short description of the error.

Last updated

Was this helpful?