Skip to main content

ใบเสร็จแบบแบ่งชำระแบบ Simple

ใช้ endpoint POST /receipts เพื่อสร้างใบเสร็จรับเงินแบบแบ่งชำระจากใบกำกับภาษี โดยภาษีมูลค่าเพิ่มคำนวณในระดับเอกสาร เหมาะสำหรับใบกำกับภาษีที่มีอัตราภาษีเดียว


Request field

Required field ระดับเอกสาร

Fieldประเภทคำอธิบาย
isBatchDocumentbooleanต้องเป็น true เสมอ — ระบุว่าเป็นเอกสารแบบแบ่งชำระ
partialPaymentMethodnumberต้องเป็น 11 (RECPartial)
publishedOnstring (date)วันที่ออกเอกสาร (yyyy-MM-dd)
creditTypenumberต้องเป็น 3 (เงินสด) ค่าอื่นไม่รองรับสำหรับใบเสร็จแบบแบ่งชำระ
grandTotaldecimalต้องเท่ากับผลรวมของ partialAmount ทุกรายการ
documentReferencearrayต้องเป็น null หรือ [] เท่านั้น

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

Fieldประเภทคำอธิบาย
documentIdnumberrecordId ของใบกำกับภาษีต้นทาง (ต้องมากกว่า 0)
documentTypenumberต้องเป็น 7 (ใบกำกับภาษี)
partialAmountdecimalยอดที่ต้องการชำระในงวดนี้ (ต้องมากกว่า 0 และไม่เกินยอดคงเหลือ)

Field เพิ่มเติม (ไม่บังคับ)

ข้อมูลผู้ติดต่อ

Fieldประเภทคำอธิบาย
contactIdinteger (int64)รหัสผู้ติดต่อ
contactNamestringชื่อผู้ติดต่อ
contactCodestringรหัสลูกค้า
contactAddressstringที่อยู่
contactTaxIdstringเลขประจำตัวผู้เสียภาษี (13 หลัก)
contactBranchstringสาขา
contactPersonstringชื่อผู้ติดต่อ
contactEmailstringอีเมล
contactNumberstringเบอร์โทรศัพท์
contactZipCodestringรหัสไปรษณีย์
contactGroupintegerประเภทผู้ติดต่อ

ข้อมูลเอกสาร

Fieldประเภทคำอธิบาย
dueDatestring (date)วันครบกำหนด (yyyy-MM-dd)
creditDaysintegerจำนวนวันเครดิต
salesNamestringชื่อพนักงานขาย
referencestringเลขอ้างอิงจากระบบภายนอก
projectNamestringชื่อโครงการ
remarksstringหมายเหตุ
internalNotesstringบันทึกภายใน
externalDocumentIdstringรหัสเอกสารจากระบบภายนอก
showSignatureOrStampbooleanแสดงพื้นที่ลายเซ็น/ตรา

การหักเงิน

Fieldประเภทคำอธิบาย
useReceiptDeductionbooleanใช้การหักเงิน (ค่าเริ่มต้น: false)
documentDeductionTypeintegerประเภทการหักเงิน
documentDeductionAmountnumber (decimal)จำนวนเงินที่หัก

ตัวอย่างการสร้างใบเสร็จแบบแบ่งชำระ

Scenario ต้องการแบ่งรับชำระเงินจากใบกำกับภาษี INV2026030045 (ยอดรวม 321 บาท) โดยชำระงวดแรก 100 บาท

Endpoint: POST /receipts

tip

field ที่ถูกไฮไลท์ในตัวอย่างข้อมูลที่ส่งและข้อมูลที่ตอบกลับ คือ field ที่เกี่ยวข้องกับใบเสร็จแบบแบ่งชำระโดยเฉพาะ

ตัวอย่าง Payload

ตัวอย่าง request แบบระบุ field ทั้งหมดที่รองรับ สำหรับใช้เป็นแนวทางในการส่งข้อมูล

{
"contactId": 490472,
"contactName": "ContactName",
"contactCode": "",
"contactAddress": "11/12 Example Rd, Silom, Bang Rak, Bangkok Example contact address",
"contactTaxId": "1234567890123",
"contactBranch": "สำนักงานใหญ่",
"contactPerson": "ExamplePerson",
"contactEmail": "Example@email.com",
"contactNumber": "0876543210",
"contactZipCode": "10500",
"contactGroup": 1,
"publishedOn": "2026-03-12",
"dueDate": "2026-03-12",
"isBatchDocument": true,
"partialPaymentMethod": 11,
"creditType": 3,
"creditDays": 0,
"grandTotal": 100,
"documentReference": [],
"useReceiptDeduction": true,
"documentDeductionType": 1,
"documentDeductionAmount": 10,
"salesName": "ExampleSalesName",
"reference": "ExampleReference",
"projectName": "ExampleProject",
"remarks": "ExampleRemarks",
"internalNotes": "ExampleInternalNotes",
"externalDocumentId": "test-xxx01",
"showSignatureOrStamp": true,
"items": [
{
"documentId": 9962945,
"documentType": 7,
"partialAmount": 100
}
]
}

Response (200 OK)

แสดงเฉพาะ field ที่เกี่ยวข้องกับใบเสร็จแบบแบ่งชำระ — field อื่นที่ไม่ได้แสดงจะตอบกลับเหมือนใบเสร็จรับเงินปกติ

{
"data": {
"items": [
{
"documentId": 9962945,
"documentType": 7,
"documentSerial": "INV2026030045",
"documentPublishedOn": "2026-03-12T00:00:00",
"documentDuedate": "2026-03-12T00:00:00",
"documentGrandTotal": 321.0,
"documentPaymentAmount": 321.0,
"partialAmount": 100.0
}
],
"status": "1",
"documentType": "9",
"publishedOn": "2026-03-12T00:00:00",
"creditType": "3",
"grandTotal": "100",
"useReceiptDeduction": "true",
"documentDeductionType": "1",
"documentDeductionAmount": "10",
"referencedByMe": [
{
"referenceId": "9962945",
"referenceDocumentType": "7",
"referenceDocumentSerial": "INV2026030045",
"documentId": "66603",
"documentType": "9",
"documentSerial": "RE2026030079",
"type": 11
}
],
"recordId": 66603,
"documentId": 66603,
"documentSerial": "RE2026030079",
"statusString": "awaiting",
"isBatchDocument": true,
"..."
},
"status": true,
"message": "",
"code": 0
}