Update Employee Tax Exception
บันทึกหรือแก้ไขรายการลดหย่อนภาษีของพนักงาน โดยส่งรายการที่ได้จาก List Tax Exception แล้วแก้ไขค่า tax_amt (จำนวนเงิน) หรือ tax_secure_code (รหัสอ้างอิง เช่น เลขบัตรประชาชน, เลขกรมธรรม์)
ขั้นตอนการใช้งาน:
- เรียก Get Cutoff Date เพื่อตรวจว่า
allow_edit_deductionเป็นtrue - เรียก List Tax Exception เพื่อดึง
person_tax_transac_idและข้อมูลรายการลดหย่อนทั้งหมด - แก้ไขค่า
tax_amtหรือtax_secure_codeตามต้องการ - เรียก API นี้พร้อมส่ง
tax_listที่แก้ไขแล้ว
person_tax_transac_id ต้องเข้ารหัส Base64 ก่อนส่ง เช่น 20260121DF117FCB163C เข้ารหัสเป็น MjAyNjAxMjFERjExN0ZDQjE2M0M=
Endpoint
POST /api/v1/open-apis/employee/update-employee-financial?path_action=save-tax-exceptionQuery Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
path_action | string | Yes | ต้องเป็น save-tax-exception |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
employee_code | string | Yes | รหัสพนักงาน |
tax_list | array | Yes | รายการลดหย่อนภาษีที่ต้องการบันทึก/แก้ไข (อย่างน้อย 1 รายการ) |
language_code | string | No | รหัสภาษา (TH/EN) |
tax_list Fields
| Field | Type | Required | Description |
|---|---|---|---|
person_tax_transac_id | string | Yes | ID รายการลดหย่อนภาษี (Base64 encoded, ขนาด 20 ตัวอักษรก่อน encode) |
tax_secure_code | string | No | รหัสอ้างอิง (ถ้า need_secure_code = Y) เช่น เลขบัตรประชาชน, เลขกรมธรรม์ |
tax_amt | number / string | No | จำนวนเงินลดหย่อน (บาท) สามารถส่งเป็น 0 หรือ "0.00" เพื่อล้างค่า |
Example Request Body
{
"employee_code": "EMP001",
"tax_list": [
{
"person_tax_transac_id": "MjAyNjAxMjFERjExN0ZDQjE2M0M=",
"tax_secure_code": "",
"tax_amt": "60000.00"
},
{
"person_tax_transac_id": "MjAyNjAxMjFDOUEzQjc3NjVDQTM=",
"tax_secure_code": "",
"tax_amt": "0.00"
}
]
}Response Format
Success Response
{
"code": 200,
"message": "สำเร็จ",
"payload": {
"employee_code": "EMP001",
"tax_list": [
{
"person_tax_transac_id": "MjAyNjAxMjFERjExN0ZDQjE2M0M=",
"tax_secure_code": "",
"tax_amt": 60000
},
{
"person_tax_transac_id": "MjAyNjAxMjFDOUEzQjc3NjVDQTM=",
"tax_secure_code": "1234567890123",
"tax_amt": 30000
}
]
}
}Response Fields
| Field | Type | Description |
|---|---|---|
code | number | 200 = สำเร็จ |
message | string | ข้อความตอบกลับ |
payload | object | ข้อมูลที่ส่งเข้า (echo back) |
payload.employee_code | string | รหัสพนักงานที่ส่งเข้า |
payload.tax_list | array | รายการ tax_list ที่ส่งเข้า |
Error Responses
Missing employee_code:
{
"code": 400,
"message": "ไม่สำเร็จ",
"error": "Missing required parameter: employee_code"
}Missing or Empty tax_list:
{
"code": 400,
"message": "ไม่สำเร็จ",
"error": "Missing or empty required parameter: tax_list (array of { person_tax_transac_id, tax_secure_code, tax_amt })"
}Employee Not Found:
{
"code": 400,
"message": "ไม่สำเร็จ",
"error": "Employee not found with code: EMP999"
}Invalid person_tax_transac_id:
{
"code": 400,
"message": "ไม่สำเร็จ",
"error": "Invalid person_tax_transac_id in tax_list"
}Validation Rules
- employee_code - ต้องระบุและต้องมีอยู่ในระบบ
- tax_list - ต้องเป็น array และมีอย่างน้อย 1 รายการ
- person_tax_transac_id - ต้อง encode เป็น Base64 และ decode ได้เป็น string ขนาด 20 ตัวอักษร
- tax_amt - ต้องเป็นตัวเลข (หรือ string ที่แปลงเป็นตัวเลขได้)
- tax_secure_code - ถ้า
need_secure_code=Yควรระบุ (แต่ไม่บังคับ)
Common Tax Exception Items
สถานะ และ มีอายุตั้งแต่ 65 ปีขึ้นไป / ผู้พิการ
| รายการ | tax_category_id | ตัวอย่าง tax_amt | need_secure_code |
|---|---|---|---|
| สถานะ | 73 | (ดู Option Values) | N |
| มีอายุตั้งแต่ 65 ปีขึ้นไป / ผู้พิการ | 74 | null | Y / N |
ค่าลดหย่อนส่วนตัวและครอบครัว
| รายการ | tax_category_id | ตัวอย่าง tax_amt | need_secure_code |
|---|---|---|---|
| ผู้มีเงินได้ (ส่วนตัว) | 60 | 60,000 | N |
| คู่สมรส | 61 | 60,000 | N |
| บุตร (คนละ 30,000) | 11 | 30,000 | Y (เลขบัตรประชาชน) |
| บุตรคนที่ 2+ เกิดปี 2561+ | 64 | 60,000 | Y (เลขบัตรประชาชน) |
| บิดามารดา (อายุ 60+) | 12, 13 | 30,000 | Y (เลขบัตรประชาชน) |
ประกัน เงินออม และการลงทุน
| รายการ | tax_category_id | ตัวอย่าง tax_amt | need_secure_code |
|---|---|---|---|
| ประกันชีวิต | 16 | 100,000 | Y (เลขกรมธรรม์) |
| ประกันสุขภาพ | 15 | 25,000 | Y (เลขกรมธรรม์) |
| กองทุนสำรองเลี้ยงชีพ (PVD) | 7 | 500,000 | Y (เลข PVD) |
| กองทุนรวมเพื่อการเลี้ยงชีพ (RMF) | 8 | 500,000 | Y (เลขกองทุน) |
| กองทุนรวมหุ้นระยะยาว (LTF) | 9 | 500,000 | Y (เลขกองทุน) |
สินทรัพย์และมาตรการนโยบายภาครัฐ
| รายการ | tax_category_id | ตัวอย่าง tax_amt | need_secure_code |
|---|---|---|---|
| ดอกเบี้ยเงินกู้ซื้อบ้าน | 21 | 100,000 | N |
| ค่าเช่าบ้าน | 25 | 100,000 | N |
| ซื้อหนังสือ | 24 | 15,000 | N |
| ท่องเที่ยวในประเทศ | 77 | 15,000 | N |
เงินบริจาค
| รายการ | tax_category_id | ตัวอย่าง tax_amt | need_secure_code |
|---|---|---|---|
| บริจาคทั่วไป | 22 | 10,000 | N |
| บริจาคการศึกษา | 23 | 10,000 | N |
| บริจาคพรรคการเมือง | 31 | 10,000 | N |
รายการอาจแตกต่างกันตามปีภาษีและการตั้งค่าของระบบ ควรเรียก List Tax Exception เพื่อดูรายการที่ใช้ได้จริง
Option Values
marital_status (employee_status) — สถานะภาพสมรส (ภาษี)
ใช้สำหรับระบุสถานะสมรสในการคำนวณภาษีประจำปี ภงด.91
| Value | Description (TH) | Description (EN) |
|---|---|---|
01 | โสด | Single |
02 | สมรสและอยู่ร่วมกันตลอดปี | Married |
03 | หม้าย | Divorce |
04 | ตายระหว่างปีภาษี | Die in year |
05 | สมรสระหว่างปี | Married during the year |
06 | หย่าระหว่างปี | Divorce during the year |
07 | สมรสและคู่สมรสตายระหว่างปี | Married and spouse die during the year |
รายการอาจมีเพิ่มเติมได้จากการตั้งค่าในระบบ
Code Examples
cURL
curl -X POST "https://openapi.humansoft.co.th/api/v1/open-apis/employee/update-employee-financial?path_action=save-tax-exception" \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"employee_code": "EMP001",
"tax_list": [
{
"person_tax_transac_id": "MjAyNjAxMjFERjExN0ZDQjE2M0M=",
"tax_secure_code": "",
"tax_amt": 60000
},
{
"person_tax_transac_id": "MjAyNjAxMjFDOUEzQjc3NjVDQTM=",
"tax_secure_code": "1234567890123",
"tax_amt": 30000
},
{
"person_tax_transac_id": "MjAyNjAxMjFEMEMxMDZBQUIzQkE=",
"tax_secure_code": "PVD2568001",
"tax_amt": 100000
}
]
}'Related APIs
- List Tax Exception - ดึงรายการลดหย่อนภาษี (ได้ person_tax_transac_id)
- Get Tax - ดึงรายละเอียดภาษีหนึ่งปี (เงินเดือนสะสม, กองทุน, ประกันสังคม)
- Fill Tax Exception - เติมข้อมูลลดหย่อนภาษีจากปีก่อน
- Get Cutoff Date - ตรวจสอบวันตัดแก้ไข (allow_edit_deduction)
- Delete Tax - ลบข้อมูลภาษีทั้งปี
Last updated on