Skip to Content
🚀 Welcome to Humansoft Open API Documentation

Update Employee Tax Exception

บันทึกหรือแก้ไขรายการลดหย่อนภาษีของพนักงาน โดยส่งรายการที่ได้จาก List Tax Exception แล้วแก้ไขค่า tax_amt (จำนวนเงิน) หรือ tax_secure_code (รหัสอ้างอิง เช่น เลขบัตรประชาชน, เลขกรมธรรม์)

ขั้นตอนการใช้งาน:

  1. เรียก Get Cutoff Date เพื่อตรวจว่า allow_edit_deduction เป็น true
  2. เรียก List Tax Exception เพื่อดึง person_tax_transac_id และข้อมูลรายการลดหย่อนทั้งหมด
  3. แก้ไขค่า tax_amt หรือ tax_secure_code ตามต้องการ
  4. เรียก API นี้พร้อมส่ง tax_list ที่แก้ไขแล้ว

person_tax_transac_id ต้องเข้ารหัส Base64 ก่อนส่ง เช่น 20260121DF117FCB163C เข้ารหัสเป็น MjAyNjAxMjFERjExN0ZDQjE2M0M=

Endpoint

POST /api/v1/open-apis/employee/update-employee-financial?path_action=save-tax-exception

Query Parameters

ParameterTypeRequiredDescription
path_actionstringYesต้องเป็น save-tax-exception

Request Body

FieldTypeRequiredDescription
employee_codestringYesรหัสพนักงาน
tax_listarrayYesรายการลดหย่อนภาษีที่ต้องการบันทึก/แก้ไข (อย่างน้อย 1 รายการ)
language_codestringNoรหัสภาษา (TH/EN)

tax_list Fields

FieldTypeRequiredDescription
person_tax_transac_idstringYesID รายการลดหย่อนภาษี (Base64 encoded, ขนาด 20 ตัวอักษรก่อน encode)
tax_secure_codestringNoรหัสอ้างอิง (ถ้า need_secure_code = Y) เช่น เลขบัตรประชาชน, เลขกรมธรรม์
tax_amtnumber / stringNoจำนวนเงินลดหย่อน (บาท) สามารถส่งเป็น 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

FieldTypeDescription
codenumber200 = สำเร็จ
messagestringข้อความตอบกลับ
payloadobjectข้อมูลที่ส่งเข้า (echo back)
payload.employee_codestringรหัสพนักงานที่ส่งเข้า
payload.tax_listarrayรายการ 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

  1. employee_code - ต้องระบุและต้องมีอยู่ในระบบ
  2. tax_list - ต้องเป็น array และมีอย่างน้อย 1 รายการ
  3. person_tax_transac_id - ต้อง encode เป็น Base64 และ decode ได้เป็น string ขนาด 20 ตัวอักษร
  4. tax_amt - ต้องเป็นตัวเลข (หรือ string ที่แปลงเป็นตัวเลขได้)
  5. tax_secure_code - ถ้า need_secure_code = Y ควรระบุ (แต่ไม่บังคับ)

Common Tax Exception Items

สถานะ และ มีอายุตั้งแต่ 65 ปีขึ้นไป / ผู้พิการ

รายการtax_category_idตัวอย่าง tax_amtneed_secure_code
สถานะ73(ดู Option Values)N
มีอายุตั้งแต่ 65 ปีขึ้นไป / ผู้พิการ74nullY / N

ค่าลดหย่อนส่วนตัวและครอบครัว

รายการtax_category_idตัวอย่าง tax_amtneed_secure_code
ผู้มีเงินได้ (ส่วนตัว)6060,000N
คู่สมรส6160,000N
บุตร (คนละ 30,000)1130,000Y (เลขบัตรประชาชน)
บุตรคนที่ 2+ เกิดปี 2561+6460,000Y (เลขบัตรประชาชน)
บิดามารดา (อายุ 60+)12, 1330,000Y (เลขบัตรประชาชน)

ประกัน เงินออม และการลงทุน

รายการtax_category_idตัวอย่าง tax_amtneed_secure_code
ประกันชีวิต16100,000Y (เลขกรมธรรม์)
ประกันสุขภาพ1525,000Y (เลขกรมธรรม์)
กองทุนสำรองเลี้ยงชีพ (PVD)7500,000Y (เลข PVD)
กองทุนรวมเพื่อการเลี้ยงชีพ (RMF)8500,000Y (เลขกองทุน)
กองทุนรวมหุ้นระยะยาว (LTF)9500,000Y (เลขกองทุน)

สินทรัพย์และมาตรการนโยบายภาครัฐ

รายการtax_category_idตัวอย่าง tax_amtneed_secure_code
ดอกเบี้ยเงินกู้ซื้อบ้าน21100,000N
ค่าเช่าบ้าน25100,000N
ซื้อหนังสือ2415,000N
ท่องเที่ยวในประเทศ7715,000N

เงินบริจาค

รายการtax_category_idตัวอย่าง tax_amtneed_secure_code
บริจาคทั่วไป2210,000N
บริจาคการศึกษา2310,000N
บริจาคพรรคการเมือง3110,000N

รายการอาจแตกต่างกันตามปีภาษีและการตั้งค่าของระบบ ควรเรียก List Tax Exception เพื่อดูรายการที่ใช้ได้จริง


Option Values

marital_status (employee_status) — สถานะภาพสมรส (ภาษี)

ใช้สำหรับระบุสถานะสมรสในการคำนวณภาษีประจำปี ภงด.91

ValueDescription (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 -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 } ] }'

  • List Tax Exception - ดึงรายการลดหย่อนภาษี (ได้ person_tax_transac_id)
  • Get Tax - ดึงรายละเอียดภาษีหนึ่งปี (เงินเดือนสะสม, กองทุน, ประกันสังคม)
  • Fill Tax Exception - เติมข้อมูลลดหย่อนภาษีจากปีก่อน
  • Get Cutoff Date - ตรวจสอบวันตัดแก้ไข (allow_edit_deduction)
  • Delete Tax - ลบข้อมูลภาษีทั้งปี
Last updated on