{"openapi":"3.1.0","info":{"title":"POST /api/v1/inventory/counts/{count_id}/lines","version":"1.0.0","description":"Add or scan a line"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/inventory/counts/{count_id}/lines":{"post":{"tags":["inventory:counts"],"summary":"Add or scan a line","description":"Add a line by `variant_id`, `barcode`, or `sku`. Re-scans of the same variant update the existing line.","operationId":"add_count_line_api_v1_inventory_counts__count_id__lines_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":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddCountLineRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_AddCountLineResponse_"}}}},"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"}}}},"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":{"AddCountLineRequest":{"properties":{"variant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Id","description":"Variant UUID."},"barcode":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Barcode"},"sku":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Sku"},"counted_quantity":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Counted Quantity","description":"Optional initial count. If omitted, the line is added with expected_quantity only and the user records the count later."},"reason":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Reason"},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Notes"}},"type":"object","title":"AddCountLineRequest","description":"Add a line by variant id, barcode, or SKU."},"AddCountLineResponse":{"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":"AddCountLineResponse","description":"Response for ``add_count_line``."},"SuccessEnvelope_AddCountLineResponse_":{"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/AddCountLineResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[AddCountLineResponse]"}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}