{"openapi":"3.1.0","info":{"title":"POST /api/v1/inventory/counts","version":"1.0.0","description":"Start a cycle count"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/inventory/counts":{"post":{"tags":["inventory:counts"],"summary":"Start a cycle count","description":"Create a draft cycle / physical count at a location.","operationId":"start_count_api_v1_inventory_counts_post","parameters":[{"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":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartCountRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_StartCountResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"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"}}}},"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"},"StartCountRequest":{"properties":{"location_id":{"type":"string","title":"Location Id","description":"Location to count."},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Notes"}},"type":"object","required":["location_id"],"title":"StartCountRequest"},"StartCountResponse":{"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":"StartCountResponse","description":"Response for ``start_count``."},"SuccessEnvelope_StartCountResponse_":{"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/StartCountResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[StartCountResponse]"}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}