curl --request PATCH \
--url https://clarus-api.com/api/stocks/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "stocks",
"attributes": {
"description": "Repackaged pallet",
"string1": "REF-00821",
"integer1": 12,
"unit_dimensions": {
"weight": 15.5,
"weight_unit_of_measure": "kilogram",
"height": 20,
"width": 30,
"length": 40,
"unit_of_measure": "centimetre"
}
}
}
}
'import requests
url = "https://clarus-api.com/api/stocks/{id}"
payload = { "data": {
"type": "stocks",
"attributes": {
"description": "Repackaged pallet",
"string1": "REF-00821",
"integer1": 12,
"unit_dimensions": {
"weight": 15.5,
"weight_unit_of_measure": "kilogram",
"height": 20,
"width": 30,
"length": 40,
"unit_of_measure": "centimetre"
}
}
} }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {
type: 'stocks',
attributes: {
description: 'Repackaged pallet',
string1: 'REF-00821',
integer1: 12,
unit_dimensions: {
weight: 15.5,
weight_unit_of_measure: 'kilogram',
height: 20,
width: 30,
length: 40,
unit_of_measure: 'centimetre'
}
}
}
})
};
fetch('https://clarus-api.com/api/stocks/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"type": "stocks",
"id": 123,
"attributes": {
"status": "available",
"quantity": 100,
"description": "Repackaged pallet",
"string1": "REF-00821",
"integer1": 12,
"height": 20,
"width": 30,
"depth": 40
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Update stock details
Update the details of an existing stock record. Covers descriptive fields, packaging configuration, physical dimensions (including weight, via the nested unit_dimensions object), and the tenant-configurable custom fields. This endpoint does not move stock or change quantity — use the dedicated move, transfer, hold and negative adjustment actions for those. Creates an attributes-updated (ATTRUP) transaction for audit purposes.
curl --request PATCH \
--url https://clarus-api.com/api/stocks/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "stocks",
"attributes": {
"description": "Repackaged pallet",
"string1": "REF-00821",
"integer1": 12,
"unit_dimensions": {
"weight": 15.5,
"weight_unit_of_measure": "kilogram",
"height": 20,
"width": 30,
"length": 40,
"unit_of_measure": "centimetre"
}
}
}
}
'import requests
url = "https://clarus-api.com/api/stocks/{id}"
payload = { "data": {
"type": "stocks",
"attributes": {
"description": "Repackaged pallet",
"string1": "REF-00821",
"integer1": 12,
"unit_dimensions": {
"weight": 15.5,
"weight_unit_of_measure": "kilogram",
"height": 20,
"width": 30,
"length": 40,
"unit_of_measure": "centimetre"
}
}
} }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {
type: 'stocks',
attributes: {
description: 'Repackaged pallet',
string1: 'REF-00821',
integer1: 12,
unit_dimensions: {
weight: 15.5,
weight_unit_of_measure: 'kilogram',
height: 20,
width: 30,
length: 40,
unit_of_measure: 'centimetre'
}
}
}
})
};
fetch('https://clarus-api.com/api/stocks/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"type": "stocks",
"id": 123,
"attributes": {
"status": "available",
"quantity": 100,
"description": "Repackaged pallet",
"string1": "REF-00821",
"integer1": 12,
"height": 20,
"width": 30,
"depth": 40
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Request Structure
{
"data": {
"type": "stocks",
"attributes": {
"description": "Repackaged pallet",
"string1": "REF-00821",
"unit_dimensions": {
"weight": 15.5,
"weight_unit_of_measure": "kilogram"
}
}
}
}
Key Fields
| Field | Type | Description |
|---|---|---|
description | string | Free-text description of the stock line |
stock_configuration | string | Packaging configuration: unit, case, inner, outer |
unit_of_measure | string | Dimension unit: centimetre, metre, inch, foot, millimetre |
height, width, depth | number | Physical dimensions of the stock line (>= 0) |
units_per_layer, configurations_per_layer, units_per_configuration | number | Layout/packing quantities (>= 0) |
unit_dimensions | object | Nested dimensions record where weight and other physical measurements are held — see below |
string1–string5 | string | Tenant-configurable custom text fields |
integer1–integer5 | integer | Tenant-configurable custom number fields |
datetime1–datetime5 | string (date-time) | Tenant-configurable custom date/time fields |
boolean1–boolean5 | boolean | Tenant-configurable custom flag fields |
Setting Weight
Weight is stored on the stock’s associated dimensions record, not directly on the stock. Set it via the nestedunit_dimensions object:
| Field | Type | Description |
|---|---|---|
weight | number | Weight of a single unit (>= 0) |
weight_unit_of_measure | string | gram or kilogram |
packing_weight | number | Packaging weight of a single unit (>= 0) |
packing_weight_unit_of_measure | string | gram or kilogram |
volume | number | Volume of a single unit (>= 0) |
volume_unit_of_measure | string | millilitre, litre, hectolitre, gallon, pint |
cube | number | Cubic measurement (>= 0) |
height, length, width | number | Physical dimensions (>= 0) |
value | number | Monetary/assessed value (>= 0) |
unit_of_measure | string | Dimension unit for the measurements above |
stock_configuration | string | Configuration the dimensions apply to |
packing_description | string | Free-text packing description |
Authorizations
OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.
- Authorization URL
- https://clarus-api.com/oauth/authorize
- Token URL
- https://clarus-api.com/oauth/token
- Token URL
- https://clarus-api.com/oauth/token
The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.
Path Parameters
The unique identifier of the stock record to update
Body
Request body for updating the details of a stock record. All attributes are optional — send only the fields to change.
Show child attributes
Show child attributes
Response
Stock updated successfully
Standard successful response wrapper following JSON:API format
The response payload
Show child attributes
Show child attributes

