Add an extra to the session's basket
curl --request POST \
--url https://{apiBaseUrl}/v2/{sessionId}/basket/extras \
--header 'Content-Type: application/json' \
--data '
{
"extraId": 1234,
"roomId": 29449,
"quantity": 3,
"guestPosition": 0
}
'const url = 'https://{apiBaseUrl}/v2/{sessionId}/basket/extras';
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({extraId: 1234, roomId: 29449, quantity: 3, guestPosition: 0})
};
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/extras"
payload = {
"extraId": 1234,
"roomId": 29449,
"quantity": 3,
"guestPosition": 0
}
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/extras",
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([
'extraId' => 1234,
'roomId' => 29449,
'quantity' => 3,
'guestPosition' => 0
]),
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/extras");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n \"extraId\": 1234,\n \"roomId\": 29449,\n \"quantity\": 3,\n \"guestPosition\": 0\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
HttpResponse<String> response = Unirest.post("https://{apiBaseUrl}/v2/{sessionId}/basket/extras")
.header("Content-Type", "application/json")
.body("{\n \"extraId\": 1234,\n \"roomId\": 29449,\n \"quantity\": 3,\n \"guestPosition\": 0\n}")
.asString();{
"code": "InvalidUserAuthentication",
"message": "<string>"
}Basket
Add an extra to the session's basket
Add an extra to the session’s basket
POST
/
v2
/
{sessionId}
/
basket
/
extras
Add an extra to the session's basket
curl --request POST \
--url https://{apiBaseUrl}/v2/{sessionId}/basket/extras \
--header 'Content-Type: application/json' \
--data '
{
"extraId": 1234,
"roomId": 29449,
"quantity": 3,
"guestPosition": 0
}
'const url = 'https://{apiBaseUrl}/v2/{sessionId}/basket/extras';
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({extraId: 1234, roomId: 29449, quantity: 3, guestPosition: 0})
};
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/extras"
payload = {
"extraId": 1234,
"roomId": 29449,
"quantity": 3,
"guestPosition": 0
}
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/extras",
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([
'extraId' => 1234,
'roomId' => 29449,
'quantity' => 3,
'guestPosition' => 0
]),
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/extras");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n \"extraId\": 1234,\n \"roomId\": 29449,\n \"quantity\": 3,\n \"guestPosition\": 0\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
HttpResponse<String> response = Unirest.post("https://{apiBaseUrl}/v2/{sessionId}/basket/extras")
.header("Content-Type", "application/json")
.body("{\n \"extraId\": 1234,\n \"roomId\": 29449,\n \"quantity\": 3,\n \"guestPosition\": 0\n}")
.asString();{
"code": "InvalidUserAuthentication",
"message": "<string>"
}Headers
Path Parameters
Body
application/jsontext/json
The extra identifier and the quantity required.
The extra to add in the basket, as provided by the search/extras endpoint.
The roomId of the extra to add in the basket (only for room extras), as provided by the search/extras endpoint.
The quantity to add in the basket. Must not exceed the available quantity provided by the search/extras endpoint.
The guest position in the Session.Context.Guests list the selected room will be occupied by.
Response
The basket has been updated correctly
Was this page helpful?