Update Employee Basic Setting
บันทึกข้อมูลการตั้งค่าพื้นฐานของพนักงาน เช่น วันทำงานต่อเดือน, ชั่วโมงทำงานต่อวัน, การปัดเศษ, กลุ่มบัญชี, LINE Token
Endpoint
POST /api/v1/open-apis/employee/update-employee-setting?path_action=save-basicฟิลด์ที่ไม่ส่งมาจะไม่ถูกเปลี่ยนแปลง (Partial Update) ส่งเฉพาะฟิลด์ที่ต้องการอัพเดท
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
path_action | string | Yes | ต้องเป็น save-basic หรือ basic |
Request Body
Employee Identification
| Parameter | Type | Required | Description |
|---|---|---|---|
employee_code | string | Yes | รหัสพนักงาน เช่น "EMP001" |
Work Time Configuration
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
days_per_month | string | No | จำนวนวันทำงานต่อเดือน (ต้องเป็น String) | "26" |
hours_per_day | string | No | จำนวนชั่วโมงทำงานต่อวัน (format HH:MM:SS) | "08:00:00" |
Rounding Configuration
| Parameter | Type | Required | Description | Values |
|---|---|---|---|---|
round_month_config | string | No | รอบการคำนวณเงินเดือน | "Full", "Split" |
round_xtra_config | string | No | รอบการคำนวณงวดพิเศษ | "Y", "N" |
round_ot_config | string | No | รอบการคำนวณงวดแยก OT | "Y", "N" |
round_worktime_config | string | No | รอบการคำนวณงวดแยกเวลาทำงาน | "Y", "N" |
Other Settings
| Parameter | Type | Required | Description |
|---|---|---|---|
holiday_apply_config | string | No | อนุญาตให้หยุดวันหยุดนักขัตฤกษ์ ("Y" / "N") |
coa_account_group_id | string | No | ตั้งค่าผังบัญชี (Base64 encoded) |
line_token_id | string | No | LINE Notify Token ID (Base64 encoded) |
line_token_todolist_id | string | No | LINE Notify Token ID สำหรับ To-do (Base64 encoded) |
chat_token | string | No | Chat Token สำหรับส่งข้อมูลเข้ากลุ่มแชท |
Response Format
Success Response
{
"code": 200,
"message": "Save Basic Info Success",
"payload": {
"employee_code": "EMP001",
"employee_id": "20260121FC89F3BB9120",
"days_per_month": "26",
"hours_per_day": "08:00:00",
"round_month_config": "Full",
"round_xtra_config": "Y",
"round_ot_config": "N",
"round_worktime_config": "N",
"holiday_apply_config": "Y",
"coa_account_group_id": "",
"line_token_id": "",
"line_token_todolist_id": "",
"chat_token": ""
}
}Error Response
{
"code": "400",
"message": "Validation failed",
"errors": ["Missing required parameter: 'employee_code'"]
}| เงื่อนไข | Error Message |
|---|---|
ไม่ส่ง employee_code หรือว่าง | Missing required parameter: 'employee_code' |
employee_code ไม่มีในระบบ | Employee not found with code: xxx |
Code Examples
cURL
curl -X POST "https://openapi.humansoft.co.th/api/v1/open-apis/employee/update-employee-setting?path_action=save-basic" \
-H "Content-Type: application/json" \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
-d '{
"employee_code": "EMP001",
"days_per_month": "26",
"hours_per_day": "08:00:00",
"round_month_config": "Full",
"round_xtra_config": "Y",
"round_ot_config": "N",
"round_worktime_config": "N",
"holiday_apply_config": "Y"
}'Notes
days_per_month ต้องเป็น String เช่น "26" ไม่ใช่ Number 26 และ hours_per_day ต้องเป็น format "HH:MM:SS" เช่น "08:00:00"
Related APIs
- Update Approver - แก้ไขผู้อนุมัติของพนักงาน
Last updated on