Create Petty Cash Type
API สำหรับผู้ดูแลระบบ (HR/Admin) เพื่อเพิ่มหมวดหมู่หรือประเภทการเบิกเงินสดย่อยใหม่เข้าสู่ระบบของบริษัท ประเภทที่สร้างขึ้นใหม่จะปรากฏในผลลัพธ์ของ API List Types ทันที
Endpoint
POST /api/v1/open-apis/petty-cash/submit-typeRequest Body
Required Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
petty_cash_type_name | string | Yes | ชื่อประเภท (ภาษาไทย) | "ค่าที่พัก" |
authorize_id | string (base64) | Yes | ID ของผู้ที่ดำเนินการสร้างประเภท | "MjAy..." |
Optional Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
petty_cash_type_name_en | string | No | ชื่อประเภท (ภาษาอังกฤษ) | "Accommodation" |
enable_flag | string | No | สถานะเริ่มต้น ("1" = ใช้งาน) default: "1" | "1" |
Response Format
Success Response
{
"code": 200,
"message": "สร้างประเภทรายการสำเร็จ",
"payload": {
"petty_cash_type_name": "ค่าที่พัก",
"petty_cash_type_name_en": "Accommodation",
"petty_cash_type_code": "PC003",
"petty_cash_type_id": "20260325OPTYX0003"
}
}Response Fields
| Field | Type | Nullable | Description |
|---|---|---|---|
petty_cash_type_id | string | No | รหัสประเภทที่สร้างขึ้นใหม่ |
petty_cash_type_name | string | No | ชื่อประเภท (ภาษาไทย) |
petty_cash_type_name_en | string | Yes | ชื่อประเภท (ภาษาอังกฤษ) |
petty_cash_type_code | string | No | รหัสประเภทสั้น |
Code Examples
cURL
curl -X POST "https://openapi.humansoft.co.th/api/v1/open-apis/petty-cash/submit-type" \
-H "Content-Type: application/json" \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
-d '{
"petty_cash_type_name": "ค่าที่พัก",
"petty_cash_type_name_en": "Accommodation",
"authorize_id": "MjAyNTAzMDM1MUIwQTJDQ0JEOUM="
}'Notes
แนะนำให้ระบุชื่อภาษาอังกฤษ (petty_cash_type_name_en) เพื่อรองรับผู้ใช้งานหลากหลายภาษา
Related APIs
- List Types - ดูรายการประเภทค่าใช้จ่าย
- Update Type - แก้ไขประเภทค่าใช้จ่าย
- Delete Type - ลบประเภทค่าใช้จ่าย
Last updated on