Skip to content

POST /inventory/count-session

Create Counting Session

POST
/inventory/count-session

Create a new inventory counting session with assignments.

Inserts an InventoryCountSession document and all its
InventoryCountAssignment records in a single transaction. Auto-generates a
session code from the system counter if code is omitted. Each assignment
must reference at least one target (position or product key depending on the
session type).

Emits: (direct transaction — no event class)
Required scope: inventory:count:create

Authorizations

OAuth2PasswordBearer
password Flow
Token URL"/api/auth"
Scopes:
  • "admin"User can access and edit users and system settings
  • "library"User can access and edit products
  • "production"User can access and edit production plans
  • "operator"User can access the operator panel and make production declarations

Request Body

application/json
JSON
{
  
"count_session": {
  
  
"_id": "string",
  
  
"_key": "string",
  
  
"_rev": "string",
  
  
"code": "CNT-2026-001",
  
  
"description": "Annual full-warehouse count Q2 2026",
  
  
"type": "position",
  
  
"status": "planned",
  
  
"blind_quantities": true,
  
  
"blind_serials": true,
  
  
"coverage_percentage": 100,
  
  
"scheduled_start": "2026-05-20T08:00:00Z",
  
  
"scheduled_end": "2026-05-20T18:00:00Z",
  
  
"created": "2026-05-15T10:00:00Z",
  
  
"created_by": "user/operator-01",
  
  
"started": "2026-05-20T08:05:00Z",
  
  
"completed": "2026-05-20T17:45:00Z",
  
  
"baseline_snapshot_key": "snap-001",
  
  
"post_count_snapshot_key": "snap-002",
  
  
"post_adjustment_snapshot_key": "snap-003",
  
  
"adjustment_list_key": "mvtlist-001",
  
  
"notes": "Verify all rows in zone A before zone B",
  
  
"extra": "string"
  
},
  
"assignments": [
  
  
{
  
  
  
"user_key": "user/operator-01",
  
  
  
"target_keys": [
  
  
  
  
[
  
  
  
  
  
"12345",
  
  
  
  
  
"67890"
  
  
  
  
]
  
  
  
]
  
  
}
  
]
}

Responses

Successful Response

application/json
JSON
{
  
"status": 200,
  
"message": "string",
  
"detail": "string"
}

Samples

Powered by VitePress OpenAPI

Released under the Apache 2.0 License.