ใบเสร็จแบบแบ่งชำระแบบ Simple
ใช้ endpoint POST /receipts เพื่อสร้างใบเสร็จรับเงินแบบแบ่งชำระจากใบกำกับภาษี
โดยภาษีมูลค่ าเพิ่มคำนวณในระดับเอกสาร เหมาะสำหรับใบกำกับภาษีที่มีอัตราภาษีเดียว
Request field
Required field ระดับเอกสาร
| Field | ประเภท | คำอธิบาย |
|---|---|---|
isBatchDocument | boolean | ต้องเป็น true เสมอ — ระบุว่าเป็นเอกสารแบบแบ่งชำระ |
partialPaymentMethod | number | ต้องเป็น 11 (RECPartial) |
creditType | number | ต้องเป็น 3 (เงินสด) ค่าอื่นไม่รองรับสำหรับใบเสร็จแบบแบ่งชำระ |
grandTotal | decimal | ต้องเท่ากับ partialAmount |
documentReference | array | ต้องเป็น null หรือ [] เท่านั้น |
Required field ระดับรายการสินค้า
| Field | ประเภท | คำอธิบาย |
|---|---|---|
documentId | number | recordId ของใบกำกับภาษีต้นทาง (ต้องมากกว่า 0) |
documentType | number | ต้องเป็น 7 (ใบกำกับภาษี) |
partialAmount | decimal | ยอดที่ต้องการชำระในงวดนี้ (ต้องมากกว่า 0 และไม่เกินยอดคงเหลือ) |
Field เพิ่มเติม (ไม่บังคับ)
ข้อมูลผู้ติดต่อ
| Field | ประเภท | คำอธิบาย |
|---|---|---|
contactId | integer (int64) | รหัสผู้ติดต่อ |
contactName | string | ชื่อผู้ติดต่อ |
contactCode | string | รหัสลูกค้า |
contactAddress | string | ที่อยู่ |
contactTaxId | string | เลขประจำตัวผู้เสียภาษี (13 หลัก) |
contactBranch | string | สาขา |
contactPerson | string | ชื่อผู้ติดต่อ |
contactEmail | string | อีเมล |
contactNumber | string | เบอร์โทรศัพท์ |
contactZipCode | string | รหัสไปรษณีย์ |
contactGroup | integer | ประเภทผู้ติดต่อ |
ข้อมูลเอกสาร
| Field | ประเภท | คำอธิบาย |
|---|---|---|
dueDate | string (date) | วันครบกำหนด (yyyy-MM-dd) |
publishedOn | string (date) | วันที่ออกเอกสาร (yyyy-MM-dd) |
creditDays | integer | จำนวนวันเครดิต |
salesName | string | ชื่อพนักงานขาย |
reference | string | เลขอ้างอ ิงจากระบบภายนอก |
projectName | string | ชื่อโครงการ |
remarks | string | หมายเหตุ |
internalNotes | string | บันทึกภายใน |
externalDocumentId | string | รหัสเอกสารจากระบบภายนอก |
showSignatureOrStamp | boolean | แสดงพื้นที่ลายเซ็น/ตรา |
การหักเงิน
| Field | ประเภท | คำอธิบาย |
|---|---|---|
useReceiptDeduction | boolean | ใช้การหักเงิน (ค่าเริ่มต้น: false) |
documentDeductionType | integer | ประเภทการหักเงิน |
documentDeductionAmount | number (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
}