Back

Search

Search

Methods

Inventory

Orders

Stock /SetStockLevel

Response: List<StockItemLevel>



Set the stock level of a list of stock items identified by its SKU to the value provided

Parameters

NameTypeDescription
stockLevelsList<StockLevelUpdate>The new stock items levels to set
changeSourceString

HTTP Endpoint

Server /Stock / SetStockLevel

Permissions

GlobalPermissions.Inventory.Stock.StockWrite.ChangeStockLevelsNode

Example Code

Example Request

The following request format is required for this method.

POST https://eu-ext.linnworks.net//api/Stock/SetStockLevel 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

stockLevels=[
  {
    "SKU": "sample string 1",
    "LocationId": "c60f52fe-7b6f-4fc8-8d56-c48db8f55f2c",
    "Level": 3
  },
  {
    "SKU": "sample string 1",
    "LocationId": "c60f52fe-7b6f-4fc8-8d56-c48db8f55f2c",
    "Level": 3
  }
]&changeSource=sample string 1

Response

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

[
  {
    "Location": {
      "StockLocationId": "8e9e8d37-0a3c-4460-baed-43c73a7f7ff8",
      "LocationName": "sample string 2",
      "IsFulfillmentCenter": true,
      "LocationTag": "sample string 4",
      "BinRack": "sample string 5",
      "IsWarehouseManaged": true
    },
    "StockLevel": 1,
    "StockValue": 2.1,
    "MinimumLevel": 3,
    "InOrderBook": 4,
    "Due": 5,
    "JIT": true,
    "InOrders": 4,
    "Available": -3,
    "UnitCost": 2.1,
    "SKU": "sample string 7",
    "AutoAdjust": true,
    "LastUpdateDate": "2019-06-12T09:27:50.9859035+01:00",
    "LastUpdateOperation": "sample string 10",
    "rowid": "404847e5-4f00-45fa-ac05-ce71bc604869",
    "PendingUpdate": true,
    "StockItemPurchasePrice": 13.1,
    "StockItemId": "f2b40c70-c129-4a78-9b1b-e61635affd9d"
  },
  {
    "Location": {
      "StockLocationId": "8e9e8d37-0a3c-4460-baed-43c73a7f7ff8",
      "LocationName": "sample string 2",
      "IsFulfillmentCenter": true,
      "LocationTag": "sample string 4",
      "BinRack": "sample string 5",
      "IsWarehouseManaged": true
    },
    "StockLevel": 1,
    "StockValue": 2.1,
    "MinimumLevel": 3,
    "InOrderBook": 4,
    "Due": 5,
    "JIT": true,
    "InOrders": 4,
    "Available": -3,
    "UnitCost": 2.1,
    "SKU": "sample string 7",
    "AutoAdjust": true,
    "LastUpdateDate": "2019-06-12T09:27:50.9859035+01:00",
    "LastUpdateOperation": "sample string 10",
    "rowid": "404847e5-4f00-45fa-ac05-ce71bc604869",
    "PendingUpdate": true,
    "StockItemPurchasePrice": 13.1,
    "StockItemId": "f2b40c70-c129-4a78-9b1b-e61635affd9d"
  }
]