All templates
Payment receipt template
A5 portraitA centered, digital-style payment receipt on a compact A5 page: a paid badge, the amount paid, the masked payment method, itemized charges, and a tax summary. Wire it to your payment webhook and every successful charge gets its receipt.

The exact PDF the API produces. What you preview is what you generate.
Generate with the API
Use this template, publish it to get a template id, then call the API with your data. Replace YOUR_TEMPLATE_ID and YOUR_API_KEY with your own.
import { writeFile } from "node:fs/promises";
import { PdfGlyph } from "pdfglyph";
const client = new PdfGlyph({
apiKey: "YOUR_API_KEY",
baseUrl: "https://api.pdfglyph.dev",
});
const { pdf } = await client.generate({
templateId: "YOUR_TEMPLATE_ID",
data: {
"receiptNumber": "RCPT-4Q2X-0917",
"datePaid": "June 12, 2026",
"amountPaid": "$53.41",
"subtotal": "$49.00",
"taxLabel": "Tax (9%)",
"taxAmount": "$4.41",
"total": "$53.41",
"merchant": {
"name": "PDFglyph",
"email": "support@pdfglyph.dev"
},
"customer": {
"name": "Dana Whitfield",
"email": "dana@example.com"
},
"paymentMethod": {
"brand": "Visa",
"last4": "4242"
},
"items": [
{
"description": "Pro plan, monthly",
"amount": "$49.00"
}
]
},
});
// pdf is a Uint8Array — write it to a file, return it, or stream it.
await writeFile("document.pdf", pdf);Sample data
The JSON this preview was rendered from. Match these fields, or edit the template to fit the data you already have.
{
"receiptNumber": "RCPT-4Q2X-0917",
"datePaid": "June 12, 2026",
"amountPaid": "$53.41",
"subtotal": "$49.00",
"taxLabel": "Tax (9%)",
"taxAmount": "$4.41",
"total": "$53.41",
"merchant": {
"name": "PDFglyph",
"email": "support@pdfglyph.dev"
},
"customer": {
"name": "Dana Whitfield",
"email": "dana@example.com"
},
"paymentMethod": {
"brand": "Visa",
"last4": "4242"
},
"items": [
{
"description": "Pro plan, monthly",
"amount": "$49.00"
}
]
}Start from the Payment receipt template
Open it in the editor as a new draft, adjust the HTML until it looks like yours, then generate PDFs from your code.