Add a room to the session's basket
curl --request POST \
--url https://{apiBaseUrl}/v2/{sessionId}/basket/rooms \
--header 'Content-Type: application/json' \
--data '
{
"roomId": 29449,
"rateId": "20260605;20260608;32641",
"occupancyId": 0,
"quantity": 3,
"guestPosition": 0,
"beddingConfigurationId": "273bb7fa-aa7b-4cd1-92b9-7bdab3a21a06"
}
'const url = 'https://{apiBaseUrl}/v2/{sessionId}/basket/rooms';
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
roomId: 29449,
rateId: '20260605;20260608;32641',
occupancyId: 0,
quantity: 3,
guestPosition: 0,
beddingConfigurationId: '273bb7fa-aa7b-4cd1-92b9-7bdab3a21a06'
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));import requests
url = "https://{apiBaseUrl}/v2/{sessionId}/basket/rooms"
payload = {
"roomId": 29449,
"rateId": "20260605;20260608;32641",
"occupancyId": 0,
"quantity": 3,
"guestPosition": 0,
"beddingConfigurationId": "273bb7fa-aa7b-4cd1-92b9-7bdab3a21a06"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{apiBaseUrl}/v2/{sessionId}/basket/rooms",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'roomId' => 29449,
'rateId' => '20260605;20260608;32641',
'occupancyId' => 0,
'quantity' => 3,
'guestPosition' => 0,
'beddingConfigurationId' => '273bb7fa-aa7b-4cd1-92b9-7bdab3a21a06'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}using RestSharp;
var options = new RestClientOptions("https://{apiBaseUrl}/v2/{sessionId}/basket/rooms");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n \"roomId\": 29449,\n \"rateId\": \"20260605;20260608;32641\",\n \"occupancyId\": 0,\n \"quantity\": 3,\n \"guestPosition\": 0,\n \"beddingConfigurationId\": \"273bb7fa-aa7b-4cd1-92b9-7bdab3a21a06\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
HttpResponse<String> response = Unirest.post("https://{apiBaseUrl}/v2/{sessionId}/basket/rooms")
.header("Content-Type", "application/json")
.body("{\n \"roomId\": 29449,\n \"rateId\": \"20260605;20260608;32641\",\n \"occupancyId\": 0,\n \"quantity\": 3,\n \"guestPosition\": 0,\n \"beddingConfigurationId\": \"273bb7fa-aa7b-4cd1-92b9-7bdab3a21a06\"\n}")
.asString();{
"code": "InvalidUserAuthentication",
"message": "<string>"
}Basket
Add a room to the session's basket
Add a room to the session’s basket
POST
/
v2
/
{sessionId}
/
basket
/
rooms
Add a room to the session's basket
curl --request POST \
--url https://{apiBaseUrl}/v2/{sessionId}/basket/rooms \
--header 'Content-Type: application/json' \
--data '
{
"roomId": 29449,
"rateId": "20260605;20260608;32641",
"occupancyId": 0,
"quantity": 3,
"guestPosition": 0,
"beddingConfigurationId": "273bb7fa-aa7b-4cd1-92b9-7bdab3a21a06"
}
'const url = 'https://{apiBaseUrl}/v2/{sessionId}/basket/rooms';
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
roomId: 29449,
rateId: '20260605;20260608;32641',
occupancyId: 0,
quantity: 3,
guestPosition: 0,
beddingConfigurationId: '273bb7fa-aa7b-4cd1-92b9-7bdab3a21a06'
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));import requests
url = "https://{apiBaseUrl}/v2/{sessionId}/basket/rooms"
payload = {
"roomId": 29449,
"rateId": "20260605;20260608;32641",
"occupancyId": 0,
"quantity": 3,
"guestPosition": 0,
"beddingConfigurationId": "273bb7fa-aa7b-4cd1-92b9-7bdab3a21a06"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{apiBaseUrl}/v2/{sessionId}/basket/rooms",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'roomId' => 29449,
'rateId' => '20260605;20260608;32641',
'occupancyId' => 0,
'quantity' => 3,
'guestPosition' => 0,
'beddingConfigurationId' => '273bb7fa-aa7b-4cd1-92b9-7bdab3a21a06'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}using RestSharp;
var options = new RestClientOptions("https://{apiBaseUrl}/v2/{sessionId}/basket/rooms");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n \"roomId\": 29449,\n \"rateId\": \"20260605;20260608;32641\",\n \"occupancyId\": 0,\n \"quantity\": 3,\n \"guestPosition\": 0,\n \"beddingConfigurationId\": \"273bb7fa-aa7b-4cd1-92b9-7bdab3a21a06\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
HttpResponse<String> response = Unirest.post("https://{apiBaseUrl}/v2/{sessionId}/basket/rooms")
.header("Content-Type", "application/json")
.body("{\n \"roomId\": 29449,\n \"rateId\": \"20260605;20260608;32641\",\n \"occupancyId\": 0,\n \"quantity\": 3,\n \"guestPosition\": 0,\n \"beddingConfigurationId\": \"273bb7fa-aa7b-4cd1-92b9-7bdab3a21a06\"\n}")
.asString();{
"code": "InvalidUserAuthentication",
"message": "<string>"
}Headers
Path Parameters
Body
application/jsontext/json
The room identifier and the quantity required.
Describes the update basket room request model.
The room to add in the basket, as provided by the search/rooms endpoint.
The rate to add in the basket, as provided by the search/rooms endpoint.
Pattern:
^(\d{8};\d{8};\d+)(#(\d{8};\d{8};\d+))*$The occupancy to add in the basket, as provided by the search/rooms endpoint.
The quantity to add in the basket. Must not exceed the available quantity provided by the search/rooms endpoint.
The guest position in the Session.Context.Guests list the selected room will
be occupied by.
Gets or sets the bedding configuration id.
Example:
"00000000-0000-0000-0000-000000000000"
Response
The basket has been updated correctly
Was this page helpful?