{"openapi":"3.1.0","info":{"title":"POST /api/v1/fixed-assets","version":"1.0.0","description":"Create fixed asset"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/fixed-assets":{"post":{"tags":["fixed-assets"],"summary":"Create fixed asset","description":"Create a new fixed asset.\n\n**Request Body:**\n- `name`: Asset name, 1-255 chars (required)\n- `purchase_date`: Purchase date in YYYY-MM-DD format (required)\n- `original_cost`: Original cost in cents, must be >= 0 (required)\n- `description`: Asset description (optional)\n- `asset_number`: Asset number, max 50 chars (optional)\n- `serial_number`: Serial number, max 100 chars (optional)\n- `salvage_value`: Salvage value in cents, must be >= 0 and < original_cost (optional, defaults to 0)\n- `useful_life_months`: Useful life in months, 1-600 (optional, defaults to 60)\n- `depreciation_method`: Depreciation method - straight_line, declining_balance, double_declining, units_of_production (optional, defaults to 'straight_line')\n- `location`: Asset location, max 255 chars (optional)\n- `notes`: Additional notes (optional)\n- `category_id`: Asset category UUID (optional)\n- `vendor_id`: Vendor UUID (optional)\n- `in_service_date`: Date asset was placed in service, YYYY-MM-DD format (optional)\n- `total_expected_units`: Total expected units for units_of_production method, must be >= 1 (optional)","operationId":"create_fixed_asset_api_v1_fixed_assets_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/FixedAssetCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FixedAssetResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AssetStatus":{"type":"string","enum":["draft","active","fully_depreciated","disposed"],"title":"AssetStatus","description":"Fixed asset lifecycle status."},"DepreciationMethod":{"type":"string","enum":["straight_line","declining_balance","double_declining","units_of_production"],"title":"DepreciationMethod","description":"Depreciation calculation methods."},"DisposalMethod":{"type":"string","enum":["sold","traded","scrapped","lost","donated"],"title":"DisposalMethod","description":"How an asset was disposed."},"FixedAssetCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Asset name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Asset description"},"asset_number":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Asset Number","description":"User-defined asset tracking number"},"serial_number":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Serial Number","description":"Manufacturer serial number"},"purchase_date":{"type":"string","format":"date","title":"Purchase Date","description":"Date the asset was purchased"},"original_cost":{"type":"integer","minimum":0.0,"title":"Original Cost","description":"Purchase cost in cents"},"salvage_value":{"type":"integer","minimum":0.0,"title":"Salvage Value","description":"Estimated salvage value in cents","default":0},"useful_life_months":{"type":"integer","maximum":600.0,"minimum":1.0,"title":"Useful Life Months","description":"Expected useful life in months","default":60},"depreciation_method":{"$ref":"#/components/schemas/DepreciationMethod","description":"Depreciation calculation method","default":"straight_line"},"location":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Location","description":"Physical location of the asset"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Additional notes"},"category_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Id","description":"Asset category ID"},"vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id","description":"Vendor the asset was purchased from"},"in_service_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"In Service Date","description":"Date the asset was placed in service (starts depreciation)"},"total_expected_units":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Total Expected Units","description":"Total expected units for units-of-production depreciation"}},"type":"object","required":["name","purchase_date","original_cost"],"title":"FixedAssetCreate","description":"Schema for creating a fixed asset."},"FixedAssetResponse":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Asset name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Asset description"},"asset_number":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Asset Number","description":"User-defined asset tracking number"},"serial_number":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Serial Number","description":"Manufacturer serial number"},"purchase_date":{"type":"string","format":"date","title":"Purchase Date","description":"Date the asset was purchased"},"original_cost":{"type":"integer","minimum":0.0,"title":"Original Cost","description":"Purchase cost in cents"},"salvage_value":{"type":"integer","minimum":0.0,"title":"Salvage Value","description":"Estimated salvage value in cents","default":0},"useful_life_months":{"type":"integer","maximum":600.0,"minimum":1.0,"title":"Useful Life Months","description":"Expected useful life in months","default":60},"depreciation_method":{"$ref":"#/components/schemas/DepreciationMethod","description":"Depreciation calculation method","default":"straight_line"},"location":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Location","description":"Physical location of the asset"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Additional notes"},"id":{"type":"string","title":"Id","description":"Asset ID"},"category_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Id","description":"Asset category ID"},"category_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Name","description":"Asset category name"},"vendor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Id","description":"Vendor ID"},"in_service_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"In Service Date","description":"Date placed in service"},"total_expected_units":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Expected Units","description":"Total expected units (units-of-production method)"},"units_used_to_date":{"type":"integer","title":"Units Used To Date","description":"Cumulative units used to date","default":0},"status":{"$ref":"#/components/schemas/AssetStatus","description":"Asset lifecycle status: draft, active, fully_depreciated, disposed"},"disposal_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Disposal Date","description":"Date the asset was disposed"},"disposal_amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Disposal Amount","description":"Sale/trade proceeds in cents"},"disposal_method":{"anyOf":[{"$ref":"#/components/schemas/DisposalMethod"},{"type":"null"}],"description":"How the asset was disposed"},"depreciable_amount":{"type":"integer","title":"Depreciable Amount","description":"Cost minus salvage value, in cents"},"accumulated_depreciation":{"type":"integer","title":"Accumulated Depreciation","description":"Total depreciation taken to date, in cents"},"book_value":{"type":"integer","title":"Book Value","description":"Current book value (cost - accumulated depreciation), in cents"},"monthly_depreciation_amount":{"type":"integer","title":"Monthly Depreciation Amount","description":"Monthly depreciation amount, in cents"},"remaining_life_months":{"type":"integer","title":"Remaining Life Months","description":"Remaining useful life in months"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Record creation timestamp"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp"}},"type":"object","required":["name","purchase_date","original_cost","id","status","depreciable_amount","accumulated_depreciation","book_value","monthly_depreciation_amount","remaining_life_months","created_at","updated_at"],"title":"FixedAssetResponse","description":"Schema for fixed asset response."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"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":[]}]}