Billing और finance systems के लिए Invoice PDF API
Billing data से ordinary invoice PDFs generate करें, JSON Render या Template Render के साथ, जबकि tax और accounting logic आपके system में रहे.
/api/v1/pdf/render Billing, ERP या SaaS system के invoice data को readable PDF invoice में बदलें, जबकि numbering, tax, payment state और accounting semantics caller के system में रहें.
यह API कब इस्तेमाल करें
- Customers, receipts, statements या accounting exports के लिए ordinary invoice PDFs चाहिए.
- आपका system invoice numbers, tax calculation, line items और payment state पहले से own करता है.
- Browser चलाए बिना tables, totals, metadata और optional PDF/A settings चाहिए.
- Repeated invoice layouts के लिए template_id contract चाहिए.
यह क्या replace नहीं करता
- आपको Factur-X या ZUGFeRD जैसी legal e-invoice package चाहिए. E-Invoice Render use करें.
- आप gPdf से tax calculate, accounting rules validate या payments reconcile कराने की उम्मीद करते हैं.
- आप structured JSON या templates के बजाय arbitrary HTML invoice conversion चाहते हैं.
कौन सा endpoint call करें
/api/v1/pdf/render
JSON Render इस workflow का default path है।
/api/v1/template-render
जब workflow को related API path, template contract या capabilities lookup चाहिए, तब इसका उपयोग करें।
/api/v1/e-invoice/render
जब workflow को related API path, template contract या capabilities lookup चाहिए, तब इसका उपयोग करें।
Minimal request
POST /api/v1/pdf/render - minimal invoice header और total.
{
"pages": [
{
"size": "a4",
"elements": [
{
"type": "text",
"x": 20,
"y": 24,
"content": "Invoice INV-1007",
"style": { "font_size": 18, "font_family": "NotoSans-Regular" }
},
{
"type": "text",
"x": 20,
"y": 42,
"content": "Bill to: Example Customer\nAmount due: USD 245.00",
"style": { "font_size": 11, "font_family": "NotoSans-Regular" }
},
{
"type": "line",
"x1": 20,
"y1": 62,
"x2": 190,
"y2": 62
}
]
}
]
}
gPdf क्या handle करता है
- JSON pages या template data से invoice PDF rendering.
- Text, tables, totals blocks, pagination, metadata और optional PDF/A output.
- Multiple systems में use होने वाले stable invoice layouts के लिए Template Render.
- Binary PDF response और consistent API error envelope.
आपका system क्या संभालता है
- Invoice numbers, payment state, tax calculation, discounts, credits और ledger meaning.
- Customer और issuer data, line-item mapping, currencies और rounding rules.
- Retention, delivery, email, payment links और accounting-system reconciliation.
Production checklist
- हर visible invoice field को source billing data से map करना confirm करें.
- Line-item overflow, long customer names, multi-page invoices और totals test करें.
- तय करें कि layout JSON Render में रहेगा या published template में.
- Ordinary invoice PDF generation को legal e-invoice packaging से अलग रखें.
- Invoice records के साथ request IDs और output filenames store करें.
Claim boundaries
- Ordinary invoice PDFs legal e-invoice mandates जैसे नहीं होते.
- gPdf invoice document render करता है; tax या accounting state calculate नहीं करता.
- Factur-X / ZUGFeRD output `POST /api/v1/e-invoice/render` पर belong करता है.
Ordinary invoices और e-invoices का फर्क
Ordinary invoice PDF वह document है जिसे आपका customer पढ़ता है. इसे JSON Render या Template Render से generate किया जा सकता है. आपका system invoice number, taxes, line items, currency और payment state decide करता है; फिर gPdf visible PDF render करता है.
Legal e-invoice अलग है. Factur-X और ZUGFeRD readable PDF/A-3b invoice को
embedded EN 16931 CII XML के साथ combine करते हैं. उस package के लिए
POST /api/v1/e-invoice/render use करें.
Template Render अक्सर production endpoint होता है
Finance teams आम तौर पर नहीं चाहतीं कि हर service invoice coordinates दोबारा
बनाए. Common path है: invoice को एक बार design करें, template के रूप में publish
करें, और callers को stable template_id plus data schema दें. Custom layouts,
internal tools और template prototyping के लिए JSON Render उपयोगी रहता है.
Accounting logic upstream रखें
gPdf को final display values मिलने चाहिए, unresolved accounting decisions नहीं. Render API call करने से पहले tax, discounts, rounding, payment status और invoice eligibility compute करें. इससे PDF output deterministic रहता है और financial system source of truth बना रहता है.
FAQ
- क्या invoice PDF और e-invoice एक ही चीज हैं?
- नहीं. Ordinary invoice PDF human-readable output है. Factur-X या ZUGFeRD e-invoice PDF/A-3b wrapper के अंदर EN 16931 CII XML भी embed करता है.
- Repeated invoices के लिए कौन सा endpoint use करना चाहिए?
- जब invoice layout stable हो और callers को सिर्फ template_id plus data भेजना चाहिए, तब Template Render use करें. जब code layout own करता है, तब JSON Render use करें.
- क्या gPdf taxes calculate करता है?
- नहीं. आपका billing या accounting system render data भेजने से पहले taxes, totals, discounts और payment state calculate करता है.
- क्या invoice PDFs PDF/A use कर सकते हैं?
- हाँ, JSON Render PDF/A settings support करता है. जब invoice को Factur-X या ZUGFeRD के रूप में package करना हो, तभी E-Invoice Render use करें.