{"openapi":"3.1.0","info":{"title":"POST /api/v1/fixed-assets/categories","version":"1.0.0","description":"Create asset category"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/fixed-assets/categories":{"post":{"tags":["fixed-assets"],"summary":"Create asset category","description":"Create a new asset category.\n\n**Request Body:**\n- `name`: Category name, 1-255 chars (required)\n- `description`: Category description, max 1000 chars (optional)\n- `default_useful_life_months`: Default useful life in months, 1-600 (optional, defaults to 60)\n- `default_depreciation_method`: Default depreciation method - straight_line, declining_balance, double_declining, units_of_production (optional, defaults to 'straight_line')\n- `default_salvage_percent`: Default salvage percentage, 0-100 (optional, defaults to 0)\n- `asset_ledger_id`: Ledger ID for asset account (optional)\n- `depreciation_expense_ledger_id`: Ledger ID for depreciation expense (optional)\n- `accumulated_depreciation_ledger_id`: Ledger ID for accumulated depreciation (optional)","operationId":"create_asset_category_api_v1_fixed_assets_categories_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/AssetCategoryCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetCategoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AssetCategoryCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Category name"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description","description":"Category description"},"default_useful_life_months":{"type":"integer","maximum":600.0,"minimum":1.0,"title":"Default Useful Life Months","description":"Default useful life in months for assets in this category","default":60},"default_depreciation_method":{"$ref":"#/components/schemas/DepreciationMethod","description":"Default depreciation method","default":"straight_line"},"default_salvage_percent":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Default Salvage Percent","description":"Default salvage value as percentage of cost","default":0},"asset_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Asset Ledger Id","description":"Ledger account for asset cost"},"depreciation_expense_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Depreciation Expense Ledger Id","description":"Ledger account for depreciation expense"},"accumulated_depreciation_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accumulated Depreciation Ledger Id","description":"Ledger account for accumulated depreciation"}},"type":"object","required":["name"],"title":"AssetCategoryCreate","description":"Schema for creating an asset category."},"AssetCategoryResponse":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Category name"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description","description":"Category description"},"default_useful_life_months":{"type":"integer","maximum":600.0,"minimum":1.0,"title":"Default Useful Life Months","description":"Default useful life in months for assets in this category","default":60},"default_depreciation_method":{"$ref":"#/components/schemas/DepreciationMethod","description":"Default depreciation method","default":"straight_line"},"default_salvage_percent":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Default Salvage Percent","description":"Default salvage value as percentage of cost","default":0},"id":{"type":"string","title":"Id","description":"Category ID"},"asset_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Asset Ledger Id","description":"Ledger account for asset cost"},"depreciation_expense_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Depreciation Expense Ledger Id","description":"Ledger account for depreciation expense"},"accumulated_depreciation_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accumulated Depreciation Ledger Id","description":"Ledger account for accumulated depreciation"},"asset_count":{"type":"integer","title":"Asset Count","description":"Number of assets in this category","default":0},"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","id","created_at","updated_at"],"title":"AssetCategoryResponse","description":"Schema for asset category response."},"DepreciationMethod":{"type":"string","enum":["straight_line","declining_balance","double_declining","units_of_production"],"title":"DepreciationMethod","description":"Depreciation calculation methods."},"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":[]}]}