Invoicing और finance

Ecommerce और SaaS payments के लिए Receipt PDF API

Order, payment, tax और refund data से QR codes, barcodes, PDF/A settings और repeatable template output वाले receipt PDFs generate करें.

PRIMARY API JSON Render
ENDPOINT /api/v1/pdf/render
SYSTEMS ecommerce backend / billing backend / SaaS platform / POS export service
काम जो पूरा करना है

Completed order, payment, refund और tax data को receipt PDF में बदलें, जिसे email, store, print या customer account से attach किया जा सके, बिना हर caller से PDF drawing code own कराए.

यह API कब इस्तेमाल करें

  • आपका system payment status, receipt number, tax lines और customer data पहले से own करता है.
  • Email, account history, support workflows या audit export के लिए receipt PDF चाहिए.
  • Lookup, refund या pickup flows के लिए receipt में QR codes या barcodes चाहिए.
  • Layout approve होने के बाद stable receipt template चाहिए.

यह क्या replace नहीं करता

  • आपको payment processing या refund execution चाहिए. gPdf receipt render करता है; money movement आपका payment system own करता है.
  • आपको legal e-invoice packaging चाहिए. Factur-X या ZUGFeRD output के लिए E-Invoice Render endpoint use करें.
  • आपको POS hardware control या cash drawer logic चाहिए.

कौन सा endpoint call करें

PRIMARY

/api/v1/pdf/render

JSON Render इस workflow का default path है।

SECONDARY 1

/api/v1/template-render

जब workflow को related API path, template contract या capabilities lookup चाहिए, तब इसका उपयोग करें।

Minimal request

POST /api/v1/pdf/render - lookup QR code वाला compact receipt.

{
  "pages": [
    {
      "size": "a6",
      "elements": [
        {
          "type": "text",
          "x": 10,
          "y": 12,
          "content": "Receipt R-2026-1001",
          "style": { "font_size": 16, "font_family": "NotoSans-Regular" }
        },
        {
          "type": "text",
          "x": 10,
          "y": 28,
          "content": "Order total: $82.40\nPaid by card ending 4242\nTax: $6.10",
          "style": { "font_size": 10, "font_family": "NotoSans-Regular" }
        },
        {
          "type": "barcode",
          "format": "qrcode",
          "content": "https://example.com/receipts/R-2026-1001",
          "x": 10,
          "y": 58,
          "width": 28,
          "height": 28
        }
      ]
    }
  ]
}

gPdf क्या handle करता है

  • JSON Render payloads से receipt page rendering.
  • Text, totals, item lines, QR codes, barcodes, metadata और optional PDF/A settings.
  • Same receipt layout reuse होने पर Template Render binding.
  • Failure पर shared gPdf error envelope के साथ binary PDF output.

आपका system क्या संभालता है

  • Payment authorization, capture, refund, tax calculation और receipt numbering.
  • Customer identity, order state, currency formatting और retention policy.
  • Email delivery, account storage और duplicate receipt handling.

Production checklist

  1. Stable receipt number use करें और हर render के साथ X-Request-Id pass करें.
  2. तय करें कि receipts source data से regenerate होंगी या first render के बाद store होंगी.
  3. Long item names, refunds, discounts, multi-tax lines और zero-value orders test करें.
  4. Support और finance teams layout approve कर दें, तो Template Render पर switch करें.
  5. Payment और tax decisions को rendering request से बाहर रखें.

Claim boundaries

  • gPdf payments process नहीं करता, tax calculate नहीं करता और refunds issue नहीं करता.
  • Receipt PDF अपने आप legal e-invoice नहीं बनती.
  • Business truth आपका system own करता है; gPdf उसका PDF representation render करता है.

Receipt PDFs rendering outputs हैं

यह separate payment या POS endpoint नहीं है. आपका ecommerce, billing या POS backend decide करता है कि receipt exists करती है, फिर receipt content को DocumentRequest या published template के data के रूप में gPdf को भेजता है.

Rendering layer deterministic रहनी चाहिए. अगर support agent वही receipt फिर से मांगता है, तो आपका system retention policy के हिसाब से source data replay कर सकता है या पहले से stored PDF लौटा सकता है.

Repeated receipts के लिए template path

Receipt layouts आम तौर पर जल्दी stabilize हो जाते हैं. Design approve होने के बाद template publish करें और receipt fields के साथ POST /api/v1/template-render call करें. इससे payment systems data पर focus रखते हैं और layout ownership एक जगह रहती है.

FAQ

क्या gPdf receipt total calculate कर सकता है?
नहीं. Totals, discounts, tax और refund state आपका payment या commerce system own करता है. gPdf आपके भेजे values render करता है.
Receipts JSON Render use करें या Template Render?
Layout design करते समय JSON Render use करें. Receipt layout और field contract stable होने पर Template Render use करें.
क्या receipt में QR code हो सकता है?
हाँ. gPdf PDF output में QR code barcode elements support करता है. QR code में encode होने वाला URL या payload आपका system own करता है.
क्या यह e-invoice API जैसा है?
नहीं. Ordinary receipt PDFs JSON Render या Template Render use करते हैं. Factur-X और ZUGFeRD packaging E-Invoice Render endpoint use करती है.