# 🏦 Accounts

Chart of accounts and account management

## List accounts

> List all accounts (chart of accounts) for an organization

```json
{"openapi":"3.0.3","info":{"title":"Skhokho API","version":"v1.0"},"tags":[{"name":"Accounts","description":"Chart of accounts and account management"}],"servers":[{"url":"https://skhokho.ai","description":"Production"},{"url":"http://102.209.118.152:8000/","description":"Local"},{"url":"https://dev.skhokho.ai","description":"Development"}],"security":[{"basicAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"sessionid"}},"schemas":{"AccountList":{"type":"object","description":"Lightweight version for list views.","properties":{"unique_id":{"type":"string","nullable":true,"maxLength":100},"name":{"type":"string"},"account_code":{"type":"string","maxLength":20},"full_account_code":{"type":"string","readOnly":true},"account_type":{"enum":["asset","liability","equity","income","expense"],"type":"string","description":"* `asset` - Asset\n* `liability` - Liability\n* `equity` - Equity\n* `income` - Income\n* `expense` - Expense"},"account_type_display":{"type":"string","readOnly":true},"account_category":{"enum":["current_assets","fixed_assets","intangible_assets","current_liabilities","long_term_liabilities","owner_equity","retained_earnings","operating_income","other_income","cost_of_goods_sold","operating_expenses","administrative_expenses","financial_expenses","other_expenses"],"type":"string","description":"* `current_assets` - Current Assets\n* `fixed_assets` - Fixed Assets\n* `intangible_assets` - Intangible Assets\n* `current_liabilities` - Current Liabilities\n* `long_term_liabilities` - Long-term Liabilities\n* `owner_equity` - Owner Equity\n* `retained_earnings` - Retained Earnings\n* `operating_income` - Operating Income\n* `other_income` - Other Income\n* `cost_of_goods_sold` - Cost of Goods Sold\n* `operating_expenses` - Operating Expenses\n* `administrative_expenses` - Administrative Expenses\n* `financial_expenses` - Financial Expenses\n* `other_expenses` - Other Expenses"},"account_category_display":{"type":"string","readOnly":true},"current_balance":{"type":"string","format":"decimal","pattern":"^-?\\d{0,13}(?:\\.\\d{0,2})?$","readOnly":true,"description":"Current account balance (calculated from transactions)"},"is_active":{"type":"boolean"},"has_sub_accounts":{"type":"boolean","readOnly":true},"date_created":{"type":"string","format":"date-time","readOnly":true,"nullable":true}},"required":["account_category","account_category_display","account_code","account_type","account_type_display","current_balance","date_created","full_account_code","has_sub_accounts","name"]}}},"paths":{"/api/v1.0/organisation/{org_id}/accounts/":{"get":{"operationId":"organisation_accounts_list","description":"List all accounts (chart of accounts) for an organization","summary":"List accounts","parameters":[{"in":"query","name":"account_category","schema":{"type":"string"},"description":"Filter by account category"},{"in":"query","name":"account_type","schema":{"type":"string","enum":["asset","equity","expense","income","liability"]},"description":"Filter by account type"},{"in":"query","name":"is_active","schema":{"type":"string"},"description":"Filter by active status (true/false)"},{"in":"path","name":"org_id","schema":{"type":"string"},"required":true},{"in":"query","name":"parent_account","schema":{"type":"string"},"description":"Filter by parent account unique_id (use \"null\" for top-level accounts)"},{"in":"query","name":"search","schema":{"type":"string"},"description":"Search account_code or name"}],"tags":["Accounts"],"responses":{"200":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AccountList"}}}},"description":""},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"}}}}}}
```

## Create account

> Create a new account in the chart of accounts

```json
{"openapi":"3.0.3","info":{"title":"Skhokho API","version":"v1.0"},"tags":[{"name":"Accounts","description":"Chart of accounts and account management"}],"servers":[{"url":"https://skhokho.ai","description":"Production"},{"url":"http://102.209.118.152:8000/","description":"Local"},{"url":"https://dev.skhokho.ai","description":"Development"}],"security":[{"basicAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"sessionid"}},"schemas":{"AccountRequest":{"type":"object","description":"Comprehensive serializer for Account model.\nHandles chart of accounts with multilingual support and hierarchy.","properties":{"unique_id":{"type":"string","nullable":true,"maxLength":100},"name":{"type":"string","minLength":1},"description":{"type":"string","nullable":true},"account_code":{"type":"string","minLength":1,"maxLength":20},"account_type":{"enum":["asset","liability","equity","income","expense"],"type":"string","description":"* `asset` - Asset\n* `liability` - Liability\n* `equity` - Equity\n* `income` - Income\n* `expense` - Expense"},"account_category":{"enum":["current_assets","fixed_assets","intangible_assets","current_liabilities","long_term_liabilities","owner_equity","retained_earnings","operating_income","other_income","cost_of_goods_sold","operating_expenses","administrative_expenses","financial_expenses","other_expenses"],"type":"string","description":"* `current_assets` - Current Assets\n* `fixed_assets` - Fixed Assets\n* `intangible_assets` - Intangible Assets\n* `current_liabilities` - Current Liabilities\n* `long_term_liabilities` - Long-term Liabilities\n* `owner_equity` - Owner Equity\n* `retained_earnings` - Retained Earnings\n* `operating_income` - Operating Income\n* `other_income` - Other Income\n* `cost_of_goods_sold` - Cost of Goods Sold\n* `operating_expenses` - Operating Expenses\n* `administrative_expenses` - Administrative Expenses\n* `financial_expenses` - Financial Expenses\n* `other_expenses` - Other Expenses"},"parent_account_id":{"type":"string","writeOnly":true,"nullable":true,"minLength":1},"is_active":{"type":"boolean"},"is_system_account":{"type":"boolean","description":"System accounts cannot be deleted"}},"required":["account_category","account_code","account_type","name"]},"AccountDetail":{"type":"object","description":"Detailed version with transaction summary.","properties":{"unique_id":{"type":"string","nullable":true,"maxLength":100},"name":{"type":"string"},"description":{"type":"string","nullable":true},"account_code":{"type":"string","maxLength":20},"account_type":{"enum":["asset","liability","equity","income","expense"],"type":"string","description":"* `asset` - Asset\n* `liability` - Liability\n* `equity` - Equity\n* `income` - Income\n* `expense` - Expense"},"account_type_display":{"type":"string","readOnly":true},"account_category":{"enum":["current_assets","fixed_assets","intangible_assets","current_liabilities","long_term_liabilities","owner_equity","retained_earnings","operating_income","other_income","cost_of_goods_sold","operating_expenses","administrative_expenses","financial_expenses","other_expenses"],"type":"string","description":"* `current_assets` - Current Assets\n* `fixed_assets` - Fixed Assets\n* `intangible_assets` - Intangible Assets\n* `current_liabilities` - Current Liabilities\n* `long_term_liabilities` - Long-term Liabilities\n* `owner_equity` - Owner Equity\n* `retained_earnings` - Retained Earnings\n* `operating_income` - Operating Income\n* `other_income` - Other Income\n* `cost_of_goods_sold` - Cost of Goods Sold\n* `operating_expenses` - Operating Expenses\n* `administrative_expenses` - Administrative Expenses\n* `financial_expenses` - Financial Expenses\n* `other_expenses` - Other Expenses"},"account_category_display":{"type":"string","readOnly":true},"parent_account":{"allOf":[{"$ref":"#/components/schemas/AccountParent"}],"readOnly":true},"full_account_code":{"type":"string","readOnly":true},"account_path":{"type":"string","readOnly":true},"current_balance":{"type":"string","format":"decimal","pattern":"^-?\\d{0,13}(?:\\.\\d{0,2})?$","readOnly":true,"description":"Current account balance (calculated from transactions)"},"is_active":{"type":"boolean"},"is_system_account":{"type":"boolean","description":"System accounts cannot be deleted"},"has_sub_accounts":{"type":"boolean","readOnly":true},"created_by":{"allOf":[{"$ref":"#/components/schemas/FinancePersonMini"}],"readOnly":true},"date_created":{"type":"string","format":"date-time","readOnly":true,"nullable":true},"last_updated":{"type":"string","format":"date-time","readOnly":true,"nullable":true},"sub_accounts_count":{"type":"integer","readOnly":true},"transaction_count":{"type":"integer","readOnly":true}},"required":["account_category","account_category_display","account_code","account_path","account_type","account_type_display","created_by","current_balance","date_created","full_account_code","has_sub_accounts","last_updated","name","parent_account","sub_accounts_count","transaction_count"]},"AccountParent":{"type":"object","description":"Minimal serializer for parent account references.","properties":{"unique_id":{"type":"string","nullable":true,"maxLength":100},"account_code":{"type":"string","maxLength":20},"name":{"type":"string","readOnly":true},"account_type":{"enum":["asset","liability","equity","income","expense"],"type":"string","description":"* `asset` - Asset\n* `liability` - Liability\n* `equity` - Equity\n* `income` - Income\n* `expense` - Expense"}},"required":["account_code","account_type","name"]},"FinancePersonMini":{"type":"object","description":"Lightweight serializer for Person model.\nUsed for nested person references in financial documents.","properties":{"unique_id":{"type":"string","nullable":true,"maxLength":100},"full_name":{"type":"string","readOnly":true}},"required":["full_name"]}}},"paths":{"/api/v1.0/organisation/{org_id}/accounts/create/":{"post":{"operationId":"organisation_accounts_create_create","description":"Create a new account in the chart of accounts","summary":"Create account","parameters":[{"in":"path","name":"org_id","schema":{"type":"string"},"required":true}],"tags":["Accounts"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountRequest"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/AccountRequest"}},"multipart/form-data":{"schema":{"$ref":"#/components/schemas/AccountRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountDetail"}}},"description":""},"400":{"description":"Bad Request"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"}}}}}}
```

## Get account

> Retrieve a specific account by ID

```json
{"openapi":"3.0.3","info":{"title":"Skhokho API","version":"v1.0"},"tags":[{"name":"Accounts","description":"Chart of accounts and account management"}],"servers":[{"url":"https://skhokho.ai","description":"Production"},{"url":"http://102.209.118.152:8000/","description":"Local"},{"url":"https://dev.skhokho.ai","description":"Development"}],"security":[{"basicAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"sessionid"}},"schemas":{"AccountDetail":{"type":"object","description":"Detailed version with transaction summary.","properties":{"unique_id":{"type":"string","nullable":true,"maxLength":100},"name":{"type":"string"},"description":{"type":"string","nullable":true},"account_code":{"type":"string","maxLength":20},"account_type":{"enum":["asset","liability","equity","income","expense"],"type":"string","description":"* `asset` - Asset\n* `liability` - Liability\n* `equity` - Equity\n* `income` - Income\n* `expense` - Expense"},"account_type_display":{"type":"string","readOnly":true},"account_category":{"enum":["current_assets","fixed_assets","intangible_assets","current_liabilities","long_term_liabilities","owner_equity","retained_earnings","operating_income","other_income","cost_of_goods_sold","operating_expenses","administrative_expenses","financial_expenses","other_expenses"],"type":"string","description":"* `current_assets` - Current Assets\n* `fixed_assets` - Fixed Assets\n* `intangible_assets` - Intangible Assets\n* `current_liabilities` - Current Liabilities\n* `long_term_liabilities` - Long-term Liabilities\n* `owner_equity` - Owner Equity\n* `retained_earnings` - Retained Earnings\n* `operating_income` - Operating Income\n* `other_income` - Other Income\n* `cost_of_goods_sold` - Cost of Goods Sold\n* `operating_expenses` - Operating Expenses\n* `administrative_expenses` - Administrative Expenses\n* `financial_expenses` - Financial Expenses\n* `other_expenses` - Other Expenses"},"account_category_display":{"type":"string","readOnly":true},"parent_account":{"allOf":[{"$ref":"#/components/schemas/AccountParent"}],"readOnly":true},"full_account_code":{"type":"string","readOnly":true},"account_path":{"type":"string","readOnly":true},"current_balance":{"type":"string","format":"decimal","pattern":"^-?\\d{0,13}(?:\\.\\d{0,2})?$","readOnly":true,"description":"Current account balance (calculated from transactions)"},"is_active":{"type":"boolean"},"is_system_account":{"type":"boolean","description":"System accounts cannot be deleted"},"has_sub_accounts":{"type":"boolean","readOnly":true},"created_by":{"allOf":[{"$ref":"#/components/schemas/FinancePersonMini"}],"readOnly":true},"date_created":{"type":"string","format":"date-time","readOnly":true,"nullable":true},"last_updated":{"type":"string","format":"date-time","readOnly":true,"nullable":true},"sub_accounts_count":{"type":"integer","readOnly":true},"transaction_count":{"type":"integer","readOnly":true}},"required":["account_category","account_category_display","account_code","account_path","account_type","account_type_display","created_by","current_balance","date_created","full_account_code","has_sub_accounts","last_updated","name","parent_account","sub_accounts_count","transaction_count"]},"AccountParent":{"type":"object","description":"Minimal serializer for parent account references.","properties":{"unique_id":{"type":"string","nullable":true,"maxLength":100},"account_code":{"type":"string","maxLength":20},"name":{"type":"string","readOnly":true},"account_type":{"enum":["asset","liability","equity","income","expense"],"type":"string","description":"* `asset` - Asset\n* `liability` - Liability\n* `equity` - Equity\n* `income` - Income\n* `expense` - Expense"}},"required":["account_code","account_type","name"]},"FinancePersonMini":{"type":"object","description":"Lightweight serializer for Person model.\nUsed for nested person references in financial documents.","properties":{"unique_id":{"type":"string","nullable":true,"maxLength":100},"full_name":{"type":"string","readOnly":true}},"required":["full_name"]}}},"paths":{"/api/v1.0/organisation/{org_id}/accounts/{account_id}/":{"get":{"operationId":"organisation_accounts_retrieve","description":"Retrieve a specific account by ID","summary":"Get account","parameters":[{"in":"path","name":"account_id","schema":{"type":"string"},"required":true},{"in":"path","name":"org_id","schema":{"type":"string"},"required":true}],"tags":["Accounts"],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountDetail"}}},"description":""},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}}}}
```

## Update account

> Update an existing account

```json
{"openapi":"3.0.3","info":{"title":"Skhokho API","version":"v1.0"},"tags":[{"name":"Accounts","description":"Chart of accounts and account management"}],"servers":[{"url":"https://skhokho.ai","description":"Production"},{"url":"http://102.209.118.152:8000/","description":"Local"},{"url":"https://dev.skhokho.ai","description":"Development"}],"security":[{"basicAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"sessionid"}},"schemas":{"AccountRequest":{"type":"object","description":"Comprehensive serializer for Account model.\nHandles chart of accounts with multilingual support and hierarchy.","properties":{"unique_id":{"type":"string","nullable":true,"maxLength":100},"name":{"type":"string","minLength":1},"description":{"type":"string","nullable":true},"account_code":{"type":"string","minLength":1,"maxLength":20},"account_type":{"enum":["asset","liability","equity","income","expense"],"type":"string","description":"* `asset` - Asset\n* `liability` - Liability\n* `equity` - Equity\n* `income` - Income\n* `expense` - Expense"},"account_category":{"enum":["current_assets","fixed_assets","intangible_assets","current_liabilities","long_term_liabilities","owner_equity","retained_earnings","operating_income","other_income","cost_of_goods_sold","operating_expenses","administrative_expenses","financial_expenses","other_expenses"],"type":"string","description":"* `current_assets` - Current Assets\n* `fixed_assets` - Fixed Assets\n* `intangible_assets` - Intangible Assets\n* `current_liabilities` - Current Liabilities\n* `long_term_liabilities` - Long-term Liabilities\n* `owner_equity` - Owner Equity\n* `retained_earnings` - Retained Earnings\n* `operating_income` - Operating Income\n* `other_income` - Other Income\n* `cost_of_goods_sold` - Cost of Goods Sold\n* `operating_expenses` - Operating Expenses\n* `administrative_expenses` - Administrative Expenses\n* `financial_expenses` - Financial Expenses\n* `other_expenses` - Other Expenses"},"parent_account_id":{"type":"string","writeOnly":true,"nullable":true,"minLength":1},"is_active":{"type":"boolean"},"is_system_account":{"type":"boolean","description":"System accounts cannot be deleted"}},"required":["account_category","account_code","account_type","name"]},"AccountDetail":{"type":"object","description":"Detailed version with transaction summary.","properties":{"unique_id":{"type":"string","nullable":true,"maxLength":100},"name":{"type":"string"},"description":{"type":"string","nullable":true},"account_code":{"type":"string","maxLength":20},"account_type":{"enum":["asset","liability","equity","income","expense"],"type":"string","description":"* `asset` - Asset\n* `liability` - Liability\n* `equity` - Equity\n* `income` - Income\n* `expense` - Expense"},"account_type_display":{"type":"string","readOnly":true},"account_category":{"enum":["current_assets","fixed_assets","intangible_assets","current_liabilities","long_term_liabilities","owner_equity","retained_earnings","operating_income","other_income","cost_of_goods_sold","operating_expenses","administrative_expenses","financial_expenses","other_expenses"],"type":"string","description":"* `current_assets` - Current Assets\n* `fixed_assets` - Fixed Assets\n* `intangible_assets` - Intangible Assets\n* `current_liabilities` - Current Liabilities\n* `long_term_liabilities` - Long-term Liabilities\n* `owner_equity` - Owner Equity\n* `retained_earnings` - Retained Earnings\n* `operating_income` - Operating Income\n* `other_income` - Other Income\n* `cost_of_goods_sold` - Cost of Goods Sold\n* `operating_expenses` - Operating Expenses\n* `administrative_expenses` - Administrative Expenses\n* `financial_expenses` - Financial Expenses\n* `other_expenses` - Other Expenses"},"account_category_display":{"type":"string","readOnly":true},"parent_account":{"allOf":[{"$ref":"#/components/schemas/AccountParent"}],"readOnly":true},"full_account_code":{"type":"string","readOnly":true},"account_path":{"type":"string","readOnly":true},"current_balance":{"type":"string","format":"decimal","pattern":"^-?\\d{0,13}(?:\\.\\d{0,2})?$","readOnly":true,"description":"Current account balance (calculated from transactions)"},"is_active":{"type":"boolean"},"is_system_account":{"type":"boolean","description":"System accounts cannot be deleted"},"has_sub_accounts":{"type":"boolean","readOnly":true},"created_by":{"allOf":[{"$ref":"#/components/schemas/FinancePersonMini"}],"readOnly":true},"date_created":{"type":"string","format":"date-time","readOnly":true,"nullable":true},"last_updated":{"type":"string","format":"date-time","readOnly":true,"nullable":true},"sub_accounts_count":{"type":"integer","readOnly":true},"transaction_count":{"type":"integer","readOnly":true}},"required":["account_category","account_category_display","account_code","account_path","account_type","account_type_display","created_by","current_balance","date_created","full_account_code","has_sub_accounts","last_updated","name","parent_account","sub_accounts_count","transaction_count"]},"AccountParent":{"type":"object","description":"Minimal serializer for parent account references.","properties":{"unique_id":{"type":"string","nullable":true,"maxLength":100},"account_code":{"type":"string","maxLength":20},"name":{"type":"string","readOnly":true},"account_type":{"enum":["asset","liability","equity","income","expense"],"type":"string","description":"* `asset` - Asset\n* `liability` - Liability\n* `equity` - Equity\n* `income` - Income\n* `expense` - Expense"}},"required":["account_code","account_type","name"]},"FinancePersonMini":{"type":"object","description":"Lightweight serializer for Person model.\nUsed for nested person references in financial documents.","properties":{"unique_id":{"type":"string","nullable":true,"maxLength":100},"full_name":{"type":"string","readOnly":true}},"required":["full_name"]}}},"paths":{"/api/v1.0/organisation/{org_id}/accounts/{account_id}/update/":{"put":{"operationId":"organisation_accounts_update_update","description":"Update an existing account","summary":"Update account","parameters":[{"in":"path","name":"account_id","schema":{"type":"string"},"required":true},{"in":"path","name":"org_id","schema":{"type":"string"},"required":true}],"tags":["Accounts"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountRequest"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/AccountRequest"}},"multipart/form-data":{"schema":{"$ref":"#/components/schemas/AccountRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountDetail"}}},"description":""},"400":{"description":"Bad Request"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}}}}
```

## Update account

> Update an existing account

```json
{"openapi":"3.0.3","info":{"title":"Skhokho API","version":"v1.0"},"tags":[{"name":"Accounts","description":"Chart of accounts and account management"}],"servers":[{"url":"https://skhokho.ai","description":"Production"},{"url":"http://102.209.118.152:8000/","description":"Local"},{"url":"https://dev.skhokho.ai","description":"Development"}],"security":[{"basicAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"sessionid"}},"schemas":{"PatchedAccountRequest":{"type":"object","description":"Comprehensive serializer for Account model.\nHandles chart of accounts with multilingual support and hierarchy.","properties":{"unique_id":{"type":"string","nullable":true,"maxLength":100},"name":{"type":"string","minLength":1},"description":{"type":"string","nullable":true},"account_code":{"type":"string","minLength":1,"maxLength":20},"account_type":{"enum":["asset","liability","equity","income","expense"],"type":"string","description":"* `asset` - Asset\n* `liability` - Liability\n* `equity` - Equity\n* `income` - Income\n* `expense` - Expense"},"account_category":{"enum":["current_assets","fixed_assets","intangible_assets","current_liabilities","long_term_liabilities","owner_equity","retained_earnings","operating_income","other_income","cost_of_goods_sold","operating_expenses","administrative_expenses","financial_expenses","other_expenses"],"type":"string","description":"* `current_assets` - Current Assets\n* `fixed_assets` - Fixed Assets\n* `intangible_assets` - Intangible Assets\n* `current_liabilities` - Current Liabilities\n* `long_term_liabilities` - Long-term Liabilities\n* `owner_equity` - Owner Equity\n* `retained_earnings` - Retained Earnings\n* `operating_income` - Operating Income\n* `other_income` - Other Income\n* `cost_of_goods_sold` - Cost of Goods Sold\n* `operating_expenses` - Operating Expenses\n* `administrative_expenses` - Administrative Expenses\n* `financial_expenses` - Financial Expenses\n* `other_expenses` - Other Expenses"},"parent_account_id":{"type":"string","writeOnly":true,"nullable":true,"minLength":1},"is_active":{"type":"boolean"},"is_system_account":{"type":"boolean","description":"System accounts cannot be deleted"}}},"AccountDetail":{"type":"object","description":"Detailed version with transaction summary.","properties":{"unique_id":{"type":"string","nullable":true,"maxLength":100},"name":{"type":"string"},"description":{"type":"string","nullable":true},"account_code":{"type":"string","maxLength":20},"account_type":{"enum":["asset","liability","equity","income","expense"],"type":"string","description":"* `asset` - Asset\n* `liability` - Liability\n* `equity` - Equity\n* `income` - Income\n* `expense` - Expense"},"account_type_display":{"type":"string","readOnly":true},"account_category":{"enum":["current_assets","fixed_assets","intangible_assets","current_liabilities","long_term_liabilities","owner_equity","retained_earnings","operating_income","other_income","cost_of_goods_sold","operating_expenses","administrative_expenses","financial_expenses","other_expenses"],"type":"string","description":"* `current_assets` - Current Assets\n* `fixed_assets` - Fixed Assets\n* `intangible_assets` - Intangible Assets\n* `current_liabilities` - Current Liabilities\n* `long_term_liabilities` - Long-term Liabilities\n* `owner_equity` - Owner Equity\n* `retained_earnings` - Retained Earnings\n* `operating_income` - Operating Income\n* `other_income` - Other Income\n* `cost_of_goods_sold` - Cost of Goods Sold\n* `operating_expenses` - Operating Expenses\n* `administrative_expenses` - Administrative Expenses\n* `financial_expenses` - Financial Expenses\n* `other_expenses` - Other Expenses"},"account_category_display":{"type":"string","readOnly":true},"parent_account":{"allOf":[{"$ref":"#/components/schemas/AccountParent"}],"readOnly":true},"full_account_code":{"type":"string","readOnly":true},"account_path":{"type":"string","readOnly":true},"current_balance":{"type":"string","format":"decimal","pattern":"^-?\\d{0,13}(?:\\.\\d{0,2})?$","readOnly":true,"description":"Current account balance (calculated from transactions)"},"is_active":{"type":"boolean"},"is_system_account":{"type":"boolean","description":"System accounts cannot be deleted"},"has_sub_accounts":{"type":"boolean","readOnly":true},"created_by":{"allOf":[{"$ref":"#/components/schemas/FinancePersonMini"}],"readOnly":true},"date_created":{"type":"string","format":"date-time","readOnly":true,"nullable":true},"last_updated":{"type":"string","format":"date-time","readOnly":true,"nullable":true},"sub_accounts_count":{"type":"integer","readOnly":true},"transaction_count":{"type":"integer","readOnly":true}},"required":["account_category","account_category_display","account_code","account_path","account_type","account_type_display","created_by","current_balance","date_created","full_account_code","has_sub_accounts","last_updated","name","parent_account","sub_accounts_count","transaction_count"]},"AccountParent":{"type":"object","description":"Minimal serializer for parent account references.","properties":{"unique_id":{"type":"string","nullable":true,"maxLength":100},"account_code":{"type":"string","maxLength":20},"name":{"type":"string","readOnly":true},"account_type":{"enum":["asset","liability","equity","income","expense"],"type":"string","description":"* `asset` - Asset\n* `liability` - Liability\n* `equity` - Equity\n* `income` - Income\n* `expense` - Expense"}},"required":["account_code","account_type","name"]},"FinancePersonMini":{"type":"object","description":"Lightweight serializer for Person model.\nUsed for nested person references in financial documents.","properties":{"unique_id":{"type":"string","nullable":true,"maxLength":100},"full_name":{"type":"string","readOnly":true}},"required":["full_name"]}}},"paths":{"/api/v1.0/organisation/{org_id}/accounts/{account_id}/update/":{"patch":{"operationId":"organisation_accounts_update_partial_update","description":"Update an existing account","summary":"Update account","parameters":[{"in":"path","name":"account_id","schema":{"type":"string"},"required":true},{"in":"path","name":"org_id","schema":{"type":"string"},"required":true}],"tags":["Accounts"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchedAccountRequest"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/PatchedAccountRequest"}},"multipart/form-data":{"schema":{"$ref":"#/components/schemas/PatchedAccountRequest"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountDetail"}}},"description":""},"400":{"description":"Bad Request"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}}}}
```

## Perform account action

> Perform an action on an account using query parameter.\
> &#x20;   \
> &#x20;   \*\*Available Actions:\*\*\
> &#x20;   \- \`activate\` - Activate a deactivated account\
> &#x20;   \- \`deactivate\` - Deactivate an account (soft delete, use instead of deleting accounts with transactions)\
> &#x20;   \
> &#x20;   \*\*Examples:\*\*\
> &#x20;   \- \`/accounts/{id}/action?action=activate\`\
> &#x20;   \- \`/accounts/{id}/action?action=deactivate\`\
> &#x20;  &#x20;

```json
{"openapi":"3.0.3","info":{"title":"Skhokho API","version":"v1.0"},"tags":[{"name":"Accounts","description":"Chart of accounts and account management"}],"servers":[{"url":"https://skhokho.ai","description":"Production"},{"url":"http://102.209.118.152:8000/","description":"Local"},{"url":"https://dev.skhokho.ai","description":"Development"}],"security":[{"basicAuth":[]},{"cookieAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic"},"cookieAuth":{"type":"apiKey","in":"cookie","name":"sessionid"}},"schemas":{"AccountDetail":{"type":"object","description":"Detailed version with transaction summary.","properties":{"unique_id":{"type":"string","nullable":true,"maxLength":100},"name":{"type":"string"},"description":{"type":"string","nullable":true},"account_code":{"type":"string","maxLength":20},"account_type":{"enum":["asset","liability","equity","income","expense"],"type":"string","description":"* `asset` - Asset\n* `liability` - Liability\n* `equity` - Equity\n* `income` - Income\n* `expense` - Expense"},"account_type_display":{"type":"string","readOnly":true},"account_category":{"enum":["current_assets","fixed_assets","intangible_assets","current_liabilities","long_term_liabilities","owner_equity","retained_earnings","operating_income","other_income","cost_of_goods_sold","operating_expenses","administrative_expenses","financial_expenses","other_expenses"],"type":"string","description":"* `current_assets` - Current Assets\n* `fixed_assets` - Fixed Assets\n* `intangible_assets` - Intangible Assets\n* `current_liabilities` - Current Liabilities\n* `long_term_liabilities` - Long-term Liabilities\n* `owner_equity` - Owner Equity\n* `retained_earnings` - Retained Earnings\n* `operating_income` - Operating Income\n* `other_income` - Other Income\n* `cost_of_goods_sold` - Cost of Goods Sold\n* `operating_expenses` - Operating Expenses\n* `administrative_expenses` - Administrative Expenses\n* `financial_expenses` - Financial Expenses\n* `other_expenses` - Other Expenses"},"account_category_display":{"type":"string","readOnly":true},"parent_account":{"allOf":[{"$ref":"#/components/schemas/AccountParent"}],"readOnly":true},"full_account_code":{"type":"string","readOnly":true},"account_path":{"type":"string","readOnly":true},"current_balance":{"type":"string","format":"decimal","pattern":"^-?\\d{0,13}(?:\\.\\d{0,2})?$","readOnly":true,"description":"Current account balance (calculated from transactions)"},"is_active":{"type":"boolean"},"is_system_account":{"type":"boolean","description":"System accounts cannot be deleted"},"has_sub_accounts":{"type":"boolean","readOnly":true},"created_by":{"allOf":[{"$ref":"#/components/schemas/FinancePersonMini"}],"readOnly":true},"date_created":{"type":"string","format":"date-time","readOnly":true,"nullable":true},"last_updated":{"type":"string","format":"date-time","readOnly":true,"nullable":true},"sub_accounts_count":{"type":"integer","readOnly":true},"transaction_count":{"type":"integer","readOnly":true}},"required":["account_category","account_category_display","account_code","account_path","account_type","account_type_display","created_by","current_balance","date_created","full_account_code","has_sub_accounts","last_updated","name","parent_account","sub_accounts_count","transaction_count"]},"AccountParent":{"type":"object","description":"Minimal serializer for parent account references.","properties":{"unique_id":{"type":"string","nullable":true,"maxLength":100},"account_code":{"type":"string","maxLength":20},"name":{"type":"string","readOnly":true},"account_type":{"enum":["asset","liability","equity","income","expense"],"type":"string","description":"* `asset` - Asset\n* `liability` - Liability\n* `equity` - Equity\n* `income` - Income\n* `expense` - Expense"}},"required":["account_code","account_type","name"]},"FinancePersonMini":{"type":"object","description":"Lightweight serializer for Person model.\nUsed for nested person references in financial documents.","properties":{"unique_id":{"type":"string","nullable":true,"maxLength":100},"full_name":{"type":"string","readOnly":true}},"required":["full_name"]}}},"paths":{"/api/v1.0/organisation/{org_id}/accounts/{account_id}/action/":{"get":{"operationId":"organisation_accounts_action_retrieve","description":"Perform an action on an account using query parameter.\n    \n    **Available Actions:**\n    - `activate` - Activate a deactivated account\n    - `deactivate` - Deactivate an account (soft delete, use instead of deleting accounts with transactions)\n    \n    **Examples:**\n    - `/accounts/{id}/action?action=activate`\n    - `/accounts/{id}/action?action=deactivate`\n    ","summary":"Perform account action","parameters":[{"in":"path","name":"account_id","schema":{"type":"string"},"required":true},{"in":"path","name":"org_id","schema":{"type":"string"},"required":true}],"tags":["Accounts"],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountDetail"}}},"description":""},"400":{"description":"Bad Request - Invalid action or system account cannot be deactivated"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.skhokho.ai/finance/accounts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
