Statement PDF API สำหรับ account และ billing exports
สร้าง PDF statement สำหรับ account, billing และ activity พร้อม rows หลายหน้า totals metadata และ optional PDF/A archival settings
/api/v1/pdf/render เรนเดอร์ customer, account หรือ billing statement PDFs จาก period data, opening balances, line items, adjustments และ totals เพื่อให้ผู้ใช้ download record ที่สม่ำเสมอสำหรับ review หรือ retention
ควรใช้ API นี้เมื่อใด
- ระบบของคุณเป็นเจ้าของ balances, statement periods, transaction rows และ totals อยู่แล้ว
- คุณต้องการ PDF export สำหรับ account history, billing summaries หรือ finance workflows
- คุณต้องการ output หลายหน้าที่ repeat ได้พร้อม headers, footers และ summary sections
- คุณอาจต้องใช้ PDF/A output สำหรับ archival workflows
สิ่งที่ไม่ได้ทดแทน
- คุณต้องการ bank connectivity, ledger reconciliation หรือ financial advice
- คุณต้องการ encrypted statements และ PDF/A ใน render request เดียว public Render API ถือว่า security settings และ PDF/A profile settings เป็น mutually exclusive
- คุณต้องการ e-invoice XML packaging ให้ใช้ E-Invoice Render endpoint สำหรับเรื่องนั้น
ควรเรียก endpoint ใด
/api/v1/pdf/render
JSON Render คือ path หลักสำหรับเวิร์กโฟลว์นี้.
/api/v1/template-render
ใช้เมื่อเวิร์กโฟลว์ต้องการ API path ที่เกี่ยวข้อง สัญญาเทมเพลต หรือการค้นหา capability.
Minimal request
POST /api/v1/pdf/render - cover page ของ statement พร้อม period totals
{
"settings": {
"profile": "pdfa-2b"
},
"pages": [
{
"size": "letter",
"elements": [
{
"type": "text",
"x": 18,
"y": 20,
"content": "Account Statement",
"style": { "font_size": 18, "font_family": "NotoSans-Regular" }
},
{
"type": "text",
"x": 18,
"y": 38,
"content": "Period: 2026-05-01 to 2026-05-31\nOpening balance: $1,240.00\nClosing balance: $1,890.25",
"style": { "font_size": 11, "font_family": "NotoSans-Regular" }
}
]
}
]
}
gPdf จัดการอะไร
- การเรนเดอร์ DocumentRequest สำหรับ statement pages
- text blocks, tables, totals sections, page numbering, metadata และ PDF/A profile settings
- Template Render สำหรับ layout statement และ field contract ที่เสถียร
- binary PDF output ที่เหมาะกับการ download หรือ storage โดยระบบของคุณ
ระบบของคุณรับผิดชอบอะไร
- statement period logic, account balances, transaction data, currency rules และ customer identity
- archival policy, access control, file naming และ secure delivery
- reconciliation, audit approval หรือ regulated financial representation ใด ๆ
Production checklist
- ทดสอบคำอธิบาย transaction ที่ยาว row count สูง period ว่าง และ negative balances
- สร้าง request ID สำหรับ statement render ทุกครั้ง
- ตัดสินใจว่าจะ render on demand หรือเก็บ statement แต่ละชุดหลังปิด period
- ใช้ PDF/A เฉพาะเมื่อ archival policy ของ statement ต้องการ
- เก็บ access control และ customer authentication ไว้นอก render API
ขอบเขตของ claim
- gPdf ไม่คำนวณ account balances และไม่ reconcile ledgers
- API เรนเดอร์ statement PDFs; ระบบของคุณเป็นเจ้าของ financial correctness
- PDF/A output เป็น render setting ไม่ใช่ตัวแทนของ retention policy
Statements คือเอกสารของช่วงเวลา
หน้า statement ควรเริ่มจากชุด business facts ที่ปิดแล้ว: account, period, opening balance, activity rows, adjustments และ closing balance gPdf ไม่ตัดสินข้อเท็จจริงเหล่านั้น แต่เรนเดอร์เป็น layout PDF ที่ผู้ใช้ download หรือระบบของคุณจัดเก็บได้
การจัดการ row set ขนาดใหญ่
สำหรับ row count สูง ให้ออกแบบ statement เป็น layout ที่ repeat ได้พร้อม table regions, summary sections และ page numbers ใช้ JSON Render ระหว่างปรับ layout แล้วค่อยย้ายไป Template Render เมื่อ field contract เสถียร
FAQ
- gPdf คำนวณ statement balances ได้หรือไม่
- ไม่ได้ ระบบของคุณส่ง period, balances, rows และ totals ส่วน gPdf เรนเดอร์ PDF
- statement PDFs ใช้ PDF/A ได้หรือไม่
- ได้ JSON Render รองรับ PDF/A profile settings archival policy ของคุณเป็นผู้ตัดสินว่าต้องใช้ PDF/A หรือไม่
- statements ควรใช้ Template Render หรือไม่
- โดยทั่วไปใช่หลัง layout เสถียร Template Render ให้ caller ส่ง period data โดยไม่ต้องทำ page coordinates ซ้ำ
- gPdf เก็บ statements หรือไม่
- ไม่ standard render requests ส่งกลับ PDF response ระบบของคุณเป็นเจ้าของ storage และ access control