Skip to main content

ภาพรวมการระบุภาษีหัก ณ ที่จ่าย (Withholding Tax) ผ่าน Document API

warning

เนื้อหานี้สำหรับการใช้งาน Document API สำหรับสร้างหรืออัปเดตเอกสารค่าใช้จ่ายผ่าน POST /expense หรือ PUT /expense เท่านั้น

การระบุภาษีหัก ณ ที่จ่ายในเอกสารค่าใช้จ่าย จะแบ่งตามประเภทของเอกสารที่สร้าง ได้ดังนี้

  1. เอกสารแบบ Simple สามารถระบุภาษีหัก ณ ที่จ่ายระดับเอกสารได้ 2 แบบ คือ
    • ไม่ระบุภาษีหัก ณ ที่จ่าย
    • ระบุภาษีหัก ณ ที่จ่ายระดับเอกสาร
  2. เอกสารแบบ Inline สามารถระบุภาษีหัก ณ ที่จ่ายได้ 3 แบบ ตามการตั้งค่าเอกสาร คือ
    • ระบุส่วนลดระดับสินค้า เเละ ระบุภาษีหัก ณ ที่จ่ายระดับเอกสาร
    • ระบุส่วนลดระดับสินค้า เเต่ไม่ระบุภาษีหัก ณ ที่จ่ายระดับเอกสาร
    • ระบุภาษีหัก ณ ที่จ่ายระดับสินค้า

Field ที่เกี่ยวข้อง

Field ระดับเอกสาร

Fieldประเภทคำอธิบาย
documentShowWithholdingTaxboolเปิด/ปิดการแสดงภาษีหัก ณ ที่จ่ายระดับเอกสาร
documentWithholdingTaxPercentagedecimalอัตราภาษีหัก ณ ที่จ่ายระดับเอกสาร
ค่าที่รองรับ :
- 0, 0.5, 0.75, 1, 1.5, 2, 3, 5, 10, 15
documentWithholdingTaxAmountdecimalยอดรวมภาษีหัก ณ ที่จ่ายระดับเอกสาร
useInlineVatboolเปิด/ปิดการระบุภาษีมูลค่าเพิ่มเเละภาษี ณ ที่จ่ายระดับรายการสินค้า

Field ระดับรายการสินค้า

Fieldประเภทคำอธิบาย
withHeldPerItemdecimal (nullable)อัตราหักภาษี ณ ที่จ่ายต่อรายการ (%)
ค่าที่รองรับ :
- 0, 0.5, 0.75, 1, 1.5, 2, 3, 5, 10, 15
- null (ไม่มีการระบุภาษีหัก ณ ที่จ่าย)
withHeldPerItemValuedecimal (nullable)จำนวนเงินหักภาษี ณ ที่จ่ายต่อรายการสินค้า

รหัสข้อผิดพลาด

เมื่อส่ง Payload ที่ไม่ถูกต้อง ระบบจะตอบกลับด้วย error code และ error message ดังนี้:

Error codeError Messageสาเหตุ
207400DocumentWithholdingTaxPercentage cannot less than 0documentWithholdingTaxPercentage มีค่าน้อยกว่า 0
207400DocumentWithholdingTaxAmount cannot less than 0documentWithholdingTaxAmount มีค่าน้อยกว่า 0
207400DocumentWithholdingTaxPercentage is not related to DocumentShowWithholdingTaxdocumentShowWithholdingTax = false แต่ documentWithholdingTaxPercentage ≠ 0
207400DocumentWithholdingTaxAmount is not related to DocumentShowWithholdingTaxdocumentShowWithholdingTax = false แต่ documentWithholdingTaxAmount ≠ 0
207400DocumentWithholdingTaxPercentage must be greater than 0 when DocumentShowWithholdingTax is trueสำหรับเอกสาร Simple: documentShowWithholdingTax = true แต่ documentWithholdingTaxPercentage = 0
207400DocumentShowWithholdingTax must be true when UseInlineVat is trueสำหรับเอกสาร Inline: useInlineVat = true แต่ documentShowWithholdingTax = false
207400DocumentWithholdingTaxPercentage must be 0 when UseInlineVat is trueสำหรับเอกสาร Inline: useInlineVat = true แต่ documentWithholdingTaxPercentage ≠ 0
207400DocumentWithholdingTaxAmount must be >= 0 when UseInlineVat is trueสำหรับเอกสาร Inline: useInlineVat = true แต่ documentWithholdingTaxAmount < 0
207400WithHeldPerItem must be null when UseInlineVat is falseสำหรับเอกสาร Simple: ส่ง withHeldPerItem ในรายการสินค้า แต่ useInlineVat = false
207400WithHeldPerItemValue must be null when UseInlineVat is falseสำหรับเอกสาร Simple: ส่ง withHeldPerItemValue ในรายการสินค้า แต่ useInlineVat = false
207400WithHeldPerItem must be null or >= 0 when UseInlineVat is trueสำหรับเอกสาร Inline: withHeldPerItem < 0
207400WithHeldPerItemValue must be null or >= 0 when UseInlineVat is trueสำหรับเอกสาร Inline: withHeldPerItemValue < 0
70041Cannot create a document with an invalid inline withholding tax.ระบุ withHeldPerItem แต่ไม่ระบุ withHeldPerItemValue (หรือกลับกัน) — ต้องระบุทั้งคู่หรือไม่ระบุทั้งคู่
70041Cannot create a document with a mix of percentage and amount.รายการสินค้ามีการผสมประเภทของการระบุภาษีหัก ณ ที่จ่าย (บางรายการเป็นเปอร์เซ็นต์ บางรายการเป็นจำนวนเงิน)
70041WithHeldPerItem is required.สำหรับเอกสาร Inline: useInlineVat = true เเต่ withHeldPerItem เป็น null
70041WithHeldPerItem is invalid. WithHeldPerItem cannot be less than zero.withHeldPerItem < 0
70041WithHeldPerItem is invalid. Withholding tax percentage cannot be greater than 100%.withHeldPerItem > 100
70041WithHeldPerItemValue is required.withHeldPerItemValue เป็น null ในรายการที่มีการระบุภาษีหัก ณ ที่จ่าย
70041InlineWithholdingTax per item value is invalid. Withholding tax value cannot less than 0.withHeldPerItemValue < 0
70041InlineWithholdingTax per item value is invalid. Withholding tax cannot be greater than item total.withHeldPerItemValue มากกว่า total ของรายการสินค้า
70041UseInlineVat and IsWithholding must be true.รายการสินค้ามีค่าของภาษีหัก ณ ที่จ่าย แต่ useInlineVat หรือ documentShowWithholdingTax ไม่ได้เปิดใช้งาน