ภาพรวมการระบุภาษีหัก ณ ที่จ่าย (Withholding Tax) ผ่าน Document API
warning
เนื้อหานี้สำหรับการใช้งาน Document API สำหรับสร้างหรืออัปเดตเอกสารค่าใช้จ่ายผ่าน POST /expense หรือ PUT /expense เท่านั้น
การระบุภาษีหัก ณ ที่จ่ายในเอกสารค่าใช้จ่าย จะแบ่งตามประเภทของเอกสารที่สร้าง ได้ดังนี้
- เอกสารแบบ Simple สามารถระบุภาษีหัก ณ ที่จ่ายระดับเอกสารได้ 2 แบบ คือ
- ไม่ระบุภาษีหัก ณ ที่จ่าย
- ระบุภาษีหัก ณ ที่จ่ายระดับเอกสาร
- เอกสารแบบ Inline สามารถระบุภาษีหัก ณ ที่จ่ายได้ 3 แบบ ตามการตั้งค่าเอกสาร คือ
- ระบุส่วนลดระดับสินค้า เเละ ระบุภาษีหัก ณ ที่จ่ายระดับเอกสาร
- ระบุส่วนลดระดับสินค้า เเต่ไม่ระบุภาษีหัก ณ ที่จ่ายระดับเอกสาร
- ระบุภาษีหัก ณ ที่จ่ายระ ดับสินค้า
Field ที่เกี่ยวข้อง
Field ระดับเอกสาร
| Field | ประเภท | คำอธิบาย |
|---|---|---|
documentShowWithholdingTax | bool | เปิด/ปิดการแสดงภาษีหัก ณ ที่จ่ายระดับเอกสาร |
documentWithholdingTaxPercentage | decimal | อัตราภาษีหัก ณ ที่จ่ายระดับเอกสาร ค่าที่รองรับ : - 0, 0.5, 0.75, 1, 1.5, 2, 3, 5, 10, 15 |
documentWithholdingTaxAmount | decimal | ยอดรวมภาษีหัก ณ ที่จ่ายระดับเอกสาร |
useInlineVat | bool | เปิด/ปิดการระบุภาษีมูลค่ าเพิ่มเเละภาษี ณ ที่จ่ายระดับรายการสินค้า |
Field ระดับรายการสินค้า
| Field | ประเภท | คำอธิบาย |
|---|---|---|
withHeldPerItem | decimal (nullable) | อัตราหักภาษี ณ ที่จ่ายต่อรายการ (%) ค่าที่รองรับ : - 0, 0.5, 0.75, 1, 1.5, 2, 3, 5, 10, 15 - null (ไม่มีการระบุภาษีหัก ณ ที่จ่าย) |
withHeldPerItemValue | decimal (nullable) | จำนวนเงินหักภาษี ณ ที่จ่ายต่อรายการสินค้า |
รหัสข้อผิดพลาด
เมื่อส่ง Payload ที่ไม่ถูกต้อง ระบบจะตอบกลับด้วย error code และ error message ดั งนี้:
| Error code | Error Message | สาเหตุ |
|---|---|---|
| 207400 | DocumentWithholdingTaxPercentage cannot less than 0 | documentWithholdingTaxPercentage มีค่าน้อยกว่า 0 |
| 207400 | DocumentWithholdingTaxAmount cannot less than 0 | documentWithholdingTaxAmount มีค่าน้อยกว่า 0 |
| 207400 | DocumentWithholdingTaxPercentage is not related to DocumentShowWithholdingTax | documentShowWithholdingTax = false แต่ documentWithholdingTaxPercentage ≠ 0 |
| 207400 | DocumentWithholdingTaxAmount is not related to DocumentShowWithholdingTax | documentShowWithholdingTax = false แต่ documentWithholdingTaxAmount ≠ 0 |
| 207400 | DocumentWithholdingTaxPercentage must be greater than 0 when DocumentShowWithholdingTax is true | สำหรับเอกสาร Simple: documentShowWithholdingTax = true แต่ documentWithholdingTaxPercentage = 0 |
| 207400 | DocumentShowWithholdingTax must be true when UseInlineVat is true | สำหรับเอกสาร Inline: useInlineVat = true แต่ documentShowWithholdingTax = false |
| 207400 | DocumentWithholdingTaxPercentage must be 0 when UseInlineVat is true | สำหรับเอกสาร Inline: useInlineVat = true แต่ documentWithholdingTaxPercentage ≠ 0 |
| 207400 | DocumentWithholdingTaxAmount must be >= 0 when UseInlineVat is true | สำหรับเอกสาร Inline: useInlineVat = true แต่ documentWithholdingTaxAmount < 0 |
| 207400 | WithHeldPerItem must be null when UseInlineVat is false | สำหรับเอกสาร Simple: ส่ง withHeldPerItem ในรายการสินค้า แต่ useInlineVat = false |
| 207400 | WithHeldPerItemValue must be null when UseInlineVat is false | สำหรับเอกสาร Simple: ส่ง withHeldPerItemValue ในรายการสินค้า แต่ useInlineVat = false |
| 207400 | WithHeldPerItem must be null or >= 0 when UseInlineVat is true | สำหรับเอกสาร Inline: withHeldPerItem < 0 |
| 207400 | WithHeldPerItemValue must be null or >= 0 when UseInlineVat is true | สำหรับเอกสาร Inline: withHeldPerItemValue < 0 |
| 70041 | Cannot create a document with an invalid inline withholding tax. | ระบุ withHeldPerItem แต่ไม่ระบุ withHeldPerItemValue (หรือกลับกัน) — ต้องระบุทั้งคู่หรือไม่ระบุทั้งคู่ |
| 70041 | Cannot create a document with a mix of percentage and amount. | รายการสินค้ามีการผสมประเภทของการระบุภาษีหัก ณ ที่จ่าย (บางรายการเป็นเปอร์เซ็นต์ บางรายการเป็นจำนวนเงิน) |
| 70041 | WithHeldPerItem is required. | สำหรับเอกสาร Inline: useInlineVat = true เเต่ withHeldPerItem เป็น null |
| 70041 | WithHeldPerItem is invalid. WithHeldPerItem cannot be less than zero. | withHeldPerItem < 0 |
| 70041 | WithHeldPerItem is invalid. Withholding tax percentage cannot be greater than 100%. | withHeldPerItem > 100 |
| 70041 | WithHeldPerItemValue is required. | withHeldPerItemValue เป็น null ในรายการที่มีการระบุภาษีหัก ณ ที่จ่าย |
| 70041 | InlineWithholdingTax per item value is invalid. Withholding tax value cannot less than 0. | withHeldPerItemValue < 0 |
| 70041 | InlineWithholdingTax per item value is invalid. Withholding tax cannot be greater than item total. | withHeldPerItemValue มากกว่า total ของรายการสินค้า |
| 70041 | UseInlineVat and IsWithholding must be true. | รายการสินค้ามีค่าของภาษีหัก ณ ที่จ่าย แต่ useInlineVat หรือ documentShowWithholdingTax ไม่ได้เปิดใช้งาน |