Stable document contracts के लिए Template PDF API
Repeated layouts को एक बार own करके ERP, OMS, WMS या SaaS callers में reuse करना हो, तो stable template_id और data array से PDF render करें.
/api/v1/template-render हर request में pages, coordinates और layout elements describe कराने के बजाय stable template_id और business data array भेजकर repeated PDFs render करें.
यह API कब इस्तेमाल करें
- Document layout approved है और multiple callers या jobs में reuse होता है.
- Callers को coordinate-level layout JSON नहीं, सिर्फ business data भेजना चाहिए.
- आपको invoice, packing list, shipping label या custom template output चाहिए.
- Active template revisions को caller से बाहर control करना है.
यह क्या replace नहीं करता
- आप अभी layout design कर रहे हैं. Coordinates और fields stable होने तक JSON Render use करें.
- आपको arbitrary HTML-to-PDF conversion चाहिए.
- आपको embedded CII XML वाली e-invoice PDF/A-3b packaging चाहिए.
कौन सा endpoint call करें
/api/v1/template-render
Template Render इस workflow का default path है।
/api/v1/pdf/render
जब workflow को related API path, template contract या capabilities lookup चाहिए, तब इसका उपयोग करें।
Minimal request
POST /api/v1/template-render - template से एक invoice render करें.
{
"template_id": "invoice",
"data": [
{
"invoice_number": "INV-2026-001",
"date_of_issue": "2026-05-29",
"date_due": "2026-06-28",
"issuer_name": "Acme Cloud Inc.",
"issuer_address": "88 Harbor Rd, Long Beach, CA",
"bill_to_name": "Receiver Inc.",
"bill_to_address": "123 Main St, Los Angeles, CA",
"subtotal": "$100.00",
"total": "$100.00",
"amount_due": "$100.00",
"items": [
{
"description": "Service A",
"qty": 1,
"unit_price": "$100.00",
"amount": "$100.00"
}
]
}
]
}
gPdf क्या handle करता है
- Stable template_id से template lookup.
- Active template के against हर data item render करना.
- Public endpoint limits के अंदर rendered pages को single PDF में concatenate करना.
- Shared authentication, request ID और error envelope behavior.
आपका system क्या संभालता है
- Template selection, field mapping, business data और caller authorization.
- Template publication workflow, change communication और test coverage.
- बहुत सारे documents render करते समय chunking, queueing और retries.
Production checklist
- template_id को opaque stable contract की तरह treat करें.
- Template Render call करने से पहले data fields validate करें.
- Active template और representative data के लिए golden-PDF tests रखें.
- Large batches को public Template Render limits के हिसाब से split करें.
- Traceability के लिए template_id, request ID और business object IDs log करें.
Claim boundaries
- Template Render अपने आप design tool नहीं है; templates पहले से published होने चाहिए.
- gPdf template से missing business data infer नहीं करता.
- Template Render, E-Invoice Render endpoint को replace नहीं करता.
Template Render production contract layer है
जब layout design हो रहा हो, JSON Render ideal है. Layout contract बन जाने के बाद
Template Render use करें. Callers template_id और data भेजते हैं; active
template document structure own करता है.
इससे callers छोटे रहते हैं और template changes को review, test और rollout करना आसान होता है.
FAQ
- JSON Render के बजाय Template Render कब use करना चाहिए?
- Layout approve हो जाने के बाद, जब callers को सिर्फ business data भेजना चाहिए, तब Template Render use करें.
- क्या template_id stable होता है?
- हाँ. Template API docs में template_id को stable caller-facing identifier के रूप में describe किया गया है.
- क्या एक request multiple data items render कर सकती है?
- हाँ. Template Render public endpoint limits के अंदर data array स्वीकार करता है.
- क्या Template Render e-invoices बना सकता है?
- नहीं. Factur-X और ZUGFeRD PDF/A-3b packaging के लिए E-Invoice Render endpoint use होता है.