{"openapi":"3.1.0","info":{"title":"POST /api/v1/inventory/counts/{count_id}/post","version":"1.0.0","description":"Post a cycle count"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/inventory/counts/{count_id}/post":{"post":{"tags":["inventory:counts"],"summary":"Post a cycle count","description":"Finalize the count, emitting one manual inventory adjustment per non-zero variance line.","operationId":"post_count_api_v1_inventory_counts__count_id__post_post","parameters":[{"name":"count_id","in":"path","required":true,"schema":{"type":"string","title":"Count Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/PostCountRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_PostCountResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"422":{"description":"Validation Error - Invalid data format","content":{"application/json":{"example":{"detail":[{"loc":["body","field"],"msg":"field required","type":"value_error.missing"}]}}}}}}}},"components":{"schemas":{"CycleCountLineResponse":{"properties":{"id":{"type":"string","title":"Id"},"count_id":{"type":"string","title":"Count Id"},"variant_id":{"type":"string","title":"Variant Id"},"variant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Name"},"sku":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sku"},"barcode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Barcode"},"expected_quantity":{"type":"number","title":"Expected Quantity","default":0},"counted_quantity":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Counted Quantity"},"variance":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Variance"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"adjustment_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Adjustment Id"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"additionalProperties":true,"type":"object","required":["id","count_id","variant_id"],"title":"CycleCountLineResponse"},"PostCountRequest":{"properties":{"posted_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Posted By User Id","description":"Optional user id stamped onto the count. The audit middleware already records the request user separately."}},"type":"object","title":"PostCountRequest"},"PostCountResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_id":{"type":"string","title":"Business Id"},"count_number":{"type":"string","title":"Count Number"},"location_id":{"type":"string","title":"Location Id"},"status":{"type":"string","title":"Status"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"posted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Posted At"},"counted_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Counted By User Id"},"posted_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Posted By User Id"},"variance_line_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Variance Line Count"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"lines":{"items":{"$ref":"#/components/schemas/CycleCountLineResponse"},"type":"array","title":"Lines","default":[]}},"additionalProperties":true,"type":"object","required":["id","business_id","count_number","location_id","status"],"title":"PostCountResponse","description":"Response for ``post_count``."},"SuccessEnvelope_PostCountResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/PostCountResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[PostCountResponse]"}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}