Publish and generate documents from your document templates using the API
npx htmldocs@latest init
npx htmldocs@latest login
publish
npx htmldocs@latest publish ./documents/templates/Invoice.tsx
documentId
Invoice.documentId = "invoice"; export default Invoice;
Authorization: Bearer YOUR_API_KEY
curl -X POST https://api.htmldocs.com/api/documents/invoice \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "format": "json", "props": { "billedTo": { "name": "Josiah Zhang", "address": "123 Elm Street", "city": "Anytown", "state": "CA", "zip": "12345", "phone": "123-456-7890" }, "yourCompany": { "name": "Your Company", "address": "456 Banana Rd.", "city": "San Francisco", "state": "CA", "zip": "94107", "taxId": "00XXXXX1234X0XX", "phone": "123-456-7890", "email": "hello@email.com" }, "services": [ { "name": "Design", "description": "Website redesign and branding", "quantity": 1, "rate": 1000 }, { "name": "Consulting", "description": "Technical architecture review", "quantity": 2, "rate": 1200 } ] } }'