# Stock endpoints

## The Stock object

```json
{"openapi":"3.0.1","info":{"title":"fulfillmenttools","version":"VERSIONLESS"},"components":{"schemas":{"Stock":{"properties":{"available":{"type":"number"},"availableUntil":{"description":"defines until when a stock is included in the stock availability as available and used for routing","format":"date-time","type":"string"},"conditions":{"description":"Describes conditions of a stock\n    *`DEFECTIVE` - stock is defective, not usable for customer orders","items":{"enum":["DEFECTIVE"],"type":"string"},"type":"array"},"created":{"format":"date-time","type":"string"},"customAttributes":{"description":"Attributes that can be added to this entity. These attributes **cannot** be used within fulfillment processes, but enable you to attach custom data from your systems to fulfillmenttools entities.","nullable":true,"type":"object"},"facility":{"$ref":"#/components/schemas/StockFacilityReferences"},"facilityRef":{"description":"facility in which the stock is located","type":"string"},"facilityWideReserved":{"deprecated":true,"type":"number"},"id":{"type":"string"},"lastModified":{"format":"date-time","type":"string"},"locationRef":{"description":"location on which the stock is placed","type":"string"},"properties":{"additionalProperties":{"type":"string"},"allOf":[{"$ref":"#/components/schemas/StockPropertyPreset"}],"description":"allow tracking of specific values such as expiry dates on a set of items. They should describe physical identifiable properties of the stock and are not meant to be used for metadata (see \"customAttributes\" for that)."},"receiptDate":{"description":"date-time when stock has entered the system, defaults to the creation date","format":"date-time","type":"string"},"reserved":{"description":"amount of this stock reserved for customer orders","type":"number"},"scannableCodes":{"description":"scannableCodes such as barcodes that identify this stock","items":{"type":"string"},"type":"array"},"scores":{"description":"stock with a high score can used preferably over stock with a lower score in routing, depending on configuration. The score can represent different attributes of the stock like zone, storage location, expiry date or receipt date.","items":{"type":"string"},"type":"array"},"serializedProperties":{"description":"properties object serialized as JSON string, sorted alphabetically by key","type":"string"},"tenantArticleId":{"description":"tenantArticleId of the stock","minLength":1,"type":"string"},"tenantStockId":{"description":"tenantStockId is an optional identifier for the stock in the tenant system.","type":"string"},"traitConfig":{"description":"defines the traits of the stock, overrules the storage location traits","items":{"$ref":"#/components/schemas/StorageLocationTraitConfigEntry"},"type":"array"},"traits":{"description":"provide information on how storage locations and stocks are to be handled in operational processes. Can only be set via storageLocation. ","items":{"enum":["PICKABLE","ACCESSIBLE","KEEP_ON_ZERO","OUTBOUND","IN_MOTION"],"type":"string"},"type":"array"},"value":{"format":"int32","minimum":0,"type":"integer"},"version":{"type":"number"}},"required":["tenantArticleId","value","reserved","facilityWideReserved","facilityRef","facility","available","id","version","created","lastModified","traits","serializedProperties"],"title":"Stock","type":"object","description":"Stock"},"StockFacilityReferences":{"properties":{"facilityRef":{"description":"facility in which the stock is located","type":"string"},"tenantFacilityId":{"description":"tenantFacilityId in which the stock is located","type":"string"}},"required":["facilityRef"],"title":"StockFacilityReferences","type":"object","description":"StockFacilityReferences"},"StockPropertyPreset":{"properties":{"expiry":{"type":"string"}},"title":"StockPropertyPreset","type":"object","description":"StockPropertyPreset"},"StorageLocationTraitConfigEntry":{"properties":{"enabled":{"description":"whether the trait is enabled or not","type":"boolean"},"trait":{"description":"Describes what kind of actions this stock is available for\n     * `PICKABLE`- The stock is available for picking\n     * `ACCESSIBLE`- The stock is available for stock movements (stowing, inbound, etc)\n     * `KEEP_ON_ZERO`- The stock will not be deleted when emptied\n     * `OUTBOUND`- The stock is intended for outbound processes","type":"string"}},"required":["enabled","trait"],"title":"StorageLocationTraitConfigEntry","type":"object","description":"StorageLocationTraitConfigEntry"}}}}
```

## GET /api/stocks/{stockId}

> Get stock

```json
{"openapi":"3.0.1","info":{"title":"fulfillmenttools","version":"VERSIONLESS"},"tags":[{"description":"Endpoints to create, update and read stocks.","name":"Stocks (Inventory)"}],"servers":[{"url":"https://{tenant}.api.fulfillmenttools.com","variables":{"tenant":{"default":"your-tenant-name"}}}],"security":[{"BearerToken":[]}],"components":{"securitySchemes":{"BearerToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Stock":{"properties":{"available":{"type":"number"},"availableUntil":{"description":"defines until when a stock is included in the stock availability as available and used for routing","format":"date-time","type":"string"},"conditions":{"description":"Describes conditions of a stock\n    *`DEFECTIVE` - stock is defective, not usable for customer orders","items":{"enum":["DEFECTIVE"],"type":"string"},"type":"array"},"created":{"format":"date-time","type":"string"},"customAttributes":{"description":"Attributes that can be added to this entity. These attributes **cannot** be used within fulfillment processes, but enable you to attach custom data from your systems to fulfillmenttools entities.","nullable":true,"type":"object"},"facility":{"$ref":"#/components/schemas/StockFacilityReferences"},"facilityRef":{"description":"facility in which the stock is located","type":"string"},"facilityWideReserved":{"deprecated":true,"type":"number"},"id":{"type":"string"},"lastModified":{"format":"date-time","type":"string"},"locationRef":{"description":"location on which the stock is placed","type":"string"},"properties":{"additionalProperties":{"type":"string"},"allOf":[{"$ref":"#/components/schemas/StockPropertyPreset"}],"description":"allow tracking of specific values such as expiry dates on a set of items. They should describe physical identifiable properties of the stock and are not meant to be used for metadata (see \"customAttributes\" for that)."},"receiptDate":{"description":"date-time when stock has entered the system, defaults to the creation date","format":"date-time","type":"string"},"reserved":{"description":"amount of this stock reserved for customer orders","type":"number"},"scannableCodes":{"description":"scannableCodes such as barcodes that identify this stock","items":{"type":"string"},"type":"array"},"scores":{"description":"stock with a high score can used preferably over stock with a lower score in routing, depending on configuration. The score can represent different attributes of the stock like zone, storage location, expiry date or receipt date.","items":{"type":"string"},"type":"array"},"serializedProperties":{"description":"properties object serialized as JSON string, sorted alphabetically by key","type":"string"},"tenantArticleId":{"description":"tenantArticleId of the stock","minLength":1,"type":"string"},"tenantStockId":{"description":"tenantStockId is an optional identifier for the stock in the tenant system.","type":"string"},"traitConfig":{"description":"defines the traits of the stock, overrules the storage location traits","items":{"$ref":"#/components/schemas/StorageLocationTraitConfigEntry"},"type":"array"},"traits":{"description":"provide information on how storage locations and stocks are to be handled in operational processes. Can only be set via storageLocation. ","items":{"enum":["PICKABLE","ACCESSIBLE","KEEP_ON_ZERO","OUTBOUND","IN_MOTION"],"type":"string"},"type":"array"},"value":{"format":"int32","minimum":0,"type":"integer"},"version":{"type":"number"}},"required":["tenantArticleId","value","reserved","facilityWideReserved","facilityRef","facility","available","id","version","created","lastModified","traits","serializedProperties"],"title":"Stock","type":"object","description":"Stock"},"StockFacilityReferences":{"properties":{"facilityRef":{"description":"facility in which the stock is located","type":"string"},"tenantFacilityId":{"description":"tenantFacilityId in which the stock is located","type":"string"}},"required":["facilityRef"],"title":"StockFacilityReferences","type":"object","description":"StockFacilityReferences"},"StockPropertyPreset":{"properties":{"expiry":{"type":"string"}},"title":"StockPropertyPreset","type":"object","description":"StockPropertyPreset"},"StorageLocationTraitConfigEntry":{"properties":{"enabled":{"description":"whether the trait is enabled or not","type":"boolean"},"trait":{"description":"Describes what kind of actions this stock is available for\n     * `PICKABLE`- The stock is available for picking\n     * `ACCESSIBLE`- The stock is available for stock movements (stowing, inbound, etc)\n     * `KEEP_ON_ZERO`- The stock will not be deleted when emptied\n     * `OUTBOUND`- The stock is intended for outbound processes","type":"string"}},"required":["enabled","trait"],"title":"StorageLocationTraitConfigEntry","type":"object","description":"StorageLocationTraitConfigEntry"},"ApiError":{"items":{"$ref":"#/components/schemas/ErrorInner"},"type":"array","xml":{"name":"ApiError"},"title":"ApiError","description":"ApiError"},"ErrorInner":{"properties":{"description":{"type":"string"},"requestVersion":{"description":"The version provided within an invalid request.","format":"int64","type":"integer"},"summary":{"type":"string"},"version":{"format":"int64","type":"integer"}},"required":["summary"],"type":"object","title":"ErrorInner","description":"ErrorInner"}}},"paths":{"/api/stocks/{stockId}":{"get":{"deprecated":false,"description":"","operationId":"getStock","parameters":[{"in":"path","name":"stockId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Stock"}}},"description":"Stock"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Your user is not allowed to operate against this API instance"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Your user, although recognized, is not authorized to use this"}},"summary":"Get stock","tags":["Stocks (Inventory)"]}}}}
```

## GET /api/stocks

> List stocks

```json
{"openapi":"3.0.1","info":{"title":"fulfillmenttools","version":"VERSIONLESS"},"tags":[{"description":"Endpoints to create, update and read stocks.","name":"Stocks (Inventory)"}],"servers":[{"url":"https://{tenant}.api.fulfillmenttools.com","variables":{"tenant":{"default":"your-tenant-name"}}}],"security":[{"BearerToken":[]}],"components":{"securitySchemes":{"BearerToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"StockPaginatedResult":{"properties":{"pageInfo":{"allOf":[{"$ref":"#/components/schemas/PageInfo"}],"description":"Pagination information for the search result."},"stocks":{"items":{"$ref":"#/components/schemas/Stock"},"type":"array"},"total":{"description":"The total number of items matching the search criteria. Only filled, if withTotal is set to true in the search options.","minimum":0,"type":"number"}},"required":["pageInfo","stocks"],"title":"StockPaginatedResult","type":"object","description":"StockPaginatedResult"},"PageInfo":{"properties":{"endCursor":{"description":"The cursor to use to fetch the next page of items. Use with parameter `after`.","type":"string"},"hasNextPage":{"description":"If true, there are more items after the current page.","type":"boolean"},"hasPreviousPage":{"description":"If true, there are more items before the current page.","type":"boolean"},"startCursor":{"description":"The cursor to use to fetch the previous page of items.","type":"string"}},"required":["hasNextPage","hasPreviousPage","startCursor","endCursor"],"title":"PageInfo","type":"object","description":"PageInfo"},"Stock":{"properties":{"available":{"type":"number"},"availableUntil":{"description":"defines until when a stock is included in the stock availability as available and used for routing","format":"date-time","type":"string"},"conditions":{"description":"Describes conditions of a stock\n    *`DEFECTIVE` - stock is defective, not usable for customer orders","items":{"enum":["DEFECTIVE"],"type":"string"},"type":"array"},"created":{"format":"date-time","type":"string"},"customAttributes":{"description":"Attributes that can be added to this entity. These attributes **cannot** be used within fulfillment processes, but enable you to attach custom data from your systems to fulfillmenttools entities.","nullable":true,"type":"object"},"facility":{"$ref":"#/components/schemas/StockFacilityReferences"},"facilityRef":{"description":"facility in which the stock is located","type":"string"},"facilityWideReserved":{"deprecated":true,"type":"number"},"id":{"type":"string"},"lastModified":{"format":"date-time","type":"string"},"locationRef":{"description":"location on which the stock is placed","type":"string"},"properties":{"additionalProperties":{"type":"string"},"allOf":[{"$ref":"#/components/schemas/StockPropertyPreset"}],"description":"allow tracking of specific values such as expiry dates on a set of items. They should describe physical identifiable properties of the stock and are not meant to be used for metadata (see \"customAttributes\" for that)."},"receiptDate":{"description":"date-time when stock has entered the system, defaults to the creation date","format":"date-time","type":"string"},"reserved":{"description":"amount of this stock reserved for customer orders","type":"number"},"scannableCodes":{"description":"scannableCodes such as barcodes that identify this stock","items":{"type":"string"},"type":"array"},"scores":{"description":"stock with a high score can used preferably over stock with a lower score in routing, depending on configuration. The score can represent different attributes of the stock like zone, storage location, expiry date or receipt date.","items":{"type":"string"},"type":"array"},"serializedProperties":{"description":"properties object serialized as JSON string, sorted alphabetically by key","type":"string"},"tenantArticleId":{"description":"tenantArticleId of the stock","minLength":1,"type":"string"},"tenantStockId":{"description":"tenantStockId is an optional identifier for the stock in the tenant system.","type":"string"},"traitConfig":{"description":"defines the traits of the stock, overrules the storage location traits","items":{"$ref":"#/components/schemas/StorageLocationTraitConfigEntry"},"type":"array"},"traits":{"description":"provide information on how storage locations and stocks are to be handled in operational processes. Can only be set via storageLocation. ","items":{"enum":["PICKABLE","ACCESSIBLE","KEEP_ON_ZERO","OUTBOUND","IN_MOTION"],"type":"string"},"type":"array"},"value":{"format":"int32","minimum":0,"type":"integer"},"version":{"type":"number"}},"required":["tenantArticleId","value","reserved","facilityWideReserved","facilityRef","facility","available","id","version","created","lastModified","traits","serializedProperties"],"title":"Stock","type":"object","description":"Stock"},"StockFacilityReferences":{"properties":{"facilityRef":{"description":"facility in which the stock is located","type":"string"},"tenantFacilityId":{"description":"tenantFacilityId in which the stock is located","type":"string"}},"required":["facilityRef"],"title":"StockFacilityReferences","type":"object","description":"StockFacilityReferences"},"StockPropertyPreset":{"properties":{"expiry":{"type":"string"}},"title":"StockPropertyPreset","type":"object","description":"StockPropertyPreset"},"StorageLocationTraitConfigEntry":{"properties":{"enabled":{"description":"whether the trait is enabled or not","type":"boolean"},"trait":{"description":"Describes what kind of actions this stock is available for\n     * `PICKABLE`- The stock is available for picking\n     * `ACCESSIBLE`- The stock is available for stock movements (stowing, inbound, etc)\n     * `KEEP_ON_ZERO`- The stock will not be deleted when emptied\n     * `OUTBOUND`- The stock is intended for outbound processes","type":"string"}},"required":["enabled","trait"],"title":"StorageLocationTraitConfigEntry","type":"object","description":"StorageLocationTraitConfigEntry"},"ApiError":{"items":{"$ref":"#/components/schemas/ErrorInner"},"type":"array","xml":{"name":"ApiError"},"title":"ApiError","description":"ApiError"},"ErrorInner":{"properties":{"description":{"type":"string"},"requestVersion":{"description":"The version provided within an invalid request.","format":"int64","type":"integer"},"summary":{"type":"string"},"version":{"format":"int64","type":"integer"}},"required":["summary"],"type":"object","title":"ErrorInner","description":"ErrorInner"}}},"paths":{"/api/stocks":{"get":{"deprecated":false,"description":"","operationId":"getStocks","parameters":[{"in":"query","name":"facilityRef","required":false,"schema":{"type":"string"}},{"in":"query","name":"tenantFacilityId","required":false,"schema":{"type":"string"}},{"in":"query","name":"tenantArticleId","required":false,"schema":{"items":{"type":"string"},"maxItems":500,"type":"array"}},{"in":"query","name":"locationRef","required":false,"schema":{"items":{"type":"string"},"maxItems":500,"type":"array"}},{"in":"query","name":"size","required":false,"schema":{"default":25,"maximum":100,"minimum":1,"type":"number"}},{"in":"query","name":"startAfterId","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockPaginatedResult"}}},"description":"Stocks"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Your user is not allowed to operate against this API instance"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Your user, although recognized, is not authorized to use this"}},"summary":"List stocks","tags":["Stocks (Inventory)"]}}}}
```

## List stock summaries

> Get the accumulated Stock for each Article

```json
{"openapi":"3.0.1","info":{"title":"fulfillmenttools","version":"VERSIONLESS"},"tags":[{"description":"Endpoints to create, update and read stocks.","name":"Stocks (Inventory)"}],"servers":[{"url":"https://{tenant}.api.fulfillmenttools.com","variables":{"tenant":{"default":"your-tenant-name"}}}],"security":[{"BearerToken":[]}],"components":{"securitySchemes":{"BearerToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"StockSummaries":{"properties":{"stockSummaries":{"items":{"$ref":"#/components/schemas/StockSummary"},"type":"array"},"total":{"minimum":0,"type":"number"}},"required":["total","stockSummaries"],"title":"StockSummaries","type":"object","description":"StockSummaries"},"StockSummary":{"properties":{"article":{"$ref":"#/components/schemas/StockSummaryArticle"},"details":{"$ref":"#/components/schemas/StockSummaryDetails"},"includedFacilityRefs":{"description":"ALPHA Status!. The facilityRefs that are included in the stock summary.","items":{"type":"string"},"type":"array"}},"required":["includedFacilityRefs","article","details"],"title":"StockSummary","type":"object","description":"StockSummary"},"StockSummaryArticle":{"properties":{"imageUrl":{"type":"string"},"tenantArticleId":{"type":"string"},"title":{"type":"string"}},"required":["tenantArticleId","title"],"title":"StockSummaryArticle","type":"object","description":"StockSummaryArticle"},"StockSummaryDetails":{"properties":{"available":{"deprecated":true,"description":"This field is deprecated and replaced by new availability concepts. Please see https://docs.fulfillmenttools.com/documentation/products/inventory-management/stock/stock-availability for more information.","minimum":0,"type":"number"},"availableForPicking":{"type":"number"},"availableOnStock":{"type":"number"},"availableToPromise":{"deprecated":true,"description":"This field is deprecated and replaced by new availability concepts. Please see https://docs.fulfillmenttools.com/documentation/products/inventory-management/stock/stock-availability for more information.","type":"number"},"byTrait":{"$ref":"#/components/schemas/ByTrait"},"channelAdjusted":{"items":{"$ref":"#/components/schemas/ChannelStockAvailability"},"type":"array"},"readyToPick":{"deprecated":true,"description":"This field is deprecated and replaced by new availability concepts. Please see https://docs.fulfillmenttools.com/documentation/products/inventory-management/stock/stock-availability for more information.","type":"number"},"reserved":{"minimum":0,"type":"number"},"safetyStock":{"minimum":0,"type":"number"},"stockOnHand":{"type":"number"},"totalAmount":{"minimum":0,"type":"number"}},"required":["reserved","totalAmount","available","safetyStock","byTrait","availableForPicking","availableToPromise","readyToPick","availableOnStock","stockOnHand"],"title":"StockSummaryDetails","type":"object","description":"StockSummaryDetails"},"ByTrait":{"properties":{"ACCESSIBLE":{"type":"number"},"PICKABLE":{"type":"number"}},"required":["PICKABLE","ACCESSIBLE"],"title":"ByTrait","type":"object","description":"ByTrait"},"ChannelStockAvailability":{"properties":{"availableForPicking":{"type":"number"},"availableOnStock":{"type":"number"},"channelRef":{"type":"string"}},"required":["channelRef","availableForPicking","availableOnStock"],"title":"ChannelStockAvailability","type":"object","description":"ChannelStockAvailability"},"ApiError":{"items":{"$ref":"#/components/schemas/ErrorInner"},"type":"array","xml":{"name":"ApiError"},"title":"ApiError","description":"ApiError"},"ErrorInner":{"properties":{"description":{"type":"string"},"requestVersion":{"description":"The version provided within an invalid request.","format":"int64","type":"integer"},"summary":{"type":"string"},"version":{"format":"int64","type":"integer"}},"required":["summary"],"type":"object","title":"ErrorInner","description":"ErrorInner"}}},"paths":{"/api/stocks/summaries":{"get":{"deprecated":false,"description":"Get the accumulated Stock for each Article","operationId":"getStockSummaries","parameters":[{"in":"query","name":"size","required":false,"schema":{"default":25,"maximum":100,"minimum":1,"type":"number"}},{"description":"The stockSummaries.article.tenantArticleId value should be used for pagination.","in":"query","name":"startAfterId","required":false,"schema":{"type":"string"}},{"explode":false,"in":"query","name":"facilityServiceTypes","required":false,"schema":{"items":{"enum":["SHIP_FROM_STORE","PICKUP"],"type":"string"},"type":"array"}},{"explode":false,"in":"query","name":"facilityStatus","required":false,"schema":{"items":{"enum":["ONLINE","SUSPENDED","OFFLINE"],"type":"string"},"type":"array"}},{"explode":true,"in":"query","name":"facilityRefs","required":false,"schema":{"items":{"type":"string"},"type":"array"}},{"in":"query","name":"allowStale","required":false,"schema":{"type":"boolean"}},{"explode":true,"in":"query","name":"tenantArticleIds","required":false,"schema":{"items":{"type":"string"},"type":"array"}},{"description":"Returns stock summaries using adaptive batching to reduce latency spikes, as a consequence response time will have a more consistent upper bound but page size may be reduced below the maximum - This overrides `size` argument.","in":"query","name":"maxPageSize","required":false,"schema":{"maximum":100,"minimum":1,"type":"number"}},{"description":"The channels to included under \"channelAdjusted\" in the stock summary. Provide up to 50 channelRefs, specify \"UNALLOCATED for unallocated stock.\"","explode":true,"in":"query","name":"channelRefs","required":false,"schema":{"items":{"type":"string"},"maxItems":50,"type":"array"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockSummaries"}}},"description":"Stock summaries was loaded & you were allowed to access it. The result is in the body."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Your user is not allowed to operate against this API instance"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Your user, although recognized, is not authorized to use this"}},"summary":"List stock summaries","tags":["Stocks (Inventory)"]}}}}
```

## POST /api/stocks

> Create stock

```json
{"openapi":"3.0.1","info":{"title":"fulfillmenttools","version":"VERSIONLESS"},"tags":[{"description":"Endpoints to create, update and read stocks.","name":"Stocks (Inventory)"}],"servers":[{"url":"https://{tenant}.api.fulfillmenttools.com","variables":{"tenant":{"default":"your-tenant-name"}}}],"security":[{"BearerToken":[]}],"components":{"securitySchemes":{"BearerToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"StockForCreation":{"properties":{"availableUntil":{"description":"defines until when a stock is included in the stock availability as available and used for routing","format":"date-time","type":"string"},"conditions":{"description":"Describes conditions of a stock\n    *`DEFECTIVE` - stock is defective, not usable for customer orders","items":{"enum":["DEFECTIVE"],"type":"string"},"type":"array"},"customAttributes":{"description":"Attributes that can be added to this entity. These attributes **cannot** be used within fulfillment processes, but enable you to attach custom data from your systems to fulfillmenttools entities.","nullable":true,"type":"object"},"facility":{"description":"Selector for the facility. Either a facility reference or a tenant facility ID must be provided.","oneOf":[{"$ref":"#/components/schemas/FacilityRefSelector"},{"$ref":"#/components/schemas/TenantFacilityIdSelector"}]},"facilityRef":{"deprecated":true,"description":"facility in which the stock is located - fill with either facilityRef or tenantFacilityId - Deprecated: use facility object instead","type":"string"},"locationRef":{"description":"location on which the stock is placed","type":"string"},"properties":{"allOf":[{"$ref":"#/components/schemas/StockPropertyPreset"},{"additionalProperties":{"type":"string"},"type":"object"}],"description":"allow tracking of specific values such as expiry dates on a set of items. They should describe physical identifiable properties of the stock and are not meant to be used for metadata (see \"customAttributes\" for that)."},"receiptDate":{"description":"date-time when stock has entered the system, defaults to the creation date","format":"date-time","type":"string"},"tenantArticleId":{"description":"tenantArticleId of the stock","minLength":1,"type":"string"},"tenantFacilityId":{"deprecated":true,"description":"tenantFacilityId in which the stock is located - fill with either facilityRef or tenantFacilityId - Deprecated: use facility object instead","type":"string"},"tenantStockId":{"description":"tenantStockId is an optional identifier for the stock in the tenant system.","type":"string"},"traitConfig":{"description":"defines the traits of the stock, overrules the storage location traits","items":{"$ref":"#/components/schemas/StorageLocationTraitConfigEntry"},"type":"array"},"value":{"format":"int32","minimum":0,"type":"integer"}},"required":["tenantArticleId","value"],"title":"StockForCreation","type":"object","description":"StockForCreation"},"FacilityRefSelector":{"properties":{"facilityRef":{"description":"Resolves a facility by its reference. This is the preferred way to resolve a facility.","minLength":1,"type":"string"}},"required":["facilityRef"],"title":"FacilityRefSelector","type":"object","description":"FacilityRefSelector"},"TenantFacilityIdSelector":{"properties":{"tenantFacilityId":{"description":"Resolves a facility by its tenantFacilityId.","minLength":1,"type":"string"}},"required":["tenantFacilityId"],"title":"TenantFacilityIdSelector","type":"object","description":"TenantFacilityIdSelector"},"StockPropertyPreset":{"properties":{"expiry":{"type":"string"}},"title":"StockPropertyPreset","type":"object","description":"StockPropertyPreset"},"StorageLocationTraitConfigEntry":{"properties":{"enabled":{"description":"whether the trait is enabled or not","type":"boolean"},"trait":{"description":"Describes what kind of actions this stock is available for\n     * `PICKABLE`- The stock is available for picking\n     * `ACCESSIBLE`- The stock is available for stock movements (stowing, inbound, etc)\n     * `KEEP_ON_ZERO`- The stock will not be deleted when emptied\n     * `OUTBOUND`- The stock is intended for outbound processes","type":"string"}},"required":["enabled","trait"],"title":"StorageLocationTraitConfigEntry","type":"object","description":"StorageLocationTraitConfigEntry"},"Stock":{"properties":{"available":{"type":"number"},"availableUntil":{"description":"defines until when a stock is included in the stock availability as available and used for routing","format":"date-time","type":"string"},"conditions":{"description":"Describes conditions of a stock\n    *`DEFECTIVE` - stock is defective, not usable for customer orders","items":{"enum":["DEFECTIVE"],"type":"string"},"type":"array"},"created":{"format":"date-time","type":"string"},"customAttributes":{"description":"Attributes that can be added to this entity. These attributes **cannot** be used within fulfillment processes, but enable you to attach custom data from your systems to fulfillmenttools entities.","nullable":true,"type":"object"},"facility":{"$ref":"#/components/schemas/StockFacilityReferences"},"facilityRef":{"description":"facility in which the stock is located","type":"string"},"facilityWideReserved":{"deprecated":true,"type":"number"},"id":{"type":"string"},"lastModified":{"format":"date-time","type":"string"},"locationRef":{"description":"location on which the stock is placed","type":"string"},"properties":{"additionalProperties":{"type":"string"},"allOf":[{"$ref":"#/components/schemas/StockPropertyPreset"}],"description":"allow tracking of specific values such as expiry dates on a set of items. They should describe physical identifiable properties of the stock and are not meant to be used for metadata (see \"customAttributes\" for that)."},"receiptDate":{"description":"date-time when stock has entered the system, defaults to the creation date","format":"date-time","type":"string"},"reserved":{"description":"amount of this stock reserved for customer orders","type":"number"},"scannableCodes":{"description":"scannableCodes such as barcodes that identify this stock","items":{"type":"string"},"type":"array"},"scores":{"description":"stock with a high score can used preferably over stock with a lower score in routing, depending on configuration. The score can represent different attributes of the stock like zone, storage location, expiry date or receipt date.","items":{"type":"string"},"type":"array"},"serializedProperties":{"description":"properties object serialized as JSON string, sorted alphabetically by key","type":"string"},"tenantArticleId":{"description":"tenantArticleId of the stock","minLength":1,"type":"string"},"tenantStockId":{"description":"tenantStockId is an optional identifier for the stock in the tenant system.","type":"string"},"traitConfig":{"description":"defines the traits of the stock, overrules the storage location traits","items":{"$ref":"#/components/schemas/StorageLocationTraitConfigEntry"},"type":"array"},"traits":{"description":"provide information on how storage locations and stocks are to be handled in operational processes. Can only be set via storageLocation. ","items":{"enum":["PICKABLE","ACCESSIBLE","KEEP_ON_ZERO","OUTBOUND","IN_MOTION"],"type":"string"},"type":"array"},"value":{"format":"int32","minimum":0,"type":"integer"},"version":{"type":"number"}},"required":["tenantArticleId","value","reserved","facilityWideReserved","facilityRef","facility","available","id","version","created","lastModified","traits","serializedProperties"],"title":"Stock","type":"object","description":"Stock"},"StockFacilityReferences":{"properties":{"facilityRef":{"description":"facility in which the stock is located","type":"string"},"tenantFacilityId":{"description":"tenantFacilityId in which the stock is located","type":"string"}},"required":["facilityRef"],"title":"StockFacilityReferences","type":"object","description":"StockFacilityReferences"},"ApiError":{"items":{"$ref":"#/components/schemas/ErrorInner"},"type":"array","xml":{"name":"ApiError"},"title":"ApiError","description":"ApiError"},"ErrorInner":{"properties":{"description":{"type":"string"},"requestVersion":{"description":"The version provided within an invalid request.","format":"int64","type":"integer"},"summary":{"type":"string"},"version":{"format":"int64","type":"integer"}},"required":["summary"],"type":"object","title":"ErrorInner","description":"ErrorInner"}}},"paths":{"/api/stocks":{"post":{"deprecated":false,"description":"","operationId":"createStock","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockForCreation"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Stock"}}},"description":"Stock was created."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Your user is not allowed to operate against this API instance"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Your user, although recognized, is not authorized to use this"}},"summary":"Create stock","tags":["Stocks (Inventory)"]}}}}
```

## Update stocks

> Update and create many stocks at once

```json
{"openapi":"3.0.1","info":{"title":"fulfillmenttools","version":"VERSIONLESS"},"tags":[{"description":"Endpoints to create, update and read stocks.","name":"Stocks (Inventory)"}],"servers":[{"url":"https://{tenant}.api.fulfillmenttools.com","variables":{"tenant":{"default":"your-tenant-name"}}}],"security":[{"BearerToken":[]}],"components":{"securitySchemes":{"BearerToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"StocksForUpsert":{"properties":{"stocks":{"description":"Please be sure to include each stock (by ID) only once, when updating. Otherwise the whole batch is rejected with an error.","items":{"oneOf":[{"$ref":"#/components/schemas/StockForCreation"},{"$ref":"#/components/schemas/StockForUpsertUpdate"},{"not":{"required":["version"]},"properties":{"id":{"type":"string"},"locationRef":{"nullable":true,"type":"string"},"value":{"format":"int32","minimum":0,"type":"integer"}},"required":["id","value"],"type":"object"}]},"maxItems":500,"type":"array"}},"required":["stocks"],"title":"StocksForUpsert","type":"object","description":"StocksForUpsert"},"StockForCreation":{"properties":{"availableUntil":{"description":"defines until when a stock is included in the stock availability as available and used for routing","format":"date-time","type":"string"},"conditions":{"description":"Describes conditions of a stock\n    *`DEFECTIVE` - stock is defective, not usable for customer orders","items":{"enum":["DEFECTIVE"],"type":"string"},"type":"array"},"customAttributes":{"description":"Attributes that can be added to this entity. These attributes **cannot** be used within fulfillment processes, but enable you to attach custom data from your systems to fulfillmenttools entities.","nullable":true,"type":"object"},"facility":{"description":"Selector for the facility. Either a facility reference or a tenant facility ID must be provided.","oneOf":[{"$ref":"#/components/schemas/FacilityRefSelector"},{"$ref":"#/components/schemas/TenantFacilityIdSelector"}]},"facilityRef":{"deprecated":true,"description":"facility in which the stock is located - fill with either facilityRef or tenantFacilityId - Deprecated: use facility object instead","type":"string"},"locationRef":{"description":"location on which the stock is placed","type":"string"},"properties":{"allOf":[{"$ref":"#/components/schemas/StockPropertyPreset"},{"additionalProperties":{"type":"string"},"type":"object"}],"description":"allow tracking of specific values such as expiry dates on a set of items. They should describe physical identifiable properties of the stock and are not meant to be used for metadata (see \"customAttributes\" for that)."},"receiptDate":{"description":"date-time when stock has entered the system, defaults to the creation date","format":"date-time","type":"string"},"tenantArticleId":{"description":"tenantArticleId of the stock","minLength":1,"type":"string"},"tenantFacilityId":{"deprecated":true,"description":"tenantFacilityId in which the stock is located - fill with either facilityRef or tenantFacilityId - Deprecated: use facility object instead","type":"string"},"tenantStockId":{"description":"tenantStockId is an optional identifier for the stock in the tenant system.","type":"string"},"traitConfig":{"description":"defines the traits of the stock, overrules the storage location traits","items":{"$ref":"#/components/schemas/StorageLocationTraitConfigEntry"},"type":"array"},"value":{"format":"int32","minimum":0,"type":"integer"}},"required":["tenantArticleId","value"],"title":"StockForCreation","type":"object","description":"StockForCreation"},"FacilityRefSelector":{"properties":{"facilityRef":{"description":"Resolves a facility by its reference. This is the preferred way to resolve a facility.","minLength":1,"type":"string"}},"required":["facilityRef"],"title":"FacilityRefSelector","type":"object","description":"FacilityRefSelector"},"TenantFacilityIdSelector":{"properties":{"tenantFacilityId":{"description":"Resolves a facility by its tenantFacilityId.","minLength":1,"type":"string"}},"required":["tenantFacilityId"],"title":"TenantFacilityIdSelector","type":"object","description":"TenantFacilityIdSelector"},"StockPropertyPreset":{"properties":{"expiry":{"type":"string"}},"title":"StockPropertyPreset","type":"object","description":"StockPropertyPreset"},"StorageLocationTraitConfigEntry":{"properties":{"enabled":{"description":"whether the trait is enabled or not","type":"boolean"},"trait":{"description":"Describes what kind of actions this stock is available for\n     * `PICKABLE`- The stock is available for picking\n     * `ACCESSIBLE`- The stock is available for stock movements (stowing, inbound, etc)\n     * `KEEP_ON_ZERO`- The stock will not be deleted when emptied\n     * `OUTBOUND`- The stock is intended for outbound processes","type":"string"}},"required":["enabled","trait"],"title":"StorageLocationTraitConfigEntry","type":"object","description":"StorageLocationTraitConfigEntry"},"StockForUpsertUpdate":{"properties":{"conditions":{"description":"Describes conditions of a stock\n    *`DEFECTIVE` - stock is defective, not usable for customer orders","items":{"enum":["DEFECTIVE"],"type":"string"},"type":"array"},"customAttributes":{"description":"Attributes that can be added to this entity. These attributes **cannot** be used within fulfillment processes, but enable you to attach custom data from your systems to fulfillmenttools entities.","nullable":true,"type":"object"},"id":{"type":"string"},"locationRef":{"nullable":true,"type":"string"},"tenantStockId":{"description":"tenantStockId is an optional identifier for the stock in the tenant system.","type":"string"},"traitConfig":{"description":"defines the traits of the stock, overrules the storage location traits","items":{"$ref":"#/components/schemas/StorageLocationTraitConfigEntry"},"type":"array"},"value":{"format":"int32","minimum":0,"type":"integer"},"version":{"type":"number"}},"required":["value","id","version"],"title":"StockForUpsertUpdate","type":"object","description":"StockForUpsertUpdate"},"StockUpsertOperationResult":{"properties":{"status":{"enum":["UPDATED","CREATED","UNCHANGED"],"type":"string"},"stock":{"$ref":"#/components/schemas/Stock"}},"required":["stock","status"],"title":"StockUpsertOperationResult","type":"object","description":"StockUpsertOperationResult"},"Stock":{"properties":{"available":{"type":"number"},"availableUntil":{"description":"defines until when a stock is included in the stock availability as available and used for routing","format":"date-time","type":"string"},"conditions":{"description":"Describes conditions of a stock\n    *`DEFECTIVE` - stock is defective, not usable for customer orders","items":{"enum":["DEFECTIVE"],"type":"string"},"type":"array"},"created":{"format":"date-time","type":"string"},"customAttributes":{"description":"Attributes that can be added to this entity. These attributes **cannot** be used within fulfillment processes, but enable you to attach custom data from your systems to fulfillmenttools entities.","nullable":true,"type":"object"},"facility":{"$ref":"#/components/schemas/StockFacilityReferences"},"facilityRef":{"description":"facility in which the stock is located","type":"string"},"facilityWideReserved":{"deprecated":true,"type":"number"},"id":{"type":"string"},"lastModified":{"format":"date-time","type":"string"},"locationRef":{"description":"location on which the stock is placed","type":"string"},"properties":{"additionalProperties":{"type":"string"},"allOf":[{"$ref":"#/components/schemas/StockPropertyPreset"}],"description":"allow tracking of specific values such as expiry dates on a set of items. They should describe physical identifiable properties of the stock and are not meant to be used for metadata (see \"customAttributes\" for that)."},"receiptDate":{"description":"date-time when stock has entered the system, defaults to the creation date","format":"date-time","type":"string"},"reserved":{"description":"amount of this stock reserved for customer orders","type":"number"},"scannableCodes":{"description":"scannableCodes such as barcodes that identify this stock","items":{"type":"string"},"type":"array"},"scores":{"description":"stock with a high score can used preferably over stock with a lower score in routing, depending on configuration. The score can represent different attributes of the stock like zone, storage location, expiry date or receipt date.","items":{"type":"string"},"type":"array"},"serializedProperties":{"description":"properties object serialized as JSON string, sorted alphabetically by key","type":"string"},"tenantArticleId":{"description":"tenantArticleId of the stock","minLength":1,"type":"string"},"tenantStockId":{"description":"tenantStockId is an optional identifier for the stock in the tenant system.","type":"string"},"traitConfig":{"description":"defines the traits of the stock, overrules the storage location traits","items":{"$ref":"#/components/schemas/StorageLocationTraitConfigEntry"},"type":"array"},"traits":{"description":"provide information on how storage locations and stocks are to be handled in operational processes. Can only be set via storageLocation. ","items":{"enum":["PICKABLE","ACCESSIBLE","KEEP_ON_ZERO","OUTBOUND","IN_MOTION"],"type":"string"},"type":"array"},"value":{"format":"int32","minimum":0,"type":"integer"},"version":{"type":"number"}},"required":["tenantArticleId","value","reserved","facilityWideReserved","facilityRef","facility","available","id","version","created","lastModified","traits","serializedProperties"],"title":"Stock","type":"object","description":"Stock"},"StockFacilityReferences":{"properties":{"facilityRef":{"description":"facility in which the stock is located","type":"string"},"tenantFacilityId":{"description":"tenantFacilityId in which the stock is located","type":"string"}},"required":["facilityRef"],"title":"StockFacilityReferences","type":"object","description":"StockFacilityReferences"},"ApiError":{"items":{"$ref":"#/components/schemas/ErrorInner"},"type":"array","xml":{"name":"ApiError"},"title":"ApiError","description":"ApiError"},"ErrorInner":{"properties":{"description":{"type":"string"},"requestVersion":{"description":"The version provided within an invalid request.","format":"int64","type":"integer"},"summary":{"type":"string"},"version":{"format":"int64","type":"integer"}},"required":["summary"],"type":"object","title":"ErrorInner","description":"ErrorInner"}}},"paths":{"/api/stocks":{"put":{"deprecated":false,"description":"Update and create many stocks at once","operationId":"upsertStocks","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StocksForUpsert"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/StockUpsertOperationResult"},"type":"array"}}},"description":"Stock upsert result"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Your user is not allowed to operate against this API instance"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Your user, although recognized, is not authorized to use this"}},"summary":"Update stocks","tags":["Stocks (Inventory)"]}}}}
```

## PUT /api/stocks/{stockId}

> Update stock

```json
{"openapi":"3.0.1","info":{"title":"fulfillmenttools","version":"VERSIONLESS"},"tags":[{"description":"Endpoints to create, update and read stocks.","name":"Stocks (Inventory)"}],"servers":[{"url":"https://{tenant}.api.fulfillmenttools.com","variables":{"tenant":{"default":"your-tenant-name"}}}],"security":[{"BearerToken":[]}],"components":{"securitySchemes":{"BearerToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"StockForUpdate":{"properties":{"conditions":{"description":"Describes conditions of a stock\n    *`DEFECTIVE` - stock is defective, not usable for customer orders","items":{"enum":["DEFECTIVE"],"type":"string"},"type":"array"},"customAttributes":{"description":"Attributes that can be added to this entity. These attributes **cannot** be used within fulfillment processes, but enable you to attach custom data from your systems to fulfillmenttools entities.","nullable":true,"type":"object"},"locationRef":{"nullable":true,"type":"string"},"tenantStockId":{"description":"tenantStockId is an optional identifier for the stock in the tenant system.","type":"string"},"traitConfig":{"description":"defines the traits of the stock, overrules the storage location traits","items":{"$ref":"#/components/schemas/StorageLocationTraitConfigEntry"},"type":"array"},"value":{"format":"int32","minimum":0,"type":"integer"},"version":{"type":"number"}},"required":["value","version"],"title":"StockForUpdate","type":"object","description":"StockForUpdate"},"StorageLocationTraitConfigEntry":{"properties":{"enabled":{"description":"whether the trait is enabled or not","type":"boolean"},"trait":{"description":"Describes what kind of actions this stock is available for\n     * `PICKABLE`- The stock is available for picking\n     * `ACCESSIBLE`- The stock is available for stock movements (stowing, inbound, etc)\n     * `KEEP_ON_ZERO`- The stock will not be deleted when emptied\n     * `OUTBOUND`- The stock is intended for outbound processes","type":"string"}},"required":["enabled","trait"],"title":"StorageLocationTraitConfigEntry","type":"object","description":"StorageLocationTraitConfigEntry"},"Stock":{"properties":{"available":{"type":"number"},"availableUntil":{"description":"defines until when a stock is included in the stock availability as available and used for routing","format":"date-time","type":"string"},"conditions":{"description":"Describes conditions of a stock\n    *`DEFECTIVE` - stock is defective, not usable for customer orders","items":{"enum":["DEFECTIVE"],"type":"string"},"type":"array"},"created":{"format":"date-time","type":"string"},"customAttributes":{"description":"Attributes that can be added to this entity. These attributes **cannot** be used within fulfillment processes, but enable you to attach custom data from your systems to fulfillmenttools entities.","nullable":true,"type":"object"},"facility":{"$ref":"#/components/schemas/StockFacilityReferences"},"facilityRef":{"description":"facility in which the stock is located","type":"string"},"facilityWideReserved":{"deprecated":true,"type":"number"},"id":{"type":"string"},"lastModified":{"format":"date-time","type":"string"},"locationRef":{"description":"location on which the stock is placed","type":"string"},"properties":{"additionalProperties":{"type":"string"},"allOf":[{"$ref":"#/components/schemas/StockPropertyPreset"}],"description":"allow tracking of specific values such as expiry dates on a set of items. They should describe physical identifiable properties of the stock and are not meant to be used for metadata (see \"customAttributes\" for that)."},"receiptDate":{"description":"date-time when stock has entered the system, defaults to the creation date","format":"date-time","type":"string"},"reserved":{"description":"amount of this stock reserved for customer orders","type":"number"},"scannableCodes":{"description":"scannableCodes such as barcodes that identify this stock","items":{"type":"string"},"type":"array"},"scores":{"description":"stock with a high score can used preferably over stock with a lower score in routing, depending on configuration. The score can represent different attributes of the stock like zone, storage location, expiry date or receipt date.","items":{"type":"string"},"type":"array"},"serializedProperties":{"description":"properties object serialized as JSON string, sorted alphabetically by key","type":"string"},"tenantArticleId":{"description":"tenantArticleId of the stock","minLength":1,"type":"string"},"tenantStockId":{"description":"tenantStockId is an optional identifier for the stock in the tenant system.","type":"string"},"traitConfig":{"description":"defines the traits of the stock, overrules the storage location traits","items":{"$ref":"#/components/schemas/StorageLocationTraitConfigEntry"},"type":"array"},"traits":{"description":"provide information on how storage locations and stocks are to be handled in operational processes. Can only be set via storageLocation. ","items":{"enum":["PICKABLE","ACCESSIBLE","KEEP_ON_ZERO","OUTBOUND","IN_MOTION"],"type":"string"},"type":"array"},"value":{"format":"int32","minimum":0,"type":"integer"},"version":{"type":"number"}},"required":["tenantArticleId","value","reserved","facilityWideReserved","facilityRef","facility","available","id","version","created","lastModified","traits","serializedProperties"],"title":"Stock","type":"object","description":"Stock"},"StockFacilityReferences":{"properties":{"facilityRef":{"description":"facility in which the stock is located","type":"string"},"tenantFacilityId":{"description":"tenantFacilityId in which the stock is located","type":"string"}},"required":["facilityRef"],"title":"StockFacilityReferences","type":"object","description":"StockFacilityReferences"},"StockPropertyPreset":{"properties":{"expiry":{"type":"string"}},"title":"StockPropertyPreset","type":"object","description":"StockPropertyPreset"},"ApiError":{"items":{"$ref":"#/components/schemas/ErrorInner"},"type":"array","xml":{"name":"ApiError"},"title":"ApiError","description":"ApiError"},"ErrorInner":{"properties":{"description":{"type":"string"},"requestVersion":{"description":"The version provided within an invalid request.","format":"int64","type":"integer"},"summary":{"type":"string"},"version":{"format":"int64","type":"integer"}},"required":["summary"],"type":"object","title":"ErrorInner","description":"ErrorInner"}}},"paths":{"/api/stocks/{stockId}":{"put":{"deprecated":false,"description":"","operationId":"updateStock","parameters":[{"in":"path","name":"stockId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/StockForUpdate"},{"not":{"required":["version"]},"properties":{"locationRef":{"nullable":true,"type":"string"},"value":{"format":"int32","minimum":0,"type":"integer"}},"required":["value"],"type":"object"}]}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Stock"}}},"description":"Stock"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Your user is not allowed to operate against this API instance"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Your user, although recognized, is not authorized to use this"}},"summary":"Update stock","tags":["Stocks (Inventory)"]}}}}
```

## DELETE /api/stocks/{stockId}

> Delete stock

```json
{"openapi":"3.0.1","info":{"title":"fulfillmenttools","version":"VERSIONLESS"},"tags":[{"description":"Endpoints to create, update and read stocks.","name":"Stocks (Inventory)"}],"servers":[{"url":"https://{tenant}.api.fulfillmenttools.com","variables":{"tenant":{"default":"your-tenant-name"}}}],"security":[{"BearerToken":[]}],"components":{"securitySchemes":{"BearerToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"ApiError":{"items":{"$ref":"#/components/schemas/ErrorInner"},"type":"array","xml":{"name":"ApiError"},"title":"ApiError","description":"ApiError"},"ErrorInner":{"properties":{"description":{"type":"string"},"requestVersion":{"description":"The version provided within an invalid request.","format":"int64","type":"integer"},"summary":{"type":"string"},"version":{"format":"int64","type":"integer"}},"required":["summary"],"type":"object","title":"ErrorInner","description":"ErrorInner"}}},"paths":{"/api/stocks/{stockId}":{"delete":{"deprecated":false,"description":"","operationId":"deleteStock","parameters":[{"in":"path","name":"stockId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Stock was deleted."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Your user is not allowed to operate against this API instance"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Your user, although recognized, is not authorized to use this"}},"summary":"Delete stock","tags":["Stocks (Inventory)"]}}}}
```

## List stocks (search)

> Search for Stock

```json
{"openapi":"3.0.1","info":{"title":"fulfillmenttools","version":"VERSIONLESS"},"tags":[{"description":"Endpoints to create, update and read stocks.","name":"Stocks (Inventory)"}],"servers":[{"url":"https://{tenant}.api.fulfillmenttools.com","variables":{"tenant":{"default":"your-tenant-name"}}}],"security":[{"BearerToken":[]}],"components":{"securitySchemes":{"BearerToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"StockSearchPayload":{"properties":{"after":{"deprecated":false,"description":"The cursor to start after for forward pagination. The value is provided in the `pageInfo.endCursor` field of the response. Cannot be used with `before` or `last`.","type":"string"},"before":{"description":"The cursor to start before for backward pagination. The value is provided in the `pageInfo.startCursor` field of the response. Cannot be used with `after` or `size` (first).","type":"string"},"last":{"description":"Number of items to return for backward pagination. Cannot be used with 'size' (first). Default: 20.","maximum":250,"minimum":1,"type":"number"},"options":{"$ref":"#/components/schemas/SearchOptions"},"query":{"$ref":"#/components/schemas/StockSearchQuery"},"size":{"description":"Number of items to return for forward pagination. Cannot be used with 'last'. Default: 20.","maximum":250,"minimum":1,"type":"number"},"sort":{"description":"Use for sorting the result.","items":{"$ref":"#/components/schemas/StockSort"},"maxItems":1,"minItems":1,"type":"array"},"startAfterId":{"deprecated":true,"description":"The ID to start after. Deprecated, use `after` with the value provided in `pageInfo.endCursor` instead.","type":"string"}},"required":["query"],"title":"StockSearchPayload","type":"object","description":"StockSearchPayload"},"SearchOptions":{"properties":{"withTotal":{"description":"Set to true to include the total count of items in the search result.","type":"boolean"}},"title":"SearchOptions","type":"object","description":"SearchOptions"},"StockSearchQuery":{"properties":{"and":{"items":{"$ref":"#/components/schemas/StockSearchQuery"},"maxItems":500,"type":"array"},"availableUntil":{"allOf":[{"$ref":"#/components/schemas/DateFilter"}],"description":"Search by availableUntil"},"conditions":{"allOf":[{"$ref":"#/components/schemas/StockConditionEnumListFilter"}],"description":"Search by conditions"},"customAttributes":{"additionalProperties":{"anyOf":[{"$ref":"#/components/schemas/BooleanFilter"},{"$ref":"#/components/schemas/StringEqFilter"},{"$ref":"#/components/schemas/NumberEqFilter"},{"$ref":"#/components/schemas/DateFilter"}]},"description":"Search by custom attributes","type":"object"},"facilityRef":{"allOf":[{"$ref":"#/components/schemas/StringFilter"}],"description":"Search by facilityRef"},"id":{"allOf":[{"$ref":"#/components/schemas/StringFilter"}],"description":"Search by id"},"locationRef":{"allOf":[{"$ref":"#/components/schemas/StringFilter"}],"description":"Search by locationRef"},"or":{"items":{"$ref":"#/components/schemas/StockSearchQuery"},"maxItems":500,"type":"array"},"properties":{"additionalProperties":{"anyOf":[{"$ref":"#/components/schemas/StringFilter"},{"$ref":"#/components/schemas/DateFilter"},{"$ref":"#/components/schemas/KeyExistsFilter"}]},"description":"Search by properties","type":"object"},"receiptDate":{"allOf":[{"$ref":"#/components/schemas/DateFilter"}],"description":"Search by receiptDate"},"scannableCodes":{"allOf":[{"$ref":"#/components/schemas/StringListFilter"}],"description":"Search by scannableCodes"},"tenantArticleId":{"allOf":[{"$ref":"#/components/schemas/StringFilter"}],"description":"Search by tenantArticleId"},"tenantFacilityId":{"allOf":[{"$ref":"#/components/schemas/StringFilter"}],"description":"tenantFacilityId is handled like facilityRef filter, if you want to search by both you should wrap that filter in an \"or\" filter"},"tenantStockId":{"allOf":[{"$ref":"#/components/schemas/StringFilter"}],"description":"Search by tenantStockId"},"traits":{"allOf":[{"$ref":"#/components/schemas/StockStorageLocationTraitEnumListFilter"}],"description":"Search by traits"},"value":{"allOf":[{"$ref":"#/components/schemas/NumberFilter"}],"description":"Search by value"}},"title":"StockSearchQuery","type":"object","description":"StockSearchQuery"},"DateFilter":{"properties":{"after":{"description":"Search using ISO‑8601 dates relative to today. Prefix with “–” for past dates. Results include events after the specified date. Example: “–P1D” for yesterday, “P1W” for next week.","maxLength":256,"type":"string"},"before":{"description":"Search using ISO‑8601 dates relative to today. Prefix with “–” for past dates. Results include events before the specified date. Example: “–P1D” for yesterday, “P1W” for next week.","maxLength":256,"type":"string"},"eq":{"format":"date-time","type":"string"},"gt":{"format":"date-time","type":"string"},"gte":{"format":"date-time","type":"string"},"lt":{"format":"date-time","type":"string"},"lte":{"format":"date-time","type":"string"},"notEq":{"format":"date-time","type":"string"}},"title":"DateFilter","type":"object","description":"DateFilter"},"StockConditionEnumListFilter":{"properties":{"contains":{"allOf":[{"$ref":"#/components/schemas/StockConditionEnumFilter"}],"description":"Search by conditions"}},"title":"StockConditionEnumListFilter","type":"object","description":"StockConditionEnumListFilter"},"StockConditionEnumFilter":{"properties":{"eq":{"description":"Search by conditions","enum":["DEFECTIVE"],"type":"string"},"in":{"description":"Search by conditions","items":{"enum":["DEFECTIVE"],"type":"string"},"maxItems":500,"type":"array"},"notEq":{"description":"Search by conditions","enum":["DEFECTIVE"],"type":"string"}},"title":"StockConditionEnumFilter","type":"object","description":"StockConditionEnumFilter"},"BooleanFilter":{"properties":{"eq":{"type":"boolean"},"notEq":{"type":"boolean"}},"title":"BooleanFilter","type":"object","description":"BooleanFilter"},"StringEqFilter":{"properties":{"eq":{"maxLength":256,"type":"string"},"notEq":{"maxLength":256,"type":"string"}},"title":"StringEqFilter","type":"object","description":"StringEqFilter"},"NumberEqFilter":{"properties":{"eq":{"type":"number"},"gt":{"type":"number"},"gte":{"type":"number"},"lt":{"type":"number"},"lte":{"type":"number"},"notEq":{"type":"number"}},"title":"NumberEqFilter","type":"object","description":"NumberEqFilter"},"StringFilter":{"properties":{"eq":{"maxLength":256,"type":"string"},"in":{"items":{"maxLength":256,"type":"string"},"maxItems":25,"type":"array"},"notEq":{"maxLength":256,"type":"string"},"notIn":{"items":{"maxLength":256,"type":"string"},"maxItems":25,"type":"array"}},"title":"StringFilter","type":"object","description":"StringFilter"},"KeyExistsFilter":{"properties":{"exists":{"description":"Search all entities which have or do not have this key defined","type":"boolean"}},"title":"KeyExistsFilter","type":"object","description":"KeyExistsFilter"},"StringListFilter":{"properties":{"contains":{"$ref":"#/components/schemas/StringEqFilter"}},"title":"StringListFilter","type":"object","description":"StringListFilter"},"StockStorageLocationTraitEnumListFilter":{"properties":{"contains":{"allOf":[{"$ref":"#/components/schemas/StockStorageLocationTraitEnumFilter"}],"description":"Search by traits"}},"title":"StockStorageLocationTraitEnumListFilter","type":"object","description":"StockStorageLocationTraitEnumListFilter"},"StockStorageLocationTraitEnumFilter":{"properties":{"eq":{"description":"Search by traits","enum":["PICKABLE","ACCESSIBLE","KEEP_ON_ZERO","OUTBOUND","IN_MOTION"],"type":"string"},"in":{"description":"Search by traits","items":{"enum":["PICKABLE","ACCESSIBLE","KEEP_ON_ZERO","OUTBOUND","IN_MOTION"],"type":"string"},"maxItems":500,"type":"array"},"notEq":{"description":"Search by traits","enum":["PICKABLE","ACCESSIBLE","KEEP_ON_ZERO","OUTBOUND","IN_MOTION"],"type":"string"}},"title":"StockStorageLocationTraitEnumFilter","type":"object","description":"StockStorageLocationTraitEnumFilter"},"NumberFilter":{"properties":{"eq":{"type":"number"},"gt":{"type":"number"},"gte":{"type":"number"},"in":{"items":{"type":"number"},"maxItems":25,"type":"array"},"lt":{"type":"number"},"lte":{"type":"number"},"notEq":{"type":"number"},"notIn":{"items":{"type":"number"},"maxItems":25,"type":"array"}},"title":"NumberFilter","type":"object","description":"NumberFilter"},"StockSort":{"properties":{"customAttributes":{"additionalProperties":true,"maxProperties":1,"minProperties":1,"type":"object"},"lastModified":{"enum":["ASC","DESC"],"type":"string"},"locationName":{"enum":["ASC","DESC"],"type":"string"},"tenantArticleId":{"enum":["ASC","DESC"],"type":"string"},"value":{"enum":["ASC","DESC"],"type":"string"}},"title":"StockSort","type":"object","description":"StockSort"},"StockPaginatedResult":{"properties":{"pageInfo":{"allOf":[{"$ref":"#/components/schemas/PageInfo"}],"description":"Pagination information for the search result."},"stocks":{"items":{"$ref":"#/components/schemas/Stock"},"type":"array"},"total":{"description":"The total number of items matching the search criteria. Only filled, if withTotal is set to true in the search options.","minimum":0,"type":"number"}},"required":["pageInfo","stocks"],"title":"StockPaginatedResult","type":"object","description":"StockPaginatedResult"},"PageInfo":{"properties":{"endCursor":{"description":"The cursor to use to fetch the next page of items. Use with parameter `after`.","type":"string"},"hasNextPage":{"description":"If true, there are more items after the current page.","type":"boolean"},"hasPreviousPage":{"description":"If true, there are more items before the current page.","type":"boolean"},"startCursor":{"description":"The cursor to use to fetch the previous page of items.","type":"string"}},"required":["hasNextPage","hasPreviousPage","startCursor","endCursor"],"title":"PageInfo","type":"object","description":"PageInfo"},"Stock":{"properties":{"available":{"type":"number"},"availableUntil":{"description":"defines until when a stock is included in the stock availability as available and used for routing","format":"date-time","type":"string"},"conditions":{"description":"Describes conditions of a stock\n    *`DEFECTIVE` - stock is defective, not usable for customer orders","items":{"enum":["DEFECTIVE"],"type":"string"},"type":"array"},"created":{"format":"date-time","type":"string"},"customAttributes":{"description":"Attributes that can be added to this entity. These attributes **cannot** be used within fulfillment processes, but enable you to attach custom data from your systems to fulfillmenttools entities.","nullable":true,"type":"object"},"facility":{"$ref":"#/components/schemas/StockFacilityReferences"},"facilityRef":{"description":"facility in which the stock is located","type":"string"},"facilityWideReserved":{"deprecated":true,"type":"number"},"id":{"type":"string"},"lastModified":{"format":"date-time","type":"string"},"locationRef":{"description":"location on which the stock is placed","type":"string"},"properties":{"additionalProperties":{"type":"string"},"allOf":[{"$ref":"#/components/schemas/StockPropertyPreset"}],"description":"allow tracking of specific values such as expiry dates on a set of items. They should describe physical identifiable properties of the stock and are not meant to be used for metadata (see \"customAttributes\" for that)."},"receiptDate":{"description":"date-time when stock has entered the system, defaults to the creation date","format":"date-time","type":"string"},"reserved":{"description":"amount of this stock reserved for customer orders","type":"number"},"scannableCodes":{"description":"scannableCodes such as barcodes that identify this stock","items":{"type":"string"},"type":"array"},"scores":{"description":"stock with a high score can used preferably over stock with a lower score in routing, depending on configuration. The score can represent different attributes of the stock like zone, storage location, expiry date or receipt date.","items":{"type":"string"},"type":"array"},"serializedProperties":{"description":"properties object serialized as JSON string, sorted alphabetically by key","type":"string"},"tenantArticleId":{"description":"tenantArticleId of the stock","minLength":1,"type":"string"},"tenantStockId":{"description":"tenantStockId is an optional identifier for the stock in the tenant system.","type":"string"},"traitConfig":{"description":"defines the traits of the stock, overrules the storage location traits","items":{"$ref":"#/components/schemas/StorageLocationTraitConfigEntry"},"type":"array"},"traits":{"description":"provide information on how storage locations and stocks are to be handled in operational processes. Can only be set via storageLocation. ","items":{"enum":["PICKABLE","ACCESSIBLE","KEEP_ON_ZERO","OUTBOUND","IN_MOTION"],"type":"string"},"type":"array"},"value":{"format":"int32","minimum":0,"type":"integer"},"version":{"type":"number"}},"required":["tenantArticleId","value","reserved","facilityWideReserved","facilityRef","facility","available","id","version","created","lastModified","traits","serializedProperties"],"title":"Stock","type":"object","description":"Stock"},"StockFacilityReferences":{"properties":{"facilityRef":{"description":"facility in which the stock is located","type":"string"},"tenantFacilityId":{"description":"tenantFacilityId in which the stock is located","type":"string"}},"required":["facilityRef"],"title":"StockFacilityReferences","type":"object","description":"StockFacilityReferences"},"StockPropertyPreset":{"properties":{"expiry":{"type":"string"}},"title":"StockPropertyPreset","type":"object","description":"StockPropertyPreset"},"StorageLocationTraitConfigEntry":{"properties":{"enabled":{"description":"whether the trait is enabled or not","type":"boolean"},"trait":{"description":"Describes what kind of actions this stock is available for\n     * `PICKABLE`- The stock is available for picking\n     * `ACCESSIBLE`- The stock is available for stock movements (stowing, inbound, etc)\n     * `KEEP_ON_ZERO`- The stock will not be deleted when emptied\n     * `OUTBOUND`- The stock is intended for outbound processes","type":"string"}},"required":["enabled","trait"],"title":"StorageLocationTraitConfigEntry","type":"object","description":"StorageLocationTraitConfigEntry"},"ApiError":{"items":{"$ref":"#/components/schemas/ErrorInner"},"type":"array","xml":{"name":"ApiError"},"title":"ApiError","description":"ApiError"},"ErrorInner":{"properties":{"description":{"type":"string"},"requestVersion":{"description":"The version provided within an invalid request.","format":"int64","type":"integer"},"summary":{"type":"string"},"version":{"format":"int64","type":"integer"}},"required":["summary"],"type":"object","title":"ErrorInner","description":"ErrorInner"}}},"paths":{"/api/stocks/search":{"post":{"deprecated":false,"description":"Search for Stock","operationId":"searchStock","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockSearchPayload"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockPaginatedResult"}}},"description":"Your search result"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Your user is not allowed to operate against this API instance"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Your user, although recognized, is not authorized to use this"}},"summary":"List stocks (search)","tags":["Stocks (Inventory)"]}}}}
```

## POST /api/stocks/actions

> Call stock action

```json
{"openapi":"3.0.1","info":{"title":"fulfillmenttools","version":"VERSIONLESS"},"tags":[{"description":"Endpoints to create, update and read stocks.","name":"Stocks (Inventory)"}],"servers":[{"url":"https://{tenant}.api.fulfillmenttools.com","variables":{"tenant":{"default":"your-tenant-name"}}}],"security":[{"BearerToken":[]}],"components":{"securitySchemes":{"BearerToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"StockAction":{"properties":{"action":{"description":"Action to be performed on the stock. If a user has specific facility context limitations, only stocks located in the referenced facilities will be affected","oneOf":[{"$ref":"#/components/schemas/StockDeleteByLocations"},{"$ref":"#/components/schemas/StockDeleteByProducts"},{"$ref":"#/components/schemas/StockDeleteByIds"},{"$ref":"#/components/schemas/StockMoveToLocation"},{"$ref":"#/components/schemas/VersionlessUpdateStock"}]},"actions":{"deprecated":true,"description":"Deprecated. Use 'action' with a single action input instead.","items":{"oneOf":[{"$ref":"#/components/schemas/StockDeleteByLocations"},{"$ref":"#/components/schemas/StockDeleteByProducts"},{"$ref":"#/components/schemas/StockDeleteByIds"}]},"maxItems":10,"type":"array"}},"title":"StockAction","type":"object","description":"StockAction"},"StockDeleteByLocations":{"properties":{"locationRefs":{"items":{"type":"string"},"maxItems":500,"type":"array"},"name":{"enum":["DELETE_BY_LOCATIONS"],"type":"string"}},"required":["name","locationRefs"],"title":"StockDeleteByLocations","type":"object","description":"StockDeleteByLocations"},"StockDeleteByProducts":{"properties":{"facilityRef":{"type":"string"},"name":{"enum":["DELETE_BY_PRODUCTS"],"type":"string"},"tenantArticleIds":{"items":{"type":"string"},"maxItems":500,"type":"array"}},"required":["name","facilityRef","tenantArticleIds"],"title":"StockDeleteByProducts","type":"object","description":"StockDeleteByProducts"},"StockDeleteByIds":{"properties":{"ids":{"items":{"type":"string"},"maxItems":500,"type":"array"},"name":{"enum":["DELETE_BY_IDS"],"type":"string"}},"required":["name","ids"],"title":"StockDeleteByIds","type":"object","description":"StockDeleteByIds"},"StockMoveToLocation":{"properties":{"amount":{"type":"number"},"fromStockId":{"type":"string"},"name":{"enum":["MOVE_TO_LOCATION"],"type":"string"},"options":{"$ref":"#/components/schemas/MoveStockToLocationOptions"},"toLocationRef":{"type":"string"}},"required":["name","fromStockId","toLocationRef","amount"],"title":"StockMoveToLocation","type":"object","description":"This part of the API is in Beta status. For details please check the <a href=\"https://docs.fulfillmenttools.com/documentation/developer-docs/api/core-concepts/api-release-life-cycle#beta\" target=\"_blank\">api-release-life-cycle documentation</a>.<br /><br />StockMoveToLocation"},"MoveStockToLocationOptions":{"properties":{"deleteFromStockIfZero":{"type":"boolean"}},"title":"MoveStockToLocationOptions","type":"object","description":"MoveStockToLocationOptions"},"VersionlessUpdateStock":{"properties":{"name":{"enum":["UPDATE_VERSIONLESS"],"type":"string"},"stocks":{"description":"Please be sure to include each stock (by ID) only once, when updating. Otherwise the whole batch is rejected with an error.","items":{"oneOf":[{"$ref":"#/components/schemas/StockForCreationVersionless"},{"$ref":"#/components/schemas/StockForUpdateVersionless"}]},"maxItems":25,"type":"array"}},"required":["name","stocks"],"title":"VersionlessUpdateStock","type":"object","description":"VersionlessUpdateStock"},"StockForCreationVersionless":{"properties":{"availableUntil":{"description":"defines until when a stock is included in the stock availability as available and used for routing","format":"date-time","type":"string"},"conditions":{"description":"Describes conditions of a stock\n    *`DEFECTIVE` - stock is defective, not usable for customer orders","items":{"enum":["DEFECTIVE"],"type":"string"},"type":"array"},"customAttributes":{"description":"Attributes that can be added to this entity. These attributes **cannot** be used within fulfillment processes, but enable you to attach custom data from your systems to fulfillmenttools entities.","nullable":true,"type":"object"},"facility":{"description":"Selector for the facility. Either a facility reference or a tenant facility ID must be provided.","oneOf":[{"$ref":"#/components/schemas/FacilityRefSelector"},{"$ref":"#/components/schemas/TenantFacilityIdSelector"}]},"facilityRef":{"deprecated":true,"description":"facility in which the stock is located - fill with either facilityRef or tenantFacilityId - Deprecated: use facility object instead","type":"string"},"locationRef":{"description":"location on which the stock is placed","type":"string"},"operationType":{"enum":["CREATE"],"type":"string"},"properties":{"allOf":[{"$ref":"#/components/schemas/StockPropertyPreset"},{"additionalProperties":{"type":"string"},"type":"object"}],"description":"allow tracking of specific values such as expiry dates on a set of items. They should describe physical identifiable properties of the stock and are not meant to be used for metadata (see \"customAttributes\" for that)."},"receiptDate":{"description":"date-time when stock has entered the system, defaults to the creation date","format":"date-time","type":"string"},"tenantArticleId":{"description":"tenantArticleId of the stock","minLength":1,"type":"string"},"tenantFacilityId":{"deprecated":true,"description":"tenantFacilityId in which the stock is located - fill with either facilityRef or tenantFacilityId - Deprecated: use facility object instead","type":"string"},"tenantStockId":{"description":"tenantStockId is an optional identifier for the stock in the tenant system.","type":"string"},"traitConfig":{"description":"defines the traits of the stock, overrules the storage location traits","items":{"$ref":"#/components/schemas/StorageLocationTraitConfigEntry"},"type":"array"},"value":{"format":"int32","minimum":0,"type":"integer"}},"required":["tenantArticleId","value","operationType"],"title":"StockForCreationVersionless","type":"object","description":"StockForCreationVersionless"},"FacilityRefSelector":{"properties":{"facilityRef":{"description":"Resolves a facility by its reference. This is the preferred way to resolve a facility.","minLength":1,"type":"string"}},"required":["facilityRef"],"title":"FacilityRefSelector","type":"object","description":"FacilityRefSelector"},"TenantFacilityIdSelector":{"properties":{"tenantFacilityId":{"description":"Resolves a facility by its tenantFacilityId.","minLength":1,"type":"string"}},"required":["tenantFacilityId"],"title":"TenantFacilityIdSelector","type":"object","description":"TenantFacilityIdSelector"},"StockPropertyPreset":{"properties":{"expiry":{"type":"string"}},"title":"StockPropertyPreset","type":"object","description":"StockPropertyPreset"},"StorageLocationTraitConfigEntry":{"properties":{"enabled":{"description":"whether the trait is enabled or not","type":"boolean"},"trait":{"description":"Describes what kind of actions this stock is available for\n     * `PICKABLE`- The stock is available for picking\n     * `ACCESSIBLE`- The stock is available for stock movements (stowing, inbound, etc)\n     * `KEEP_ON_ZERO`- The stock will not be deleted when emptied\n     * `OUTBOUND`- The stock is intended for outbound processes","type":"string"}},"required":["enabled","trait"],"title":"StorageLocationTraitConfigEntry","type":"object","description":"StorageLocationTraitConfigEntry"},"StockForUpdateVersionless":{"properties":{"conditions":{"description":"Describes conditions of a stock\n    *`DEFECTIVE` - stock is defective, not usable for customer orders","items":{"enum":["DEFECTIVE"],"type":"string"},"type":"array"},"customAttributes":{"description":"Attributes that can be added to this entity. These attributes **cannot** be used within fulfillment processes, but enable you to attach custom data from your systems to fulfillmenttools entities.","nullable":true,"type":"object"},"id":{"type":"string"},"locationRef":{"nullable":true,"type":"string"},"operationType":{"enum":["UPDATE"],"type":"string"},"tenantStockId":{"description":"tenantStockId is an optional identifier for the stock in the tenant system.","type":"string"},"traitConfig":{"description":"defines the traits of the stock, overrules the storage location traits","items":{"$ref":"#/components/schemas/StorageLocationTraitConfigEntry"},"type":"array"},"value":{"format":"int32","minimum":0,"type":"integer"}},"required":["value","id","operationType"],"title":"StockForUpdateVersionless","type":"object","description":"StockForUpdateVersionless"},"StockActionResult":{"properties":{"name":{"enum":["DELETE_BY_LOCATIONS","DELETE_BY_PRODUCTS","DELETE_BY_IDS","MOVE_TO_LOCATION","UPDATE_VERSIONLESS"],"type":"string"},"result":{"oneOf":[{"$ref":"#/components/schemas/StockDeleteActionResult"},{"$ref":"#/components/schemas/StockMoveToLocationActionResult"},{"$ref":"#/components/schemas/StockVersionlessUpsertActionResult"}]}},"required":["name","result"],"title":"StockActionResult","type":"object","description":"StockActionResult"},"StockDeleteActionResult":{"properties":{"ids":{"items":{"type":"string"},"type":"array"}},"required":["ids"],"title":"StockDeleteActionResult","type":"object","description":"StockDeleteActionResult"},"StockMoveToLocationActionResult":{"properties":{"fromStock":{"$ref":"#/components/schemas/Stock"},"toStock":{"$ref":"#/components/schemas/Stock"}},"required":["toStock"],"title":"StockMoveToLocationActionResult","type":"object","description":"StockMoveToLocationActionResult"},"Stock":{"properties":{"available":{"type":"number"},"availableUntil":{"description":"defines until when a stock is included in the stock availability as available and used for routing","format":"date-time","type":"string"},"conditions":{"description":"Describes conditions of a stock\n    *`DEFECTIVE` - stock is defective, not usable for customer orders","items":{"enum":["DEFECTIVE"],"type":"string"},"type":"array"},"created":{"format":"date-time","type":"string"},"customAttributes":{"description":"Attributes that can be added to this entity. These attributes **cannot** be used within fulfillment processes, but enable you to attach custom data from your systems to fulfillmenttools entities.","nullable":true,"type":"object"},"facility":{"$ref":"#/components/schemas/StockFacilityReferences"},"facilityRef":{"description":"facility in which the stock is located","type":"string"},"facilityWideReserved":{"deprecated":true,"type":"number"},"id":{"type":"string"},"lastModified":{"format":"date-time","type":"string"},"locationRef":{"description":"location on which the stock is placed","type":"string"},"properties":{"additionalProperties":{"type":"string"},"allOf":[{"$ref":"#/components/schemas/StockPropertyPreset"}],"description":"allow tracking of specific values such as expiry dates on a set of items. They should describe physical identifiable properties of the stock and are not meant to be used for metadata (see \"customAttributes\" for that)."},"receiptDate":{"description":"date-time when stock has entered the system, defaults to the creation date","format":"date-time","type":"string"},"reserved":{"description":"amount of this stock reserved for customer orders","type":"number"},"scannableCodes":{"description":"scannableCodes such as barcodes that identify this stock","items":{"type":"string"},"type":"array"},"scores":{"description":"stock with a high score can used preferably over stock with a lower score in routing, depending on configuration. The score can represent different attributes of the stock like zone, storage location, expiry date or receipt date.","items":{"type":"string"},"type":"array"},"serializedProperties":{"description":"properties object serialized as JSON string, sorted alphabetically by key","type":"string"},"tenantArticleId":{"description":"tenantArticleId of the stock","minLength":1,"type":"string"},"tenantStockId":{"description":"tenantStockId is an optional identifier for the stock in the tenant system.","type":"string"},"traitConfig":{"description":"defines the traits of the stock, overrules the storage location traits","items":{"$ref":"#/components/schemas/StorageLocationTraitConfigEntry"},"type":"array"},"traits":{"description":"provide information on how storage locations and stocks are to be handled in operational processes. Can only be set via storageLocation. ","items":{"enum":["PICKABLE","ACCESSIBLE","KEEP_ON_ZERO","OUTBOUND","IN_MOTION"],"type":"string"},"type":"array"},"value":{"format":"int32","minimum":0,"type":"integer"},"version":{"type":"number"}},"required":["tenantArticleId","value","reserved","facilityWideReserved","facilityRef","facility","available","id","version","created","lastModified","traits","serializedProperties"],"title":"Stock","type":"object","description":"Stock"},"StockFacilityReferences":{"properties":{"facilityRef":{"description":"facility in which the stock is located","type":"string"},"tenantFacilityId":{"description":"tenantFacilityId in which the stock is located","type":"string"}},"required":["facilityRef"],"title":"StockFacilityReferences","type":"object","description":"StockFacilityReferences"},"StockVersionlessUpsertActionResult":{"properties":{"operationResults":{"$ref":"#/components/schemas/StockUpsertOperationResult"}},"required":["operationResults"],"title":"StockVersionlessUpsertActionResult","type":"object","description":"StockVersionlessUpsertActionResult"},"StockUpsertOperationResult":{"properties":{"status":{"enum":["UPDATED","CREATED","UNCHANGED"],"type":"string"},"stock":{"$ref":"#/components/schemas/Stock"}},"required":["stock","status"],"title":"StockUpsertOperationResult","type":"object","description":"StockUpsertOperationResult"},"ApiError":{"items":{"$ref":"#/components/schemas/ErrorInner"},"type":"array","xml":{"name":"ApiError"},"title":"ApiError","description":"ApiError"},"ErrorInner":{"properties":{"description":{"type":"string"},"requestVersion":{"description":"The version provided within an invalid request.","format":"int64","type":"integer"},"summary":{"type":"string"},"version":{"format":"int64","type":"integer"}},"required":["summary"],"type":"object","title":"ErrorInner","description":"ErrorInner"}}},"paths":{"/api/stocks/actions":{"post":{"deprecated":false,"description":"","operationId":"performStocksActions","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockAction"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockActionResult"}}},"description":"Stock action result"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Your user is not allowed to operate against this API instance"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}},"description":"Your user, although recognized, is not authorized to use this"}},"summary":"Call stock action","tags":["Stocks (Inventory)"]}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fulfillmenttools.com/documentation/by-pillar/global-inventory-hub/stock/stock-endpoints.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
