curl --request PATCH \
--url https://{apiBaseUrl}/v2/{sessionId}/session/context \
--header 'Content-Type: application/json' \
--data '
{
"stayPeriod": {
"arrivalDate": "2026-06-08T00:00:00Z",
"departureDate": "2026-06-13T00:00:00Z"
},
"guests": [
{
"adults": 2,
"children": 0,
"infants": 0,
"position": 1,
"memberLevel": 0
}
],
"selectedHotelId": "10133",
"selectedRoomCode": "29513",
"highlightedRateCode": "32643",
"promoCode": "DISCOUNT",
"excludeMixedRates": false,
"disableCrossSell": false,
"isMobile": false
}
'const url = 'https://{apiBaseUrl}/v2/{sessionId}/session/context';
const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
stayPeriod: {arrivalDate: '2026-06-08T00:00:00Z', departureDate: '2026-06-13T00:00:00Z'},
guests: [{adults: 2, children: 0, infants: 0, position: 1, memberLevel: 0}],
selectedHotelId: '10133',
selectedRoomCode: '29513',
highlightedRateCode: '32643',
promoCode: 'DISCOUNT',
excludeMixedRates: false,
disableCrossSell: false,
isMobile: false
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));import requests
url = "https://{apiBaseUrl}/v2/{sessionId}/session/context"
payload = {
"stayPeriod": {
"arrivalDate": "2026-06-08T00:00:00Z",
"departureDate": "2026-06-13T00:00:00Z"
},
"guests": [
{
"adults": 2,
"children": 0,
"infants": 0,
"position": 1,
"memberLevel": 0
}
],
"selectedHotelId": "10133",
"selectedRoomCode": "29513",
"highlightedRateCode": "32643",
"promoCode": "DISCOUNT",
"excludeMixedRates": False,
"disableCrossSell": False,
"isMobile": False
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{apiBaseUrl}/v2/{sessionId}/session/context",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'stayPeriod' => [
'arrivalDate' => '2026-06-08T00:00:00Z',
'departureDate' => '2026-06-13T00:00:00Z'
],
'guests' => [
[
'adults' => 2,
'children' => 0,
'infants' => 0,
'position' => 1,
'memberLevel' => 0
]
],
'selectedHotelId' => '10133',
'selectedRoomCode' => '29513',
'highlightedRateCode' => '32643',
'promoCode' => 'DISCOUNT',
'excludeMixedRates' => false,
'disableCrossSell' => false,
'isMobile' => false
]),
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}/session/context");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n \"stayPeriod\": {\n \"arrivalDate\": \"2026-06-08T00:00:00Z\",\n \"departureDate\": \"2026-06-13T00:00:00Z\"\n },\n \"guests\": [\n {\n \"adults\": 2,\n \"children\": 0,\n \"infants\": 0,\n \"position\": 1,\n \"memberLevel\": 0\n }\n ],\n \"selectedHotelId\": \"10133\",\n \"selectedRoomCode\": \"29513\",\n \"highlightedRateCode\": \"32643\",\n \"promoCode\": \"DISCOUNT\",\n \"excludeMixedRates\": false,\n \"disableCrossSell\": false,\n \"isMobile\": false\n}", false);
var response = await client.PatchAsync(request);
Console.WriteLine("{0}", response.Content);
HttpResponse<String> response = Unirest.patch("https://{apiBaseUrl}/v2/{sessionId}/session/context")
.header("Content-Type", "application/json")
.body("{\n \"stayPeriod\": {\n \"arrivalDate\": \"2026-06-08T00:00:00Z\",\n \"departureDate\": \"2026-06-13T00:00:00Z\"\n },\n \"guests\": [\n {\n \"adults\": 2,\n \"children\": 0,\n \"infants\": 0,\n \"position\": 1,\n \"memberLevel\": 0\n }\n ],\n \"selectedHotelId\": \"10133\",\n \"selectedRoomCode\": \"29513\",\n \"highlightedRateCode\": \"32643\",\n \"promoCode\": \"DISCOUNT\",\n \"excludeMixedRates\": false,\n \"disableCrossSell\": false,\n \"isMobile\": false\n}")
.asString();{}{
"code": "InvalidSessionId"
}{
"code": "InvalidUserAuthentication",
"message": "<string>"
}Update the search context
Update the search context
curl --request PATCH \
--url https://{apiBaseUrl}/v2/{sessionId}/session/context \
--header 'Content-Type: application/json' \
--data '
{
"stayPeriod": {
"arrivalDate": "2026-06-08T00:00:00Z",
"departureDate": "2026-06-13T00:00:00Z"
},
"guests": [
{
"adults": 2,
"children": 0,
"infants": 0,
"position": 1,
"memberLevel": 0
}
],
"selectedHotelId": "10133",
"selectedRoomCode": "29513",
"highlightedRateCode": "32643",
"promoCode": "DISCOUNT",
"excludeMixedRates": false,
"disableCrossSell": false,
"isMobile": false
}
'const url = 'https://{apiBaseUrl}/v2/{sessionId}/session/context';
const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
stayPeriod: {arrivalDate: '2026-06-08T00:00:00Z', departureDate: '2026-06-13T00:00:00Z'},
guests: [{adults: 2, children: 0, infants: 0, position: 1, memberLevel: 0}],
selectedHotelId: '10133',
selectedRoomCode: '29513',
highlightedRateCode: '32643',
promoCode: 'DISCOUNT',
excludeMixedRates: false,
disableCrossSell: false,
isMobile: false
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));import requests
url = "https://{apiBaseUrl}/v2/{sessionId}/session/context"
payload = {
"stayPeriod": {
"arrivalDate": "2026-06-08T00:00:00Z",
"departureDate": "2026-06-13T00:00:00Z"
},
"guests": [
{
"adults": 2,
"children": 0,
"infants": 0,
"position": 1,
"memberLevel": 0
}
],
"selectedHotelId": "10133",
"selectedRoomCode": "29513",
"highlightedRateCode": "32643",
"promoCode": "DISCOUNT",
"excludeMixedRates": False,
"disableCrossSell": False,
"isMobile": False
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{apiBaseUrl}/v2/{sessionId}/session/context",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'stayPeriod' => [
'arrivalDate' => '2026-06-08T00:00:00Z',
'departureDate' => '2026-06-13T00:00:00Z'
],
'guests' => [
[
'adults' => 2,
'children' => 0,
'infants' => 0,
'position' => 1,
'memberLevel' => 0
]
],
'selectedHotelId' => '10133',
'selectedRoomCode' => '29513',
'highlightedRateCode' => '32643',
'promoCode' => 'DISCOUNT',
'excludeMixedRates' => false,
'disableCrossSell' => false,
'isMobile' => false
]),
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}/session/context");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n \"stayPeriod\": {\n \"arrivalDate\": \"2026-06-08T00:00:00Z\",\n \"departureDate\": \"2026-06-13T00:00:00Z\"\n },\n \"guests\": [\n {\n \"adults\": 2,\n \"children\": 0,\n \"infants\": 0,\n \"position\": 1,\n \"memberLevel\": 0\n }\n ],\n \"selectedHotelId\": \"10133\",\n \"selectedRoomCode\": \"29513\",\n \"highlightedRateCode\": \"32643\",\n \"promoCode\": \"DISCOUNT\",\n \"excludeMixedRates\": false,\n \"disableCrossSell\": false,\n \"isMobile\": false\n}", false);
var response = await client.PatchAsync(request);
Console.WriteLine("{0}", response.Content);
HttpResponse<String> response = Unirest.patch("https://{apiBaseUrl}/v2/{sessionId}/session/context")
.header("Content-Type", "application/json")
.body("{\n \"stayPeriod\": {\n \"arrivalDate\": \"2026-06-08T00:00:00Z\",\n \"departureDate\": \"2026-06-13T00:00:00Z\"\n },\n \"guests\": [\n {\n \"adults\": 2,\n \"children\": 0,\n \"infants\": 0,\n \"position\": 1,\n \"memberLevel\": 0\n }\n ],\n \"selectedHotelId\": \"10133\",\n \"selectedRoomCode\": \"29513\",\n \"highlightedRateCode\": \"32643\",\n \"promoCode\": \"DISCOUNT\",\n \"excludeMixedRates\": false,\n \"disableCrossSell\": false,\n \"isMobile\": false\n}")
.asString();{}{
"code": "InvalidSessionId"
}{
"code": "InvalidUserAuthentication",
"message": "<string>"
}Path Parameters
Body
The new search context
This represent the parameters used to configure future call to the service. It represents more or less the data entered by the final customer.
Describe a period of stay by specifying the arrival date and the departure date.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
The currently selected hotel id. Could be zero when starting a session for a multi hotel booking engine. Automatically set when starting a session for a mono hotel booking engine.
Configure whether the search results should include mixed rates or not.
Configure whether the search results should return cross sell configuration when no rooms are available.
Configure whether the request came from a mobile or not.
The promo code requested for the session. It could be either an OfferCode or a RateCode.
If defined the search results should be based on user's location.
Show child attributes
Show child attributes
Response
OK
The response is of type object.
Was this page helpful?