Income/Expense Template
ดึง Template คอลัมน์รายได้/รายจ่ายและข้อมูลพนักงาน สำหรับเตรียมข้อมูลก่อนนำเข้า
Endpoint
GET /api/v1/open-apis/salary/get-data-filter?path_action=inex_templateRequest Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
year_month | string | Yes | งวดเงินเดือน (YYYY-MM) | "2026-03" |
lang | string | No | ภาษาที่แสดง: "TH" / "EN" (ค่าเริ่มต้น: "TH") | "TH" |
keyword | string | No | ค้นหาจากชื่อ นามสกุล รหัสพนักงาน | "EMP001" |
hashtags | array | No | กรองตาม hashtag | ["tag1"] |
company_lists | array | No | กรองตามบริษัท (Base64 encoded ID) | [{"id":"Q01Q"}] |
branch_lists | array | No | กรองตามสาขา (Base64 encoded ID) | |
department_lists | array | No | กรองตามแผนก (Base64 encoded ID) | |
position_lists | array | No | กรองตามตำแหน่ง (Base64 encoded ID) | |
employee_lists | array | No | กรองเฉพาะพนักงาน (Base64 encoded ID) | |
employee_type_code | array | No | กรองตามประเภทพนักงาน | ["01"] |
sys_del_flag | string | No | สถานะ: "N" = ทำงานอยู่ (ค่าเริ่มต้น) | "N" |
signout_flag | string | No | สถานะลาออก | "N" |
_PAGE | number | No | หน้าที่ต้องการ (ค่าเริ่มต้น: 1) | 1 |
_NUMBER_PER_PAGE | number | No | จำนวนต่อหน้า (ค่าเริ่มต้น: 20) | 50 |
Response Format
Success Response
{
"code": 200,
"message": "สำเร็จ",
"payload": {
"year_month": "2026-03",
"columns": [
{ "key": "emp_code", "label": "รหัสพนักงาน", "type": "fixed" },
{ "key": "full_name", "label": "ชื่อ-นามสกุล", "type": "fixed" },
{ "key": "Income-SAL001", "label": "เงินเดือน", "type": "income", "color": "#a5ffd9" },
{ "key": "Income-SAL002", "label": "ค่าตำแหน่ง", "type": "income", "color": "#a5ffd9" },
{ "key": "Expense-EXP001", "label": "หักขาดงาน", "type": "expense", "color": "#ffc6c6" }
],
"total_employees": 150,
"import_data": [
{
"emp_code": "EMP001",
"full_name": "สมชาย ใจดี",
"Income-SAL001": "25000",
"Income-SAL002": "5000",
"Expense-EXP001": ""
}
]
},
"_PAGINATION": {
"_TOTAL_RECORDS": 150,
"_PAGE": 1,
"_NUMBER_PER_PAGE": 20
}
}Key Response Fields
| Field | Type | Description |
|---|---|---|
year_month | string | งวดเงินเดือนที่เลือก |
columns | array | รายการคอลัมน์ที่ใช้ในการนำเข้า |
columns[].key | string | ชื่อ key สำหรับส่งข้อมูล (เช่น Income-SAL001) |
columns[].label | string | ชื่อแสดงผลของคอลัมน์ |
columns[].type | string | ประเภท: "fixed", "income", "expense" |
columns[].color | string | สี hex สำหรับแสดงผล |
total_employees | number | จำนวนพนักงานทั้งหมด |
import_data | array | ข้อมูลพนักงานปัจจุบัน |
- คอลัมน์ Income จะมีสี
#a5ffd9(เขียว) และ Expense จะมีสี#ffc6c6(แดง) - ค่าที่เป็นสตริงว่าง
""หมายถึงยังไม่มีข้อมูล
Error Response
{
"code": 400,
"message": "Invalid year_month format",
"payload": []
}| HTTP Status | Description |
|---|---|
400 | รูปแบบ year_month ไม่ถูกต้อง หรือไม่พบงวดเงินเดือน |
401 | API Key ไม่ถูกต้องหรือไม่ได้ส่ง |
Code Examples
cURL
curl -X GET "https://openapi.humansoft.co.th/api/v1/open-apis/salary/get-data-filter?path_action=inex_template&year_month=2026-03" \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY"Notes
คอลัมน์ Income-{id} และ Expense-{id} เป็น dynamic columns ที่ขึ้นกับการตั้งค่าของแต่ละบริษัท ควรเรียก API นี้ก่อนเสมอเพื่อดูคอลัมน์ที่ถูกต้อง
Related APIs
- Income/Expense Import - นำเข้าข้อมูลรายได้/รายจ่าย
- Income/Expense Import Log - ดูประวัติการนำเข้า
- Split Income/Expense Template - Template สำหรับรอบเงินเดือนแยก
Last updated on