{"openapi":"3.1.0","info":{"title":"GET /api/v1/accounting-periods/{period_id}","version":"1.0.0","description":"Get accounting period"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/accounting-periods/{period_id}":{"get":{"tags":["accounting-periods"],"summary":"Get accounting period","description":"Get details of a specific accounting period.","operationId":"get_period_api_v1_accounting_periods__period_id__get","parameters":[{"name":"period_id","in":"path","required":true,"schema":{"type":"string","title":"Period 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"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountingPeriodResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AccountingPeriodResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Period UUID"},"business_id":{"type":"string","title":"Business Id","description":"Business UUID"},"period_start":{"type":"string","format":"date","title":"Period Start","description":"Start date of the period"},"period_end":{"type":"string","format":"date","title":"Period End","description":"End date of the period"},"status":{"type":"string","title":"Status","description":"Status: open, closed, or locked"},"closed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Closed At","description":"When period was closed"},"closed_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Closed By User Id","description":"User who closed the period"},"lock_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lock Reason","description":"Reason period was closed"},"reopen_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reopen Reason","description":"Reason period was reopened"},"reopened_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Reopened At","description":"When period was reopened"},"reopened_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reopened By User Id","description":"User who reopened the period"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp"}},"type":"object","required":["id","business_id","period_start","period_end","status","created_at","updated_at"],"title":"AccountingPeriodResponse","description":"Response schema for an accounting period."},"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":[]}]}