Get Organization Settings Summary
ดึงสรุปการตั้งค่าทั้งองค์กรของรอบเงินเดือนที่ระบุ ครอบคลุม 4 หมวด ได้แก่ ตั้งค่าทั่วไป ตั้งค่าเวลาการทำงาน ตั้งค่าประเภทการลา/ขาดงาน และตั้งค่าประเภทรายรับรายจ่าย เลือกดึงทั้งหมดหรือเฉพาะหมวดที่ต้องการได้
Endpoint
GET /api/v1/open-apis/salary/get-data-filter?path_action=get_organization_settings_summaryสิทธิ์ที่ต้องการ: API Key ต้องมีสิทธิ์ ข้อมูลเงินเดือนทั้งองค์กร (payroll:read:all)
Request Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
path_action | string | Yes | ระบุเป็น get_organization_settings_summary | "get_organization_settings_summary" |
year_month | string | Yes | รอบเงินเดือนที่ต้องการดู รูปแบบ YYYY-MM | "2026-10" |
section | string | No | หมวดที่ต้องการ (ค่าเริ่มต้น: all) ดูตารางด้านล่าง | "common" |
language_code | string | No | ภาษาของข้อความอธิบายและชื่อประเภท: TH หรือ EN (ค่าเริ่มต้น: TH) | "EN" |
ค่าของ section
| ค่า | หมวดที่ได้รับใน payload |
|---|---|
all | ครบทั้ง 4 หมวด |
common | common_settings — ตั้งค่าทั่วไป |
work_time | work_time_settings — ตั้งค่าเวลาการทำงาน |
leave_type | leave_type_settings — ตั้งค่าประเภทการลา/ขาดงาน |
salary_type | salary_type_settings — ตั้งค่าประเภทรายรับรายจ่าย |
section และ language_code ไม่แยกตัวพิมพ์เล็ก-ใหญ่
ข้อมูลตามรอบเงินเดือน (Snapshot)
ผลลัพธ์ขึ้นกับว่าเดือนใน year_month มีรอบเงินเดือนในระบบแล้วหรือยัง
is_snapshot | ความหมาย |
|---|---|
true | มีรอบเงินเดือนของเดือนนี้แล้ว ระบบใช้ชุดการตั้งค่าที่บันทึกไว้กับรอบนั้น และส่งข้อมูลรอบ (salary_report_id, salary_report_start_dt, salary_report_end_dt, salary_split_flag) กลับมาด้วย |
false | ยังไม่มีรอบเงินเดือนของเดือนนี้ ระบบใช้การตั้งค่าปัจจุบันขององค์กร และไม่ส่ง field ข้อมูลรอบกลับมา |
- รอบเงินเดือนมีอยู่ตั้งแต่เปิดรอบ ไม่จำเป็นต้องปิดงวดก่อน
is_snapshotจึงเป็นtrueได้ทั้งรอบที่เปิดอยู่และรอบที่ปิดแล้ว - ชุดการตั้งค่าของรอบจะอัปเดตเมื่อมีการคำนวณเงินเดือนรอบนั้นใหม่ หากแก้ไขการตั้งค่าหลังการคำนวณครั้งล่าสุด จะยังได้ชุดเดิมจนกว่าจะคำนวณรอบนั้นอีกครั้ง
- หมวดใดที่รอบนั้นไม่มีการตั้งค่าบันทึกไว้ ระบบจะใช้การตั้งค่าปัจจุบันแทน แม้
is_snapshotเป็นtrue - การตั้งค่าทั่วไปบางรายการที่ไม่ได้บันทึกไว้กับรอบ (เช่น รอบที่สร้างก่อนมีการตั้งค่านั้น) จะเป็นค่าเริ่มต้นของระบบ
- ตารางโควตาตามอายุงาน (
quota_tiers) เป็นการตั้งค่าปัจจุบันเสมอ
Response Format
Success Response
ตัวอย่างเมื่อเรียก section=all สำหรับเดือนที่มีรอบเงินเดือนแล้ว (แสดงบางรายการในแต่ละหมวด)
{
"code": 200,
"message": "Success",
"payload": {
"year_month": "2026-10",
"is_snapshot": true,
"salary_report_id": "20251127D4573C421639",
"salary_report_start_dt": "2026-09-26 00:00:00",
"salary_report_end_dt": "2026-10-25 23:59:59",
"salary_split_flag": "N",
"common_settings": {
"salary_calculation": {
"payroll_round": {
"start_day": "26",
"end_day": "25"
},
"split_round": {
"split_round_code": "A",
"split_count": 1,
"split_mode": "Auto",
"rounds": [],
"split_calculate_type": "A",
"split_calculate_type_text": "งวดสุดท้าย = งวดเต็ม - ผลรวมของงวดแยกก่อนหน้า"
},
"days_per_month": "30",
"hours_per_day": "08:00",
"ot_block": true,
"decimal_rounding": false,
"daily_employee_paid_holiday": false,
"social_insurance": {
"employee_rate": 5,
"company_rate": 5
}
},
"leave_quota": {
"hours_per_day_quota": "08:00"
},
"attendance_recording": {
"duplicate_punch_prevent_minutes": 1,
"scans_per_day_policy": "2",
"scans_per_day_policy_text": "สแกนนิ้ว 2 ครั้ง/วัน",
"incomplete_scan_penalty": "half",
"incomplete_scan_penalty_text": "ตัดขาดงาน ครึ่งวัน"
},
"other": {
"days_per_month_for_inout": null,
"days_per_month_for_adjust": null,
"show_absence_on_holiday": true,
"document_cut_off": {
"enabled": false,
"rules": {
"time_leave": { "active": false, "cutoff_day": 1, "period_type": "Full" },
"time_adjust": { "active": false, "cutoff_day": 1, "period_type": "Full" },
"overtime": { "active": false, "cutoff_day": 1, "period_type": "Full" },
"holiday_change": { "active": false, "cutoff_day": 1, "period_type": "Full" },
"work_cycle_change": { "active": false, "cutoff_day": 1, "period_type": "Full" },
"prevent_change_holiday": { "active": false, "cutoff_day": 1, "scope": "All" },
"prevent_change_work_cycle": { "active": false, "cutoff_day": 1, "scope": "All" },
"prevent_change_tax_deduction": { "active": false }
}
},
"document_request_quotas": {
"enabled": true,
"quotas": {
"time_leave": { "active": false, "limit": 1 },
"time_adjust": { "active": true, "limit": 2 },
"overtime": { "active": false, "limit": 1 },
"holiday_change": { "active": false, "limit": 1 },
"work_cycle_change": { "active": false, "limit": 1 },
"salary_certificate": { "active": false, "limit": 1 },
"work_certificate": { "active": false, "limit": 1 },
"visa_certificate": { "active": false, "limit": 1 },
"welfare": { "active": false, "limit": 1 },
"emp_withdraw": { "active": false, "limit": 1 },
"petty_cash": { "active": false, "limit": 1 }
}
},
"organization_labels": {
"company": { "th": "บริษัท", "en": "Company" },
"branch": { "th": "สำนักงานสาขา", "en": "Branch" },
"department": { "th": "แผนก", "en": "Department" },
"division": { "th": "ฝ่ายงาน", "en": "Division" },
"section": { "th": "หน่วยงาน", "en": "Section" },
"section_lv01": { "th": "", "en": "" },
"section_lv02": { "th": "", "en": "" },
"section_lv03": { "th": "", "en": "" },
"section_lv04": { "th": "", "en": "" },
"section_lv05": { "th": "", "en": "" }
}
}
},
"work_time_settings": {
"receive": [
{
"type_code": "morning",
"type_name": "มาเช้า",
"rules": [
{
"employee_type": "EMP_MONTHLY",
"employee_type_text": "พนักงานรายเดือน",
"action_active": true,
"calculation_method": "A",
"calculation_method_text": "ตามเรทค่าแรง",
"calculation_value": 1,
"tax_include": true,
"sso_include": true,
"provident_include": false,
"emp_welfare_fund_include": false,
"round_decimal_type": "N"
}
]
}
],
"deduct": [
{
"type_code": "late",
"type_name": "สาย",
"rules": [
{
"employee_type": "EMP_MONTHLY",
"employee_type_text": "พนักงานรายเดือน",
"action_active": true,
"calculation_method": "B",
"calculation_method_text": "เป็นนาที (2 บาท/นาที)",
"calculation_value": 2,
"tax_include": true,
"sso_include": true,
"provident_include": false,
"emp_welfare_fund_include": false,
"round_decimal_type": "N"
}
]
}
],
"overtime": [
{
"ot_code": "OT_1_5",
"ot_multiplier": 1.5,
"ot_name": "โอที 1.5 เท่า",
"use_with": {
"day_type": "A",
"day_type_text": "วันทำงาน",
"time_period": "B",
"time_period_text": "นอกเวลากะ"
},
"lunch_include": true,
"request_rule": {
"type": "A",
"days": 1,
"text": "ขอล่วงหน้า 1 วัน"
},
"rules": [
{
"employee_type": "EMP_MONTHLY",
"employee_type_text": "พนักงานรายเดือน",
"calculation_method": "A",
"calculation_value": 1.5,
"max_ot_hours": 8,
"decimal_rounding": "1",
"tax_include": true,
"sso_include": true,
"provident_include": false,
"emp_welfare_fund_include": false
}
]
}
]
},
"leave_type_settings": [
{
"leave_type_id": "20241225A1B2C3D4E5F6",
"leave_flag_code": "03",
"leave_type_name": "ลาป่วยมีใบรับรองแพทย์",
"time_unit": "Daily",
"time_unit_text": "วัน",
"calculate_type": "A",
"calculate_type_text": "ตามขั้นบันได",
"gender_restriction": "A",
"work_age_count": "B",
"request_rules": {
"day_max": 30
},
"deduction_rules": {
"monthly": {
"tax_include": true,
"sso_include": true,
"provident_include": false,
"emp_welfare_fund_include": false
},
"daily": {
"tax_include": true,
"sso_include": true,
"provident_include": false,
"emp_welfare_fund_include": false
},
"contractor": {
"tax_include": false,
"sso_include": false,
"provident_include": false,
"emp_welfare_fund_include": false
}
},
"quota_tiers": {
"monthly": [
{ "worked_month": 0, "quota": "30 วัน", "quota_value": 30 }
],
"daily": [
{ "worked_month": 0, "quota": "30 วัน", "quota_value": 30 }
],
"contractor": []
}
}
],
"salary_type_settings": {
"income": [
{
"salary_type_id": "20250101AAAA11112222",
"salary_group_id": "20250101BBBB33334444",
"salary_type_code": "ST0001",
"salary_type_name": "คอมมิชชั่น",
"salary_type_name_en": "Commission",
"calculate_method": "Income",
"tax_type": "1",
"round_decimal": false,
"order_no": 1,
"tax_include": true,
"sso_include": true,
"social_insurance_include": true,
"provident_include": false,
"emp_welfare_fund_include": false,
"tax_resign_include": true,
"bank_link": {
"bank_id": "0",
"bank_name": "ไม่ผูกบัญชี"
}
}
],
"expense": [
{
"salary_type_id": "20250101CCCC55556666",
"salary_group_id": null,
"salary_type_code": "employee_welfare_fund",
"salary_type_name": "กองทุนสงเคราะห์ลูกจ้าง",
"salary_type_name_en": "Employee Welfare Fund",
"calculate_method": "Fund",
"tax_type": "1",
"round_decimal": false,
"order_no": 2,
"tax_include": false,
"sso_include": false,
"social_insurance_include": false,
"provident_include": false,
"emp_welfare_fund_include": false,
"tax_resign_include": false,
"bank_link": {
"bank_id": "4",
"bank_name": "KBANK"
},
"fund_data": {
"fund_id": "20250101DDDD77778888",
"salary_type_id": "20250101CCCC55556666",
"fund_code": "FD0001",
"fund_name": "กองทุนสงเคราะห์ลูกจ้าง",
"fund_desc": null,
"fund_balance": "125000.00",
"bank_id": "4",
"order_no": "1"
}
}
]
}
}
}เมื่อเรียกเฉพาะหมวด (เช่น section=common) payload จะมีเฉพาะ field ข้อมูลรอบและหมวดนั้น
Response Fields
ข้อมูลรอบ
| Field | Type | Description |
|---|---|---|
year_month | string | รอบเดือนที่ขอ (YYYY-MM) |
is_snapshot | boolean | true = ใช้การตั้งค่าที่บันทึกไว้กับรอบเงินเดือน, false = ใช้การตั้งค่าปัจจุบัน (ดูหัวข้อข้อมูลตามรอบเงินเดือนด้านบน) |
salary_report_id | string | รหัสรอบเงินเดือน (มีเฉพาะเมื่อ is_snapshot เป็น true) |
salary_report_start_dt | string | วันเวลาเริ่มรอบ (YYYY-MM-DD HH:mm:ss) (มีเฉพาะเมื่อ is_snapshot เป็น true) |
salary_report_end_dt | string | วันเวลาสิ้นสุดรอบ (YYYY-MM-DD HH:mm:ss) (มีเฉพาะเมื่อ is_snapshot เป็น true) |
salary_split_flag | string | การแบ่งงวดของรอบนี้: "Y" = แบ่งงวด, "N" = ไม่แบ่ง (มีเฉพาะเมื่อ is_snapshot เป็น true) |
common_settings | object | ตั้งค่าทั่วไป (เมื่อ section เป็น all หรือ common) |
work_time_settings | object | ตั้งค่าเวลาการทำงาน (เมื่อ section เป็น all หรือ work_time) |
leave_type_settings | array | ตั้งค่าประเภทการลา/ขาดงาน (เมื่อ section เป็น all หรือ leave_type) |
salary_type_settings | object | ตั้งค่าประเภทรายรับรายจ่าย (เมื่อ section เป็น all หรือ salary_type) |
common_settings
| Field | Type | Description |
|---|---|---|
salary_calculation.payroll_round.start_day | string | วันเริ่มรอบเงินเดือน เช่น "26" |
salary_calculation.payroll_round.end_day | string | วันสิ้นสุดรอบเงินเดือน เช่น "25" — "EOM" = สิ้นเดือน (รอบตรงกับเดือนปฏิทิน) |
salary_calculation.split_round.split_round_code | string | รูปแบบการแบ่งงวด: "A" = 1 งวด, "B" = 2 งวด, "C" = 3 งวด, "D" = 4 งวด |
salary_calculation.split_round.split_count | integer | จำนวนงวด (1–4) |
salary_calculation.split_round.split_mode | string | "Auto" = ตัดงวดอัตโนมัติ, "Fixed" = กำหนดวันตัดงวดเอง |
salary_calculation.split_round.rounds | array | ช่วงวันของแต่ละงวด — เป็น array ว่างเมื่อ split_mode เป็น "Auto" หรือไม่ได้แบ่งงวด |
salary_calculation.split_round.rounds[].seq | integer | ลำดับงวด เริ่มที่ 0 |
salary_calculation.split_round.rounds[].start_day | string | วันเริ่มของงวด |
salary_calculation.split_round.rounds[].end_day | string | วันสิ้นสุดของงวด |
salary_calculation.split_round.rounds[].label | string | ช่วงวันของงวด เช่น "26-10" |
salary_calculation.split_round.split_calculate_type | string | วิธีคำนวณยอดงวดแบ่งจ่าย: "A" = งวดสุดท้ายเท่ากับงวดเต็มหักผลรวมงวดก่อนหน้า, "B" = งวดเต็มเท่ากับผลรวมของงวดแยก |
salary_calculation.split_round.split_calculate_type_text | string | คำอธิบาย split_calculate_type ตาม language_code |
salary_calculation.days_per_month | string | จำนวนวันต่อเดือนที่ใช้คำนวณเงินเดือน เช่น "30" — เป็นค่าว่าง ("") หรือ "Real" เมื่อไม่ได้กำหนดค่าตายตัว |
salary_calculation.hours_per_day | string | จำนวนชั่วโมงทำงานต่อวัน เช่น "08:00" — เป็นค่าว่าง ("") หรือ "Real" เมื่อไม่ได้กำหนดค่าตายตัว |
salary_calculation.ot_block | boolean | true = ไม่คิดค่าล่วงเวลาให้วันที่ไม่มีเอกสารขอทำงานล่วงเวลารองรับ |
salary_calculation.decimal_rounding | boolean | true = ปัดยอดเงินเป็นจำนวนเต็ม, false = ทศนิยม 2 ตำแหน่ง |
salary_calculation.daily_employee_paid_holiday | boolean | true = จ่ายค่าจ้างวันหยุดนักขัตฤกษ์ให้พนักงานรายวัน |
salary_calculation.social_insurance.employee_rate | number | อัตราเงินสมทบประกันสังคมฝ่ายลูกจ้าง (%) |
salary_calculation.social_insurance.company_rate | number | อัตราเงินสมทบประกันสังคมฝ่ายนายจ้าง (%) |
leave_quota.hours_per_day_quota | string | จำนวนชั่วโมงต่อ 1 วันที่ใช้คำนวณโควตาการลา เช่น "08:00" |
attendance_recording.duplicate_punch_prevent_minutes | integer | ช่วงเวลา (นาที) ที่ถือว่าเป็นการลงเวลาซ้ำ |
attendance_recording.scans_per_day_policy | string | จำนวนครั้งการลงเวลาต่อวัน: "2" = 2 ครั้ง/วัน, "4" = อย่างน้อย 4 ครั้ง/วัน, "N" = มากกว่า 2 ครั้ง/วัน |
attendance_recording.scans_per_day_policy_text | string | ข้อความอธิบายที่ระบบส่งกลับตาม language_code |
attendance_recording.incomplete_scan_penalty | string | การตัดขาดงานเมื่อลงเวลาไม่ครบคู่: "half" = ครึ่งวัน, "full" = เต็มวัน |
attendance_recording.incomplete_scan_penalty_text | string | คำอธิบาย incomplete_scan_penalty ตาม language_code |
other.days_per_month_for_inout | string | null | ตัวเลือกจำนวนวันต่อเดือนกรณีพนักงานเริ่มงานหรือลาออกระหว่างรอบ: "26" / "30" = ใช้จำนวนวันตามค่านั้น, "193" = ใช้ฐาน 30 วัน (รูปแบบเฉพาะของระบบ), null หรือค่าอื่น = ตามจำนวนวันจริงของรอบ |
other.days_per_month_for_adjust | string | null | ตัวเลือกจำนวนวันต่อเดือนกรณีปรับเงินเดือนระหว่างรอบ: "26" / "30" = ใช้จำนวนวันตามค่านั้น, "30-1" = ใช้ฐาน 30 วัน (รูปแบบเฉพาะของระบบ), null หรือค่าอื่น = ตามจำนวนวันจริงของรอบ |
other.show_absence_on_holiday | boolean | true = แจ้งการลงเวลาไม่ครบคู่ในวันหยุดด้วย |
other.document_cut_off.enabled | boolean | สถานะรวมของการตั้งค่าการตัดรอบ — การบังคับใช้กับเอกสารแต่ละประเภทให้ดูที่ rules.*.active |
other.document_cut_off.rules | object | การตัดรอบแยกตามประเภทเอกสาร: time_leave, time_adjust, overtime, holiday_change, work_cycle_change (มี active, cutoff_day, period_type), prevent_change_holiday, prevent_change_work_cycle (มี active, cutoff_day, scope) และ prevent_change_tax_deduction (มีเฉพาะ active) |
other.document_cut_off.rules.*.active | boolean | เปิดใช้การตัดรอบกับเอกสารประเภทนั้น |
other.document_cut_off.rules.*.cutoff_day | integer | จำนวนวันหลังสิ้นรอบเงินเดือนที่ยังยื่นเอกสารได้ |
other.document_cut_off.rules.*.period_type | string | ประเภทรอบเงินเดือนที่ใช้กฎนี้: "Full" = รอบเต็ม, "Split" = รอบแบ่งงวด, "All" = ทั้งสองแบบ |
other.document_cut_off.rules.*.scope | string | ประเภทรอบเงินเดือนที่ใช้กฎนี้ ค่าเหมือน period_type |
other.document_request_quotas.enabled | boolean | สถานะรวมของการจำกัดจำนวนการยื่นเอกสาร — การบังคับใช้กับเอกสารแต่ละประเภทให้ดูที่ quotas.*.active |
other.document_request_quotas.quotas | object | การจำกัดแยกตามเอกสาร 11 ประเภท: time_leave, time_adjust, overtime, holiday_change, work_cycle_change, salary_certificate, work_certificate, visa_certificate, welfare, emp_withdraw, petty_cash |
other.document_request_quotas.quotas.*.active | boolean | เปิดใช้การจำกัดกับเอกสารประเภทนั้น |
other.document_request_quotas.quotas.*.limit | integer | จำนวนครั้งที่ยื่นได้ต่อรอบเงินเดือน |
other.organization_labels | object | ชื่อเรียกระดับโครงสร้างองค์กร: company, branch, department, division, section, section_lv01–section_lv05 แต่ละตัวมี th และ en เสมอ ไม่ขึ้นกับ language_code (อาจเป็นค่าว่าง) |
work_time_settings
| Field | Type | Description |
|---|---|---|
receive | array | กฎการได้เงินจากเวลาทำงาน: morning (มาเช้า), underlunch (พักไว), after (กลับช้า) |
deduct | array | กฎการหักเงินจากเวลาทำงาน: late (สาย), overlunch (พักเกิน), early (กลับก่อน) |
overtime | array | กฎค่าล่วงเวลา OT_1_0, OT_1_5, OT_2_0 ถึง OT_7_0 |
receive และ deduct แสดงเฉพาะประเภทที่เปิดใช้กับพนักงานรายเดือนหรือรายวัน ส่วน overtime แสดงเฉพาะประเภทที่เปิดใช้กับพนักงานอย่างน้อย 1 กลุ่ม หากไม่มีการตั้งค่าจะได้ array ว่าง
รายการใน receive และ deduct
| Field | Type | Description |
|---|---|---|
type_code | string | รหัสประเภท เช่น "morning", "late" |
type_name | string | ชื่อที่องค์กรตั้งไว้ — เมื่อ language_code เป็น EN ใช้ชื่อภาษาอังกฤษถ้าตั้งไว้ ไม่เช่นนั้นใช้ชื่อภาษาไทยที่องค์กรตั้ง และถ้าไม่ได้ตั้งชื่อเลยจะใช้ชื่อมาตรฐานของระบบ |
rules | array | กฎแยกตามกลุ่มพนักงาน (มีเฉพาะรายเดือนและรายวัน) |
rules[].employee_type | string | "EMP_MONTHLY" = พนักงานรายเดือน, "EMP_DAILY" = พนักงานรายวัน |
rules[].employee_type_text | string | ชื่อกลุ่มพนักงานตาม language_code |
rules[].action_active | boolean | true = มีการตั้งค่าเกณฑ์การได้เงิน/หักเงินไว้ |
rules[].calculation_method | string | "A" = ตามอัตราค่าแรง, "B" = อัตราบาทต่อนาที, ค่าอื่น = ตามสูตรคำนวณ |
rules[].calculation_method_text | string | คำอธิบายวิธีคำนวณตาม language_code (กรณี "B" จะระบุบาทต่อนาทีด้วย) |
rules[].calculation_value | number | กรณี "A" = ตัวคูณของอัตราค่าแรง, กรณี "B" = บาทต่อนาที, วิธีตามสูตรคำนวณจะเป็น 0 |
rules[].tax_include | boolean | นำยอดเงินไปคำนวณภาษี |
rules[].sso_include | boolean | นำยอดเงินไปคำนวณประกันสังคม |
rules[].provident_include | boolean | นำยอดเงินไปคำนวณกองทุนสำรองเลี้ยงชีพ |
rules[].emp_welfare_fund_include | boolean | นำยอดเงินไปคำนวณกองทุนสงเคราะห์ลูกจ้าง |
rules[].round_decimal_type | string | "Y" = ปัดยอดเงินเป็นจำนวนเต็ม, ค่าอื่น = ทศนิยม 2 ตำแหน่ง |
รายการใน overtime
| Field | Type | Description |
|---|---|---|
ot_code | string | รหัสโอที เช่น "OT_1_5" |
ot_multiplier | number | ตัวคูณโอที เช่น 1.5 |
ot_name | string | ชื่อที่องค์กรตั้งไว้ — เมื่อ language_code เป็น EN ใช้ชื่อภาษาอังกฤษถ้าตั้งไว้ ไม่เช่นนั้นใช้ชื่อภาษาไทยที่องค์กรตั้ง และถ้าไม่ได้ตั้งชื่อเลยจะใช้ชื่อมาตรฐานของระบบ เช่น "โอที 1.5 เท่า" |
use_with.day_type | string | วันที่ใช้: "A" = วันทำงาน, "B" = วันหยุด, "C" = วันทำงานและวันหยุด |
use_with.day_type_text | string | คำอธิบาย day_type ตาม language_code |
use_with.time_period | string | ช่วงเวลา: "A" = ในเวลากะ, "B" = นอกเวลากะ, "C" = ในและนอกเวลากะ — เมื่อ day_type เป็น "A" จะเป็น "B" เสมอ |
use_with.time_period_text | string | คำอธิบาย time_period ตาม language_code |
lunch_include | boolean | true = นับรวมเวลาพักกลางวัน — เมื่อ day_type เป็น "A" จะเป็น true เสมอ |
request_rule.type | string | "A" = ต้องขอล่วงหน้า, "B" = ขอย้อนหลังได้, "C" = ไม่กำหนด |
request_rule.days | integer | จำนวนวันของกฎการขอ |
request_rule.text | string | คำอธิบายกฎตาม language_code เช่น "ขอล่วงหน้า 1 วัน" ("ไม่กำหนด" เมื่อ type ไม่ใช่ "A" หรือ "B" หรือ days เป็น 0) |
rules | array | กฎแยกตามกลุ่มพนักงาน: EMP_MONTHLY, EMP_DAILY, EMP_PARTTIME (พาร์ตไทม์), EMP_CONTRACTOR (เหมาจ่าย) |
rules[].employee_type | string | รหัสกลุ่มพนักงาน |
rules[].employee_type_text | string | ชื่อกลุ่มพนักงานตาม language_code |
rules[].calculation_method | string | วิธีคำนวณค่าโอที: "A" = อัตราค่าแรง × calculation_value, "B" = บาทต่อนาที, "C" = ตามสูตรคำนวณ, "D" = แปลงเวลาโอทีเป็นวันหยุด |
rules[].calculation_value | number | ค่าที่ใช้คำนวณ เช่น 1.5 |
rules[].max_ot_hours | integer | null | ชั่วโมงโอทีสูงสุดที่ตั้งไว้ (null = ไม่ได้กำหนด ระบบจะจำกัดตามชั่วโมงทำงานของกะ) |
rules[].decimal_rounding | string | การปัดเศษเวลาโอที: "1" = ปัดลง 30 นาที, "2" = ปัดลง 1 ชั่วโมง, "3" = ปัดลง 10 นาที, "4" = ปัดลง 15 นาที, "5" = ปัดลง 20 นาที, ค่าอื่น = ไม่ปัด |
rules[].tax_include | boolean | นำค่าโอทีไปคำนวณภาษี |
rules[].sso_include | boolean | นำค่าโอทีไปคำนวณประกันสังคม |
rules[].provident_include | boolean | นำค่าโอทีไปคำนวณกองทุนสำรองเลี้ยงชีพ |
rules[].emp_welfare_fund_include | boolean | นำค่าโอทีไปคำนวณกองทุนสงเคราะห์ลูกจ้าง |
leave_type_settings
แสดงเฉพาะประเภทการลาที่เปิดใช้งาน หากไม่มีจะได้ array ว่าง
| Field | Type | Description |
|---|---|---|
leave_type_id | string | รหัสประเภทการลา |
leave_flag_code | string | รหัสประเภทการลา — "01"–"09" เป็นประเภทมาตรฐานของระบบ เช่น "03" = ลาป่วย, "06" = ลาพักร้อน, "09" = ขาดงาน ส่วนประเภทที่องค์กรเพิ่มเองจะมีรหัสอื่น เช่น "10" |
leave_type_name | string | ชื่อประเภทการลา (เมื่อ language_code เป็น EN จะใช้ชื่อภาษาอังกฤษ ถ้าตั้งไว้) |
time_unit | string | หน่วยการลา: "Daily" = วัน, "Hour" = ชั่วโมง |
time_unit_text | string | ชื่อหน่วยตาม language_code |
calculate_type | string | วิธีกำหนดโควตา: "A" = ตามขั้นบันไดอายุงาน (quota_tiers), "B" = สูตรคำนวณพิเศษ |
calculate_type_text | string | คำอธิบาย calculate_type ตาม language_code |
gender_restriction | string | เพศที่ใช้สิทธิ์ได้: "A" = ทุกเพศ, "M" = ชาย, "F" = หญิง, "N" = ไม่ระบุเพศ หรือค่าผสมของ M, F, N เช่น "MF" |
work_age_count | string | จุดเริ่มนับอายุงานสำหรับโควตา: "E" = นับจากวันที่เริ่มงาน, ค่าอื่น = นับจากวันที่บรรจุ |
request_rules.day_max | integer | จำนวนวันลาติดต่อกันสูงสุด |
deduction_rules.monthly | object | การนำไปคำนวณภาษีและกองทุนของพนักงานรายเดือน: tax_include, sso_include, provident_include, emp_welfare_fund_include (boolean) |
deduction_rules.daily | object | เหมือน monthly สำหรับพนักงานรายวัน |
deduction_rules.contractor | object | เหมือน monthly สำหรับพนักงานเหมาจ่าย |
quota_tiers.monthly | array | โควตาตามอายุงานของพนักงานรายเดือน |
quota_tiers.daily | array | โควตาตามอายุงานของพนักงานรายวัน |
quota_tiers.contractor | array | โควตาตามอายุงานของพนักงานเหมาจ่าย (ประเภทขาดงาน "09" ไม่มีโควตาของกลุ่มนี้) |
quota_tiers.*[].worked_month | integer | อายุงานขั้นต่ำ (เดือน) ที่ได้โควตานี้ |
quota_tiers.*[].quota | string | โควตาพร้อมหน่วยตาม language_code เช่น "30 วัน" |
quota_tiers.*[].quota_value | number | โควตาเป็นตัวเลข |
salary_type_settings
| Field | Type | Description |
|---|---|---|
income | array | ประเภทรายรับ |
expense | array | ประเภทรายจ่าย/รายการหัก |
หากไม่มีการตั้งค่าจะได้ income และ expense เป็น array ว่าง
รายการใน income และ expense
| Field | Type | Description |
|---|---|---|
salary_type_id | string | รหัสประเภทรายรับรายจ่าย |
salary_group_id | string | null | รหัสกลุ่มของประเภท (null = ไม่อยู่ในกลุ่ม) |
salary_type_code | string | รหัสประเภท เช่น "ST0001" |
salary_type_name | string | ชื่อหลักของประเภท (ไม่เปลี่ยนตาม language_code) |
salary_type_name_en | string | ชื่อภาษาอังกฤษ |
calculate_method | string | ประเภทการคำนวณ เช่น "Income", "Expense", "Constant", "Loan", "Fund", "Welfare", "Auto" |
tax_type | string | ประเภทเงินได้สำหรับคำนวณภาษี เช่น "1" |
round_decimal | boolean | true = ปัดเศษทศนิยม |
order_no | integer | ลำดับการแสดงผล |
tax_include | boolean | นำไปคำนวณภาษี |
sso_include | boolean | นำไปคำนวณประกันสังคม |
social_insurance_include | boolean | ค่าเดียวกับ sso_include |
provident_include | boolean | นำไปคำนวณกองทุนสำรองเลี้ยงชีพ |
emp_welfare_fund_include | boolean | นำไปคำนวณกองทุนสงเคราะห์ลูกจ้าง |
tax_resign_include | boolean | นำไปรวมในฐานค่าจ้างสำหรับคำนวณค่าชดเชยและภาษีกรณีพนักงานลาออก |
bank_link.bank_id | string | รหัสธนาคารที่ผูกกับกองทุน ("0" = ไม่ผูก) — มีค่าเฉพาะ calculate_method เป็น "Fund" |
bank_link.bank_name | string | ชื่อธนาคารตาม language_code |
fund_data | object | รายละเอียดกองทุน (มีเฉพาะ calculate_method เป็น "Fund" ที่ผูกกองทุนไว้) |
fund_data.fund_id | string | รหัส ID ของกองทุน |
fund_data.salary_type_id | string | รหัสประเภทรายรับรายจ่ายที่ผูกกับกองทุนนี้ |
fund_data.fund_code | string | รหัสอ้างอิงกองทุน เช่น "FD0001" |
fund_data.fund_name | string | ชื่อกองทุน |
fund_data.fund_desc | string | null | คำอธิบายกองทุน |
fund_data.fund_balance | string | ยอดเงินกองทุนสะสม (ตัวเลขในรูปแบบ string) |
fund_data.bank_id | string | รหัสธนาคารที่ผูกกับกองทุน |
fund_data.order_no | string | ลำดับของกองทุน (ตัวเลขในรูปแบบ string) |
Error Response
Parameter ไม่ถูกต้อง (400)
{
"code": 400,
"message": "ไม่สำเร็จ",
"errors": [
"'year_month' ไม่ถูกต้อง ต้องเป็นรูปแบบ YYYY-MM เช่น 2026-10"
]
}ข้อความใน errors | สาเหตุ |
|---|---|
กรุณาระบุ 'year_month' | ไม่ได้ส่ง year_month |
'year_month' ไม่ถูกต้อง ต้องเป็นรูปแบบ YYYY-MM เช่น 2026-10 | รูปแบบไม่ใช่ YYYY-MM หรือเดือนไม่อยู่ในช่วง 01–12 |
'section' ไม่ถูกต้อง ต้องเป็นหนึ่งใน: all, common, work_time, leave_type, salary_type | ค่า section ไม่รองรับ |
'language_code' ไม่ถูกต้อง ต้องเป็นหนึ่งใน: TH, EN | ค่า language_code ไม่รองรับ |
หากผิดหลายข้อ errors จะมีครบทุกข้อในครั้งเดียว
ไม่มีสิทธิ์ (403)
{
"code": 403,
"message": "Forbidden: Insufficient permissions",
"error": {
"type": "PERMISSION_DENIED",
"required_permission": "payroll:read:all",
"resource": "payroll:read:all"
}
}API Key ไม่ถูกต้องหรือไม่ได้ส่ง (401)
{
"statusCode": 401,
"message": "Access denied due to invalid subscription key. Make sure to provide a valid key for an active subscription."
}| HTTP Status | Description |
|---|---|
400 | Parameter ไม่ถูกต้อง |
401 | API Key ไม่ถูกต้องหรือไม่ได้ส่ง |
403 | API Key ไม่มีสิทธิ์ payroll:read:all |
500 | ระบบขัดข้อง |
Code Examples
cURL
curl -X GET "https://openapi.humansoft.co.th/api/v1/open-apis/salary/get-data-filter?path_action=get_organization_settings_summary&year_month=2026-10§ion=all&language_code=TH" \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY"Notes
- ข้อความอธิบาย (field ที่ลงท้ายด้วย
_text),type_name,ot_name,leave_type_name,bank_nameและหน่วยในquotaเปลี่ยนตามlanguage_code salary_type_nameไม่เปลี่ยนตามlanguage_codeใช้salary_type_name_enสำหรับชื่อภาษาอังกฤษ ส่วนorganization_labelsส่งทั้งthและenเสมอ- ค่า ID ใน response เป็น plain text ไม่ได้เข้ารหัส Base64
- ใช้ Current Month เพื่อหารอบเดือนปัจจุบันขององค์กร แล้วนำ
master_salary_monthมาใช้เป็นyear_month(API นั้นต้องใช้สิทธิ์payroll:read:self)
Related APIs
- Current Month - ดูรอบเงินเดือนปัจจุบันเพื่อใช้เป็น
year_month - Get Active Leave Types - ดูประเภทการลาที่เปิดใช้งาน
- Salary Summary - ดูสรุปเงินเดือนของรอบเดือน