curl --request POST \
--url https://clarus-api.com/api/positive_adjustments/create_stocks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"account_id": 1,
"description": "Stock found during cycle count",
"stock_date": "2026-10-17T09:30:00Z",
"stocks": [
{
"location_id": 100,
"product_id": 123,
"quantity": 6
},
{
"location_id": 101,
"product_id": 123,
"quantity": 24,
"storage_unit_quantity": 1,
"storage_unit_type_id": 2
}
],
"warehouse_id": 1
}
'import requests
url = "https://clarus-api.com/api/positive_adjustments/create_stocks"
payload = {
"account_id": 1,
"description": "Stock found during cycle count",
"stock_date": "2026-10-17T09:30:00Z",
"stocks": [
{
"location_id": 100,
"product_id": 123,
"quantity": 6
},
{
"location_id": 101,
"product_id": 123,
"quantity": 24,
"storage_unit_quantity": 1,
"storage_unit_type_id": 2
}
],
"warehouse_id": 1
}
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({
account_id: 1,
description: 'Stock found during cycle count',
stock_date: '2026-10-17T09:30:00Z',
stocks: [
{location_id: 100, product_id: 123, quantity: 6},
{
location_id: 101,
product_id: 123,
quantity: 24,
storage_unit_quantity: 1,
storage_unit_type_id: 2
}
],
warehouse_id: 1
})
};
fetch('https://clarus-api.com/api/positive_adjustments/create_stocks', 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": {}
}
]
}Create stock (positive adjustment)
Add stock the system does not know about, such as stock found during a count or opening stock for a new warehouse. Each line is created as loose stock, on one storage unit, or across several new storage units. Every stock line created is recorded as a positive adjustment transaction. To increase the quantity of an existing stock record instead, use POST /api/positive_adjustments/extra_stock_on_storage_unit_found.
curl --request POST \
--url https://clarus-api.com/api/positive_adjustments/create_stocks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"account_id": 1,
"description": "Stock found during cycle count",
"stock_date": "2026-10-17T09:30:00Z",
"stocks": [
{
"location_id": 100,
"product_id": 123,
"quantity": 6
},
{
"location_id": 101,
"product_id": 123,
"quantity": 24,
"storage_unit_quantity": 1,
"storage_unit_type_id": 2
}
],
"warehouse_id": 1
}
'import requests
url = "https://clarus-api.com/api/positive_adjustments/create_stocks"
payload = {
"account_id": 1,
"description": "Stock found during cycle count",
"stock_date": "2026-10-17T09:30:00Z",
"stocks": [
{
"location_id": 100,
"product_id": 123,
"quantity": 6
},
{
"location_id": 101,
"product_id": 123,
"quantity": 24,
"storage_unit_quantity": 1,
"storage_unit_type_id": 2
}
],
"warehouse_id": 1
}
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({
account_id: 1,
description: 'Stock found during cycle count',
stock_date: '2026-10-17T09:30:00Z',
stocks: [
{location_id: 100, product_id: 123, quantity: 6},
{
location_id: 101,
product_id: 123,
quantity: 24,
storage_unit_quantity: 1,
storage_unit_type_id: 2
}
],
warehouse_id: 1
})
};
fetch('https://clarus-api.com/api/positive_adjustments/create_stocks', 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": {}
}
]
}Request Structure
{
"account_id": 1,
"description": "Stock found during cycle count",
"stock_date": "2026-10-17T09:30:00Z",
"stocks": [
{
"location_id": 100,
"product_id": 123,
"quantity": 6
},
{
"location_id": 101,
"product_id": 123,
"quantity": 24,
"storage_unit_quantity": 1,
"storage_unit_type_id": 2
}
],
"warehouse_id": 1,
"reason_code_id": 4
}
Key Fields
| Field | Required | Description |
|---|---|---|
account_id | Yes | Stock account (owner of the stock) for every line |
warehouse_id | Yes | Warehouse for every line |
stock_date | Yes | ISO 8601 date-time used as the FIFO date of every line |
description | Yes | Free-text reason for the adjustment (audit trail) |
stocks | Yes | Lines to create: product_id, location_id and quantity are required on each |
reason_code_id | No | positive_adjustment reason code; required if the account enforces one |
Storage Units
Each line’s storage unit fields decide how it is created:storage_unit_quantity | Other fields | Result |
|---|---|---|
Omitted or 0 | - | Loose stock at the location, no storage unit |
1 | storage_unit_reference matches an existing non-dispatched storage unit | Stock is added to that storage unit |
1 | storage_unit_reference is new | A storage unit is created with that reference |
1 | storage_unit_type_id only | A storage unit is created with a reference generated from the type’s sequence |
Greater than 1 | storage_unit_type_id | That many storage units are created, each holding quantity |
storage_unit_reference on several lines to build a mixed storage unit.
Behavior
- All lines are created in a single transaction: if any line fails, nothing is created.
- New stock is always created with status
AVAILABLE. - Products with full serial number tracking need one serial number per unit, and cannot use
storage_unit_quantitygreater than 1. - The response has no body (204). To read the created stock, query
/graphql#ListStocks(for example filtered by location and product).
Error Codes
| Code | Symbol | Description |
|---|---|---|
| 228 | incorrect_reason_code_type | Reason code is not a positive_adjustment reason code |
| 230 | reason_code_missing | No reason code was sent but the account enforces positive adjustment reason codes |
| 335 | receipt_line_storage_unit_quantity_must_eq_one_with_full_tracking_of_serial_numbers | storage_unit_quantity greater than 1 sent for a serial-tracked product |
| 339 | serial_numbers_quantity_is_not_equal_to_stock_quantity | Serial-tracked product sent with a number of serial numbers that does not match the quantity |
| 341 | serial_numbers_already_in_stock | A serial number is already in stock for the product |
| 342 | serial_numbers_not_unique | The same serial number was sent more than once |
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
Request body for creating new stock through a positive adjustment. The body is sent as plain JSON, not wrapped in a JSON:API data envelope.
Stock account that owns all the stock created by this request
1
Free-text reason for the adjustment, recorded on each transaction
ISO 8601 date-time used as the FIFO date of every stock line created (e.g. 2026-10-17T09:30:00Z)
The stock lines to create. Each line is created as loose stock, on one storage unit, or on several storage units depending on its storage unit fields.
1Show child attributes
Show child attributes
Warehouse all the stock is created in
1
ID of a reason code with reason_type positive_adjustment, recorded on the transaction for the audit trail. Required when the stock's account has enforce_positive_adjustment_reason_code enabled.
Response
Stock created successfully

