Skip to content
ShopentlyLearn

Stock and inventory models

Inventory models for stock, adjustments, reservations and sales limits. Inspect quantities, locations and the version fields used by updates.

Data schemas

Quantities assigned to warehouse locations

AllocationData · Schema · Stock and inventory models
location_codeStringRequired

Warehouse location code.

Example: "example"
location_idStringRequired

Warehouse location identifier.

Example: "example"
location_nameStringRequired

Warehouse location name.

Example: "example"
on_handIntegerRequired

Physical stock quantity.

Example: 10

Additional fields: No

List stock records — Response

ApiResponse_list_StockData__ · Fields, types and constraints of data accepted or returned by the API.
dataArray <StockData > Required

Response example · ApiResponse_list_StockData__.

Example: [{"active":true,"available":5,"id":"stock_v1_WyJleGFtcGxlIiwicHJvZHVjdCIsImV4YW1wbGUiXQ","manual_reserved":2,"on_hand":10,"reserved":3,"sellable_limit":10,"target_id":"example","target_type":"product","total_reserved":5,"updated_at":"2026-01-01T12:00:00Z","version":1,"warehouse_id":"example"}]
metaContextPageMeta ContextMeta PageMeta RequestMeta Required

Response metadata.

Example: {"pagination":{"has_more":false,"limit":20,"next_cursor":null},"request_id":"example"}

Additional fields: No

Get a stock record — Response

ApiResponse_StockDetailData_ · Fields, types and constraints of data accepted or returned by the API.
dataStockDetailData Required

Response example · StockDetailData.

Example: {"active":true,"allocations":[{"location_code":"example","location_id":"example","location_name":"example","on_hand":10}],"available":5,"id":"stock_v1_WyJleGFtcGxlIiwicHJvZHVjdCIsImV4YW1wbGUiXQ","manual_reserved":2,"on_hand":10,"reserved":3,"sellable_limit":10,"target_id":"example","target_type":"product","total_reserved":5,"updated_at":"2026-01-01T12:00:00Z","version":1,"warehouse_id":"example"}
metaContextPageMeta ContextMeta PageMeta RequestMeta Required

Response metadata.

Example: {"request_id":"example"}

Additional fields: No

Update a manual reservation — Request body

ManualReservationUpdate · Fields, types and constraints of data accepted or returned by the API.
expected_versionIntegerRequired

Version read before the write; a mismatch rejects the update.

minimum: 1maximum: 9223372036854775807
Example: 1
manual_reservedIntegerRequired

Quantity reserved manually.

minimum: 0maximum: 2147483647
Example: 1
reasonStringOptional

Reason recorded for the change.

maxLength: 500
Default: ""

Additional fields: No

Update a sales limit — Request body

SalesLimitUpdate · Fields, types and constraints of data accepted or returned by the API.
expected_versionIntegerRequired

Version read before the write; a mismatch rejects the update.

minimum: 1maximum: 9223372036854775807
Example: 1
reasonStringOptional

Reason recorded for the change.

maxLength: 500
Default: ""
sellable_limitIntegerRequired

Sales limit: -1 means unlimited and 0 disables available sales.

minimum: -1maximum: 2147483647
Example: 1

Additional fields: No

Create a stock adjustment — Request body

StockAdjustmentCreate · Fields, types and constraints of data accepted or returned by the API.
expected_versionIntegerRequired

Version read before the write; a mismatch rejects the update.

minimum: 0maximum: 9223372036854775807
Example: 0
locationsArray <LocationQuantity > Required

Warehouse locations.

minItems: 1maxItems: 100
Example: [{"location_id":"example","on_hand":1}]
reasonStringRequired

Reason recorded for the change.

minLength: 1maxLength: 500
Example: "Example"
target_idStringRequired

Identifier of the product or variant affected by the operation.

Constraints
pattern
"^[a-z0-9][a-z0-9_-]{0,62}$"
Example: "example"
target_typeStringRequired

Whether the operation concerns a product or a variant.

Constraints
enum
["product", "variant"]
Example: "product"
warehouse_idStringRequired

Warehouse identifier.

Constraints
pattern
"^[a-z0-9][a-z0-9_-]{0,62}$"
Example: "example"

Additional fields: No

Update a stock record — Request body

StockAdjustmentUpdate · Fields, types and constraints of data accepted or returned by the API.
expected_versionIntegerRequired

Version read before the write; a mismatch rejects the update.

minimum: 1maximum: 9223372036854775807
Example: 1
locationsArray <LocationQuantity > Required

Warehouse locations.

minItems: 1maxItems: 100
Example: [{"location_id":"example","on_hand":1}]
reasonStringRequired

Reason recorded for the change.

minLength: 1maxLength: 500
Example: "Example"

Additional fields: No

List stock records — Response

StockData · Fields, types and constraints of data accepted or returned by the API.
activeBooleanRequired

Whether the resource is active.

Example: true
availableInteger nullRequired

Quantity available for sale; null represents an unbounded amount.

Example: 5
idStringRequired

Resource identifier; preserve it as returned. (StockData).

Example: "stock_v1_WyJleGFtcGxlIiwicHJvZHVjdCIsImV4YW1wbGUiXQ"
manual_reservedIntegerRequired

Quantity reserved manually.

Example: 2
on_handIntegerRequired

Physical stock quantity.

Example: 10
reservedIntegerRequired

Quantity reserved by orders.

Example: 3
sellable_limitIntegerRequired

Sales limit: -1 means unlimited and 0 disables available sales.

Example: 10
target_idStringRequired

Identifier of the product or variant affected by the operation.

Example: "example"
target_typeStringRequired

Whether the operation concerns a product or a variant.

Constraints
enum
["product", "variant"]
Example: "product"
total_reservedIntegerRequired

Total reserved quantity.

Example: 5
updated_atStringRequired

Most recent update time.

format: "date-time"
Example: "2026-01-01T12:00:00Z"
versionIntegerRequired

Resource version used for concurrency control.

Example: 1
warehouse_idStringRequired

Warehouse identifier.

Example: "example"

Additional fields: No

Get a stock record — Response

StockDetailData · Fields, types and constraints of data accepted or returned by the API.
activeBooleanRequired

Whether the resource is active.

Example: true
allocationsArray <AllocationData > Required

Quantities assigned to warehouse locations.

Example: [{"location_code":"example","location_id":"example","location_name":"example","on_hand":10}]
availableInteger nullRequired

Quantity available for sale; null represents an unbounded amount.

Example: 5
idStringRequired

Resource identifier; preserve it as returned. (StockDetailData).

Example: "stock_v1_WyJleGFtcGxlIiwicHJvZHVjdCIsImV4YW1wbGUiXQ"
manual_reservedIntegerRequired

Quantity reserved manually.

Example: 2
on_handIntegerRequired

Physical stock quantity.

Example: 10
reservedIntegerRequired

Quantity reserved by orders.

Example: 3
sellable_limitIntegerRequired

Sales limit: -1 means unlimited and 0 disables available sales.

Example: 10
target_idStringRequired

Identifier of the product or variant affected by the operation.

Example: "example"
target_typeStringRequired

Whether the operation concerns a product or a variant.

Constraints
enum
["product", "variant"]
Example: "product"
total_reservedIntegerRequired

Total reserved quantity.

Example: 5
updated_atStringRequired

Most recent update time.

format: "date-time"
Example: "2026-01-01T12:00:00Z"
versionIntegerRequired

Resource version used for concurrency control.

Example: 1
warehouse_idStringRequired

Warehouse identifier.

Example: "example"

Additional fields: No