{"openapi":"3.0.0","paths":{"/metrics":{"get":{"operationId":"index","parameters":[],"responses":{"200":{"description":""}},"tags":["Prometheus"]}},"/business-units/{businessUnitId}/stock-counts":{"post":{"description":"This endpoint allows you to create a new stock count for a specified business unit.","operationId":"createStockCount","parameters":[{"name":"Correlation-Id","required":false,"in":"header","description":"Id used for tracking a request throughout the system(s). Autogenerated if not supplied.","schema":{"minLength":1,"type":"string"}},{"name":"businessUnitId","required":true,"in":"path","description":"Business unit id to perform action","schema":{"type":"string"}},{"name":"type","required":true,"in":"query","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateStockCountDto"}}}},"responses":{"202":{"description":""},"400":{"description":"Invalid params","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestDto"}}}},"403":{"description":"Unauthorized"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDto"}}}}},"security":[{"access-token":[]}],"summary":"Create a new stock count for a business unit","tags":["StockCounts"],"x-permissions":["stc.stock-count.create-full","stc.stock-count.create-cycle","stc.stock-count.create-control","stc.stock-count.create-test"]},"get":{"description":"This endpoint retrieves all stock counts for the specified business unit, including their details.","operationId":"listStockCounts","parameters":[{"name":"businessUnitId","required":true,"in":"path","description":"Business unit id to perform action","schema":{"type":"string"}},{"name":"statuses","required":false,"in":"query","description":"Only return stock counts in these statuses. Repeat the parameter for several, e.g. `?statuses=CREATED&statuses=COMPLETED`. Defaults to CREATED and IN-PROGRESS. Takes precedence over doIncludeCompletedStockCounts.","schema":{"type":"array","items":{"$ref":"#/components/schemas/StockCountStatus"}}},{"name":"doIncludeFutureStockCounts","required":false,"in":"query","description":"Include future stock counts, i.e. having a future startDate.","schema":{"example":false,"type":"boolean"}},{"name":"doIncludeCompletedStockCounts","required":false,"in":"query","description":"Include completed stock counts, i.e., stock counts that are marked as completed. Ignored when statuses is supplied.","deprecated":true,"schema":{"example":false,"type":"boolean"}},{"name":"startDateFrom","required":false,"in":"query","description":"Filter stock counts with a start date from this date onward. Format: YYYY-MM-DD.","schema":{"format":"date","type":"string"}},{"name":"startDateTo","required":false,"in":"query","description":"Filter stock counts with a start date up to this date. Format: YYYY-MM-DD.","schema":{"format":"date","type":"string"}},{"name":"completedDateFrom","required":false,"in":"query","description":"Filter stock counts that were completed from this date onward. Format: YYYY-MM-DD.","schema":{"format":"date","type":"string"}},{"name":"completedDateTo","required":false,"in":"query","description":"Filter stock counts that were completed up to this date. Format: YYYY-MM-DD.","schema":{"format":"date","type":"string"}},{"name":"Correlation-Id","required":false,"in":"header","description":"Id used for tracking a request throughout the system(s). Autogenerated if not supplied.","schema":{"minLength":1,"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListStockCountDto"}}}},"400":{"description":"Invalid params","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestDto"}}}},"403":{"description":"Unauthorized"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDto"}}}}},"security":[{"access-token":[]}],"summary":"Retrieve all stock counts for a business unit","tags":["StockCounts"],"x-permissions":["stc.stock-count.get"]}},"/business-units/{businessUnitId}/stock-counts:quick-count":{"post":{"description":"This endpoint allows you to create a new stock count of type quick count for a specified business unit.","operationId":"createQuickStockCount","parameters":[{"name":"Correlation-Id","required":false,"in":"header","description":"Id used for tracking a request throughout the system(s). Autogenerated if not supplied.","schema":{"minLength":1,"type":"string"}},{"name":"businessUnitId","required":true,"in":"path","description":"Business unit id to perform action","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateQuickStockCountDto"}}}},"responses":{"202":{"description":""},"400":{"description":"Invalid params","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestDto"}}}},"403":{"description":"Unauthorized"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDto"}}}}},"security":[{"access-token":[]}],"summary":"Create a new quick count for a business unit","tags":["StockCounts"],"x-permissions":["stc.stock-count.quick-count"]}},"/business-units/{businessUnitId}/stock-counts:items-not-counted":{"post":{"description":"This endpoint allows you to create a new stock count for items not counted this calendar year for a specified business unit.","operationId":"createItemsNotCountedStockCount","parameters":[{"name":"Correlation-Id","required":false,"in":"header","description":"Id used for tracking a request throughout the system(s). Autogenerated if not supplied.","schema":{"minLength":1,"type":"string"}},{"name":"businessUnitId","required":true,"in":"path","description":"Business unit id to perform action","schema":{"type":"string"}},{"name":"type","required":true,"in":"query","description":"Type of stock count, restricted to CYCLE and TEST.","schema":{"$ref":"#/components/schemas/StockCountCycleType"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateItemsNotCountedStockCountDto"}}}},"responses":{"202":{"description":""},"400":{"description":"Invalid params","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestDto"}}}},"403":{"description":"Unauthorized"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDto"}}}}},"security":[{"access-token":[]}],"summary":"create a new stock count for items not counted this calendar year for a business unit ","tags":["StockCounts"],"x-permissions":["stc.stock-count.create-cycle","stc.stock-count.create-test"]}},"/business-units/{businessUnitId}/stock-counts/{stockCountId}":{"get":{"description":"This endpoint fetches detailed information about a stock count, including the stock count lines, based on the provided stock count ID.Pagination is supported for the stock count lines.","operationId":"getStockCountAndLines","parameters":[{"name":"businessUnitId","required":true,"in":"path","description":"Business unit id to perform action","schema":{"type":"string"}},{"name":"stockCountId","required":true,"in":"path","description":"Stock count id","schema":{"type":"string"}},{"name":"take","required":false,"in":"query","description":"Take certain number of records","schema":{"default":10,"example":10,"type":"number"}},{"name":"skip","required":false,"in":"query","description":"Skip certain number of records","schema":{"default":0,"example":0,"type":"number"}},{"name":"Correlation-Id","required":false,"in":"header","description":"Id used for tracking a request throughout the system(s). Autogenerated if not supplied.","schema":{"minLength":1,"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetStockCountAndListItemsDto"}}}},"400":{"description":"Invalid params","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestDto"}}}},"403":{"description":"Unauthorized"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDto"}}}}},"security":[{"access-token":[]}],"summary":"Get detailed information about a specific stock count and its lines","tags":["StockCounts"],"x-permissions":["stc.stock-count.get"]},"put":{"description":"This endpoint allows you to update an existing stock count for a specified business unit.","operationId":"updateStockCount","parameters":[{"name":"Correlation-Id","required":false,"in":"header","description":"Id used for tracking a request throughout the system(s). Autogenerated if not supplied.","schema":{"minLength":1,"type":"string"}},{"name":"businessUnitId","required":true,"in":"path","description":"Business unit id to perform action","schema":{"type":"string"}},{"name":"stockCountId","required":true,"in":"path","description":"Stock count id","schema":{"type":"string"}},{"name":"type","required":true,"in":"query","description":"Type of stock count, e.g., FULL, CYCLE, etc.","schema":{"$ref":"#/components/schemas/StockCountType"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateStockCountDto"}}}},"responses":{"202":{"description":""},"400":{"description":"Invalid params","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestDto"}}}},"403":{"description":"Unauthorized"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDto"}}}}},"security":[{"access-token":[]}],"summary":"Update an existing stock count","tags":["StockCounts"],"x-permissions":["stock-count.update-full","stock-count.update-cycle","stock-count.update-control","stock-count.update-test"]},"delete":{"description":"This endpoint deletes a stock count for a specified business unit based on the provided stock count ID.","operationId":"deleteStockCount","parameters":[{"name":"Correlation-Id","required":false,"in":"header","description":"Id used for tracking a request throughout the system(s). Autogenerated if not supplied.","schema":{"minLength":1,"type":"string"}},{"name":"businessUnitId","required":true,"in":"path","description":"Business unit id to perform action","schema":{"type":"string"}},{"name":"stockCountId","required":true,"in":"path","description":"Stock count id","schema":{"type":"string"}},{"name":"type","required":true,"in":"query","description":"Type of stock count, e.g., FULL, CYCLE, etc.","schema":{"$ref":"#/components/schemas/StockCountType"}}],"responses":{"202":{"description":""},"400":{"description":"Invalid params","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestDto"}}}},"403":{"description":"Unauthorized"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDto"}}}}},"security":[{"access-token":[]}],"summary":"Delete a specific stock count","tags":["StockCounts"],"x-permissions":["stock-count.delete-full","stock-count.delete-cycle","stock-count.delete-control","stock-count.delete-test"]}},"/business-units/{businessUnitId}/stock-counts/{stockCountId}/locations":{"get":{"description":"Get list of locations already added for the stock count","operationId":"getStockCountLocations","parameters":[{"name":"businessUnitId","required":true,"in":"path","description":"Business unit id to perform action","schema":{"type":"string"}},{"name":"stockCountId","required":true,"in":"path","description":"Stock count id","schema":{"type":"string"}},{"name":"Correlation-Id","required":false,"in":"header","description":"Id used for tracking a request throughout the system(s). Autogenerated if not supplied.","schema":{"minLength":1,"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListStockCountLocationsDto"}}}},"400":{"description":"Invalid params","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestDto"}}}},"403":{"description":"Unauthorized"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDto"}}}}},"security":[{"access-token":[]}],"summary":"Get list of locations already added for the stock count","tags":["StockCounts"],"x-permissions":["stc.stock-count.get"]}},"/business-units/{businessUnitId}/stock-counts/{stockCountId}/item":{"get":{"description":"Get details of an item and its associated lines in a stock count","operationId":"getItemDetials","parameters":[{"name":"businessUnitId","required":true,"in":"path","description":"Business unit id to perform action","schema":{"type":"string"}},{"name":"stockCountId","required":true,"in":"path","description":"Stock count id","schema":{"type":"string"}},{"name":"take","required":false,"in":"query","description":"Take certain number of records","schema":{"default":10,"example":10,"type":"number"}},{"name":"skip","required":false,"in":"query","description":"Skip certain number of records","schema":{"default":0,"example":0,"type":"number"}},{"name":"itemIdentifier","required":false,"in":"query","description":"Identifies the item counted. Either this field or the itemId must be specified.","schema":{"type":"string"}},{"name":"itemId","required":false,"in":"query","description":"Preferred way for identifying the item.  Either this field or the itemIdentifier must be specified.","schema":{"type":"string"}},{"name":"Correlation-Id","required":false,"in":"header","description":"Id used for tracking a request throughout the system(s). Autogenerated if not supplied.","schema":{"minLength":1,"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockCountItemDetailsDto"}}}},"400":{"description":"Invalid params","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestDto"}}}},"403":{"description":"Unauthorized"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDto"}}}}},"security":[{"access-token":[]}],"summary":"Get details of an item and its associated lines in a stock count","tags":["StockCounts"],"x-permissions":["stc.stock-count.get"]}},"/business-units/{businessUnitId}/stock-counts/{stockCountId}/items:not-counted":{"get":{"description":"This endpoint retrieves a list of items that have not been counted in a specified stock count","operationId":"getNotCounteStockItems","parameters":[{"name":"businessUnitId","required":true,"in":"path","description":"Business unit id to perform action","schema":{"type":"string"}},{"name":"stockCountId","required":true,"in":"path","description":"Stock count id","schema":{"type":"string"}},{"name":"take","required":false,"in":"query","description":"Take certain number of records","schema":{"default":10,"example":10,"type":"number"}},{"name":"skip","required":false,"in":"query","description":"Skip certain number of records","schema":{"default":0,"example":0,"type":"number"}},{"name":"itemIdentifier","required":false,"in":"query","description":"Global Trade Item Number (GTIN) associated with the item.","schema":{"type":"string"}},{"name":"itemId","required":false,"in":"query","description":"Preferred way for identifying the item.","schema":{"type":"string"}},{"name":"Correlation-Id","required":false,"in":"header","description":"Id used for tracking a request throughout the system(s). Autogenerated if not supplied.","schema":{"minLength":1,"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListStockCountItemsNotCounted"}}}},"400":{"description":"Invalid params","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestDto"}}}},"403":{"description":"Unauthorized"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDto"}}}}},"security":[{"access-token":[]}],"summary":"Retrieve a list of not counted items for a stock count","tags":["StockCounts"],"x-permissions":["stc.stock-count.get"]}},"/business-units/{businessUnitId}/stock-counts/{stockCountId}/item-categories/{itemCategoryId}/items":{"get":{"description":"Fetch a list of items belonging to given level 2 category and stock count ID, applying filtering and sorting rules.","operationId":"listItemsByCategory","parameters":[{"name":"businessUnitId","required":true,"in":"path","description":"Business unit id to perform action","schema":{"type":"string"}},{"name":"stockCountId","required":true,"in":"path","description":"Stock count id","schema":{"type":"string"}},{"name":"itemCategoryId","required":true,"in":"path","description":"item category id","schema":{"type":"string"}},{"name":"take","required":false,"in":"query","description":"Take certain number of records","schema":{"default":10,"example":10,"type":"number"}},{"name":"skip","required":false,"in":"query","description":"Skip certain number of records","schema":{"default":0,"example":0,"type":"number"}},{"name":"Correlation-Id","required":false,"in":"header","description":"Id used for tracking a request throughout the system(s). Autogenerated if not supplied.","schema":{"minLength":1,"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListStockCountItemsByCategoryCountedDto"}}}},"400":{"description":"Invalid params","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestDto"}}}},"403":{"description":"Unauthorized"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDto"}}}}},"security":[{"access-token":[]}],"summary":"List items to-be-counted or counted based on stock count ID and item category","tags":["StockCounts"],"x-permissions":["stc.stock-count.get"]}},"/business-units/{businessUnitId}/stock-counts/{stockCountId}/item-categories":{"get":{"description":"Retrieve a list of level 2 category reporting IDs associated with item categories for the specified stock count ID","operationId":"listCategoriesByStockCount","parameters":[{"name":"businessUnitId","required":true,"in":"path","description":"Business unit id to perform action","schema":{"type":"string"}},{"name":"stockCountId","required":true,"in":"path","description":"Stock count id","schema":{"type":"string"}},{"name":"Correlation-Id","required":false,"in":"header","description":"Id used for tracking a request throughout the system(s). Autogenerated if not supplied.","schema":{"minLength":1,"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListCategoriesByStockCountDto"}}}},"400":{"description":"Invalid params","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestDto"}}}},"403":{"description":"Unauthorized"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDto"}}}}},"security":[{"access-token":[]}],"summary":"List level 2 categories for given stock count ID","tags":["StockCounts"],"x-permissions":["stc.stock-count.get"]}},"/business-units/{businessUnitId}/stock-counts/{stockCountId}:submit":{"post":{"description":"This endpoint submits a stock count","operationId":"submitStockCount","parameters":[{"name":"Correlation-Id","required":false,"in":"header","description":"Id used for tracking a request throughout the system(s). Autogenerated if not supplied.","schema":{"minLength":1,"type":"string"}},{"name":"businessUnitId","required":true,"in":"path","description":"Business unit id to perform action","schema":{"type":"string"}},{"name":"stockCountId","required":true,"in":"path","description":"Stock count id","schema":{"type":"string"}},{"name":"type","required":true,"in":"query","description":"Type of stock count, e.g., FULL, CYCLE, etc.","schema":{"$ref":"#/components/schemas/StockCountType"}}],"responses":{"202":{"description":""},"400":{"description":"Invalid params","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestDto"}}}},"403":{"description":"Unauthorized"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDto"}}}}},"security":[{"access-token":[]}],"summary":"Submit a stock count","tags":["StockCounts"],"x-permissions":["stc.stock-count.submit-full","stc.stock-count.submit-cycle","stc.stock-count.submit-control","stc.stock-count.submit-test"]}},"/business-units/{businessUnitId}/stock-counts/{stockCountId}/lines":{"put":{"description":"This endpoint allows you to create or update a stock count line for a specific stock count.","operationId":"createStockCountLines","parameters":[{"name":"Correlation-Id","required":false,"in":"header","description":"Id used for tracking a request throughout the system(s). Autogenerated if not supplied.","schema":{"minLength":1,"type":"string"}},{"name":"businessUnitId","required":true,"in":"path","description":"Business unit id to perform action","schema":{"type":"string"}},{"name":"stockCountId","required":true,"in":"path","description":"Stock count id","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateStockCountLineDto"}}}},"responses":{"202":{"description":""},"400":{"description":"Invalid params","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestDto"}}}},"403":{"description":"Unauthorized"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDto"}}}}},"security":[{"access-token":[]}],"summary":"Create or update a stock count line","tags":["StockCounts"],"x-permissions":["stc.stock-count-line.create"]}},"/business-units/{businessUnitId}/stock-counts/{stockCountId}/lines/{lineId}":{"delete":{"description":"This endpoint deletes a specific stock count line for the given stock count.","operationId":"deleteStockCountLine","parameters":[{"name":"businessUnitId","required":true,"in":"path","description":"Business unit id to perform action","schema":{"type":"string"}},{"name":"stockCountId","required":true,"in":"path","description":"Stock count id","schema":{"type":"string"}},{"name":"lineId","required":true,"in":"path","description":"Stock count line id","schema":{"type":"string"}},{"name":"Correlation-Id","required":false,"in":"header","description":"Id used for tracking a request throughout the system(s). Autogenerated if not supplied.","schema":{"minLength":1,"type":"string"}}],"responses":{"202":{"description":""},"400":{"description":"Invalid params","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestDto"}}}},"403":{"description":"Unauthorized"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDto"}}}}},"security":[{"access-token":[]}],"summary":"Delete a stock count line","tags":["StockCounts"],"x-permissions":["stc.stock-count-line.delete"]}},"/business-units/{businessUnitId}/stock-counts/{stockCountId}/import":{"post":{"description":"This endpoint allows import of stock count for a specified business unit from an external system.","operationId":"importStockCountFromExternalSystem","parameters":[{"name":"Correlation-Id","required":false,"in":"header","description":"Id used for tracking a request throughout the system(s). Autogenerated if not supplied.","schema":{"minLength":1,"type":"string"}},{"name":"businessUnitId","required":true,"in":"path","description":"Business unit id to perform action","schema":{"type":"string"}},{"name":"stockCountId","required":true,"in":"path","description":"Stock count id","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportStockCountDto"}}}},"responses":{"202":{"description":""},"400":{"description":"Invalid params","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestDto"}}}},"403":{"description":"Unauthorized"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDto"}}}}},"security":[{"access-token":[]}],"summary":"Import a stock count for a business unit from external system","tags":["StockCounts"],"x-permissions":["stc.stock-count.import"]}},"/business-units/{businessUnitId}/stock-counts/{stockCountId}/item-categories/{itemCategoryId}:completed":{"post":{"description":"Publish an event indicating an item category has been completed for a given stock count","operationId":"completeItemCategory","parameters":[{"name":"Correlation-Id","required":false,"in":"header","description":"Id used for tracking a request throughout the system(s). Autogenerated if not supplied.","schema":{"minLength":1,"type":"string"}},{"name":"businessUnitId","required":true,"in":"path","description":"Business unit id to perform action","schema":{"type":"string"}},{"name":"stockCountId","required":true,"in":"path","description":"Stock count id","schema":{"type":"string"}},{"name":"itemCategoryId","required":true,"in":"path","description":"item category id","schema":{"type":"string"}}],"responses":{"202":{"description":""},"400":{"description":"Invalid params","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestDto"}}}},"403":{"description":"Unauthorized"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDto"}}}}},"security":[{"access-token":[]}],"summary":"Mark an item category as completed for a stock count","tags":["StockCounts"],"x-permissions":["stc.item-categories.complete"]}},"/business-units/{businessUnitId}/stock-counts/{stockCountId}/counts/categories":{"get":{"description":"This endpoint allows you to retrieve total counts for each category.","operationId":"getTotalsForCategories","parameters":[{"name":"businessUnitId","required":true,"in":"path","description":"Business unit id to perform action","schema":{"type":"string"}},{"name":"stockCountId","required":true,"in":"path","description":"Stock count id","schema":{"type":"string"}},{"name":"doIncludeCountedItems","required":false,"in":"query","description":"If true, include counted items. Defaults to true if not provided.","schema":{"default":true,"example":false,"type":"boolean"}},{"name":"doIncludeNotCountedItems","required":false,"in":"query","description":"If true, include not counted items. Defaults to false if not provided.","schema":{"default":false,"example":false,"type":"boolean"}},{"name":"itemCategoryId","required":false,"in":"query","description":"Category ID of item category counted during the stock count.","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockCountTotalCategoryCountsDto"}}}},"400":{"description":"Invalid params","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestDto"}}}},"403":{"description":"Unauthorized"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDto"}}}}},"security":[{"access-token":[]}],"summary":"Inventory Reports - Category Count","tags":["InventoryReports"],"x-permissions":["stc.stock-count.deviations-total"]}},"/business-units/{businessUnitId}/stock-counts/{stockCountId}/counts/items":{"get":{"description":"This endpoint allows you to retrieve total count for each item.","operationId":"getTotalForItems","parameters":[{"name":"businessUnitId","required":true,"in":"path","description":"Business unit id to perform action","schema":{"type":"string"}},{"name":"stockCountId","required":true,"in":"path","description":"Stock count id","schema":{"type":"string"}},{"name":"doIncludeCountedItems","required":false,"in":"query","description":"If true, include counted items. Defaults to true if not provided.","schema":{"default":true,"example":false,"type":"boolean"}},{"name":"doIncludeNotCountedItems","required":false,"in":"query","description":"If true, include not counted items. Defaults to false if not provided.","schema":{"default":false,"example":false,"type":"boolean"}},{"name":"take","required":false,"in":"query","description":"Take certain number of records","schema":{"default":10,"example":10,"type":"number"}},{"name":"skip","required":false,"in":"query","description":"Skip certain number of records","schema":{"default":0,"example":0,"type":"number"}},{"name":"doExcludeWithinThreshold","required":false,"in":"query","description":"If true, exclude items that are within the threshold.","schema":{"example":false,"type":"boolean"}},{"name":"itemCategoryId","required":false,"in":"query","description":"Item ID of item counted during the stock count.","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockCountItemCountsDto"}}}},"400":{"description":"Invalid params","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestDto"}}}},"403":{"description":"Unauthorized"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDto"}}}}},"security":[{"access-token":[]}],"summary":"Inventory Reports - Total count for each item","tags":["InventoryReports"],"x-permissions":["stc.stock-count.deviations-item"]}},"/business-units/{businessUnitId}/stock-counts/{stockCountId}/counts/items:deviations":{"get":{"description":"This endpoint allows you to retrieve deviations for each item.","operationId":"getItemDeviations","parameters":[{"name":"businessUnitId","required":true,"in":"path","description":"Business unit id to perform action","schema":{"type":"string"}},{"name":"stockCountId","required":true,"in":"path","description":"Stock count id","schema":{"type":"string"}},{"name":"take","required":false,"in":"query","description":"Take certain number of records","schema":{"default":10,"example":10,"type":"number"}},{"name":"skip","required":false,"in":"query","description":"Skip certain number of records","schema":{"default":0,"example":0,"type":"number"}},{"name":"doExcludeWithinThreshold","required":false,"in":"query","description":"If true, exclude items that are within the threshold.","schema":{"example":false,"type":"boolean"}},{"name":"itemCategoryId","required":false,"in":"query","description":"Category ID to filter items by category.","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockCountItemCountsDto"}}}},"400":{"description":"Invalid params","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestDto"}}}},"403":{"description":"Unauthorized"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDto"}}}}},"security":[{"access-token":[]}],"summary":"Inventory Reports -deviations for each item","tags":["InventoryReports"],"x-permissions":["stc.stock-count.deviations-item"]}},"/item-categories/initial-state":{"post":{"description":"This endpoint initiates the initial state processing for item categories for a list of tenant IDs or all tenants.","operationId":"triggerItemCategoriesInitialState","parameters":[{"name":"Correlation-Id","required":false,"in":"header","description":"Id used for tracking a request throughout the system(s). Autogenerated if not supplied.","schema":{"minLength":1,"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ItemCategoriesInitialStateDto"}}}},"responses":{"202":{"description":""},"403":{"description":"Unauthorized"}},"security":[{"access-token":[]}],"summary":"Trigger initial state processing for item categories for specified tenants or all tenants","tags":["InitialState"],"x-permissions":["stc.item-categories.initial-state"]}},"/business-units/initial-state":{"post":{"description":"Starts a pull-based seed of business units and groups from the BUM read API, filling entities that predate the importer subscription. Insert-only: an existing row is never modified, so a re-run is safe. Extenda tenant only.","operationId":"triggerBusinessUnitsInitialState","parameters":[{"name":"Correlation-Id","required":false,"in":"header","description":"Id used for tracking a request throughout the system(s). Autogenerated if not supplied.","schema":{"minLength":1,"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessUnitsInitialStateDto"}}}},"responses":{"202":{"description":""},"403":{"description":"Unauthorized"}},"security":[{"access-token":[]}],"summary":"Trigger BUM initial state (seed) for specified tenants or all tenants","tags":["InitialState"],"x-permissions":["stc.business-units.initial-state"]}},"/recurring-stock-counts":{"post":{"description":"Validates the definition and publishes an upsert command; the definition is applied asynchronously. Returns once the command is accepted, not once it is stored.","operationId":"createRecurringStockCount","parameters":[{"name":"Correlation-Id","required":false,"in":"header","description":"Id used for tracking a request throughout the system(s). Autogenerated if not supplied.","schema":{"minLength":1,"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRecurringStockCountDto"}}}},"responses":{"202":{"description":""},"400":{"description":"Invalid params","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestDto"}}}},"403":{"description":"Unauthorized"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDto"}}}}},"security":[{"access-token":[]}],"summary":"Create a recurring stock count definition","tags":["RecurringStockCounts"],"x-permissions":["stc.recurring-count.create"]},"get":{"description":"Returns the tenant's active definitions with their scope, frequency and both filter sets. Soft-deleted definitions are omitted.","operationId":"listRecurringStockCounts","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListRecurringStockCountDto"}}}},"400":{"description":"Invalid params","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestDto"}}}},"403":{"description":"Unauthorized"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDto"}}}}},"security":[{"access-token":[]}],"summary":"List recurring stock count definitions","tags":["RecurringStockCounts"],"x-permissions":["stc.recurring-count.get"]}},"/recurring-stock-counts/{recurringStockCountId}":{"put":{"description":"Validates the definition and publishes the same upsert command as create, keyed by the path id. The write is idempotent by that id and applied last-writer-wins.","operationId":"updateRecurringStockCount","parameters":[{"name":"Correlation-Id","required":false,"in":"header","description":"Id used for tracking a request throughout the system(s). Autogenerated if not supplied.","schema":{"minLength":1,"type":"string"}},{"name":"recurringStockCountId","required":true,"in":"path","description":"Recurring stock count definition id","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRecurringStockCountDto"}}}},"responses":{"202":{"description":""},"400":{"description":"Invalid params","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestDto"}}}},"403":{"description":"Unauthorized"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDto"}}}}},"security":[{"access-token":[]}],"summary":"Replace a recurring stock count definition","tags":["RecurringStockCounts"],"x-permissions":["stc.recurring-count.update"]},"delete":{"description":"Publishes a delete command. The definition is soft-deleted: the row is retained with a DELETED status and stops producing occurrences.","operationId":"deleteRecurringStockCount","parameters":[{"name":"Correlation-Id","required":false,"in":"header","description":"Id used for tracking a request throughout the system(s). Autogenerated if not supplied.","schema":{"minLength":1,"type":"string"}},{"name":"recurringStockCountId","required":true,"in":"path","description":"Recurring stock count definition id","schema":{"type":"string"}}],"responses":{"202":{"description":""},"400":{"description":"Invalid params","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestDto"}}}},"403":{"description":"Unauthorized"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDto"}}}}},"security":[{"access-token":[]}],"summary":"Delete a recurring stock count definition","tags":["RecurringStockCounts"],"x-permissions":["stc.recurring-count.delete"]},"get":{"description":"Returns the definition's scope, count type, run window, frequency and both filter sets. Empty filter collections are omitted rather than returned empty.","operationId":"getRecurringStockCount","parameters":[{"name":"recurringStockCountId","required":true,"in":"path","description":"Recurring stock count definition id","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecurringStockCountDto"}}}},"400":{"description":"Invalid params","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestDto"}}}},"403":{"description":"Unauthorized"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDto"}}}}},"security":[{"access-token":[]}],"summary":"Get a recurring stock count definition","tags":["RecurringStockCounts"],"x-permissions":["stc.recurring-count.get"]}},"/recurring-stock-counts/occurrences":{"get":{"description":"Returns the dates each active definition would fire on within the given range, with the due date its count window implies. Occurrence **dates** are deterministic — derived from the anchor, the frequency, the count window and `recurrenceEndDate`, and identical to the dates the scheduler generates on. Occurrence **contents** are an estimate: which items a future count will hold cannot be known in advance, because the definition's filters resolve against stock state at each occurrence's own valid-from. This endpoint creates, reserves and persists nothing.","operationId":"listOccurrences","parameters":[{"name":"from","required":true,"in":"query","description":"Start of the projection range, inclusive. Format: YYYY-MM-DD.","schema":{"format":"date","type":"string"}},{"name":"to","required":true,"in":"query","description":"End of the projection range, inclusive. Must not be earlier than `from`. Format: YYYY-MM-DD.","schema":{"format":"date","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListRecurringStockCountOccurrencesDto"}}}},"400":{"description":"Invalid params","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestDto"}}}},"403":{"description":"Unauthorized"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDto"}}}}},"security":[{"access-token":[]}],"summary":"Project future occurrence dates for every recurring definition in the tenant","tags":["RecurringStockCounts"],"x-permissions":["stc.recurring-count.get"]}},"/recurring-stock-counts/{recurringStockCountId}/occurrences":{"get":{"description":"Returns the dates this definition would fire on within the given range, with the due date its count window implies. Occurrence **dates** are deterministic — derived from the anchor, the frequency, the count window and `recurrenceEndDate`, and identical to the dates the scheduler generates on. Occurrence **contents** are an estimate: which items a future count will hold cannot be known in advance, because the definition's filters resolve against stock state at each occurrence's own valid-from. This endpoint creates, reserves and persists nothing.","operationId":"getOccurrences","parameters":[{"name":"recurringStockCountId","required":true,"in":"path","description":"Recurring stock count definition id","schema":{"type":"string"}},{"name":"from","required":true,"in":"query","description":"Start of the projection range, inclusive. Format: YYYY-MM-DD.","schema":{"format":"date","type":"string"}},{"name":"to","required":true,"in":"query","description":"End of the projection range, inclusive. Must not be earlier than `from`. Format: YYYY-MM-DD.","schema":{"format":"date","type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecurringStockCountOccurrencesDto"}}}},"400":{"description":"Invalid params","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestDto"}}}},"403":{"description":"Unauthorized"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDto"}}}}},"security":[{"access-token":[]}],"summary":"Project future occurrence dates for one recurring definition","tags":["RecurringStockCounts"],"x-permissions":["stc.recurring-count.get"]}}},"info":{"title":"Stock Count API","description":"Stock Count API docs <br><br> <a href=\"/schemas/v1/openapi.json\">OpenAPI Document (json)</a>","version":"1.0","contact":{},"license":{"name":"UNLICENSED","url":"UNLICENSED"}},"tags":[],"servers":[{"url":"https://stock-count-api.retailsvc.com/api/v1"}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","description":"JWT Authorization header using the Bearer scheme."}},"schemas":{"BadRequestDto":{"type":"object","properties":{"statusCode":{"type":"number","enum":[400]},"message":{"type":"array","items":{"type":"string"}},"error":{"type":"string","enum":["Bad Request"]}},"required":["statusCode","message","error"]},"InternalServerErrorDto":{"type":"object","properties":{"statusCode":{"type":"number","enum":[500]},"message":{"type":"string","enum":["Internal Server Error"]}},"required":["statusCode","message"]},"StockCountType":{"type":"string","enum":["FULL","CYCLE","CONTROL","TEST"],"description":"Type of stock count, e.g., FULL, CYCLE, etc."},"FilterType":{"type":"object","properties":{"searchSelectionId":{"type":"string","description":"Unique identifier for the filter applied to stock count items."},"query":{"type":"string","description":"Query string to filter stock count items."},"isMandatory":{"type":"boolean","description":"Indicates if this filter is mandatory for the stock count.","default":false,"example":false}}},"StockFilterKind":{"type":"string","enum":["MOVED_SINCE","NOT_COUNTED_SINCE","NEGATIVE_STOCK"],"description":"Stock-state filter kind. Independent of the PnP `filters` array."},"WindowKind":{"type":"string","enum":["SINCE_LAST_COUNT","YEAR_TO_DATE","FIXED_DAYS"],"description":"Kind of window. FIXED_DAYS requires `days`; SINCE_LAST_COUNT and YEAR_TO_DATE do not."},"StockFilterWindowDto":{"type":"object","properties":{"kind":{"description":"Kind of window. FIXED_DAYS requires `days`; SINCE_LAST_COUNT and YEAR_TO_DATE do not.","allOf":[{"$ref":"#/components/schemas/WindowKind"}]},"days":{"type":"integer","minimum":1,"maximum":400,"description":"Number of days for a FIXED_DAYS window. Must be an integer in 1..400."}},"required":["kind"]},"StockFilterDto":{"type":"object","properties":{"kind":{"description":"Stock-state filter kind. Independent of the PnP `filters` array.","allOf":[{"$ref":"#/components/schemas/StockFilterKind"}]},"window":{"description":"Time window. Required for MOVED_SINCE and NOT_COUNTED_SINCE; omitted for NEGATIVE_STOCK.","allOf":[{"$ref":"#/components/schemas/StockFilterWindowDto"}]}},"required":["kind"]},"CreateStockCountDto":{"type":"object","properties":{"name":{"type":"string","description":"Name or title of the stock count."},"type":{"description":"Type of stock count, e.g., FULL, CYCLE, etc.","allOf":[{"$ref":"#/components/schemas/StockCountType"}]},"startDate":{"type":"string","format":"date","description":"Start date for the stock count. Format: YYYY-MM-DD."},"dueDate":{"type":"string","format":"date","description":"Due date for completing the stock count. Format: YYYY-MM-DD."},"filters":{"description":"List of filters applied to stock count items, applicable for cycle stock counts.","type":"array","items":{"$ref":"#/components/schemas/FilterType"}},"stockFilters":{"description":"Stock-state filters applied to stock count items, composed with `filters` as an intersection. Applicable for CYCLE and TEST stock counts.","type":"array","items":{"$ref":"#/components/schemas/StockFilterDto"}},"comment":{"type":"string","description":"Additional remarks or notes related to the stock count."},"stockCountId":{"type":"string","description":"Optional client-supplied unique identifier for the stock count. If omitted, the service generates one."}},"required":["name","type","startDate"]},"CountRecord":{"type":"object","properties":{"countedQuantity":{"type":"number","minimum":1,"description":"The quantity counted for the item."},"location":{"type":"string","description":"Location or area where the item was counted."}},"required":["countedQuantity","location"]},"CreateQuickStockCountDto":{"type":"object","properties":{"itemId":{"type":"string","description":"Id of the item for which stock count is created"},"itemName":{"type":"string","description":"Name of the item for which stock count is created"},"countRecords":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/CountRecord"}}},"required":["itemId","itemName","countRecords"]},"StockCountCycleType":{"type":"string","enum":["CYCLE","TEST"],"description":"Type of stock count, e.g., CYCLE,TEST."},"CreateItemsNotCountedStockCountDto":{"type":"object","properties":{"name":{"type":"string","description":"Name or title of the stock count."},"startDate":{"type":"string","format":"date","description":"Start date for the stock count. Format: YYYY-MM-DD."},"dueDate":{"type":"string","format":"date","description":"Due date for completing the stock count. Format: YYYY-MM-DD."},"comment":{"type":"string","description":"Additional remarks or notes related to the stock count."},"type":{"description":"Type of stock count, e.g., CYCLE,TEST.","allOf":[{"$ref":"#/components/schemas/StockCountCycleType"}]}},"required":["name","startDate","type"]},"StockCountStatus":{"type":"string","enum":["CREATED","IN-PROGRESS","COMPLETED","DELETED"]},"ItemCategoriesDto":{"type":"object","properties":{"reportingId":{"type":"string","description":"Reporting id of stock count item category."},"countedItems":{"type":"number","minimum":0,"description":"The number of items that have been counted in the stock count category."},"notCountedItems":{"type":"number","minimum":0,"description":"The number of items that have not been counted in the stock count category."},"countStatus":{"type":"string","description":"Status of FULLY, PARTIALLY or NOT COUNTED items in stock count category."}},"required":["reportingId","countedItems","notCountedItems","countStatus"]},"ItemDeviationDto":{"type":"object","properties":{"itemId":{"type":"string","description":"Unique identifier for the item."},"itemName":{"type":"string","description":"Name of the item."},"itemCategoryId":{"type":"string","description":"Identifier for the item category."},"itemCategoryName":{"type":"string","description":"Name of the item category."},"totalQuantity":{"type":"number","description":"Total quantity counted for the item."},"totalExpectedQuantity":{"type":"number","description":"Total expected quantity for the item."},"totalDeviationQuantity":{"type":"number","description":"Deviation in quantity (counted - expected)."},"totalDeviationQuantityInPercentage":{"type":"number","description":"Deviation in quantity as a percentage."},"totalAmount":{"type":"number","description":"Total counted amount (totalQuantity × unitPrice)."},"totalExpectedAmount":{"type":"number","description":"Total expected amount (totalExpectedQuantity × unitPrice)."},"totalDeviationAmount":{"type":"number","description":"Deviation in amount (totalAmount - totalExpectedAmount)."},"unitPrice":{"type":"number","description":"Unit price of the item."}},"required":["itemId","itemName","itemCategoryId","itemCategoryName","totalQuantity","totalExpectedQuantity","totalDeviationQuantity","totalDeviationQuantityInPercentage","totalAmount","totalExpectedAmount","totalDeviationAmount","unitPrice"]},"StockCountDto":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the stock count record."},"name":{"type":"string","description":"Name or title of the stock count."},"type":{"description":"Type of stock count, e.g., FULL, CYCLE, etc.","allOf":[{"$ref":"#/components/schemas/StockCountType"}]},"startDate":{"type":"string","format":"date","description":"Start date for the stock count. Format: YYYY-MM-DD."},"dueDate":{"type":"string","format":"date","description":"Due date for completing the stock count. Format: YYYY-MM-DD."},"status":{"description":"Current status of the stock count, e.g., CREATED, INPROGRESS, etc.","allOf":[{"$ref":"#/components/schemas/StockCountStatus"}]},"filters":{"description":"List of filters applied to stock count items, applicable for cycle stock counts.","type":"array","items":{"$ref":"#/components/schemas/FilterType"}},"stockFilters":{"description":"Stock-state filters applied to stock count items, composed with `filters` as an intersection. Applicable for CYCLE and TEST stock counts.","type":"array","items":{"$ref":"#/components/schemas/StockFilterDto"}},"comment":{"type":"string","description":"Additional remarks or notes related to the stock count."},"numberOfItemsNotCounted":{"type":"number","minimum":0,"description":"The number of items yet to be counted in the stock count."},"numberOfItemsCounted":{"type":"number","minimum":0,"description":"The number of items that have been counted in the stock count."},"itemsGeneratedDateTime":{"type":"string","format":"date-time","nullable":true,"description":"When item selection last ran for this stock count, whatever it selected. Always present. `null` means selection has not run yet, so an empty items array means \"not ready\" and the client should keep waiting. A value with an empty items array means selection ran and no item qualified. An ABSENT key means the backend predates this field — treat that as ready, not as waiting. Format: YYYY-MM-DDTHH:mm:ssZ."},"numberOfItemCategoriesCounted":{"type":"number","minimum":0,"description":"The number of level-2 item categories where every item has been counted."},"numberOfItemCategoriesNotCounted":{"type":"number","minimum":0,"description":"The number of level-2 item categories that are not yet fully counted (partially counted or not counted)."},"itemCategories":{"type":"array","items":{"$ref":"#/components/schemas/ItemCategoriesDto"}},"lastCountedDateTime":{"type":"string","format":"date-time","description":"Timestamp of the most recent count activity for the stock count. Format: YYYY-MM-DDTHH:mm:ssZ."},"completedDateTime":{"type":"string","format":"date-time","description":"Timestamp when the stock count was completed. Format: YYYY-MM-DDTHH:mm:ssZ."},"completedBy":{"type":"string","description":"User identifier or name of the person who completed the stock count."},"deletedDateTime":{"type":"string","format":"date-time","description":"Timestamp when the stock count was deleted. Format: YYYY-MM-DDTHH:mm:ssZ."},"deletedBy":{"type":"string","description":"User identifier or name of the person who deleted the stock count."},"itemDeviations":{"description":"List of item deviations captured during the stock count.","type":"array","items":{"$ref":"#/components/schemas/ItemDeviationDto"}}},"required":["id","name","type","startDate","status","numberOfItemsNotCounted","numberOfItemsCounted","itemsGeneratedDateTime","numberOfItemCategoriesCounted","numberOfItemCategoriesNotCounted","itemCategories"]},"ListStockCountDto":{"type":"object","properties":{"stockCounts":{"type":"array","items":{"$ref":"#/components/schemas/StockCountDto"}}},"required":["stockCounts"]},"GetStockCountAndListItemsDto":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the stock count record."},"name":{"type":"string","description":"Name or title of the stock count."},"type":{"description":"Type of stock count, e.g., FULL, CYCLE, etc.","allOf":[{"$ref":"#/components/schemas/StockCountType"}]},"startDate":{"type":"string","format":"date","description":"Start date for the stock count. Format: YYYY-MM-DD."},"dueDate":{"type":"string","format":"date","description":"Due date for completing the stock count. Format: YYYY-MM-DD."},"status":{"description":"Current status of the stock count, e.g., CREATED, INPROGRESS, etc.","allOf":[{"$ref":"#/components/schemas/StockCountStatus"}]},"filters":{"description":"List of filters applied to stock count items, applicable for cycle stock counts.","type":"array","items":{"$ref":"#/components/schemas/FilterType"}},"stockFilters":{"description":"Stock-state filters applied to stock count items, composed with `filters` as an intersection. Applicable for CYCLE and TEST stock counts.","type":"array","items":{"$ref":"#/components/schemas/StockFilterDto"}},"comment":{"type":"string","description":"Additional remarks or notes related to the stock count."},"itemsGeneratedDateTime":{"type":"string","format":"date-time","nullable":true,"description":"When item selection last ran for this stock count, whatever it selected. Always present. `null` means selection has not run yet, so an empty items array means \"not ready\" and the client should keep waiting. A value with an empty items array means selection ran and no item qualified. An ABSENT key means the backend predates this field — treat that as ready, not as waiting. Format: YYYY-MM-DDTHH:mm:ssZ."},"numberOfItemCategoriesCounted":{"type":"number","minimum":0,"description":"The number of level-2 item categories where every item has been counted."},"numberOfItemCategoriesNotCounted":{"type":"number","minimum":0,"description":"The number of level-2 item categories that are not yet fully counted (partially counted or not counted)."},"itemCategories":{"type":"array","items":{"$ref":"#/components/schemas/ItemCategoriesDto"}},"lastCountedDateTime":{"type":"string","format":"date-time","description":"Timestamp of the most recent count activity for the stock count. Format: YYYY-MM-DDTHH:mm:ssZ."},"completedDateTime":{"type":"string","format":"date-time","description":"Timestamp when the stock count was completed. Format: YYYY-MM-DDTHH:mm:ssZ."},"completedBy":{"type":"string","description":"User identifier or name of the person who completed the stock count."},"deletedDateTime":{"type":"string","format":"date-time","description":"Timestamp when the stock count was deleted. Format: YYYY-MM-DDTHH:mm:ssZ."},"deletedBy":{"type":"string","description":"User identifier or name of the person who deleted the stock count."},"itemDeviations":{"description":"List of item deviations captured during the stock count.","type":"array","items":{"$ref":"#/components/schemas/ItemDeviationDto"}}},"required":["id","name","type","startDate","status","itemsGeneratedDateTime","numberOfItemCategoriesCounted","numberOfItemCategoriesNotCounted","itemCategories"]},"UpdateStockCountDto":{"type":"object","properties":{"name":{"type":"string","description":"Name or title of the stock count."},"startDate":{"type":"string","format":"date","description":"Start date for the stock count. Format: YYYY-MM-DD."},"dueDate":{"type":"string","format":"date","description":"Due date for completing the stock count. Format: YYYY-MM-DD."},"filters":{"description":"List of filters applied to stock count items, applicable for cycle stock counts.","type":"array","items":{"$ref":"#/components/schemas/FilterType"}},"stockFilters":{"description":"Stock-state filters applied to stock count items, composed with `filters` as an intersection. Applicable for CYCLE and TEST stock counts.","type":"array","items":{"$ref":"#/components/schemas/StockFilterDto"}},"comment":{"type":"string","description":"Additional remarks or notes related to the stock count."}}},"LocationsDto":{"type":"object","properties":{"location":{"type":"string","description":"Identifier or name of the location where the stock count is performed."},"numberOfItemsCounted":{"type":"number","minimum":0,"description":"The number of items that have been counted for this location."}},"required":["location","numberOfItemsCounted"]},"ListStockCountLocationsDto":{"type":"object","properties":{"locations":{"description":"Detailed list of stock count locations for the stock count","type":"array","items":{"$ref":"#/components/schemas/LocationsDto"}}},"required":["locations"]},"GetStockCountLineDto":{"type":"object","properties":{"lineId":{"type":"string","description":"Unique identifier for the stock count line"},"itemIdentifier":{"type":"string","description":"Global Trade Item Number (GTIN) associated with the item.  Either this field or the itemId must be specified."},"itemId":{"type":"string","description":"Preferred way for identifying the item.  Either this field or the itemIdentifier must be specified."},"countedQuantity":{"type":"number","minimum":0,"description":"Quantity of the item counted during the stock count."},"countedDateTime":{"type":"string","description":"Timestamp indicating when the item was counted. Format: YYYY-MM-DDTHH:mm:ssZ."},"countedBy":{"type":"string","description":"Identifier of the person or system that counted the item."},"batchNumber":{"type":"string","description":"Batch number of the item."},"businessPartnerId":{"type":"string","description":"Identifier of the business partner associated with this stock count line."},"serialNumber":{"type":"string","description":"Serial number of the item, if applicable, for unique identification within the batch."}},"required":["countedQuantity","countedDateTime","countedBy"]},"StockCountLocationsDto":{"type":"object","properties":{"location":{"type":"string","description":"Identifier or name of the location where the stock count is performed."},"countedQuantity":{"type":"number","minimum":0,"description":"Total quantity of items counted at this specific location."},"lines":{"description":"Detailed list of stock count lines for this location, containing line-specific counts and attributes.","type":"array","items":{"$ref":"#/components/schemas/GetStockCountLineDto"}}},"required":["location","countedQuantity","lines"]},"StockCountItemDto":{"type":"object","properties":{"itemId":{"type":"string","description":"Preferred way for identifying the item. Either this field or the itemIdentifier must be specified."},"itemName":{"type":"string","description":"Name or description of the item."},"itemIdentifier":{"type":"string","description":"Global Trade Item Number (GTIN) associated with the item.  Either this field or the itemId must be specified."},"countedQuantity":{"type":"number","minimum":0,"description":"Quantity of the item counted during the stock count."},"expectedQuantity":{"type":"number","minimum":0,"description":"Expected quantity of the item based on inventory records prior to the stock count."},"unitCostPrice":{"type":"number","minimum":0,"description":"Unit cost price of the item."},"locations":{"description":"List of locations where this item is stored or counted, detailing specific quantities by location.","type":"array","items":{"$ref":"#/components/schemas/StockCountLocationsDto"}}},"required":["countedQuantity","locations"]},"PageDto":{"type":"object","properties":{"total":{"type":"number","description":"Total amount of items in collection","example":100},"skip":{"type":"number","description":"Current pagination offset","example":10},"take":{"type":"number","description":"Max amount of items to take per request","example":50},"hasMore":{"type":"boolean","description":"If true, next call will return non empty array","example":true}},"required":["total","skip","take","hasMore"]},"StockCountItemDetailsDto":{"type":"object","properties":{"item":{"$ref":"#/components/schemas/StockCountItemDto"},"page":{"$ref":"#/components/schemas/PageDto"}},"required":["item","page"]},"StockCountItemNotCounted":{"type":"object","properties":{"itemId":{"type":"string","description":"Preferred way for identifying the item. This field is required."},"itemName":{"type":"string","description":"Name or description of the item. This field is required."},"itemIdentifier":{"type":"string","description":"Global Trade Item Number (GTIN) associated with the item.  Either this field or the itemId must be specified."},"isMandatory":{"type":"boolean","description":"Indicates if this item is mandatory."}},"required":["itemId","itemName","isMandatory"]},"ListStockCountItemsNotCounted":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/StockCountItemNotCounted"}},"page":{"$ref":"#/components/schemas/PageDto"}},"required":["items","page"]},"ItemsByCategoryCountedDto":{"type":"object","properties":{"itemId":{"type":"string","description":"Id of the item."},"itemName":{"type":"string","description":"Name of the item ."},"itemIdentifier":{"type":"string","description":"Identifier of the item."},"actualQuantity":{"type":"number","description":"Quantity of the item counted during the stock count"},"expectedQuantity":{"type":"number","description":"Expected quantity of the item counted during the stock count"},"deviationQuantity":{"type":"number","description":"Total deviation quantity of all items counted during the stock count."},"actualCostAmount":{"type":"number","description":"Total cost price of the items."},"expectedCostAmount":{"type":"number","description":"Expected total cost price of the items."},"deviationCostAmount":{"type":"number","description":"Total deviation cost of the item counted during the stock count."},"isCounted":{"type":"boolean","description":"Indicates if the item has been counted."}},"required":["itemId","itemName","itemIdentifier","actualQuantity","expectedQuantity","deviationQuantity","actualCostAmount","expectedCostAmount","deviationCostAmount","isCounted"]},"ListStockCountItemsByCategoryCountedDto":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ItemsByCategoryCountedDto"}},"page":{"$ref":"#/components/schemas/PageDto"}},"required":["items","page"]},"CategoryDto":{"type":"object","properties":{"id":{"type":"string","description":"Id of the category."},"name":{"type":"string","description":"Name of the category ."},"numberOfItems":{"type":"number","description":"Total number of items belonging to category ."},"numberOfItemsCounted":{"type":"number","description":"Number of items belonging to category that are counted."},"isCompleted":{"type":"boolean","description":"Indicates whether this category has been completed for the stock count."}},"required":["id","name","numberOfItems","numberOfItemsCounted","isCompleted"]},"ListCategoriesByStockCountDto":{"type":"object","properties":{"categories":{"type":"array","items":{"$ref":"#/components/schemas/CategoryDto"}}},"required":["categories"]},"CreateStockCountLineDto":{"type":"object","properties":{"lineId":{"type":"string","description":"Unique identifier for the stock count line"},"itemIdentifier":{"type":"string","description":"Global Trade Item Number (GTIN) associated with the item.  Either this field or the itemId must be specified."},"itemId":{"type":"string","description":"Preferred way for identifying the item.  Either this field or the itemIdentifier must be specified."},"countedQuantity":{"type":"number","minimum":0,"description":"Quantity of the item counted during the stock count."},"location":{"type":"string","description":"Location or area where the item was counted."},"batchNumber":{"type":"string","description":"Batch number of the item."},"businessPartnerId":{"type":"string","description":"Identifier of the business partner associated with this stock count line."},"serialNumber":{"type":"string","description":"Serial number of the item, if applicable, for unique identification within the batch."}},"required":["countedQuantity","location"]},"ImportStockCountItemsDto":{"type":"object","properties":{"itemId":{"type":"string","description":"Name or title of the stock count."}},"required":["itemId"]},"ImportStockCountType":{"type":"string","enum":["CYCLE","TEST"]},"ImportStockCountDto":{"type":"object","properties":{"name":{"type":"string","description":"Name or title of the stock count."},"startDate":{"type":"string","format":"date","description":"Start date for the stock count. Format: YYYY-MM-DD."},"dueDate":{"type":"string","format":"date","description":"Due date for completing the stock count. Format: YYYY-MM-DD."},"comment":{"type":"string","description":"Additional remarks or notes related to the stock count."},"items":{"type":"array","items":{"$ref":"#/components/schemas/ImportStockCountItemsDto"}},"type":{"default":"CYCLE","allOf":[{"$ref":"#/components/schemas/ImportStockCountType"}]}},"required":["name","startDate","items"]},"CategoryTotalCountsDto":{"type":"object","properties":{"itemCategoryId":{"type":"string","description":"Category ID of item category counted during the stock count."},"itemCategoryName":{"type":"string","description":"Category name of item category counted during the stock count."},"numberOfItems":{"type":"number","nullable":true,"description":"Total actual cost amount of item category counted during the stock count."},"totalAmount":{"type":"number","nullable":true,"description":"Total actual cost amount of item category counted during the stock count."},"totalExpectedAmount":{"type":"number","nullable":true,"description":"Total expected cost of item category counted during the stock count."},"totalDeviationAmount":{"type":"number","nullable":true,"description":"Total deviation cost of item category counted during the stock count."},"totalQuantity":{"type":"number","description":"Total counted quantity of item category counted during the stock count."},"totalExpectedQuantity":{"type":"number","nullable":true,"description":"Total expected quantity of item category counted during the stock count."},"totalDeviationQuantity":{"type":"number","nullable":true,"description":"Total deviation quantity of item category counted during the stock count."},"totalDeviationQuantityInPercentage":{"type":"number","nullable":true,"description":"Total deviation quantity in percentage of item category counted during the stock count."}},"required":["totalQuantity"]},"StockCountTotalCategoryCountsDto":{"type":"object","properties":{"totalQuantity":{"type":"number","nullable":true,"description":"Total counted quantity of all items counted during the stock count."},"totalExpectedQuantity":{"type":"number","nullable":true,"description":"Total expected quantity of all items counted during the stock count."},"totalDeviationQuantity":{"type":"number","nullable":true,"description":"Total deviation quantity of all items counted during the stock count."},"totalDeviationQuantityInPercentage":{"type":"number","nullable":true,"description":"Total deviation quantity in percentage of all items counted during the stock count."},"totalAmount":{"type":"number","nullable":true,"description":"Total actual cost amount of all items counted during the stock count."},"totalExpectedAmount":{"type":"number","nullable":true,"description":"Total expected cost of all items counted during the stock count."},"totalDeviationAmount":{"type":"number","nullable":true,"description":"Total deviation cost of all items counted during the stock count."},"itemCategories":{"description":"List of item categories with deviations from the expected quantity and cost.","type":"array","items":{"$ref":"#/components/schemas/CategoryTotalCountsDto"}}},"required":["totalQuantity","itemCategories"]},"ItemCountsDto":{"type":"object","properties":{"itemId":{"type":"string","description":"Item ID of item counted during the stock count."},"itemName":{"type":"string","description":"Item name of item counted during the stock count."},"itemCategoryId":{"type":"string","description":"Category ID of item category counted during the stock count."},"itemCategoryName":{"type":"string","description":"Category name of item category counted during the stock count."},"totalAmount":{"type":"number","nullable":true,"description":"Total actual cost amount of item category counted during the stock count."},"totalExpectedAmount":{"type":"number","nullable":true,"description":"Total expected cost of item category counted during the stock count."},"totalDeviationAmount":{"type":"number","nullable":true,"description":"Total deviation cost of item category counted during the stock count."},"totalQuantity":{"type":"number","description":"Total counted quantity of item category counted during the stock count."},"totalExpectedQuantity":{"type":"number","nullable":true,"description":"Total expected quantity of item category counted during the stock count."},"totalDeviationQuantity":{"type":"number","nullable":true,"description":"Total deviation quantity of item category counted during the stock count."},"totalDeviationQuantityInPercentage":{"type":"number","nullable":true,"description":"Total deviation quantity in percentage of item category counted during the stock count."}},"required":["totalQuantity"]},"StockCountItemCountsDto":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ItemCountsDto"}},"page":{"$ref":"#/components/schemas/PageDto"}},"required":["items","page"]},"ItemCategoriesInitialStateDto":{"type":"object","properties":{"tenantIds":{"description":"List of tenant IDs to filter the item categories. If not provided, all item categories are returned.","type":"array","items":{"type":"string"}}}},"BusinessUnitsInitialStateDto":{"type":"object","properties":{"tenants":{"description":"A non-empty array of tenant ids, or the literal \"all\" to seed every tenant.","example":["tenant-1","tenant-2"],"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"string","enum":["all"]}]}},"required":["tenants"]},"ScopeLevel":{"type":"string","enum":["TENANT","GROUP","BU"],"description":"What the definition targets. TENANT covers every business unit in the tenant; GROUP and BU name one via `scopeId`."},"RecurringStockCountType":{"type":"string","enum":["FULL","CYCLE","CONTROL"],"description":"Type of the counts this definition generates. Defaults to CYCLE when omitted on create."},"FrequencyType":{"type":"string","enum":["INTERVAL","CUSTOM_DATES"],"description":"How occurrences repeat. INTERVAL derives them from the anchor; CUSTOM_DATES lists them explicitly. DOES_NOT_REPEAT is not a recurring frequency."},"IntervalUnit":{"type":"string","enum":["DAY","WEEK","MONTH","YEAR"],"description":"Unit the interval is counted in. Required for INTERVAL, omitted otherwise."},"CreateRecurringStockCountDto":{"type":"object","properties":{"name":{"type":"string","description":"Human-readable name for the definition. Generated counts derive their name from it when present."},"scopeLevel":{"description":"What the definition targets. TENANT covers every business unit in the tenant; GROUP and BU name one via `scopeId`.","allOf":[{"$ref":"#/components/schemas/ScopeLevel"}]},"scopeId":{"type":"string","description":"Identifier of the targeted group or business unit. Omitted for TENANT scope."},"stockCountType":{"description":"Type of the counts this definition generates. Defaults to CYCLE when omitted on create.","allOf":[{"$ref":"#/components/schemas/RecurringStockCountType"}]},"anchorDate":{"type":"string","format":"date","description":"Date the first occurrence opens on; every later INTERVAL occurrence is derived from it. Required for INTERVAL. For CUSTOM_DATES it is derived from the earliest supplied date. Format: YYYY-MM-DD."},"countWindowDays":{"type":"integer","minimum":1,"description":"How many days each occurrence stays open. The window travels with the occurrence: an occurrence opening on its date is due this many days later."},"frequencyType":{"description":"How occurrences repeat. INTERVAL derives them from the anchor; CUSTOM_DATES lists them explicitly. DOES_NOT_REPEAT is not a recurring frequency.","allOf":[{"$ref":"#/components/schemas/FrequencyType"}]},"intervalCount":{"type":"integer","minimum":1,"description":"How many `intervalUnit`s between occurrences. Required for INTERVAL, omitted otherwise."},"intervalUnit":{"description":"Unit the interval is counted in. Required for INTERVAL, omitted otherwise.","allOf":[{"$ref":"#/components/schemas/IntervalUnit"}]},"customDates":{"description":"Explicit occurrence dates. Required for CUSTOM_DATES, omitted otherwise. Format: YYYY-MM-DD.","type":"array","items":{"type":"string","format":"date"}},"recurrenceEndDate":{"type":"string","format":"date","description":"Date after which no further occurrence is generated. Omitted means the definition recurs indefinitely. Format: YYYY-MM-DD."},"filters":{"description":"Saved-product filters applied to every generated count, validated by the same rules as a manual count of the same type.","type":"array","items":{"$ref":"#/components/schemas/FilterType"}},"stockFilters":{"description":"Stock-state filters applied to every generated count, composed with `filters` as an intersection.","type":"array","items":{"$ref":"#/components/schemas/StockFilterDto"}},"recurringStockCountId":{"type":"string","description":"Optional client-supplied identifier for the definition. If omitted, the service generates one."}},"required":["scopeLevel","countWindowDays","frequencyType"]},"OccurrenceDto":{"type":"object","properties":{"startDate":{"type":"string","format":"date","description":"Date the occurrence opens on. Format: YYYY-MM-DD."},"dueDate":{"type":"string","format":"date","description":"Date the occurrence is due, being its start date plus the definition’s count window. Format: YYYY-MM-DD."}},"required":["startDate","dueDate"]},"RecurringStockCountOccurrencesDto":{"type":"object","properties":{"recurringStockCountId":{"type":"string","description":"Identifier of the definition these occurrences were projected from."},"occurrences":{"description":"Occurrence dates within the requested range, in ascending order.","type":"array","items":{"$ref":"#/components/schemas/OccurrenceDto"}}},"required":["recurringStockCountId","occurrences"]},"ListRecurringStockCountOccurrencesDto":{"type":"object","properties":{"recurringStockCounts":{"type":"array","items":{"$ref":"#/components/schemas/RecurringStockCountOccurrencesDto"}}},"required":["recurringStockCounts"]},"RecurringStockCountStatus":{"type":"string","enum":["ACTIVE","DELETED"],"description":"Lifecycle status. A deleted definition stops recurring."},"RecurringStockCountDto":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the recurring stock count definition."},"name":{"type":"string","description":"Human-readable name for the definition. Generated counts derive their name from it when present."},"scopeLevel":{"description":"What the definition targets. TENANT covers every business unit in the tenant; GROUP and BU name one via `scopeId`.","allOf":[{"$ref":"#/components/schemas/ScopeLevel"}]},"scopeId":{"type":"string","description":"Identifier of the targeted group or business unit. Omitted for TENANT scope."},"stockCountType":{"description":"Type of the counts this definition generates. Defaults to CYCLE when omitted on create.","allOf":[{"$ref":"#/components/schemas/RecurringStockCountType"}]},"anchorDate":{"type":"string","format":"date","description":"Date the first occurrence opens on; every later INTERVAL occurrence is derived from it. Required for INTERVAL. For CUSTOM_DATES it is derived from the earliest supplied date. Format: YYYY-MM-DD."},"countWindowDays":{"type":"integer","minimum":1,"description":"How many days each occurrence stays open. The window travels with the occurrence: an occurrence opening on its date is due this many days later."},"frequencyType":{"description":"How occurrences repeat. INTERVAL derives them from the anchor; CUSTOM_DATES lists them explicitly. DOES_NOT_REPEAT is not a recurring frequency.","allOf":[{"$ref":"#/components/schemas/FrequencyType"}]},"intervalCount":{"type":"integer","minimum":1,"description":"How many `intervalUnit`s between occurrences. Required for INTERVAL, omitted otherwise."},"intervalUnit":{"description":"Unit the interval is counted in. Required for INTERVAL, omitted otherwise.","allOf":[{"$ref":"#/components/schemas/IntervalUnit"}]},"customDates":{"description":"Explicit occurrence dates. Required for CUSTOM_DATES, omitted otherwise. Format: YYYY-MM-DD.","type":"array","items":{"type":"string","format":"date"}},"recurrenceEndDate":{"type":"string","format":"date","description":"Date after which no further occurrence is generated. Omitted means the definition recurs indefinitely. Format: YYYY-MM-DD."},"status":{"description":"Lifecycle status. A deleted definition stops recurring.","allOf":[{"$ref":"#/components/schemas/RecurringStockCountStatus"}]},"filters":{"description":"Saved-product filters applied to every generated count, validated by the same rules as a manual count of the same type.","type":"array","items":{"$ref":"#/components/schemas/FilterType"}},"stockFilters":{"description":"Stock-state filters applied to every generated count, composed with `filters` as an intersection.","type":"array","items":{"$ref":"#/components/schemas/StockFilterDto"}},"createdDateTime":{"type":"string","format":"date-time","description":"Timestamp the definition was created. Format: YYYY-MM-DDTHH:mm:ssZ."},"modifiedDateTime":{"type":"string","format":"date-time","description":"Timestamp the definition was last modified. Format: YYYY-MM-DDTHH:mm:ssZ."}},"required":["id","scopeLevel","countWindowDays","frequencyType","status"]},"ListRecurringStockCountDto":{"type":"object","properties":{"recurringStockCounts":{"type":"array","items":{"$ref":"#/components/schemas/RecurringStockCountDto"}}},"required":["recurringStockCounts"]}}}}