Skip to content
PPDFInvoiceAPI

Generate credit notes from HTML, in one API call

credit note PDF API

When you refund or adjust an invoice, a credit note is the document that makes the books balance. Render one from the same template family as your invoices — same branding, correct VAT, a clear reference to the original invoice — in a single call.

No credit card · 25 free credits to start

OVERVIEW

What is the credit note PDF API?

The credit note PDF API is an HTTP endpoint that renders a branded credit note from HTML in one request. You POST the credit data as JSON to /v1/render — negative amounts, reversed VAT, and a reference to the original invoice — and get a print-ready PDF back in about 400ms, in the same template family as your invoices.

A credit note is the document that makes the books balance after a refund, return or correction. It is essentially a negative invoice: the same parties and tax treatment, but with reversed amounts and a clear pointer back to the invoice it offsets. Accountants expect it to carry its own number, the original invoice number, and VAT that mirrors the original — so it has to be correct and consistent, not improvised each time something is refunded.

Generating credit notes from HTML keeps them in lockstep with your invoices instead of forking into a separate generator that drifts. You build the credit note in the same HTML/CSS family as your invoice template — same branding, same layout — and let the data carry the differences: a CN number, the “against invoice” reference, the reason, and negative line totals. Negative amounts and reversed VAT are just values your CSS lays out; the renderer reproduces them exactly as they appear on screen, in any currency or glyph.

Because it is the same shape as an invoice, issuing one is a single call: POST the credit data to /v1/render and the PDF comes back in roughly 400 milliseconds, ready to email or archive against the customer’s account. Drop the original invoice number in from data so every credit note traces back to the document it offsets, and the pair reconciles cleanly on the customer’s statement. Nothing is stored on our side; the bytes are streamed back and discarded — handy for a document you may only issue occasionally but still need to get exactly right.

THE PROBLEM

Generating credit notes in-house is a two-week project you'll maintain forever

Turning HTML into a clean PDF yourself means running headless Chrome and everything around it. Here's the work you skip.

  • Forking your invoice layout into a separate credit-note generator that drifts over time.
  • Getting the negative amounts and reversed VAT to render correctly by hand.
  • Linking the credit note back to the original invoice number consistently.
  • Maintaining a PDF pipeline for a document you only issue occasionally.

THE SOLUTION

From your data to a finished credit note, in one request

Store your credit notes layout once, then POST the values to /v1/render and get print-ready application/pdfbytes back in roughly 400ms. Merge is plain{{ }} /{{{ }}} and dotted keys — no template loops to learn, so repeating rows are rendered to HTML and dropped in through one raw placeholder.

  • Matches your invoices. Same HTML/CSS family as your invoice template — your branding, just the credit-note variant.
  • VAT-correct reversals. Negative amounts and reversed VAT lay out exactly as your CSS dictates, so the books balance.
  • References the original. Drop the original invoice number in from data so every credit note traces back to its invoice.

Full /v1/render reference →

curl https://api.pdfinvoiceapi.com/v1/render \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "template": "tpl_credit_note",
    "data": {
      "creditNo": "CN-0042",
      "againstInvoice": "INV-1019",
      "issued": "2026-06-24",
      "billTo": { "name": "Globex LLC" },
      "reason": "Returned: 1 × edge hosting",
      "amount": "-€40.00",
      "vat": "-€8.40",
      "total": "-€48.40"
    },
    "pdf": { "format": "A4", "margin": "18mm", "printBackground": true }
  }' \
  -o credit-note.pdf

HOW TO

How to generate credit notes from HTML

  1. 01

    Reuse your invoice layout in HTML

    Build the credit note in the same HTML/CSS family as your invoice template, with placeholders for the credit number, the “against invoice” reference, the reason, and negative line totals. Same branding, just the credit-note variant.

  2. 02

    Store it once as a template

    Save the layout in the dashboard for a tpl_ id alongside your invoice template, so the two never drift. Every credit note is then just data.

  3. 03

    POST the credit data to /v1/render

    Send the template id and a JSON data object with your API key — negative amounts, reversed VAT, and the original invoice number. The renderer lays them out exactly as your CSS dictates.

  4. 04

    Stream the PDF back

    The response body is the credit note PDF. Email it to the customer or archive it against their account — issued in the same flow that processed the refund or adjustment.

WHAT YOU GET

The features that matter for credit notes

Matches your invoices

Same HTML/CSS family as your invoice template — your branding, just the credit-note variant.

VAT-correct reversals

Negative amounts and reversed VAT lay out exactly as your CSS dictates, so the books balance.

References the original

Drop the original invoice number in from data so every credit note traces back to its invoice.

FAQ

Credit notes on PDFInvoiceAPI — common questions

How do I generate a credit note PDF from HTML?
Build the credit note as HTML/CSS with {{ placeholders }} — ideally in the same family as your invoice template — store it once, then POST the template id and a JSON data object to /v1/render. You get application/pdf bytes back in one synchronous call, no SDK or browser of your own.
How do I render negative amounts and reversed VAT?
They are just values in your data. Pass the negative line totals and reversed VAT as {{ placeholders }} and the renderer lays them out exactly as your CSS dictates, in any currency or glyph — the tax math is yours, the faithful rendering is ours.
Can the credit note reference the original invoice?
Yes. Drop the original invoice number in from data so every credit note carries its “against invoice” reference and traces back to the document it offsets — the pair then reconciles cleanly on the customer’s statement.
Can it match my existing invoice design?
That is the point. Keep the credit note in the same HTML/CSS family as your invoice template so it shares your branding and layout exactly — it is just the credit-note variant, driven from the same data shape.
Can I use my own logo, fonts and brand colours?
Always — the PDF is your own HTML/CSS. Drive the logo and accent colour from data, or save a brand kit and {{brand.logo}} / {{brand.color}} fill in automatically.
Are my credit notes stored on your servers?
No. Each credit note is streamed back in the response and discarded — the content is processed transiently and never persisted on our side.

Render your first credit note PDF in the next five minutes

One endpoint, real PDFs, 25 free credits to start. No credit card to begin.

Cancel anytime · no long-term contract