การระบุภาษีหัก ณ ที่จ่ายสำห รับเอกสาร Inline
เอกสารแบบ Inline สามารถระบุภาษีหัก ณ ที่จ่ายได้ทั้งระดับเอกสารและระดับรายการสินค้า ขึ้นอยู่กับการตั้งค่า useInlineDiscount และ useInlineVat
เอกสารแบบ Inline สามารถระบุภาษีหัก ณ ที่จ่ายได้ 3 แบบ คือ
- ระบุส่วนลดระดับสินค้า เเละ ระบุภาษีหัก ณ ที่จ่ายระดับเอกสาร
- ระบุส่วนลดระดับสินค้า เเต่ไม่ระบุภาษีหัก ณ ที่จ่ายระดับเอกสาร
- ระบุภาษีหัก ณ ที่จ่ายระดับสินค้า
เงื่อนไขสำคัญ:
- แบบที่ 1 (ระบุภาษีหัก ณ ที่จ่ายระดับเอกสาร): ใช้
documentWithholdingTaxPercentage > 0คำนวณจากtotalAfterDiscount - แบบที่ 3 (ระบุภาษีหัก ณ ที่จ่ายระดับสินค้า):
documentWithholdingTaxPercentageต้องเป็น 0 เสมอ และใช้withHeldPerItem/withHeldPerItemValueระดับรายการสินค้าแทน documentShowWithholdingTaxต้องเป็น true สำหรับแบบที่ 1 และ 3documentWithholdingTaxAmount= ผลรวมของภาษีหัก ณ ที่จ่ายทั้งหมด
ในตัวอย่าง Payload และ Response ด้านล่าง fields ที่ถูกไฮไลท์ คือ fields ที่เกี่ยวข้องกับ feature การระบุภาษีหัก ณ ที่จ่าย
1. ระบุส่วนลดระดับสินค้า เเละ ระบุภาษีหัก ณ ที่จ่ายระดับเอกสาร
Scenario บริษัท ตัวอย่าง จำกัด ซึ่งเป็นบริษัทที่จดภาษี ต้องการสร้างเอกสารค่าใช้จ่ายแบบ Inline Discount พร้อมระบุภาษีหัก ณ ที่จ่าย 3% ระดับเอกสาร
- รายการสินค้า: สินค้าตัวอย่าง
- ราคาต่อหน่วย: 10,000 บาท
- จำนวน: 1
- ส่วนลด: 100 บาท
- ภ าษีหัก ณ ที่จ่ายระดับเอกสาร: 3% = 297 บาท
การตั้งค่าเอกสาร
| Field | Value |
|---|---|
isVat | true |
isVatInclusive | false |
useInlineDiscount | true |
useInlineVat | false |
documentShowWithholdingTax | true |
documentWithholdingTaxPercentage | 3 |
การคำนวณระดับสินค้า
| Field | Calculation logic | Example | Value |
|---|---|---|---|
quantity | input | 1 | 1 |
pricePerUnit | input | 10000 | 10000 |
discountAmount | input | 100 | 100 |
total | quantity × pricePerUnit - discountAmount | 1 × 10000 - 100 | 9900 |
การคำนวณระดับเอกสาร
| Field | Calculation logic | Example | Value |
|---|---|---|---|
subTotal | ∑(total) | 10000 | 10000 |
discountAmount | ∑(discountAmount per item) | 100 | 100 |
totalAfterDiscount | subTotal - discountAmount | 10000 - 100 | 9900 |
vatAmount | totalAfterDiscount × 7 / 100 | 9900 × 7 / 100 | 693 |
documentWithholdingTaxPercentage | input | 3 | 3 |
documentWithholdingTaxAmount | totalAfterDiscount × documentWithholdingTaxPercentage / 100 | 9900 × 3 / 100 | 297 |
grandTotal | totalAfterDiscount + vatAmount | 9900 + 693 | 10593 |

Endpoint: POST /expenses/inline
Payload
{
"contactName": "บริษัท ตัวอย่าง จำกัด",
"contactAddress": "11/12 Example Rd, Silom, Bang Rak, Bangkok Example contact address",
"contactTaxId": "1234567890123",
"contactBranch": "สํานักงานใหญ่",
"contactPerson": "ExamplePerson",
"contactEmail": "Example@email.com",
"contactNumber": "087-654-3210",
"contactZipCode": "10500",
"contactGroup": 1,
"publishedOn": "2026-02-23",
"creditType": 1,
"creditDays": 30,
"dueDate": "2026-03-25",
"isVatInclusive": false,
"isVat": true,
"salesName": "n b",
"discountType": 1,
"useInlineDiscount": true,
"isManualWHT": false,
"useInlineVat": false,
"documentShowWithholdingTax": true,
"documentWithholdingTaxPercentage": 3,
"documentWithholdingTaxAmount": 297,
"subTotal": 10000,
"discountAmount": 100,
"exemptAmount": 0,
"vatableAmount": 9900,
"totalAfterDiscount": 9900,
"vatAmount": 693,
"grandTotal": 10593,
"items": [
{
"description": "สินค้าตัวอย่าง",
"systemCode": 1001,
"categoryId": 40238,
"nameForeign": "Marketing & Advertising",
"nameLocal": "การตลาดและโฆษณา",
"creditId": 2707131,
"creditCode": "21399",
"creditCategory": 2,
"creditNameForeign": "21399 / Other Payables",
"creditNameLocal": "21399 / เจ้าหนี้อื่นๆ",
"debitId": 2707275,
"debitCode": "53029",
"debitCategory": 5,
"debitNameForeign": "53029 / Other advertising and marketing expenses",
"debitNameLocal": "53029 / ค่าใช้จ่ายด้านโฆษณาและการตลาดอื่นๆ",
"quantity": 1,
"unitName": "",
"pricePerUnit": 10000,
"discountAmount": 100,
"total": 9900,
"vatRate": 7,
"isManualWithholdingTaxItem": false
}
],
"showSignatureOrStamp": true
}
Response
- สำหรับเอกสารแบบ Inline ที่
useInlineVat: falseค่าwithHeldPerItemและwithHeldPerItemValueใน response จะเป็นค่าว่าง ("") เนื่องจากไม่ได้ใช้งานการระบุภาษีหัก ณ ที่จ่ายระดับรายการสินค้า
{
"status": true,
"message": "",
"code": 0,
"data": {
"recordId": 127732,
"documentSerial": "EXP2026020125",
"documentType": "13",
"statusString": "awaiting",
"contactName": "บริษัท ตัวอย่าง จำกัด",
"publishedOn": "2026-02-23T00:00:00",
"isVat": "true",
"isVatInclusive": "false",
"useInlineDiscount": "true",
"useInlineVat": "false",
"useInlineWithholdingTax": false,
"documentShowWithholdingTax": "true",
"documentWithholdingTaxPercentage": "3",
"documentWithholdingTaxAmount": 297.0,
"documentWithholdingTaxTypes": 1,
"subTotal": "10000",
"discountAmount": "100",
"totalAfterDiscount": "9900",
"vatableAmount": "9900",
"vatAmount": "693.00000000",
"grandTotal": "10593",
"totalWithoutVat": "9603.00000000",
"items": [
{
"description": "สินค้าตัวอย่าง",
"quantity": "1",
"pricePerUnit": "10000",
"total": "9900",
"discountAmount": "100",
"vatRate": "7",
"withHeldPerItem": "",
"withHeldPerItemValue": ""
}
]
}
}
2. ระบุส่วนลดระดับสินค้า เเต่ไม่ระบุภาษีหัก ณ ที่จ่ายระดับเอกสาร
Scenario บริษัท ตัวอย่าง จำกัด ซึ่งเป็นบริษัทที่จดภาษี ต้องการสร้างเอกสารค่าใช้จ่า ยแบบ Inline Discount โดยไม่ระบุภาษีหัก ณ ที่จ่าย
- รายการสินค้า: สินค้าตัวอย่าง
- ราคาต่อหน่วย: 10,000 บาท
- จำนวน: 1
- ส่วนลด: 100 บาท
การตั้งค่าเอกสาร
| Field | Value |
|---|---|
isVat | true |
isVatInclusive | false |
useInlineDiscount | true |
useInlineVat | false |
documentShowWithholdingTax | false |
documentWithholdingTaxPercentage | 0 |
การคำนวณระดับสินค้า
| Field | Calculation logic | Example | Value |
|---|---|---|---|
quantity | input | 1 | 1 |
pricePerUnit | input | 10000 | 10000 |
discountAmount | input | 100 | 100 |
total | quantity × pricePerUnit - discountAmount | 1 × 10000 - 100 | 9900 |
การคำนวณระดับเอกสาร
| Field | Calculation logic | Example | Value |
|---|---|---|---|
subTotal | ∑(total) | 10000 | 10000 |
discountAmount | ∑(discountAmount per item) | 100 | 100 |
totalAfterDiscount | subTotal - discountAmount | 10000 - 100 | 9900 |
vatAmount | totalAfterDiscount × 7 / 100 | 9900 × 7 / 100 | 693 |
grandTotal | totalAfterDiscount + vatAmount | 9900 + 693 | 10593 |

Endpoint: POST /expenses/inline
Payload
{
"contactName": "บริษัท ตัวอย่าง จำกัด",
"contactAddress": "11/12 Example Rd, Silom, Bang Rak, Bangkok Example contact address",
"contactTaxId": "1234567890123",
"contactBranch": "สํานักงานใหญ่",
"contactPerson": "ExamplePerson",
"contactEmail": "Example@email.com",
"contactNumber": "087-654-3210",
"contactZipCode": "10500",
"contactGroup": 1,
"publishedOn": "2026-02-23",
"creditType": 1,
"creditDays": 30,
"dueDate": "2026-03-25",
"isVatInclusive": false,
"isVat": true,
"salesName": "n b",
"discountType": 1,
"useInlineDiscount": true,
"isManualWHT": false,
"useInlineVat": false,
"documentShowWithholdingTax": false,
"documentWithholdingTaxPercentage": 0,
"documentWithholdingTaxAmount": 0,
"subTotal": 10000,
"discountAmount": 100,
"exemptAmount": 0,
"vatableAmount": 9900,
"totalAfterDiscount": 9900,
"vatAmount": 693,
"grandTotal": 10593,
"items": [
{
"description": "สินค้าตัวอย่าง",
"systemCode": 1001,
"categoryId": 40238,
"nameForeign": "Marketing & Advertising",
"nameLocal": "การตลาดและโฆษณา",
"creditId": 2707131,
"creditCode": "21399",
"creditCategory": 2,
"creditNameForeign": "21399 / Other Payables",
"creditNameLocal": "21399 / เจ้าหนี้อื่นๆ",
"debitId": 2707275,
"debitCode": "53029",
"debitCategory": 5,
"debitNameForeign": "53029 / Other advertising and marketing expenses",
"debitNameLocal": "53029 / ค่าใช้จ่ายด้านโฆษณาและการตลาดอื่นๆ",
"quantity": 1,
"unitName": "",
"pricePerUnit": 10000,
"discountAmount": 100,
"total": 9900,
"vatRate": 7,
"isManualWithholdingTaxItem": false
}
],
"showSignatureOrStamp": true
}
Response
{
"status": true,
"message": "",
"code": 0,
"data": {
"recordId": 127729,
"documentSerial": "EXP2026020122",
"documentType": "13",
"statusString": "awaiting",
"contactName": "บริษัท ตัวอย่าง จำกัด",
"publishedOn": "2026-02-23T00:00:00",
"isVat": "true",
"isVatInclusive": "false",
"useInlineDiscount": "true",
"useInlineVat": "false",
"useInlineWithholdingTax": false,
"documentShowWithholdingTax": "false",
"documentWithholdingTaxPercentage": "0",
"documentWithholdingTaxAmount": 0.0,
"documentWithholdingTaxTypes": 1,
"subTotal": "10000",
"discountAmount": "100",
"totalAfterDiscount": "9900",
"vatableAmount": "9900",
"vatAmount": "693.00000000",
"grandTotal": "10593",
"items": [
{
"description": "สินค้าตัวอย่าง",
"quantity": "1",
"pricePerUnit": "10000",
"total": "9900",
"discountAmount": "100",
"vatRate": "7",
"withHeldPerItem": "",
"withHeldPerItemValue": ""
}
]
}
}
3. ระบุภาษีหัก ณ ที่จ่ายระดับสินค้า
Scenario บริษัท ตัวอย่าง จำกัด ซึ่งเป็นบริษัทที่จดภาษี ต้องการสร้างเอกสารค่าใช้จ่ายแบบ Inline Discount + VAT โดยระบุภาษีหัก ณ ที่จ่าย 3% ต่อรายการสินค้า
- รายการสินค้า: ค่าบริการที่ปรึกษา
- ราคาต่อหน่วย: 10,000 บาท
- จำนวน: 1 งาน
- ภาษีหัก ณ ที่จ่าย: 3% = 300 บาท
การตั้งค่าเอกสาร
| Field | Value |
|---|---|
isVat | true |
isVatInclusive | false |
useInlineDiscount | true |
useInlineVat | true |
documentShowWithholdingTax | true |
documentWithholdingTaxPercentage | 0 |
การคำนวณระดับสินค้า
| Field | Calculation logic | Example | Value |
|---|---|---|---|
quantity | input | 1 | 1 |
pricePerUnit | input | 10000 | 10000 |
total | quantity × pricePerUnit | 1 × 10000 | 10000 |
withHeldPerItem | input | 3 | 3 |
withHeldPerItemValue | total × withHeldPerItem / 100 | 10000 × 3 / 100 | 300 |
การคำนวณระดับเอกสาร
| Field | Calculation logic | Example | Value |
|---|---|---|---|
subTotal | ∑(quantity × pricePerUnit) | 10000 | 10000 |
totalAfterDiscount | subTotal | 10000 | 10000 |
vatAmount | totalAfterDiscount × 7 / 100 | 10000 × 7 / 100 | 700 |
documentWithholdingTaxAmount | ∑(withHeldPerItemValue) | 300 | 300 |
grandTotal | totalAfterDiscount+vatAmount | 10000 + 700 | 10700 |

Endpoint: POST /expenses/inline
Payload
{
"contactName": "บริษัท ตัวอย่าง จำกัด",
"publishedOn": "2026-03-05",
"isVat": true,
"isVatInclusive": false,
"isManualWHT": false,
"documentStructureType": "InlineDocument",
"useInlineVat": true,
"documentShowWithholdingTax": true,
"documentWithholdingTaxPercentage": 0,
"documentWithholdingTaxAmount": 300,
"subTotal": 10000,
"totalAfterDiscount": 10000,
"grandTotal": 10700,
"vatableAmount": 10000,
"vatAmount": 700,
"items": [
{
"id": 1,
"type": 1,
"name": "ค่าบริการที่ปรึกษา",
"description": "ค่าที่ปรึกษาโครงการ Q1",
"quantity": 1,
"unitName": "งาน",
"pricePerUnit": 10000,
"total": 10000,
"withHeldPerItem": 3,
"withHeldPerItemValue": 300
}
]
}
Response
- Response จะมี field
useInlineWithholdingTax: trueเพิ่มขึ้นมา เพื่อระบุว่าเอกสารนี้ใช้ Inline Withholding tax documentWithholdingTaxTypes: 1หมายถึงประเภทของการหัก ณ ที่จ่ายเป็นเเบบเปอร์เซ็นต์ (fix)
{
"status": true,
"message": "",
"code": 0,
"data": {
"recordId": 127522,
"documentSerial": "EXP2026020118",
"documentType": "13",
"statusString": "awaiting",
"contactName": "บริษัท ตัวอย่าง จำกัด",
"publishedOn": "2026-02-23T00:00:00",
"isVat": "true",
"isVatInclusive": "false",
"useInlineVat": "true",
"useInlineWithholdingTax": true,
"documentShowWithholdingTax": "true",
"documentWithholdingTaxPercentage": "0",
"documentWithholdingTaxAmount": 300.0,
"documentWithholdingTaxTypes": 1,
"subTotal": "10000",
"discountAmount": "0",
"totalAfterDiscount": "10000",
"vatableAmount": "10000",
"vatAmount": "700.00000000",
"grandTotal": "10700",
"totalWithoutVat": "9300.00000000",
"items": [
{
"description": "สินค้าตัวอย่าง",
"quantity": "1",
"pricePerUnit": "10000",
"total": "10000",
"discountAmount": "0",
"vatRate": "7",
"withHeldPerItem": "3",
"withHeldPerItemValue": "300"
}
]
}
}