Perform negative stock adjustment
curl --request PUT \
--url https://clarus-api.com/api/stocks/{id}/negative_adjustment \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"description": "Damaged in storage",
"quantity": 10
}
'import requests
url = "https://clarus-api.com/api/stocks/{id}/negative_adjustment"
payload = {
"description": "Damaged in storage",
"quantity": 10
}
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({description: 'Damaged in storage', quantity: 10})
};
fetch('https://clarus-api.com/api/stocks/{id}/negative_adjustment', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Stocks
Perform negative stock adjustment
Reduce the quantity of an existing stock record. Use this for stock corrections, write-offs, or recording damaged/lost inventory. The reduction is recorded as a negative adjustment transaction. To increase stock, use the positive adjustment endpoints.
PUT
/
api
/
stocks
/
{id}
/
negative_adjustment
Perform negative stock adjustment
curl --request PUT \
--url https://clarus-api.com/api/stocks/{id}/negative_adjustment \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"description": "Damaged in storage",
"quantity": 10
}
'import requests
url = "https://clarus-api.com/api/stocks/{id}/negative_adjustment"
payload = {
"description": "Damaged in storage",
"quantity": 10
}
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({description: 'Damaged in storage', quantity: 10})
};
fetch('https://clarus-api.com/api/stocks/{id}/negative_adjustment', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Request Structure
{
"description": "Damaged in storage",
"quantity": 10,
"reason_code_id": 2
}
Key Fields
| Field | Required | Description |
|---|---|---|
quantity | Yes | Quantity to remove (must be > 0 and no more than the stock’s quantity) |
description | Yes | Free-text reason for the adjustment (audit trail) |
reason_code_id | No | negative_adjustment reason code (e.g. damaged, expired); required if the account enforces one |
Behavior
- The stock must have status
AVAILABLEor be on hold, and its stock balance (available or on hold respectively) must coverquantity. - The stock’s quantity decreases by
quantity, and the stock balance for its account, product and warehouse decreases with it. - The response has no body (204).
Error Codes
| Code | Symbol | Description |
|---|---|---|
| 170 | stock_balance_must_be_positive | The stock balance does not cover the quantity being removed |
| 228 | incorrect_reason_code_type | Reason code is not a negative_adjustment reason code |
| 229 | reason_code_account_mismatch | Reason code is restricted to other accounts |
| 230 | reason_code_missing | No reason code was sent but the account enforces negative adjustment reason codes |
Authorizations
Body
application/json
Request body for negative stock adjustment. The body is sent as plain JSON, not wrapped in a JSON:API data envelope.
Response
Stock adjusted successfully

