Reference invoice

One English invoice template, every xgenerate API call: nested tables, computed totals, images, a payment QR code, a Swiss QR-bill, a letterhead, a conditional block. Full walkthrough in README.md; the contract is at /contract (Swagger UI).

Rendered invoice, page 1 Rendered invoice, page 2 Rendered invoice, QR-bill page

Files

FileWhat
Invoice-Form-A-CH-EN.docxthe template
fields.extracted.jsonresponse of POST /documents/fields — the empty contract
request.fields.jsonthe filled envelope (images inlined as data URIs; invoice.paid decides the conditional block)
sidecar.bindings.yamlcomputed bindings for the multipart sidecar part
evaluate.request.jsonthe same bindings for POST /bindings/evaluate
watermark.jsonoptional watermark part
expected/Invoice-Form-A-CH-EN.pdfthe generated PDF
run.shall calls as curl commands
assets/logo, signature and letterhead images

Run it

In an empty directory, download all inputs and run the six calls:

example_url=https://api.xgenerate.io/v2/contract/examples/reference-invoice
for file in run.sh Invoice-Form-A-CH-EN.docx request.fields.json \
  sidecar.bindings.yaml evaluate.request.json watermark.json; do
  curl -fsS -O "$example_url/$file" || exit 1
done
XGENERATE_CLIENT_ID=... XGENERATE_CLIENT_SECRET=... bash run.sh