Skip to Content
🚀 Welcome to Humansoft Open API Documentation

List Employee Welfare

ดึงรายการสวัสดิการทั้งหมดของพนักงาน (ทุกประเภท พร้อมข้อมูลโควตา ยอดยกมา ใช้ไป และคงเหลือ)

Endpoint

GET /api/v1/open-apis/employee/get-employee-data-filter?path_action=list-welfare

Query Parameters

ParameterTypeRequiredDescription
path_actionstringYesต้องเป็น list-welfare
employee_codestringYesรหัสพนักงาน (ไม่ต้อง encode Base64)
welfare_yearstringNoปีสวัสดิการ (YYYY) หากไม่ระบุจะใช้ปีปัจจุบัน

Endpoint นี้ใช้ employee_code (Plain text) ไม่ใช่ employee_id (Base64)


Response Format

Success Response

{ "code": 200, "message": "สำเร็จ", "payload": [ { "salary_type_id": "20250520073EEED41E08", "salary_type_name": "ค่ารักษาพยาบาล", "salary_type_name_en": "Medical Expense", "welfare_employee_id": "20260213WE01A2B3C4D5", "employee_id": "20260121FC89F3BB9120", "welfare_year": "2026", "welfare_prev_amt": 0, "welfare_quota_amt": 10000, "used_welfare_amt": 2500, "balance_welfare_amt": 7500 }, { "salary_type_id": "20250520073EEED41E09", "salary_type_name": "ค่าเดินทาง", "salary_type_name_en": "Travel Allowance", "welfare_employee_id": null, "employee_id": null, "welfare_year": null, "welfare_prev_amt": 0, "welfare_quota_amt": 0, "used_welfare_amt": 0, "balance_welfare_amt": 0 } ] }

Response Fields

FieldTypeDescription
codenumberรหัสสถานะ (200 = สำเร็จ)
messagestringข้อความตอบกลับ
payloadarrayรายการสวัสดิการทั้งหมด
payload[].salary_type_idstringID ประเภทสวัสดิการ (Plain text)
payload[].salary_type_namestringชื่อประเภทสวัสดิการ (TH)
payload[].salary_type_name_enstringชื่อประเภทสวัสดิการ (EN)
payload[].welfare_employee_idstringID สวัสดิการพนักงาน (null ถ้ายังไม่มีข้อมูล)
payload[].employee_idstringID ของพนักงาน (Plain text)
payload[].welfare_yearstringปีสวัสดิการ
payload[].welfare_prev_amtnumberยอดยกมา
payload[].welfare_quota_amtnumberโควตาสวัสดิการ
payload[].used_welfare_amtnumberยอดใช้ไป
payload[].balance_welfare_amtnumberยอดคงเหลือ (ยกมา + โควตา - ใช้ไป)
  • รายการจะแสดงทุกประเภทสวัสดิการ แม้พนักงานยังไม่มีข้อมูล (welfare_employee_id = null)
  • Response fields ที่ลงท้ายด้วย _id เป็น Plain text ไม่ได้ encode Base64
  • ยอดคงเหลือคำนวณจาก: welfare_prev_amt + welfare_quota_amt - used_welfare_amt

Error Response

{ "code": 400, "message": "ไม่สำเร็จ", "error": "Employee not found with code: EMP999" }

Code Examples

curl -X GET "https://openapi.humansoft.co.th/api/v1/open-apis/employee/get-employee-data-filter?path_action=list-welfare&employee_code=EMP001&welfare_year=2026" \ -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \ -H "Content-Type: application/json"

  • Get Welfare - ดึงข้อมูลสวัสดิการตาม ID
  • Add Welfare - เพิ่มสวัสดิการ
  • Save Welfare - แก้ไขสวัสดิการ
  • Delete Welfare - ลบสวัสดิการ
  • Add Welfare Log - เพิ่มบันทึกการใช้สวัสดิการ
  • Delete Welfare Log - ลบบันทึกการใช้สวัสดิการ
Last updated on