WinShopAPI docs
ReferenceStock items

Update a stock item

Updates the stock item's editable fields — such as its minimum and maximum stock levels and shelf location — and returns the stored row. Quantities move through documents, not through this endpoint. Requires `Permissions.StockItems.View`.

PUT
/api/stock-items/{stockItemId}

Authorization

Bearer
headerAuthorizationBearer <token>

OAuth 2.0 client credentials. Obtain a client id/secret from Winshop support ([email protected]), then POST to the token URL.

Path Parameters

stockItemId*integer
Formatint32

Request Body

application/json
  1. body
batchId?|

Batch these goods belong to. Read-only.

Formatint32
cashRegisterPriceChangeMinAmount?|

Lowest selling price a till operator may discount this item to.

Formatdecimal
colorId?|

Colour of this holding's variant; 0 when the product has no colour breakdown. Read-only.

Formatint32
createdAt?|

When the stock item was created. Read-only.

Formatdate-time
dimensionId?|

Dimension of this holding's variant; 0 when the product has no dimension breakdown. Read-only.

Formatint32
dontCalculateDuringStockMovement?|

True when stock movements skip recalculating this item's stock price. Read-only.

guid?|

Stable identifier of the stock item. Read-only.

Formatguid
id?|

Row id of the stock item. Read-only; the server assigns it.

Formatint32
initialDate?|

Date the opening balance was taken. Read-only.

Formatdate-time
initialQuantity?|

Quantity at the opening balance. Read-only.

Formatdecimal
initialStockPrice?|

Stock price at the opening balance. Read-only.

Formatdecimal
isCommissionItem?|

True when the goods are held on commission and not yet owned. Read-only.

isInactive?|

True to hide the stock item from pickers without deleting it.

lastPurchasePrice?|

Purchase price of the most recent intake. Read-only.

Formatdecimal
lastmodifyDate?|

When the stock item was last changed. Read-only.

Formatdate-time
lengthId?|

Length of this holding's variant; 0 when the product has no length breakdown. Read-only.

Formatint32
maxQuantity?|

Stock level above which the item counts as overstocked.

Formatdecimal
minQuantity?|

Stock level below which the item should be reordered.

Formatdecimal
note?|

Free-text note on the stock item.

optQuantity?|

Stock level the item should be replenished back to.

Formatdecimal
optTurnover?|

Target turnover in days, used when proposing reorder quantities.

Formatint32
positionId?|

Shelf position holding these goods, from the positions item list. Read-only.

Formatint32
positionText?|

Shelf position as free text, for positions not held as rows.

Lengthlength <= 100
productId?|

Product this holding is of. Read-only.

Formatint32
quantity?|

Quantity physically on stock, including what other documents have blocked. Read-only; documents move it.

Formatdecimal
quantityAvailable?|

Quantity free to sell: what is on stock less what other documents have already blocked. Read-only.

Formatdecimal
quantityChangeReason?|

Reason recorded for the last manual change of the quantity. Read-only.

Lengthlength <= 50
referenceQuantity?|

Quantity a stock taking compares the counted amount against.

Formatdecimal
sizeId?|

Size of this holding's variant; 0 when the product has no size breakdown. Read-only.

Formatint32
stockPrice?|

Current stock (cost) price per unit. Read-only; documents move it.

Formatdecimal
userId?|

User who last changed the stock item. Read-only.

Formatint32
variantId?|

Variant these goods belong to. Read-only.

Formatint32
warehouseId?|

Warehouse this holding belongs to. Read-only.

Formatint32

Response Body

application/json
  1. response
batchId?|

Batch these goods belong to. Read-only.

Formatint32
cashRegisterPriceChangeMinAmount?|

Lowest selling price a till operator may discount this item to.

Formatdecimal
colorId?|

Colour of this holding's variant; 0 when the product has no colour breakdown. Read-only.

Formatint32
createdAt?|

When the stock item was created. Read-only.

Formatdate-time
dimensionId?|

Dimension of this holding's variant; 0 when the product has no dimension breakdown. Read-only.

Formatint32
dontCalculateDuringStockMovement?|

True when stock movements skip recalculating this item's stock price. Read-only.

guid?|

Stable identifier of the stock item. Read-only.

Formatguid
id?|

Row id of the stock item. Read-only; the server assigns it.

Formatint32
initialDate?|

Date the opening balance was taken. Read-only.

Formatdate-time
initialQuantity?|

Quantity at the opening balance. Read-only.

Formatdecimal
initialStockPrice?|

Stock price at the opening balance. Read-only.

Formatdecimal
isCommissionItem?|

True when the goods are held on commission and not yet owned. Read-only.

isInactive?|

True to hide the stock item from pickers without deleting it.

lastPurchasePrice?|

Purchase price of the most recent intake. Read-only.

Formatdecimal
lastmodifyDate?|

When the stock item was last changed. Read-only.

Formatdate-time
lengthId?|

Length of this holding's variant; 0 when the product has no length breakdown. Read-only.

Formatint32
maxQuantity?|

Stock level above which the item counts as overstocked.

Formatdecimal
minQuantity?|

Stock level below which the item should be reordered.

Formatdecimal
note?|

Free-text note on the stock item.

optQuantity?|

Stock level the item should be replenished back to.

Formatdecimal
optTurnover?|

Target turnover in days, used when proposing reorder quantities.

Formatint32
positionId?|

Shelf position holding these goods, from the positions item list. Read-only.

Formatint32
positionText?|

Shelf position as free text, for positions not held as rows.

Lengthlength <= 100
productId?|

Product this holding is of. Read-only.

Formatint32
quantity?|

Quantity physically on stock, including what other documents have blocked. Read-only; documents move it.

Formatdecimal
quantityAvailable?|

Quantity free to sell: what is on stock less what other documents have already blocked. Read-only.

Formatdecimal
quantityChangeReason?|

Reason recorded for the last manual change of the quantity. Read-only.

Lengthlength <= 50
referenceQuantity?|

Quantity a stock taking compares the counted amount against.

Formatdecimal
sizeId?|

Size of this holding's variant; 0 when the product has no size breakdown. Read-only.

Formatint32
stockPrice?|

Current stock (cost) price per unit. Read-only; documents move it.

Formatdecimal
userId?|

User who last changed the stock item. Read-only.

Formatint32
variantId?|

Variant these goods belong to. Read-only.

Formatint32
warehouseId?|

Warehouse this holding belongs to. Read-only.

Formatint32
curl -X PUT 'https://<your-instance>/api/stock-items/0' \  -H 'Authorization: Bearer <access-token>' \  -H 'Content-Type: application/json' \  -d '{  "cashRegisterPriceChangeMinAmount": 15.5,  "isInactive": true,  "maxQuantity": 750,  "minQuantity": 50,  "note": "Updated Max/Min quantities and repositioned.",  "optTurnover": 6,  "positionText": "Zone A, Shelf 3, Bin B",  "referenceQuantity": 100}'
{  "batchId": 0,  "cashRegisterPriceChangeMinAmount": 0,  "colorId": 0,  "createdAt": "2019-08-24T14:15:22Z",  "dimensionId": 0,  "dontCalculateDuringStockMovement": true,  "guid": "string",  "id": 0,  "initialDate": "2019-08-24T14:15:22Z",  "initialQuantity": 0,  "initialStockPrice": 0,  "isCommissionItem": true,  "isInactive": true,  "lastPurchasePrice": 0,  "lastmodifyDate": "2019-08-24T14:15:22Z",  "lengthId": 0,  "maxQuantity": 0,  "minQuantity": 0,  "note": "string",  "optQuantity": 0,  "optTurnover": 0,  "positionId": 0,  "positionText": "string",  "productId": 0,  "quantity": 0,  "quantityAvailable": 0,  "quantityChangeReason": "string",  "referenceQuantity": 0,  "sizeId": 0,  "stockPrice": 0,  "userId": 0,  "variantId": 0,  "warehouseId": 0}