Generate invoice PDFs with an API using HTML templates, Handlebars, or AI. Code examples in Node.js and Python with Stripe webhook automation and free templates.