{"openapi":"3.1.0","info":{"title":"POST /api/v1/fixed-assets/run-depreciation","version":"1.0.0","description":"Run depreciation"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/fixed-assets/run-depreciation":{"post":{"tags":["fixed-assets"],"summary":"Run depreciation","description":"Run depreciation for a period.\n\nCreates depreciation entries for all active assets (or specified assets)\nfor the given period. Optionally creates journal entries.","operationId":"run_depreciation_api_v1_fixed_assets_run_depreciation_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/RunDepreciationRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunDepreciationResponse"}}}},"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"},"RunDepreciationRequest":{"properties":{"period_date":{"type":"string","format":"date","title":"Period Date","description":"First day of the month to depreciate"},"asset_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Asset Ids","description":"Specific assets (default: all active)"},"create_journal_entries":{"type":"boolean","title":"Create Journal Entries","description":"Create journal entries for depreciation","default":true}},"type":"object","required":["period_date"],"title":"RunDepreciationRequest","description":"Schema for running monthly depreciation."},"RunDepreciationResponse":{"properties":{"period_date":{"type":"string","format":"date","title":"Period Date","description":"Depreciation period date"},"assets_processed":{"type":"integer","title":"Assets Processed","description":"Number of assets depreciated"},"total_depreciation":{"type":"integer","title":"Total Depreciation","description":"Total depreciation amount in cents"},"entries_created":{"type":"integer","title":"Entries Created","description":"Depreciation entries created"},"journal_entries_created":{"type":"integer","title":"Journal Entries Created","description":"Journal entries created"},"errors":{"items":{"type":"string"},"type":"array","title":"Errors","description":"Errors encountered during processing"}},"type":"object","required":["period_date","assets_processed","total_depreciation","entries_created","journal_entries_created"],"title":"RunDepreciationResponse","description":"Response after running depreciation."},"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":[]}]}