{"openapi":"3.1.0","info":{"title":"POST /api/v1/fixed-assets/{asset_id}/place-in-service","version":"1.0.0","description":"Place asset in service"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/fixed-assets/{asset_id}/place-in-service":{"post":{"tags":["fixed-assets"],"summary":"Place asset in service","description":"Place an asset in service to begin depreciation.\n\nThis changes the asset status from 'draft' to 'active' and sets the\nin-service date from which depreciation will be calculated.\n\n- `capitalization: \"purchase\"` (default) posts DR asset / CR Accounts Payable.\n- `capitalization: \"opening_balance\"` is for an asset already on the books\n  at go-live: it posts DR asset / CR accumulated (opening amount) / CR\n  `offset_ledger_id`, or no journal entry when no offset is given. Only\n  months from `go_live_date` on are scheduled, so the opening balance is\n  never posted twice.","operationId":"place_asset_in_service","parameters":[{"name":"asset_id","in":"path","required":true,"schema":{"type":"string","title":"Asset Id"}},{"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/PlaceInServiceRequest"},"example":{"in_service_date":"2026-02-01"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_FixedAssetResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"validation_error","message":"Validation failed: amount: Input should be a valid integer","errors":{"amount":"Input should be a valid integer"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}},"401":{"description":"Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"unauthorized","message":"Authentication required","code":"AUTH_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"forbidden","message":"You don't have permission to access this resource","code":"AUTH_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}}},"x-fastapi-operation-id":"place_asset_in_service_api_v1_fixed_assets__asset_id__place_in_service_post"}}},"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."},"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"},"opening_accumulated_depreciation":{"type":"integer","title":"Opening Accumulated Depreciation","description":"Depreciation recognised before go-live (no JE), in cents","default":0},"opening_book_value":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Opening Book Value","description":"Book value at go-live, in cents"},"go_live_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Go Live Date","description":"First month DayZero posts for this asset"},"depreciation_expense_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Depreciation Expense Ledger Id","description":"Per-asset expense account override"},"schedule_kind":{"type":"string","enum":["depreciation","amortization"],"title":"Schedule Kind","description":"'amortization' when the schedule draws down a current-asset (prepaid) account, else 'depreciation'","default":"depreciation"},"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."},"PlaceInServiceRequest":{"properties":{"in_service_date":{"type":"string","format":"date","title":"In Service Date","description":"Date asset starts depreciating"},"capitalization":{"type":"string","enum":["purchase","opening_balance"],"title":"Capitalization","description":"'purchase' (default) posts DR asset / CR Accounts Payable for the full cost. 'opening_balance' is for an asset already on the books at go-live: it posts against `offset_ledger_id`, or nothing at all when no offset is given.","default":"purchase"},"offset_ledger_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Offset Ledger Id","description":"Opening-balance mode only: the account the opening entry credits (e.g. Opening Balance Equity). Omit to post no journal entry."},"opening_accumulated_depreciation":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Opening Accumulated Depreciation","description":"Opening-balance mode only: depreciation/amortization recognised before go-live, in cents (overrides the asset's stored value)"},"go_live_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Go Live Date","description":"Opening-balance mode only: first month DayZero posts (overrides the asset's stored value)"}},"type":"object","required":["in_service_date"],"title":"PlaceInServiceRequest","description":"Schema for placing an asset in service.","example":{"in_service_date":"2026-02-01"},"examples":[{"in_service_date":"2026-02-01"}]},"SuccessEnvelope_FixedAssetResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/FixedAssetResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[FixedAssetResponse]"},"ErrorResponse":{"title":"ErrorResponse","type":"object","description":"Envelope returned by every non-2xx response. Branch on `code` (stable) rather than `message` (human-readable, may change).","required":["error","message","code"],"properties":{"error":{"type":"string","description":"Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`."},"message":{"type":"string","description":"Human-readable explanation, safe to show to end users."},"code":{"type":"string","description":"Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`)."},"request_id":{"type":"string","description":"Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied."},"errors":{"type":"object","additionalProperties":{"type":"string"},"description":"Field-level validation messages keyed by field name. Present on 400/422 validation failures only."}}}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}