Create a product storage unit
curl --request POST \
--url https://clarus-api.com/api/product_storage_units \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "product_storage_units",
"attributes": {
"product_id": 150,
"storage_unit_type_id": 12,
"stock_configuration": "case",
"unit_of_measure": "centimetre",
"per_layer": 10,
"number_of_layers": 5,
"total": 50
}
}
}
'import requests
url = "https://clarus-api.com/api/product_storage_units"
payload = { "data": {
"type": "product_storage_units",
"attributes": {
"product_id": 150,
"storage_unit_type_id": 12,
"stock_configuration": "case",
"unit_of_measure": "centimetre",
"per_layer": 10,
"number_of_layers": 5,
"total": 50
}
} }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {
type: 'product_storage_units',
attributes: {
product_id: 150,
storage_unit_type_id: 12,
stock_configuration: 'case',
unit_of_measure: 'centimetre',
per_layer: 10,
number_of_layers: 5,
total: 50
}
}
})
};
fetch('https://clarus-api.com/api/product_storage_units', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": "1",
"type": "product_storage_units",
"attributes": {
"product_id": 150,
"priority": 0,
"per_layer": 10,
"number_of_layers": 5,
"total": 50
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Products: Storage Units
Create a product storage unit
Create a product storage unit.
POST
/
api
/
product_storage_units
Create a product storage unit
curl --request POST \
--url https://clarus-api.com/api/product_storage_units \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "product_storage_units",
"attributes": {
"product_id": 150,
"storage_unit_type_id": 12,
"stock_configuration": "case",
"unit_of_measure": "centimetre",
"per_layer": 10,
"number_of_layers": 5,
"total": 50
}
}
}
'import requests
url = "https://clarus-api.com/api/product_storage_units"
payload = { "data": {
"type": "product_storage_units",
"attributes": {
"product_id": 150,
"storage_unit_type_id": 12,
"stock_configuration": "case",
"unit_of_measure": "centimetre",
"per_layer": 10,
"number_of_layers": 5,
"total": 50
}
} }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {
type: 'product_storage_units',
attributes: {
product_id: 150,
storage_unit_type_id: 12,
stock_configuration: 'case',
unit_of_measure: 'centimetre',
per_layer: 10,
number_of_layers: 5,
total: 50
}
}
})
};
fetch('https://clarus-api.com/api/product_storage_units', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": "1",
"type": "product_storage_units",
"attributes": {
"product_id": 150,
"priority": 0,
"per_layer": 10,
"number_of_layers": 5,
"total": 50
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Request Structure
{
"data": {
"type": "product_storage_units",
"attributes": {
"product_id": 150,
"storage_unit_type_id": 12,
"stock_configuration": "case",
"unit_of_measure": "centimetre",
"per_layer": 10,
"number_of_layers": 5
}
}
}
| Field | Required | Description |
|---|---|---|
product_id | Yes | Product |
storage_unit_type_id | Yes | Storage unit type |
stock_configuration | Yes | unit, case, inner, or outer |
unit_of_measure | Yes | Dimension unit |
per_layer / number_of_layers | Yes | Layer config |
PATCH /api/product_storage_units/{id}/priority.Authorizations
OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.
The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.
Body
application/json
Show child attributes
Show child attributes
Response
Created successfully
The response is of type object.
⌘I

