# 公司組織設定

查詢公司的基本資訊及組織架構，包括：公司資料查詢、組織圖資料查詢、扣繳單位資料查詢。

## 取得公司資訊

> \`\`\`\
> company = {\
> &#x20; "CO\_ID": number,          //公司\_ID\
> &#x20; "CO\_CODE": string,        //公司代號\
> &#x20; "CO\_NAME": string,        //公司名稱\
> &#x20; "CO\_NAME\_JSON": boject,   //公司名稱\_JSON\
> &#x20; "SORT\_ORDER": number,     //排序\
> &#x20; "BUILD\_DATE": date,       //成立日期\
> &#x20; "DEF\_LANG": string,       //預設語系\
> &#x20; "TIME\_ZONE": string,      //時區\
> &#x20; "IS\_ACT": number,         //使用狀態  \
> },\
> \`\`\`<br>

````json
{"openapi":"3.0.0","tags":[{"name":"公司組織設定","description":"查詢公司的基本資訊及組織架構，包括：公司資料查詢、組織圖資料查詢、扣繳單位資料查詢。"}],"servers":[{"url":"https://104demotest-api-server.hrmax.104.com.tw"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"responses":{"401":{"description":"認證失敗 (請更新 accessToken 再試一次)"},"403":{"description":"權限不足"},"440":{"description":"參數錯誤 (請檢查 parameters 或 request body 的欄位、格式是否完整及正確)"},"500":{"description":"系統異常 `{ code: 500, msg: string }`"}}},"paths":{"/api/os/company":{"post":{"tags":["公司組織設定"],"summary":"取得公司資訊","description":"```\ncompany = {\n  \"CO_ID\": number,          //公司_ID\n  \"CO_CODE\": string,        //公司代號\n  \"CO_NAME\": string,        //公司名稱\n  \"CO_NAME_JSON\": boject,   //公司名稱_JSON\n  \"SORT_ORDER\": number,     //排序\n  \"BUILD_DATE\": date,       //成立日期\n  \"DEF_LANG\": string,       //預設語系\n  \"TIME_ZONE\": string,      //時區\n  \"IS_ACT\": number,         //使用狀態  \n},\n```\n","responses":{"200":{"description":"成功\n```\n{\n  code: 200, \n  data: [company, company, ...]\n}\n```\n"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"440":{"$ref":"#/components/responses/440"},"500":{"$ref":"#/components/responses/500"}}}}}}
````

## 取得部門資訊

> \`\`\`\
> dept = {\
> &#x20; "DEPT\_ID": number,                //部門\_ID\
> &#x20; "CO\_ID": number,                  //公司\_ID\
> &#x20; "ORG\_TYPE\_CODE": string,          //組織類別代碼\
> &#x20; "ORG\_TYPE\_NAME": string,          //組織類別名稱\
> &#x20; "DEPT\_CODE": string,              //部門代碼\
> &#x20; "DEPT\_NAME": string,              //部門名稱\
> &#x20; "DEPT\_NAME\_JSON": object,         //部門名稱\_JSON\
> &#x20; "DEPT\_ABBR  ": string,            //部門簡稱\
> &#x20; "DEPT\_ABBR\_JSON": object,         //部門簡稱\_JSON\
> &#x20; "DEPT\_LEVEL\_ID": number,          //部門組織層級\_ID\
> &#x20; "DEPT\_LEVEL\_NAME": string,        //層級名稱\
> &#x20; "DEPT\_LEVEL\_NAME\_JSON": object,   //部門層級名稱\_JSON\
> &#x20; "DEPT\_LEVEL\_SORT": number,        ##部門層級\_排序\
> &#x20; "LEADER\_ID": number,              //部門主管\_ID\
> &#x20; "LEADER\_EMP\_NO": string,          //部門主管\_員工編號\
> &#x20; "LEADER\_EMP\_NAME": string,        //部門主管\_姓名\
> &#x20; "LEADER\_STATUS": number,          //部門主管兼職/代理\
> &#x20; "DEPUTY\_LEADER\_ID": number,       //部門副主管\_ID\
> &#x20; "DEPUTY\_LEADER\_EMP\_NO": string,   //部門副主管\_員工編號\
> &#x20; "DEPUTY\_LEADER\_EMP\_NAME": string, //部門副主管\_姓名\
> &#x20; "DEPUTY\_LEADER\_STATUS": number,   //部門副主管\_兼職/代理\
> &#x20; "POSTAL\_CODE": string,            //部門郵遞區號\
> &#x20; "ADDRESS": string,                //部門地址\
> &#x20; "ADDRESS\_TW": string,             //中文地址\
> &#x20; "ADDRESS\_EN": string,             //英文地址\
> &#x20; "TEL": string,                    //部門電話\
> &#x20; "FAX": string,                    //部門傳真\
> &#x20; "NOTE": string,                   //備註\
> &#x20; "IS\_ACT": number,                 //使用狀態\
> &#x20; "PARENT\_DEPT\_ID": number,         //上層部門\_ID\
> &#x20; "PARENT\_DEPT\_CODE": string,       //上層部門\_部門代號\
> &#x20; "PARENT\_DEPT\_NAME": string,       //上層部門\_部門名稱\
> &#x20; "DEPT\_RELATION": string,          //部門連結關係(向上的父部門)\
> &#x20; "DEPT\_RELATION\_R": string,        //部門連結關係(反向：子部門)\
> &#x20; "DEPT\_SORT": number,              //組織樹狀排序位置\
> &#x20; "SORT\_BY\_LEVEL": number,          //同一個層級排序位置\
> &#x20; "LEVNUM": number,                 //組織圖排列層次  \
> &#x20; "DEPT\_START\_DATE": date,          //部門起始日    \
> &#x20; "E\_EMP\_ID": number,               //修改\_員工\_ID           \
> &#x20; "E\_EMP\_NO": string,               //修改\_員工編號\
> &#x20; "E\_DATETIME": date,               //修改\_日期    \
> }\
> \`\`\`<br>

````json
{"openapi":"3.0.0","tags":[{"name":"公司組織設定","description":"查詢公司的基本資訊及組織架構，包括：公司資料查詢、組織圖資料查詢、扣繳單位資料查詢。"}],"servers":[{"url":"https://104demotest-api-server.hrmax.104.com.tw"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"responses":{"401":{"description":"認證失敗 (請更新 accessToken 再試一次)"},"403":{"description":"權限不足"},"440":{"description":"參數錯誤 (請檢查 parameters 或 request body 的欄位、格式是否完整及正確)"},"500":{"description":"系統異常 `{ code: 500, msg: string }`"}}},"paths":{"/api/os/dept":{"post":{"tags":["公司組織設定"],"summary":"取得部門資訊","description":"```\ndept = {\n  \"DEPT_ID\": number,                //部門_ID\n  \"CO_ID\": number,                  //公司_ID\n  \"ORG_TYPE_CODE\": string,          //組織類別代碼\n  \"ORG_TYPE_NAME\": string,          //組織類別名稱\n  \"DEPT_CODE\": string,              //部門代碼\n  \"DEPT_NAME\": string,              //部門名稱\n  \"DEPT_NAME_JSON\": object,         //部門名稱_JSON\n  \"DEPT_ABBR  \": string,            //部門簡稱\n  \"DEPT_ABBR_JSON\": object,         //部門簡稱_JSON\n  \"DEPT_LEVEL_ID\": number,          //部門組織層級_ID\n  \"DEPT_LEVEL_NAME\": string,        //層級名稱\n  \"DEPT_LEVEL_NAME_JSON\": object,   //部門層級名稱_JSON\n  \"DEPT_LEVEL_SORT\": number,        ##部門層級_排序\n  \"LEADER_ID\": number,              //部門主管_ID\n  \"LEADER_EMP_NO\": string,          //部門主管_員工編號\n  \"LEADER_EMP_NAME\": string,        //部門主管_姓名\n  \"LEADER_STATUS\": number,          //部門主管兼職/代理\n  \"DEPUTY_LEADER_ID\": number,       //部門副主管_ID\n  \"DEPUTY_LEADER_EMP_NO\": string,   //部門副主管_員工編號\n  \"DEPUTY_LEADER_EMP_NAME\": string, //部門副主管_姓名\n  \"DEPUTY_LEADER_STATUS\": number,   //部門副主管_兼職/代理\n  \"POSTAL_CODE\": string,            //部門郵遞區號\n  \"ADDRESS\": string,                //部門地址\n  \"ADDRESS_TW\": string,             //中文地址\n  \"ADDRESS_EN\": string,             //英文地址\n  \"TEL\": string,                    //部門電話\n  \"FAX\": string,                    //部門傳真\n  \"NOTE\": string,                   //備註\n  \"IS_ACT\": number,                 //使用狀態\n  \"PARENT_DEPT_ID\": number,         //上層部門_ID\n  \"PARENT_DEPT_CODE\": string,       //上層部門_部門代號\n  \"PARENT_DEPT_NAME\": string,       //上層部門_部門名稱\n  \"DEPT_RELATION\": string,          //部門連結關係(向上的父部門)\n  \"DEPT_RELATION_R\": string,        //部門連結關係(反向：子部門)\n  \"DEPT_SORT\": number,              //組織樹狀排序位置\n  \"SORT_BY_LEVEL\": number,          //同一個層級排序位置\n  \"LEVNUM\": number,                 //組織圖排列層次  \n  \"DEPT_START_DATE\": date,          //部門起始日    \n  \"E_EMP_ID\": number,               //修改_員工_ID           \n  \"E_EMP_NO\": string,               //修改_員工編號\n  \"E_DATETIME\": date,               //修改_日期    \n}\n```\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["CO_ID","BASE_DATE","ORG_TYPE_CODE"],"properties":{"CO_ID":{"type":"integer","description":"公司ID"},"BASE_DATE":{"type":["string","date"],"description":"基準日"},"ORG_TYPE_CODE":{"type":["integer"],"description":"組織類別代碼  1~5"}}}}}},"responses":{"200":{"description":"成功\n```\n  {\n    code: 200,\n    data: [dept, dept, ...]\n  }\n```\n"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"440":{"$ref":"#/components/responses/440"},"500":{"$ref":"#/components/responses/500"}}}}}}
````

## 取得部門層級

> \`\`\`\
> deptLevel = {\
> &#x20; "DEPT\_LEVEL\_ID": number,       //組織層級\_ID\
> &#x20; "CO\_ID": number,               //公司\_ID\
> &#x20; "ORG\_TYPE\_CODE": string,       //組織類別代碼\
> &#x20; "ORG\_TYPE\_NAME": string,       //組織類別名稱\
> &#x20; "LEVEL\_NAME": string,          //層級名稱\
> &#x20; "LEVEL\_NAME\_JSON": object,     //層級名稱\_JSON\
> &#x20; "IS\_ACT": number,              //使用狀態\
> &#x20; "SORT\_ORDER": number,          //組織樹狀排序位置\
> &#x20; "E\_EMP\_ID": number,            //修改\_員工\_ID        \
> &#x20; "E\_EMP\_NO": string,            //修改\_員工編號\
> &#x20; "E\_DATETIME": date,            //修改\_日期  \
> }\
> \`\`\`<br>

````json
{"openapi":"3.0.0","tags":[{"name":"公司組織設定","description":"查詢公司的基本資訊及組織架構，包括：公司資料查詢、組織圖資料查詢、扣繳單位資料查詢。"}],"servers":[{"url":"https://104demotest-api-server.hrmax.104.com.tw"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"responses":{"401":{"description":"認證失敗 (請更新 accessToken 再試一次)"},"403":{"description":"權限不足"},"440":{"description":"參數錯誤 (請檢查 parameters 或 request body 的欄位、格式是否完整及正確)"},"500":{"description":"系統異常 `{ code: 500, msg: string }`"}}},"paths":{"/api/os/dept_level":{"post":{"tags":["公司組織設定"],"summary":"取得部門層級","description":"```\ndeptLevel = {\n  \"DEPT_LEVEL_ID\": number,       //組織層級_ID\n  \"CO_ID\": number,               //公司_ID\n  \"ORG_TYPE_CODE\": string,       //組織類別代碼\n  \"ORG_TYPE_NAME\": string,       //組織類別名稱\n  \"LEVEL_NAME\": string,          //層級名稱\n  \"LEVEL_NAME_JSON\": object,     //層級名稱_JSON\n  \"IS_ACT\": number,              //使用狀態\n  \"SORT_ORDER\": number,          //組織樹狀排序位置\n  \"E_EMP_ID\": number,            //修改_員工_ID        \n  \"E_EMP_NO\": string,            //修改_員工編號\n  \"E_DATETIME\": date,            //修改_日期  \n}\n```\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["CO_ID","BASE_DATE","ORG_TYPE_CODE"],"properties":{"CO_ID":{"type":"integer","description":"公司ID"},"BASE_DATE":{"type":["string","date"],"description":"基準日"},"ORG_TYPE_CODE":{"type":["integer"],"description":"組織類別代碼  1~5"}}}}}},"responses":{"200":{"description":"成功\n```\n  {\n    code: 200,\n    data: [deptLevel, deptLevel, ...]\n  }\n```\n"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"440":{"$ref":"#/components/responses/440"},"500":{"$ref":"#/components/responses/500"}}}}}}
````

## 取得扣繳單位統編

> \`\`\`\
> company\_sno = {\
> &#x20; "SNO\_ID": number,         //公司扣繳統編\_ID\
> &#x20; "CO\_ID": string,          //公司\_ID\
> &#x20; "SNO\_NAME": string,       //公司扣繳統編名稱\
> &#x20; "SNO\_NAME\_JSON": boject,  //公司扣繳統編名稱\_JSON\
> &#x20; "TAXID\_NO": number,       //統一編號\
> &#x20; "IS\_WELFARE": date,       //是否為福委會\
> },\
> \`\`\`<br>

````json
{"openapi":"3.0.0","tags":[{"name":"公司組織設定","description":"查詢公司的基本資訊及組織架構，包括：公司資料查詢、組織圖資料查詢、扣繳單位資料查詢。"}],"servers":[{"url":"https://104demotest-api-server.hrmax.104.com.tw"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"responses":{"401":{"description":"認證失敗 (請更新 accessToken 再試一次)"},"403":{"description":"權限不足"},"440":{"description":"參數錯誤 (請檢查 parameters 或 request body 的欄位、格式是否完整及正確)"},"500":{"description":"系統異常 `{ code: 500, msg: string }`"}}},"paths":{"/api/os/company_sno":{"post":{"tags":["公司組織設定"],"summary":"取得扣繳單位統編","description":"```\ncompany_sno = {\n  \"SNO_ID\": number,         //公司扣繳統編_ID\n  \"CO_ID\": string,          //公司_ID\n  \"SNO_NAME\": string,       //公司扣繳統編名稱\n  \"SNO_NAME_JSON\": boject,  //公司扣繳統編名稱_JSON\n  \"TAXID_NO\": number,       //統一編號\n  \"IS_WELFARE\": date,       //是否為福委會\n},\n```\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["CO_ID"],"properties":{"CO_ID":{"type":"integer","description":"公司ID"}}}}}},"responses":{"200":{"description":"成功\n```\n{\n  code: 200, \n  data: [company_sno, company_sno, ...]\n}\n```\n"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"440":{"$ref":"#/components/responses/440"},"500":{"$ref":"#/components/responses/500"}}}}}}
````


---

# 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://104ha-docs.gitbook.io/104-ha-openapi/clients/104-hr-max/gong-si-zu-zhi-she-ding.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.
