curl --request POST \
--url https://{base_url_domain}/api/global/v1/inventory/warehouses/{id}/locations/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"onError": "continue",
"operation": "upsert",
"locations": [
{
"label": "RK07-R2-S1-L1",
"rack": {
"type": "Rack",
"id": 3
},
"location_type": {
"type": "LocationType",
"id": 3
},
"priority": 2
}
]
}
'import requests
url = "https://{base_url_domain}/api/global/v1/inventory/warehouses/{id}/locations/batch"
payload = {
"onError": "continue",
"operation": "upsert",
"locations": [
{
"label": "RK07-R2-S1-L1",
"rack": {
"type": "Rack",
"id": 3
},
"location_type": {
"type": "LocationType",
"id": 3
},
"priority": 2
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
onError: 'continue',
operation: 'upsert',
locations: [
{
label: 'RK07-R2-S1-L1',
rack: {type: 'Rack', id: 3},
location_type: {type: 'LocationType', id: 3},
priority: 2
}
]
})
};
fetch('https://{base_url_domain}/api/global/v1/inventory/warehouses/{id}/locations/batch', 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://{base_url_domain}/api/global/v1/inventory/warehouses/{id}/locations/batch",
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([
'onError' => 'continue',
'operation' => 'upsert',
'locations' => [
[
'label' => 'RK07-R2-S1-L1',
'rack' => [
'type' => 'Rack',
'id' => 3
],
'location_type' => [
'type' => 'LocationType',
'id' => 3
],
'priority' => 2
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://{base_url_domain}/api/global/v1/inventory/warehouses/{id}/locations/batch"
payload := strings.NewReader("{\n \"onError\": \"continue\",\n \"operation\": \"upsert\",\n \"locations\": [\n {\n \"label\": \"RK07-R2-S1-L1\",\n \"rack\": {\n \"type\": \"Rack\",\n \"id\": 3\n },\n \"location_type\": {\n \"type\": \"LocationType\",\n \"id\": 3\n },\n \"priority\": 2\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.post("https://{base_url_domain}/api/global/v1/inventory/warehouses/{id}/locations/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"onError\": \"continue\",\n \"operation\": \"upsert\",\n \"locations\": [\n {\n \"label\": \"RK07-R2-S1-L1\",\n \"rack\": {\n \"type\": \"Rack\",\n \"id\": 3\n },\n \"location_type\": {\n \"type\": \"LocationType\",\n \"id\": 3\n },\n \"priority\": 2\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{base_url_domain}/api/global/v1/inventory/warehouses/{id}/locations/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"onError\": \"continue\",\n \"operation\": \"upsert\",\n \"locations\": [\n {\n \"label\": \"RK07-R2-S1-L1\",\n \"rack\": {\n \"type\": \"Rack\",\n \"id\": 3\n },\n \"location_type\": {\n \"type\": \"LocationType\",\n \"id\": 3\n },\n \"priority\": 2\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"committed": 1,
"failed": 1,
"results": [
{
"resource": {
"type": "Location",
"id": 42,
"label": "RK07-R2-S1-L1"
},
"status": "committed",
"message": "<string>"
}
]
}{
"errors": [
{
"type": "parameters",
"message": "The supplied parameters are invalid.",
"details": [
{
"key": "hold_until_date",
"message": "The date must be in the future."
}
]
}
]
}{
"errors": [
{
"type": "not_found",
"message": "The server could not find the requested resource."
}
]
}{
"errors": [
{
"type": "unable_to_process",
"message": "The supplied parameters are invalid.",
"details": [
{
"key": "hold_until_date",
"message": "The date must be in the future."
}
]
}
]
}Batch update Locations
Creates or updates a Location collection specified by a warehouse id path parameter and according to the request body.
curl --request POST \
--url https://{base_url_domain}/api/global/v1/inventory/warehouses/{id}/locations/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"onError": "continue",
"operation": "upsert",
"locations": [
{
"label": "RK07-R2-S1-L1",
"rack": {
"type": "Rack",
"id": 3
},
"location_type": {
"type": "LocationType",
"id": 3
},
"priority": 2
}
]
}
'import requests
url = "https://{base_url_domain}/api/global/v1/inventory/warehouses/{id}/locations/batch"
payload = {
"onError": "continue",
"operation": "upsert",
"locations": [
{
"label": "RK07-R2-S1-L1",
"rack": {
"type": "Rack",
"id": 3
},
"location_type": {
"type": "LocationType",
"id": 3
},
"priority": 2
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
onError: 'continue',
operation: 'upsert',
locations: [
{
label: 'RK07-R2-S1-L1',
rack: {type: 'Rack', id: 3},
location_type: {type: 'LocationType', id: 3},
priority: 2
}
]
})
};
fetch('https://{base_url_domain}/api/global/v1/inventory/warehouses/{id}/locations/batch', 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://{base_url_domain}/api/global/v1/inventory/warehouses/{id}/locations/batch",
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([
'onError' => 'continue',
'operation' => 'upsert',
'locations' => [
[
'label' => 'RK07-R2-S1-L1',
'rack' => [
'type' => 'Rack',
'id' => 3
],
'location_type' => [
'type' => 'LocationType',
'id' => 3
],
'priority' => 2
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://{base_url_domain}/api/global/v1/inventory/warehouses/{id}/locations/batch"
payload := strings.NewReader("{\n \"onError\": \"continue\",\n \"operation\": \"upsert\",\n \"locations\": [\n {\n \"label\": \"RK07-R2-S1-L1\",\n \"rack\": {\n \"type\": \"Rack\",\n \"id\": 3\n },\n \"location_type\": {\n \"type\": \"LocationType\",\n \"id\": 3\n },\n \"priority\": 2\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.post("https://{base_url_domain}/api/global/v1/inventory/warehouses/{id}/locations/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"onError\": \"continue\",\n \"operation\": \"upsert\",\n \"locations\": [\n {\n \"label\": \"RK07-R2-S1-L1\",\n \"rack\": {\n \"type\": \"Rack\",\n \"id\": 3\n },\n \"location_type\": {\n \"type\": \"LocationType\",\n \"id\": 3\n },\n \"priority\": 2\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{base_url_domain}/api/global/v1/inventory/warehouses/{id}/locations/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"onError\": \"continue\",\n \"operation\": \"upsert\",\n \"locations\": [\n {\n \"label\": \"RK07-R2-S1-L1\",\n \"rack\": {\n \"type\": \"Rack\",\n \"id\": 3\n },\n \"location_type\": {\n \"type\": \"LocationType\",\n \"id\": 3\n },\n \"priority\": 2\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"committed": 1,
"failed": 1,
"results": [
{
"resource": {
"type": "Location",
"id": 42,
"label": "RK07-R2-S1-L1"
},
"status": "committed",
"message": "<string>"
}
]
}{
"errors": [
{
"type": "parameters",
"message": "The supplied parameters are invalid.",
"details": [
{
"key": "hold_until_date",
"message": "The date must be in the future."
}
]
}
]
}{
"errors": [
{
"type": "not_found",
"message": "The server could not find the requested resource."
}
]
}{
"errors": [
{
"type": "unable_to_process",
"message": "The supplied parameters are invalid.",
"details": [
{
"key": "hold_until_date",
"message": "The date must be in the future."
}
]
}
]
}Authorizations
Generate a JWT access token through a Custom Global Integration and provide it with each request in the Authorization header prefixed with "Bearer" and then a single space.
Path Parameters
The id of the referenced Warehouse.
x >= 1Body
An object conforming to the Inventory Warehouse Location schemas batch to be created or updated.
The value determining how errors are to be handled.
continueThe current entity will be rolled back and any remaining entities will continue to be processed.stopThe current entity will be rolled back and the request will stop processing any remaining entities.abortThe entire request will be rolled back.
continue, stop, abort upsert: Create if it doesn't exist, otherwise updateinsert: Create only, existing locations will not be updatedupdate: Update existing locations, no locations will be createddelete: Delete locations
upsert, insert, update, delete Show child attributes
Show child attributes
Response
No fatal client or server errors occurred. Check the response to see which items were updated successfully.
Number of locations that were successfully inserted/updated in this batch.
1
The number of locations that could not be updated due to an error. Check the response results for more details.
1
An array of objects describing the resources that were created.
1Show child attributes
Show child attributes
Was this page helpful?