We use cookies
We use cookies to enhance your experience and analyse site usage.
Compact receipt for email delivery with transaction details, amount, and payment method.
<!DOCTYPE html>
<html>
<head>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, sans-serif; background: #f8fafc; display: flex; justify-content: center; padding: 40px 20px; }
.receipt { background: white; width: 380px; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 24px rgba(0,0,0,.08); }
.receipt-header { background: #1e293b; color: white; text-align: center; padding: 28px 24px; }
.receipt-header .logo { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.receipt-header .amount { font-size: 42px; font-weight: 800; }
.receipt-header .label { font-size: 12px; color: rgba(255,255,255,.6); margin-top: 4px; }
.receipt-body { padding: 24px; }
.row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
.row:last-child { border-bottom: none; }
.row .label { color: #64748b; }
.row .value { font-weight: 500; color: #1e293b; }
.badge { display: inline-flex; align-items: center; gap: 4px; background: #dcfce7; color: #16a34a; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; }
.footer { background: #f8fafc; padding: 16px 24px; text-align: center; font-size: 12px; color: #94a3b8; border-top: 1px solid #f1f5f9; }
</style>
</head>
<body>
<div class="receipt">
<div class="receipt-header">
<div class="logo">{{company_name}}</div>
<div class="amount">{{total}}</div>
<div class="label">Payment Received</div>
</div>
<div class="receipt-body">
<div class="row"><span class="label">Receipt #</span><span class="value">{{receipt_number}}</span></div>
<div class="row"><span class="label">Date</span><span class="value">{{date}}</span></div>
<div class="row"><span class="label">Customer</span><span class="value">{{customer_name}}</span></div>
<div class="row"><span class="label">Description</span><span class="value">{{description}}</span></div>
<div class="row"><span class="label">Payment Method</span><span class="value">{{payment_method}}</span></div>
<div class="row"><span class="label">Status</span><span class="value"><span class="badge">✓ Paid</span></span></div>
</div>
<div class="footer">Thank you for your payment · {{company_email}}</div>
</div>
</body>
</html>Sign in to open this template in the playground, or copy the HTML and use it with the API.
curl -X POST https://api.htmlpdf.dev/api/pdf \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"html": "<!DOCTYPE html>\n<html>\n<head>\n<style>\n * { box-sizing: border-box; margin: 0; p...",
"format": "A4"
}' \
--output simple-receipt.pdf