Skip to main content

Stock

A per-location stock line — the most granular stock entity. One line per (product, location) tuple, where the location is either a physical bin / warehouse or a special slot (order, return order, goods receipt, …). Use locationTypeTechnicalName / specialStockLocationTechnicalName to disambiguate.

type Stock implements Node {
id: ID!
binLocationId: ID
createdAt: DateTime!
locationTypeTechnicalName: String!
productId: ID!
quantity: Int!
specialStockLocationTechnicalName: String
updatedAt: DateTime
warehouseId: ID
binLocation: BinLocation
goodsReceipt: GoodsReceipt
order: Order
product: Product
warehouse: Warehouse
}

Fields​

Stock.id ● ID! non-null scalar​

Global identifier for this entity.

Stock.binLocationId ● ID scalar​

ID of the bin location.

Stock.createdAt ● DateTime! non-null scalar​

Timestamp the stock line was first persisted.

Stock.locationTypeTechnicalName ● String! non-null scalar​

Technical name of the location type (warehouse, bin_location, order, return_order, goods_receipt, stock_container, special_stock_location). Use this to separate lines inside the warehouses (warehouse, bin_location, stock_container, goods_receipt) from the ones outside them (order, return_order, special_stock_location).

Stock.productId ● ID! non-null scalar​

ID of the product.

Stock.quantity ● Int! non-null scalar​

Number of units at this location. Shipping books units onto the order location, so an order line counts units that left the warehouses for that order. Negative quantities occur at special stock locations: they are the counterpart of stock that entered the warehouses without a physical source, e.g. units added by a stock correction leave a negative quantity at stock_correction.

Stock.specialStockLocationTechnicalName ● String scalar​

For lines whose locationTypeTechnicalName is special_stock_location, the technical name of the special location (e.g. stock_correction, import, initialization, unknown).

Stock.updatedAt ● DateTime scalar​

Timestamp of the last quantity change.

Stock.warehouseId ● ID scalar​

ID of the warehouse this line belongs to.

Stock.binLocation ● BinLocation object​

Stock.goodsReceipt ● GoodsReceipt object​

Stock.order ● Order object​

Stock.product ● Product object​

Stock.warehouse ● Warehouse object​

Interfaces​

Node interface​

Any entity that can be loaded by its global id through the node(id: ID!) query.

Returned By​

adjustStockAtBinLocation mutation ● setStockAtBinLocation mutation ● stock query ● transferStock mutation

Member Of​

StockEdge object