Skip to Content
🚀 Welcome to Humansoft Open API Documentation

List OT Rounds

ดูรายการงวดโอทีทั้งหมดของเดือนที่ระบุ

ใช้เป็นขั้นแรกของ automation เพื่อหา master_salary_ot_report_id ก่อนสั่งคำนวณ — จำเป็นเมื่อเดือนหนึ่งมีงวดโอทีมากกว่าหนึ่งรอบ ซึ่ง endpoint อื่นจะไม่เลือกรอบให้

Endpoint

POST /api/v1/open-apis/calculation-ot/get-list-ot-round-in-month

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

Request Parameters

Required Parameters

ParameterTypeRequiredDescriptionExample
year_monthstringYesงวดเดือนที่ต้องการดู (YYYY-MM)2026-09

Request Body Example

{ "year_month": "2026-09" }

Response Format

Success Response (HTTP 200)

{ "code": 200, "message": "Get OT rounds (2026-09) Accept", "payload": [ { "master_salary_ot_report_id": "20251127D4573C421639", "master_salary_month": "2026-09", "master_salary_ot_name": "งวดโอที ก.ย. 2026", "master_salary_ot_seq": 1, "ot_report_start_dt": "2026-08-21 00:00:00", "ot_report_end_dt": "2026-09-20 23:59:59", "ot_day_in_month": 31, "read_only_flag": "N", "ot_paid_dt": "2026-09-25", "ot_paid_in_normal": "Y" } ] }

Error Response - Validation Failed (HTTP 400)

{ "code": 400, "message": "ไม่สำเร็จ", "errors": [ "กรุณาระบุ 'year_month' (รูปแบบ YYYY-MM)" ] }

วิธีแก้: ส่ง year_month ในรูปแบบ YYYY-MM

Error Response - Unauthorized (HTTP 401)

{ "code": 401, "message": "Unauthorized", "payload": [] }

วิธีแก้: ตรวจสอบว่า API Key ถูกต้องและมีสิทธิ์ตามที่ระบุไว้ด้านบน — ดูวิธีตั้งค่าได้ที่ Get Started

Response Fields

FieldTypeDescription
master_salary_ot_report_idstringรหัสรอบโอที — ใช้ส่งต่อให้ endpoint อื่น (ต้องแปลงเป็น Base64 ก่อนส่งกลับเข้า request)
master_salary_monthstringงวดเดือนที่รอบนี้สังกัด
master_salary_ot_namestringชื่อรอบตามที่ตั้งไว้
master_salary_ot_seqintลำดับรอบภายในเดือน
ot_report_start_dtstringวันเริ่มรอบ
ot_report_end_dtstringวันสิ้นรอบ
ot_day_in_monthintจำนวนวันในรอบ
read_only_flagstringY = ปิดงวดแล้ว แก้ไข/คำนวณไม่ได้, N = เปิดอยู่
ot_paid_dtstringวันที่จ่าย
ot_paid_in_normalstringY = ยอดโอทีจ่ายรวมกับเงินเดือนงวดปกติ

Code Examples

curl -X POST "https://openapi.humansoft.co.th/api/v1/open-apis/calculation-ot/get-list-ot-round-in-month" \ -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "year_month": "2026-09" }'

Validation Rules

ParameterValidationError Message
year_monthต้องระบุกรุณาระบุ 'year_month' (รูปแบบ YYYY-MM)
year_monthต้องเป็นรูปแบบ YYYY-MM'year_month' ต้องเป็นรูปแบบ YYYY-MM

Notes

  • ถ้าเดือนนั้นยังไม่ได้สร้างรอบโอที จะได้ payload เป็น array ว่าง
  • รอบโอทีตัดรอบคร่อมเดือนได้ (เช่น 21 ส.ค. – 20 ก.ย.) ค่า master_salary_month คือเดือนที่รอบสังกัด ไม่ใช่เดือนของวันที่ทำโอที
  • Get OT Round - ดูรายละเอียดงวดและรายชื่อพนักงานในงวด
  • Calculate OT - สั่งคำนวณโอทีรายคนในรอบนี้
  • Create OT Round - สร้างรอบใหม่ถ้าเดือนนั้นยังไม่มี
Last updated on