# Stock movements 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. Endpoint: GET /api/stocks/{stockId}/movements Version: 1.0.0 Security: shoptetAccessToken, shoptetPrivateApiToken ## Path parameters: - `stockId` (number, required) ID of stock for which we would like the movements. Example: "1" ## Query parameters: - `lastId` (number) ID of last transfered record. If missing, the older records are sent. Example: "45" - `changeTimeFrom` (string) 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: "2021-03-01T00:00:00+0100" - `orderCode` (string) Filtering according to order code. Example: "2017000049" - `include` (string) Optional parts of response. For specific include behavior, please see the general description above. Example: "orderCode,productGuid,historicalProductGuid,sumAmount" - `itemsPerPage` (number) Returned items per page. Default value is 25. Max value is 1000. Example: "50" - `page` (number) Page number to return. Default value is 1. Example: "3" ## Header parameters: - `Content-Type` (string, required) ## Response 200 fields (application/json): - `data` (object, required) - `data.movements` (array, required) - `data.movements.id` (integer, required) Synthetic unique incremental ID of log with changes in stock - `data.movements.productCode` (string, required) unique identification of the product variant. - `data.movements.actualAmount` (string,null, required) Current quantity in stock after carrying out the change, as a decimal with three decimal places. - `data.movements.amountChange` (string,null, required) Change in stock quantity, as a decimal with three decimal places. - `data.movements.changedBy` (string,null, required) Can have the following values: - admin if the change was invoked by the e-shop administrator - customer if the change was invoked by the e-shop customer - e-mail or null for all other cases. Upon a change invoked by a REST API request, the form of the e-mail is generated as per template `api.service-{service-id}@{e-shop-domain}. - `data.movements.changeTime` (string,null, required) DateTime of product stock movement. - `data.movements.orderCode` (string,null) Code of order which initiated stock movement, present only with orderCode include flag - `data.movements.productGuid` (any) Product GUID, can be null for specific reasons, please see endpoint description for more information. - `data.movements.historicalProductGuid` (any) Product GUID at the time of the stock movement, can be null for specific reasons and has no current relation to returned code, please see endpoint description for more information. - `data.movements.sumAmount` (string,null) Sum of all stocks for the product in time after amount change was executed. - `data.paginator` (object, required) - `data.paginator.totalCount` (integer, required) total number of available records - `data.paginator.page` (integer, required) current page - `data.paginator.pageCount` (integer, required) total available of pages - `data.paginator.itemsOnPage` (integer, required) number of currently returned records - `data.paginator.itemsPerPage` (integer, required) required number of records per page - `errors` (array,null, required) - `errors.errorCode` (string, required) Short text error identification - `errors.message` (string, required) Descriptive error message - `errors.instance` (string, required) Identification of the entity referenced