Skip to content

Stock movements

Request

It returns the list of changes in product quantity, which were done within one stock. Supports the Paging movements.

This endpoint supports optional parts using the include parameter (see Section on demand). Please note that there is some performance penalty associated with the usage of "orderCode" include and/or query parameter. Also please note that when include productGuid is used, the returned data can be null for specific cases. Either when this is a historic stock move, or the product code has been changed and/or is inconsistent with internally stored guid. This is to ensure that the returned code and productGuid always point to the same product consistently. To return GUID of product at the time of the stock movement, please use the include and attribute historicalProductGuid. The returned data can still be null on historic stock movements.

Security
shoptetAccessToken or shoptetPrivateApiToken
Path
stockIdintegerrequired

ID of stock for which we would like the movements.

Example:1
Query
lastIdinteger

ID of last transfered record. If missing, the older records are sent.

Example:lastId=45
changeTimeFromstring

Date of move, in ISO 8601 format, lower limit. It is not possible to use it as break poit, it is not unique value. Optional.

Example:changeTimeFrom=2021-03-01T00:00:00+0100
orderCodestring

Filtering according to order code.

Example:orderCode=2017000049
includestring

Optional parts of response. For specific include behavior, please see the general description above.

Example:include=orderCode,productGuid,historicalProductGuid,sumAmount
itemsPerPageinteger

Returned items per page. Default value is 25. Max value is 1000.

Example:itemsPerPage=50
pageinteger

Page number to return. Default value is 1.

Example:page=3
Headers
Content-Typestringrequired
Default:"application/json"
curl -i -X GET \
  'https://api.docs.shoptet.com/_mock/shoptet-api/openapi/api/stocks/1/movements?lastId=45&changeTimeFrom=2021-03-01T00%3A00%3A00%2B0100&orderCode=2017000049&include=orderCode%2CproductGuid%2ChistoricalProductGuid%2CsumAmount&itemsPerPage=50&page=3' \
  -H 'Content-Type: application/json' \
  -H 'Shoptet-Access-Token: YOUR_API_KEY_HERE'

Responses

OK

Bodyapplication/json
dataobjectrequired
errorsArray of objects or null(Errors)required
metadataobject(Metadata)required
Response
{ "data": { "movements": [], "paginator": {} }, "errors": [ {} ], "metadata": { "requestId": "019c8c34-64f3-7328-af43-bf1e34fa39d7" } }