Back

Search

Search

Methods

Inventory

Orders

Inventory /GetBatchesByStockItemId

Response: List<StockItemBatch>



Used to get batch info for stock item for all locations

Parameters

NameTypeDescription
stockItemIdGuidItem id
onlyAvailableBooleanIf true, only available batches will be returned

HTTP Endpoint

Server /Inventory / GetBatchesByStockItemId

Permissions


Example Code

Example Request

The following request format is required for this method.

POST https://eu-ext.linnworks.net//api/Inventory/GetBatchesByStockItemId HTTP/1.1
Host: eu-ext.linnworks.net
Connection: keep-alive
Accept: application/json, text/javascript, */*; q=0.01
Origin: https://www.linnworks.net
Accept-Language: en
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Referer: https://www.linnworks.net/
Accept-Encoding: gzip, deflate
Authorization: INSERT_YOUR_TOKEN_HERE

stockItemId=ca760bd5-3a6e-438d-a6e2-342bad56c013&onlyAvailable=true

Response

This is an example response. Results may vary depending on your data.

[
  {
    "BatchId": 1,
    "SKU": "sample string 2",
    "InventoryTrackingType": 3,
    "StockItemId": "2b5e09b7-e7c3-415c-86eb-b3c039284094",
    "BatchNumber": "sample string 5",
    "ExpiresOn": "2018-02-19T16:57:09.1024134+00:00",
    "SellBy": "2018-02-19T16:57:09.1024134+00:00",
    "Inventory": [
      null,
      {
        "BatchInventoryId": 1,
        "BatchId": 2,
        "StockLocationId": "4d4764c5-913a-4858-b3aa-ecb6ba8ab935",
        "BinRack": "sample string 4",
        "PrioritySequence": 5,
        "Quantity": 6,
        "StockValue": 7.0,
        "StartQuantity": 8,
        "PickedQuantity": 9,
        "BatchStatus": "Available",
        "IsDeleted": false
      }
    ],
    "IsDeleted": true
  },
  {
    "BatchId": 1,
    "SKU": "sample string 2",
    "InventoryTrackingType": 3,
    "StockItemId": "2b5e09b7-e7c3-415c-86eb-b3c039284094",
    "BatchNumber": "sample string 5",
    "ExpiresOn": "2018-02-19T16:57:09.1024134+00:00",
    "SellBy": "2018-02-19T16:57:09.1024134+00:00",
    "Inventory": [
      null,
      {
        "BatchInventoryId": 1,
        "BatchId": 2,
        "StockLocationId": "4d4764c5-913a-4858-b3aa-ecb6ba8ab935",
        "BinRack": "sample string 4",
        "PrioritySequence": 5,
        "Quantity": 6,
        "StockValue": 7.0,
        "StartQuantity": 8,
        "PickedQuantity": 9,
        "BatchStatus": "Available",
        "IsDeleted": false
      }
    ],
    "IsDeleted": true
  }
]