Skip to Content
🚀 Welcome to Humansoft Open API Documentation

Update Quota

แก้ไขจำนวนโควตาการลาของรายการเดียวที่มีอยู่แล้วในระบบ

Endpoint

POST /api/v1/open-apis/salary/update-data-filter

Request Body

ParameterTypeRequiredDescriptionExample
path_actionstringYesต้องเป็น update_quota"update_quota"
quota_idstringYesรหัสโควตา (Base64 encoded)"MjAyNjAxMDFBQkMxMjM0NTY3ODk="
time_leave_flag_quotastringYesจำนวนโควตาใหม่ (รองรับทศนิยม)"15", "10.5"
language_codestringNoภาษาสำหรับแสดงผล"TH", "EN"

Response Format

Success Response

{ "code": 200, "message": "สำเร็จ", "payload": { "quota_id": "20260101ABC123456789", "employee_id": "202503219741427917A0", "employee_code": "EMP001", "quota_year": "2026", "time_leave_flag": "06", "time_leave_flag_name": "ลาพักร้อน", "time_leave_flag_name_en": "Annual Leave", "time_leave_flag_quota_old": "10.00", "time_leave_flag_quota_new": "15.00", "actual": 2.5, "remaining_old": 7.5, "remaining_new": 12.5, "unit": "วัน", "updated": "2026-02-20 14:30:00" } }

Response Fields

FieldTypeNullableDescription
quota_idstringNoID โควตา (plain text)
employee_idstringNoID พนักงาน (plain text)
employee_codestringNoรหัสพนักงาน
quota_yearstringNoปีโควตา
time_leave_flagstringNoรหัสประเภทการลา
time_leave_flag_namestringNoชื่อประเภทการลา (ไทย)
time_leave_flag_name_enstringNoชื่อประเภทการลา (อังกฤษ)
time_leave_flag_quota_oldstringNoจำนวนโควตาเดิม
time_leave_flag_quota_newstringNoจำนวนโควตาใหม่
actualnumberNoจำนวนที่ใช้ไปแล้ว
remaining_oldnumberNoจำนวนคงเหลือเดิม
remaining_newnumberNoจำนวนคงเหลือใหม่
unitstringNoหน่วย: "วัน" หรือ "ชั่วโมง"
updatedstringNoวันเวลาที่แก้ไข (YYYY-MM-DD HH:mm:ss)

Error Response

{ "code": 404, "message": "Quota not found", "payload": [] }

Code Examples

curl -X POST "https://openapi.humansoft.co.th/api/v1/open-apis/salary/update-data-filter" \ -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "path_action": "update_quota", "quota_id": "MjAyNjAxMDFBQkMxMjM0NTY3ODk=", "time_leave_flag_quota": "15" }'

Notes

  • Response แสดงทั้งค่าเดิมและค่าใหม่ (_old / _new) สำหรับเปรียบเทียบ
  • remaining คำนวณอัตโนมัติจาก quota - actual
  • time_leave_flag_quota รองรับทศนิยม เช่น "10.5"
  • ใช้ Get Quota by ID เพื่อดูข้อมูลปัจจุบันก่อนแก้ไข

  • Get Quota by ID - ดูรายละเอียดโควตาก่อนแก้ไข
  • Save Quota - สร้าง/อัปเดตโควตาแบบ Bulk
  • Delete Quota - ลบโควตา
Last updated on