{"openapi":"3.1.0","info":{"title":"POST /api/v1/inventory/products/unit-costs/apply","version":"1.0.0","description":"Apply unit cost bulk update"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/inventory/products/unit-costs/apply":{"post":{"tags":["inventory:products"],"summary":"Apply unit cost bulk update","description":"Apply confirmed unit-cost updates from a validated CSV upload.","operationId":"apply_unit_cost_bulk_update_api_v1_inventory_products_unit_costs_apply_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/UnitCostBulkApplyRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnitCostBulkApplyResponse"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"422":{"description":"Validation Error - Invalid data format","content":{"application/json":{"example":{"detail":[{"loc":["body","field"],"msg":"field required","type":"value_error.missing"}]}}}}}}}},"components":{"schemas":{"UnitCostBulkApplyRequest":{"properties":{"updates":{"items":{"$ref":"#/components/schemas/UnitCostBulkUpdateRowInput"},"type":"array","maxItems":5000,"minItems":1,"title":"Updates","description":"Rows with new_unit_cost_cents set and validated via preview."}},"type":"object","required":["updates"],"title":"UnitCostBulkApplyRequest","description":"Confirmed unit-cost updates to apply."},"UnitCostBulkApplyResponse":{"properties":{"updated_count":{"type":"integer","title":"Updated Count"},"skipped_count":{"type":"integer","title":"Skipped Count"},"error_count":{"type":"integer","title":"Error Count"},"errors":{"items":{"type":"string"},"type":"array","title":"Errors"}},"type":"object","required":["updated_count","skipped_count","error_count"],"title":"UnitCostBulkApplyResponse","description":"Result of applying unit-cost bulk updates."},"UnitCostBulkUpdateRowInput":{"properties":{"row_number":{"type":"integer","minimum":1.0,"title":"Row Number","description":"1-based row number from the spreadsheet."},"sku":{"type":"string","maxLength":100,"minLength":1,"title":"Sku","description":"Variant SKU."},"variant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Id","description":"Optional variant UUID; when set, used instead of SKU matching."},"new_unit_cost_cents":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"New Unit Cost Cents","description":"New unit cost in cents. Omit or null to skip the row."}},"type":"object","required":["row_number","sku"],"title":"UnitCostBulkUpdateRowInput","description":"One CSV row for unit-cost bulk preview/apply."}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}