curl --request PUT \
--url https://api.example.com/{supplierapi}/product/{productId}/allocation/{productAllocationId} \
--header 'Content-Type: application/json' \
--data '
{
"startDate": "2023-12-25",
"allocationName": "<string>",
"defaultQuantity": 123,
"endDate": "2023-12-25",
"blockoutDays": "<string>",
"bookingDetailId": 123,
"bookingBuffer": 123,
"newProductPricesDetailsIds": "<string>"
}
'import requests
url = "https://api.example.com/{supplierapi}/product/{productId}/allocation/{productAllocationId}"
payload = {
"startDate": "2023-12-25",
"allocationName": "<string>",
"defaultQuantity": 123,
"endDate": "2023-12-25",
"blockoutDays": "<string>",
"bookingDetailId": 123,
"bookingBuffer": 123,
"newProductPricesDetailsIds": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
startDate: '2023-12-25',
allocationName: '<string>',
defaultQuantity: 123,
endDate: '2023-12-25',
blockoutDays: '<string>',
bookingDetailId: 123,
bookingBuffer: 123,
newProductPricesDetailsIds: '<string>'
})
};
fetch('https://api.example.com/{supplierapi}/product/{productId}/allocation/{productAllocationId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/{supplierapi}/product/{productId}/allocation/{productAllocationId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'startDate' => '2023-12-25',
'allocationName' => '<string>',
'defaultQuantity' => 123,
'endDate' => '2023-12-25',
'blockoutDays' => '<string>',
'bookingDetailId' => 123,
'bookingBuffer' => 123,
'newProductPricesDetailsIds' => '<string>'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/{supplierapi}/product/{productId}/allocation/{productAllocationId}"
payload := strings.NewReader("{\n \"startDate\": \"2023-12-25\",\n \"allocationName\": \"<string>\",\n \"defaultQuantity\": 123,\n \"endDate\": \"2023-12-25\",\n \"blockoutDays\": \"<string>\",\n \"bookingDetailId\": 123,\n \"bookingBuffer\": 123,\n \"newProductPricesDetailsIds\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.example.com/{supplierapi}/product/{productId}/allocation/{productAllocationId}")
.header("Content-Type", "application/json")
.body("{\n \"startDate\": \"2023-12-25\",\n \"allocationName\": \"<string>\",\n \"defaultQuantity\": 123,\n \"endDate\": \"2023-12-25\",\n \"blockoutDays\": \"<string>\",\n \"bookingDetailId\": 123,\n \"bookingBuffer\": 123,\n \"newProductPricesDetailsIds\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/{supplierapi}/product/{productId}/allocation/{productAllocationId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"startDate\": \"2023-12-25\",\n \"allocationName\": \"<string>\",\n \"defaultQuantity\": 123,\n \"endDate\": \"2023-12-25\",\n \"blockoutDays\": \"<string>\",\n \"bookingDetailId\": 123,\n \"bookingBuffer\": 123,\n \"newProductPricesDetailsIds\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyUpdate an Allocation
Update an Allocation
Updates an existing Allocation. All fields are optional: you only pass in the fields that you want to change. Note that you cannot remove existing ProductPrices from an Allocation, although you can add new ones. A ProductPrice can only belong to one Allocation at a time, so adding it to one Allocation will have the effect of removing it from any previous Allocation that it belonged to.
curl --request PUT \
--url https://api.example.com/{supplierapi}/product/{productId}/allocation/{productAllocationId} \
--header 'Content-Type: application/json' \
--data '
{
"startDate": "2023-12-25",
"allocationName": "<string>",
"defaultQuantity": 123,
"endDate": "2023-12-25",
"blockoutDays": "<string>",
"bookingDetailId": 123,
"bookingBuffer": 123,
"newProductPricesDetailsIds": "<string>"
}
'import requests
url = "https://api.example.com/{supplierapi}/product/{productId}/allocation/{productAllocationId}"
payload = {
"startDate": "2023-12-25",
"allocationName": "<string>",
"defaultQuantity": 123,
"endDate": "2023-12-25",
"blockoutDays": "<string>",
"bookingDetailId": 123,
"bookingBuffer": 123,
"newProductPricesDetailsIds": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
startDate: '2023-12-25',
allocationName: '<string>',
defaultQuantity: 123,
endDate: '2023-12-25',
blockoutDays: '<string>',
bookingDetailId: 123,
bookingBuffer: 123,
newProductPricesDetailsIds: '<string>'
})
};
fetch('https://api.example.com/{supplierapi}/product/{productId}/allocation/{productAllocationId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/{supplierapi}/product/{productId}/allocation/{productAllocationId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'startDate' => '2023-12-25',
'allocationName' => '<string>',
'defaultQuantity' => 123,
'endDate' => '2023-12-25',
'blockoutDays' => '<string>',
'bookingDetailId' => 123,
'bookingBuffer' => 123,
'newProductPricesDetailsIds' => '<string>'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/{supplierapi}/product/{productId}/allocation/{productAllocationId}"
payload := strings.NewReader("{\n \"startDate\": \"2023-12-25\",\n \"allocationName\": \"<string>\",\n \"defaultQuantity\": 123,\n \"endDate\": \"2023-12-25\",\n \"blockoutDays\": \"<string>\",\n \"bookingDetailId\": 123,\n \"bookingBuffer\": 123,\n \"newProductPricesDetailsIds\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.example.com/{supplierapi}/product/{productId}/allocation/{productAllocationId}")
.header("Content-Type", "application/json")
.body("{\n \"startDate\": \"2023-12-25\",\n \"allocationName\": \"<string>\",\n \"defaultQuantity\": 123,\n \"endDate\": \"2023-12-25\",\n \"blockoutDays\": \"<string>\",\n \"bookingDetailId\": 123,\n \"bookingBuffer\": 123,\n \"newProductPricesDetailsIds\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/{supplierapi}/product/{productId}/allocation/{productAllocationId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"startDate\": \"2023-12-25\",\n \"allocationName\": \"<string>\",\n \"defaultQuantity\": 123,\n \"endDate\": \"2023-12-25\",\n \"blockoutDays\": \"<string>\",\n \"bookingDetailId\": 123,\n \"bookingBuffer\": 123,\n \"newProductPricesDetailsIds\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyPath Parameters
The ID of the Product
The ID of the Product Allocation
supplier|apiv1/supplierBody
Allocation details to update
Start date of this Allocation.
Name of the Allocation.
Default quantity for this Allocation.
End date of this Allocation.
Days of the week when the product is not available.
ID for the BookingDetail Object for this allocation.
Number of days before booking date to disable reservations.
IDs for the ProductPricesDetails to add to this Allocation.
Response
Returned when successful.