Make adjustments to an Allocation's availability
curl --request PUT \
--url https://api.example.com/{supplierapi}/product/{productId}/allocation/{productAllocationId}/adjustments \
--header 'Content-Type: application/json' \
--data '
{
"dateRanges": [
{
"startDate": "2023-12-25",
"adjustment": 123,
"endDate": "2023-12-25"
}
]
}
'import requests
url = "https://api.example.com/{supplierapi}/product/{productId}/allocation/{productAllocationId}/adjustments"
payload = { "dateRanges": [
{
"startDate": "2023-12-25",
"adjustment": 123,
"endDate": "2023-12-25"
}
] }
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({
dateRanges: [{startDate: '2023-12-25', adjustment: 123, endDate: '2023-12-25'}]
})
};
fetch('https://api.example.com/{supplierapi}/product/{productId}/allocation/{productAllocationId}/adjustments', 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}/adjustments",
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([
'dateRanges' => [
[
'startDate' => '2023-12-25',
'adjustment' => 123,
'endDate' => '2023-12-25'
]
]
]),
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}/adjustments"
payload := strings.NewReader("{\n \"dateRanges\": [\n {\n \"startDate\": \"2023-12-25\",\n \"adjustment\": 123,\n \"endDate\": \"2023-12-25\"\n }\n ]\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}/adjustments")
.header("Content-Type", "application/json")
.body("{\n \"dateRanges\": [\n {\n \"startDate\": \"2023-12-25\",\n \"adjustment\": 123,\n \"endDate\": \"2023-12-25\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/{supplierapi}/product/{productId}/allocation/{productAllocationId}/adjustments")
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 \"dateRanges\": [\n {\n \"startDate\": \"2023-12-25\",\n \"adjustment\": 123,\n \"endDate\": \"2023-12-25\"\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyVersion 1
Make adjustments to an Allocation's availability
Make adjustments to an Allocation’s availability
Sets an adjusted availability for a given date range. For example, if the default availability is 20 and an adjustment of -5 is passed in, availability during that date range will be adjusted to 15. Each call to this method will replace the previous adjustment for the dates provided, if any. Adjustments will NOT be changed if the default availability for the Allocation is changed.
PUT
/
{supplierapi}
/
product
/
{productId}
/
allocation
/
{productAllocationId}
/
adjustments
Make adjustments to an Allocation's availability
curl --request PUT \
--url https://api.example.com/{supplierapi}/product/{productId}/allocation/{productAllocationId}/adjustments \
--header 'Content-Type: application/json' \
--data '
{
"dateRanges": [
{
"startDate": "2023-12-25",
"adjustment": 123,
"endDate": "2023-12-25"
}
]
}
'import requests
url = "https://api.example.com/{supplierapi}/product/{productId}/allocation/{productAllocationId}/adjustments"
payload = { "dateRanges": [
{
"startDate": "2023-12-25",
"adjustment": 123,
"endDate": "2023-12-25"
}
] }
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({
dateRanges: [{startDate: '2023-12-25', adjustment: 123, endDate: '2023-12-25'}]
})
};
fetch('https://api.example.com/{supplierapi}/product/{productId}/allocation/{productAllocationId}/adjustments', 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}/adjustments",
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([
'dateRanges' => [
[
'startDate' => '2023-12-25',
'adjustment' => 123,
'endDate' => '2023-12-25'
]
]
]),
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}/adjustments"
payload := strings.NewReader("{\n \"dateRanges\": [\n {\n \"startDate\": \"2023-12-25\",\n \"adjustment\": 123,\n \"endDate\": \"2023-12-25\"\n }\n ]\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}/adjustments")
.header("Content-Type", "application/json")
.body("{\n \"dateRanges\": [\n {\n \"startDate\": \"2023-12-25\",\n \"adjustment\": 123,\n \"endDate\": \"2023-12-25\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/{supplierapi}/product/{productId}/allocation/{productAllocationId}/adjustments")
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 \"dateRanges\": [\n {\n \"startDate\": \"2023-12-25\",\n \"adjustment\": 123,\n \"endDate\": \"2023-12-25\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body