Skip to Content
🚀 Welcome to Humansoft Open API Documentation

Update Employee Basic Setting

บันทึกข้อมูลการตั้งค่าพื้นฐานของพนักงาน เช่น วันทำงานต่อเดือน, ชั่วโมงทำงานต่อวัน, การปัดเศษ, กลุ่มบัญชี, LINE Token

Endpoint

POST /api/v1/open-apis/employee/update-employee-setting?path_action=save-basic

ฟิลด์ที่ไม่ส่งมาจะไม่ถูกเปลี่ยนแปลง (Partial Update) ส่งเฉพาะฟิลด์ที่ต้องการอัพเดท

Query Parameters

ParameterTypeRequiredDescription
path_actionstringYesต้องเป็น save-basic หรือ basic

Request Body

Employee Identification

ParameterTypeRequiredDescription
employee_codestringYesรหัสพนักงาน เช่น "EMP001"

Work Time Configuration

ParameterTypeRequiredDescriptionExample
days_per_monthstringNoจำนวนวันทำงานต่อเดือน (ต้องเป็น String)"26"
hours_per_daystringNoจำนวนชั่วโมงทำงานต่อวัน (format HH:MM:SS)"08:00:00"

Rounding Configuration

ParameterTypeRequiredDescriptionValues
round_month_configstringNoรอบการคำนวณเงินเดือน"Full", "Split"
round_xtra_configstringNoรอบการคำนวณงวดพิเศษ"Y", "N"
round_ot_configstringNoรอบการคำนวณงวดแยก OT"Y", "N"
round_worktime_configstringNoรอบการคำนวณงวดแยกเวลาทำงาน"Y", "N"

Other Settings

ParameterTypeRequiredDescription
holiday_apply_configstringNoอนุญาตให้หยุดวันหยุดนักขัตฤกษ์ ("Y" / "N")
coa_account_group_idstringNoตั้งค่าผังบัญชี (Base64 encoded)
line_token_idstringNoLINE Notify Token ID (Base64 encoded)
line_token_todolist_idstringNoLINE Notify Token ID สำหรับ To-do (Base64 encoded)
chat_tokenstringNoChat 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 -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"


  • Update Approver - แก้ไขผู้อนุมัติของพนักงาน
Last updated on