{"openapi":"3.1.0","info":{"title":"POST /api/v1/inventory/adjustments","version":"1.0.0","description":"Create manual inventory adjustment"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/inventory/adjustments":{"post":{"tags":["inventory:adjustments"],"summary":"Create manual inventory adjustment","description":"Create a manual inventory adjustment for a variant at a specific location. If no location is specified, the adjustment is applied to the default location.","operationId":"create_inventory_adjustment_api_v1_inventory_adjustments_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/InventoryAdjustmentRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryAdjustmentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InventoryAdjustmentRequest":{"properties":{"variant_id":{"type":"string","title":"Variant Id","description":"Product variant UUID to adjust."},"quantity_change":{"type":"integer","title":"Quantity Change","description":"Quantity change: positive to add, negative to subtract. Cannot be zero."},"reason":{"type":"string","minLength":1,"title":"Reason","description":"Required reason for the adjustment."},"location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location Id","description":"Location UUID where adjustment applies. Uses default location if not specified."}},"type":"object","required":["variant_id","quantity_change","reason"],"title":"InventoryAdjustmentRequest","description":"Request schema for manual inventory adjustments.\n\nUse this to correct inventory counts outside of normal\norder/shipment flows (e.g., damaged goods, shrinkage, audit corrections).","example":{"location_id":"019ab37c-loc1-7000-8000-000000000001","quantity_change":-5,"reason":"Damaged in warehouse - water damage","variant_id":"019ab37c-var1-7000-8000-000000000001"}},"InventoryAdjustmentResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Adjustment UUID."},"business_id":{"type":"string","title":"Business Id","description":"Business UUID."},"variant_id":{"type":"string","title":"Variant Id","description":"Adjusted variant UUID."},"delta":{"type":"integer","title":"Delta","description":"Quantity change applied."},"correction_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Correction Reason","description":"Adjustment reason."},"location_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location Id","description":"Location where adjustment was applied."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When adjustment was made."}},"type":"object","required":["id","business_id","variant_id","delta","created_at"],"title":"InventoryAdjustmentResponse","description":"Response schema for an inventory adjustment.","example":{"business_id":"019ab37c-bus1-7000-8000-000000000001","correction_reason":"Damaged in warehouse - water damage","created_at":"2024-01-15T14:00:00Z","delta":-5,"id":"019ab37c-adj1-7000-8000-000000000001","location_id":"019ab37c-loc1-7000-8000-000000000001","variant_id":"019ab37c-var1-7000-8000-000000000001"}},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}