Invoice PDF
Try this template in the editor →
Complete invoice template
Section titled “Complete invoice template”<!DOCTYPE html><html><head> <meta charset="UTF-8"></head><body class="bg-white p-8"> <div class="max-w-2xl mx-auto"> <!-- Header --> <div class="flex justify-between items-start mb-8"> <div> <h1 class="text-3xl font-bold text-gray-900">INVOICE</h1> <p class="text-gray-500 mt-1">#INV-2025-001</p> </div> <div class="text-right"> <p class="font-semibold text-gray-900">Your Company</p> <p class="text-gray-500 text-sm">123 Business Street</p> <p class="text-gray-500 text-sm">City, Country 12345</p> </div> </div>
<!-- Client info --> <div class="bg-gray-50 rounded-lg p-4 mb-8"> <p class="text-sm text-gray-500 mb-1">Bill to:</p> <p class="font-semibold text-gray-900">Client Name</p> <p class="text-gray-600 text-sm">client@example.com</p> </div>
<!-- Items --> <table class="w-full mb-8"> <thead> <tr class="border-b border-gray-200"> <th class="text-left py-2 text-gray-500 font-medium">Description</th> <th class="text-right py-2 text-gray-500 font-medium">Qty</th> <th class="text-right py-2 text-gray-500 font-medium">Price</th> <th class="text-right py-2 text-gray-500 font-medium">Total</th> </tr> </thead> <tbody> <tr class="border-b border-gray-100"> <td class="py-3 text-gray-900">API Credits - Starter Plan</td> <td class="py-3 text-right text-gray-600">1</td> <td class="py-3 text-right text-gray-600">$19.00</td> <td class="py-3 text-right text-gray-900 font-medium">$19.00</td> </tr> </tbody> </table>
<!-- Total --> <div class="flex justify-end"> <div class="w-64"> <div class="flex justify-between py-2"> <span class="text-gray-500">Subtotal</span> <span class="text-gray-900">$19.00</span> </div> <div class="flex justify-between py-2 border-t border-gray-200"> <span class="font-semibold text-gray-900">Total</span> <span class="font-bold text-xl text-gray-900">$19.00</span> </div> </div> </div>
<!-- Footer --> <div class="mt-12 pt-8 border-t border-gray-200 text-center text-gray-500 text-sm"> <p>Thank you for your business!</p> <p class="mt-1">Payment due within 30 days.</p> </div> </div></body></html>Generate with cURL
Section titled “Generate with cURL”curl -X POST https://api.orim.io/pdf/convert \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d @invoice.json \ -o invoice.pdfDynamic data
Section titled “Dynamic data”Replace placeholders in your template before sending:
const template = `<h1>Invoice #{{invoiceNumber}}</h1>...`;
const html = template .replace('{{invoiceNumber}}', 'INV-2025-001') .replace('{{clientName}}', 'John Doe') .replace('{{total}}', '$19.00');
const response = await fetch('https://api.orim.io/pdf/convert', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ html })});