WinShopAPI docs
ReferenceDocumentsStock takingStock takings

Create a stock taking

Creates a stock taking from the header and any items in the body, and returns the stored document. Reserves the next internal document number. Requires `Permissions.StockTakings.Create`.

POST
/api/documents/stock-taking/stock-takings

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.

Request Body

application/json
  1. body
id?|

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

Formatint32
internalNumber?|

Internal document number, unique within the document type and reserved when the document is created. Read-only.

Formatint32
items?array<>|

The document's items. Null when the document was loaded without them.

createdAt?|
Formatdate-time
date?|
Formatdate-time
dateOfProcessing?|
Formatdate-time
formNumber?|
Lengthlength <= 150
isCancellation?boolean|null
isConfirmed?boolean|null
isExported?boolean|null
isLocked?boolean|null
isPrinted?boolean|null
isProcessed?boolean|null
lastModify?|
Formatdate-time
lockOwner?|
Lengthlength <= 80
note?string|null
totalNumberOfItems?|
Formatint32
totalNumberOfPieces?|
Formatdecimal
totalPrice?|
Formatdecimal
totalPriceWoVat?|
Formatdecimal
totalStockPriceWoVat?|
Formatdecimal
userId?|
Formatint32
warehouseBackupId?|
Formatint32
warehouseId?|
Formatint32

Response Body

application/json
  1. response
id?|

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

Formatint32
internalNumber?|

Internal document number, unique within the document type and reserved when the document is created. Read-only.

Formatint32
items?array<>|

The document's items. Null when the document was loaded without them.

createdAt?|
Formatdate-time
date?|
Formatdate-time
dateOfProcessing?|
Formatdate-time
formNumber?|
Lengthlength <= 150
isCancellation?boolean|null
isConfirmed?boolean|null
isExported?boolean|null
isLocked?boolean|null
isPrinted?boolean|null
isProcessed?boolean|null
lastModify?|
Formatdate-time
lockOwner?|
Lengthlength <= 80
note?string|null
totalNumberOfItems?|
Formatint32
totalNumberOfPieces?|
Formatdecimal
totalPrice?|
Formatdecimal
totalPriceWoVat?|
Formatdecimal
totalStockPriceWoVat?|
Formatdecimal
userId?|
Formatint32
warehouseBackupId?|
Formatint32
warehouseId?|
Formatint32
curl -X POST 'https://<your-instance>/api/documents/stock-taking/stock-takings' \  -H 'Authorization: Bearer <access-token>' \  -H 'Content-Type: application/json' \  -d '{}'
{  "id": 0,  "internalNumber": 0,  "items": [    {      "id": 0,      "internalNumber": 0,      "item": 0,      "productId": 0,      "variants": [        {          "colorId": 0,          "dimensionId": 0,          "id": 0,          "itemId": 0,          "lengthId": 0,          "quantity": 0,          "sizeId": 0,          "locationId": 0,          "price": 0,          "priceWoVat": 0        }      ],      "barcode": "string",      "batchId": 0,      "createdAt": "2019-08-24T14:15:22Z",      "lastModify": "2019-08-24T14:15:22Z",      "locationId": 0,      "note": "string",      "packagePrice": 0,      "price": 0,      "priceWoVat": 0,      "priceWoVatIssued": 0,      "quantity": 0,      "quantityCoefficient": 0,      "quantityIssued": 0,      "recyclingFee": 0,      "recyclingFeeId": 0,      "royalty": 0,      "royaltyId": 0,      "setPrice": 0,      "stockPrice": 0,      "unitId": 0,      "unitIdIssued": 0,      "userId": 0,      "variantId": 0,      "vatRate": 0    }  ],  "createdAt": "2019-08-24T14:15:22Z",  "date": "2019-08-24T14:15:22Z",  "dateOfProcessing": "2019-08-24T14:15:22Z",  "formNumber": "string",  "isCancellation": true,  "isConfirmed": true,  "isExported": true,  "isLocked": true,  "isPrinted": true,  "isProcessed": true,  "lastModify": "2019-08-24T14:15:22Z",  "lockOwner": "string",  "note": "string",  "totalNumberOfItems": 0,  "totalNumberOfPieces": 0,  "totalPrice": 0,  "totalPriceWoVat": 0,  "totalStockPriceWoVat": 0,  "userId": 0,  "warehouseBackupId": 0,  "warehouseId": 0}