
Auto-Generate PDF Receipts After Stripe Payments
Every app that takes payments needs to send receipts. Stripe has built-in receipts, but they're Stripe-branded and limited. If you need custom receipts — with your company info, tax breakdowns, payment details — you have to generate them yourself. The typical approach is setting up Puppeteer, writing an HTML template, managing CSS, and rendering PDFs on your server. It works, but it's heavy and annoying to maintain. Here's a simpler approach: listen for Stripe's payment_intent.succeeded webhook, call a receipt API, and email the PDF to your customer. No HTML templates. No Puppeteer. Under 50 lines of code. The Setup We need three things: A Stripe webhook listener A receipt PDF generator (we'll use Kagyz ) An email sender (SendGrid, Resend, or any SMTP) Step 1: Listen for Stripe Payments import Stripe from " stripe " ; import express from " express " ; const stripe = new Stripe ( process . env . STRIPE_SECRET_KEY ); const app = express (); app . post ( " /webhook/stripe " , express . ra
Continue reading on Dev.to JavaScript
Opens in a new tab


