Skip to Content
🚀 Welcome to Humansoft Open API Documentation

Salary Summary

ดึงข้อมูลสรุปเงินเดือนของพนักงานในรอบเดือนที่ระบุ แสดงข้อมูลรอบเดือน ข้อมูลพนักงาน สรุปการเข้างาน รายรับ รายหัก และยอดสุทธิ โดยจัดกลุ่มเป็น logical sections

Endpoint

GET /api/v1/open-apis/salary/get-data-filter?path_action=salary_summary

สิทธิ์ที่ต้องการ: API Key ต้องมีสิทธิ์ ข้อมูลเงินเดือนของพนักงาน (payroll:read:self)

Request Parameters

Required Parameters

ParameterTypeRequiredDescriptionExample
employee_codestringYesรหัสพนักงาน"EMP001"
year_monthstringYesรอบเงินเดือน (YYYY-MM)"2026-02"

Optional Parameters

ParameterTypeDefaultDescriptionExample
language_codestring"TH"ภาษา: TH หรือ EN (case-insensitive)"TH"
master_salary_split_seqinteger-งวดแบ่งจ่าย (ถ้ามี split payroll)1

Validation Rules

RuleDescription
employee_codeต้องมีอยู่ในระบบ ถ้าไม่พบจะ return error 404
year_monthต้องเป็นรูปแบบ YYYY-MM และต้องมีรอบเดือนนั้นในระบบ
language_codeรองรับเฉพาะ TH หรือ EN
master_salary_split_seqถ้าส่งต้องตรงกับรอบแบ่งจ่ายที่มีในระบบ

ก่อนเรียก API นี้ ควรเรียก Calculate Month ก่อน เพื่อให้ข้อมูลสรุปเป็นปัจจุบัน summary ถูกต้อง และ slip มีข้อมูลครบถ้วน


Response Format

Success Response

{ "code": 200, "message": "Success", "payload": { "month": { "master_salary_report_id": "2026012683ECD0F50FDE", "master_salary_month": "2026-01", "salary_report_start_dt": "2025-12-26 00:00:00", "salary_report_end_dt": "2026-01-25 23:59:59", "day_in_month": 31, "salary_paid_dt": "", "read_only_flag": "Y", "approve_flag": "N" }, "profile": { "employee_id": "20260121FC89F3BB9120", "employee_code": "EMP001", "employee_name": "ธารวิน", "employee_last_name": "ศศิพฤกษ์กุล", "employee_name_en": "Tharawin", "employee_last_name_en": "Sasiprukkun", "position_name": null, "department_name": null, "branch_name": null, "company_name": null, "salary": "35000.00", "photograph": "images/userPlaceHolder.png", "employee_type_group_name": "พนักงานรายเดือน" }, "attendance": { "salary": { "amount": 35000, "currency": "THB" }, "wage": { "rate": 1346.15, "unit": "baht/day" }, "work_days": { "worked": 0, "in_month": 26, "unit": "days" }, "holidays": { "public": 0, "employee": 5, "extra": 0, "unit": "days" }, "work_hours": { "total": "00:00:00", "unit": "hours" }, "absence_days": 0, "adjustments": [], "overtime": [], "bonus_days": { "days": 0, "amount": 0 }, "time_leaves": [ { "type": "09", "label_th": "ขาดงาน", "label_en": "Absence", "days": 26, "time": "234:00:00", "time_minutes": 14040, "amount": 35000 } ] }, "summary": { "time_calc_total": 35000, "total_income": 16300, "total_expense": 5610.21, "income_expense_net": 10689.79, "salary_received": 45689.79, "advance_pay": 0, "remaining": 45689.79 }, "income": { "basic_salary": 35000, "total_income": 16300, "items": [ { "salary_type_id": "2024122573DDE87AC498", "salary_type_code": "ST0014", "salary_cal_type_lv": "Income", "salary_type_name": "Incentive", "amount": 2000 }, { "salary_type_id": "20241225371C0AF063F6", "salary_type_code": "ST0012", "salary_cal_type_lv": "Income", "salary_type_name": "โบนัส", "amount": 8000 } ] }, "deduction": { "social_insurance": 875, "income_tax": 385.21, "provident_fund": 1050, "total_deduction": 5610.21, "items": [ { "salary_type_id": "20241225FAFD1530CD17", "salary_type_code": "social_insurance", "salary_cal_type_lv": "Auto", "salary_type_name": "ประกันสังคม", "amount": 875 }, { "salary_type_id": "20241225C60004B3A765", "salary_type_code": "tax", "salary_cal_type_lv": "Auto", "salary_type_name": "ภาษี", "amount": 385.21 } ] }, "expense": { "total_net": 45689.79, "advance_pay": 0, "remaining": 45689.79 } } }

Response Sections

SectionTypeDescription
monthobjectข้อมูลรอบเงินเดือน
profileobjectข้อมูลพนักงาน
attendanceobjectสรุปการเข้างานแบบละเอียด
summaryobjectผลการคำนวณสุทธิ
incomeobjectเงินเดือน + รายการรายรับ
deductionobjectรายหัก/ภาษี/กองทุน + รายการรายหัก
expenseobjectยอดสุทธิ/เบิกล่วงหน้า/คงเหลือ

Key Response Fields - month

FieldTypeNullableDescription
master_salary_report_idstringNoรหัสรอบเงินเดือน
master_salary_monthstringNoรอบเดือน (YYYY-MM)
salary_report_start_dtstringNoวันที่เริ่มต้นรอบ (YYYY-MM-DD HH:mm:ss)
salary_report_end_dtstringNoวันที่สิ้นสุดรอบ (YYYY-MM-DD HH:mm:ss)
day_in_monthintegerNoจำนวนวันในรอบ
salary_paid_dtstringYesวันที่จ่ายเงิน
read_only_flagstringNoสถานะปิดรอบ: "Y" (ปิดแล้ว), "N" (เปิดอยู่)
approve_flagstringNoสถานะอนุมัติ: "Y" (อนุมัติแล้ว), "N" (ยังไม่อนุมัติ)
master_salary_split_report_idstringYesรหัสรอบแบ่งจ่าย (ถ้ามี split)
master_salary_split_seqintegerYesงวดแบ่งจ่าย (ถ้ามี split)
split_divideintegerYesจำนวนงวดที่แบ่ง (ถ้ามี split)

Key Response Fields - profile

FieldTypeDescription
employee_idstringรหัสพนักงาน (internal)
employee_codestringรหัสพนักงาน
employee_namestringชื่อพนักงาน (TH)
employee_last_namestringนามสกุล (TH)
employee_name_enstringชื่อพนักงาน (EN)
employee_last_name_enstringนามสกุล (EN)
position_namestringชื่อตำแหน่ง
department_namestringชื่อแผนก
branch_namestringชื่อสาขา
company_namestringชื่อบริษัท
salarystringเงินเดือน
photographstringURL รูปโปรไฟล์
employee_type_group_namestringประเภทพนักงาน (เช่น “พนักงานรายเดือน”)

Key Response Fields - attendance

FieldTypeDescription
salaryobjectเงินเดือน (amount, currency)
wageobjectอัตราค่าแรง (rate, unit: baht/day หรือ baht/hour)
work_daysobjectวันทำงาน (worked, in_month, unit)
holidaysobjectวันหยุด (public, employee, extra, unit)
work_hoursobjectชั่วโมงทำงาน (total HH:MM:SS, unit)
absence_daysnumberจำนวนวันขาดงาน
adjustments[]arrayรายการปรับเวลา (เช่น morning, late, lunch_over, lunch_under, early, after)
overtime[]arrayรายการ OT (ot_1_0 - ot_3_0 ปกติ และ ot_4_0 - ot_7_0 วันหยุด)
bonus_daysobjectโบนัสวัน (days, amount)
time_leaves[]arrayรายการลา/ขาดงาน (รหัส 01-09)

attendance.adjustments[] / attendance.overtime[]

FieldTypeDescription
typestringรหัสประเภท (เช่น morning, late, ot_1_0)
label_thstringชื่อภาษาไทย
label_enstringชื่อภาษาอังกฤษ
timestringเวลา (HH:MM:SS)
time_minutesintegerเวลาเป็นนาที
amountnumberจำนวนเงิน (ถ้ามี)
daysnumberจำนวนวัน (เฉพาะบางประเภท เช่น late)

attendance.time_leaves[]

FieldTypeDescription
typestringรหัสประเภทลา (01-09)
label_thstringชื่อภาษาไทย
label_enstringชื่อภาษาอังกฤษ
daysnumberจำนวนวัน
timestringรวมเวลา (HH:MM:SS)
time_minutesintegerรวมเวลาเป็นนาที
amountnumberจำนวนเงิน

Key Response Fields - summary

FieldTypeDescription
time_calc_totalnumberรวมการคำนวณเวลา (เงินเดือน + work cycle)
total_incomenumberรวมรายรับทั้งหมด (sync จาก income.total_income)
total_expensenumberรวมรายจ่ายทั้งหมด (sync จาก deduction.total_deduction)
income_expense_netnumberรายรับ - รายจ่าย
salary_receivednumberเงินเดือนที่ได้รับ (time_calc_total + income_expense_net)
advance_paynumberรวมเบิกล่วงหน้า
remainingnumberคงเหลือสุทธิ (salary_received - advance_pay)

Key Response Fields - income

FieldTypeDescription
basic_salarynumberเงินเดือน
total_incomenumberรวมรายรับ
items[]arrayรายการรายรับ dynamic

income.items[]

FieldTypeDescription
salary_type_idstringรหัสประเภทเงินเดือน
salary_type_codestringรหัส item (เช่น ST0014)
salary_cal_type_lvstringประเภทการคำนวณ (Income, Constant, Welfare, Auto)
salary_type_namestringชื่อแสดง
amountnumberจำนวนเงิน

Key Response Fields - deduction

FieldTypeDescription
social_insurancenumberประกันสังคม
income_taxnumberภาษีหัก ณ ที่จ่าย
provident_fundnumberกองทุนสำรองเลี้ยงชีพ
total_deductionnumberรวมรายหักทั้งหมด
items[]arrayรายการรายหัก dynamic

deduction.items[]

FieldTypeDescription
salary_type_idstringรหัสประเภทเงินเดือน
salary_type_codestringรหัส item (เช่น ST0005, tax, provident)
salary_cal_type_lvstringประเภทการคำนวณ (Expense, Fund, Loan, Auto, Constant)
salary_type_namestringชื่อแสดง
amountnumberจำนวนเงิน

Key Response Fields - expense

FieldTypeDescription
total_netnumberยอดสุทธิ
advance_paynumberเบิกล่วงหน้า
remainingnumberคงเหลือหลังหักเบิกล่วงหน้า

Error Response

{ "code": 404, "message": "Employee not found with code: EMP001" }
HTTP StatusDescription
400พารามิเตอร์ไม่ถูกต้อง เช่น year_month ผิดรูปแบบ หรือไม่ได้ส่ง parameters ที่จำเป็น
401API Key ไม่ถูกต้องหรือไม่ได้ส่ง
404ไม่พบพนักงาน, ไม่พบรอบเดือน หรือไม่พบรอบแบ่งจ่ายที่ระบุ

Code Examples

# ดูสรุปเงินเดือนรอบปกติ curl -X GET "https://openapi.humansoft.co.th/api/v1/open-apis/salary/get-data-filter?path_action=salary_summary&employee_code=EMP001&year_month=2026-02&language_code=TH" \ -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" # ดูสรุปงวดแบ่งจ่าย (split payroll) curl -X GET "https://openapi.humansoft.co.th/api/v1/open-apis/salary/get-data-filter?path_action=salary_summary&employee_code=EMP001&year_month=2026-02&master_salary_split_seq=1&language_code=TH" \ -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY"

Notes

  • API นี้ส่งข้อมูลเบากว่า daily_in_month เพราะส่งเฉพาะ section ที่จำเป็นสำหรับมุมมองสรุป
  • เหมาะสำหรับ Dashboard, Mobile app หรือ Summary view ที่ต้องการข้อมูลเบา
  • รองรับ split payroll ผ่าน master_salary_split_seq เพื่อดูสรุปแยกตามงวดแบ่งจ่าย
  • ค่า summary จะ sync อัตโนมัติกับ income.total_income และ deduction.total_deduction

  • Daily In Month - ดูข้อมูลเต็มรวมตารางเวลารายวัน
  • Calculate Month - คำนวณเงินเดือน ควรเรียกก่อน salary_summary
  • Slip Normal - ดูสลิปเงินเดือนแบบ PDF
  • Current Month - ดูรอบเดือนปัจจุบัน เพื่อหา year_month
Last updated on