$API_TOKEN=<YOUR_API_TOKEN>
$cat > input.json << 'EOF'
<{
< "template": "<!doctype html>\n<html>\n<head>\n<meta charset=\"utf-8\">\n<title>Invoice {{number}}</title>\n<style>\n body { font-size: 11pt; color: #102a43; }\n .top { display: flex; justify-content: space-between; align-items: flex-start; }\n h1 { margin: 0; font-size: 22pt; }\n .ar { font-family: 'Noto Sans Arabic', sans-serif; direction: rtl; }\n table { width: 100%; border-collapse: collapse; margin-top: 18px; }\n th, td { border-bottom: 1px solid #d9e2ec; padding: 8px; text-align: start; }\n th { background: #f0f4f8; }\n .num { text-align: end; }\n .total td { font-weight: bold; border-top: 2px solid #102a43; }\n</style>\n</head>\n<body>\n <div class=\"top\">\n <div>\n <h1>Invoice</h1>\n <div>No. {{number}}</div>\n <div>Date: {{formatDate date style=\"long\"}}</div>\n </div>\n <div class=\"ar\">\n <h1>فاتورة</h1>\n <div>رقم {{number}}</div>\n <div>التاريخ: {{formatDate date style=\"long\" locale=\"ar-SA-u-ca-gregory\"}}</div>\n </div>\n </div>\n <p><strong>Bill to:</strong> {{customer}}</p>\n <table>\n <thead><tr><th>Item</th><th class=\"num\">Qty</th><th class=\"num\">Unit price</th><th class=\"num\">Amount</th></tr></thead>\n <tbody>\n {{#each items}}\n <tr><td>{{name}}</td><td class=\"num\">{{qty}}</td><td class=\"num\">{{formatCurrency price ../currency}}</td><td class=\"num\">{{formatCurrency (multiply qty price) ../currency}}</td></tr>\n {{/each}}\n <tr class=\"total\"><td colspan=\"3\">Total / الإجمالي</td><td class=\"num\">{{formatCurrency (sum items \"qty\" \"price\") currency}}</td></tr>\n </tbody>\n </table>\n</body>\n</html>",
< "data": [
< {
< "number": "INV-1001",
< "date": "2026-10-01",
< "customer": "Example Trading LLC",
< "currency": "USD",
< "items": [
< {
< "name": "Design work",
< "qty": 10,
< "price": 45
< },
< {
< "name": "Hosting, 12 months",
< "qty": 1,
< "price": 120
< }
< ]
< },
< {
< "number": "INV-1002",
< "date": "2026-10-08",
< "customer": "Sample Studio",
< "currency": "EUR",
< "items": [
< {
< "name": "Consulting hours",
< "qty": 6,
< "price": 80
< },
< {
< "name": "Travel",
< "qty": 1,
< "price": 95.5
< }
< ]
< },
< {
< "number": "INV-1003",
< "date": "2026-10-15",
< "customer": "Demo Supplies Co.",
< "currency": "SAR",
< "items": [
< {
< "name": "Printed brochures",
< "qty": 500,
< "price": 1.2
< },
< {
< "name": "Delivery",
< "qty": 1,
< "price": 60
< }
< ]
< }
< ],
< "fileName": "invoice-{{number}}",
< "maxPdfs": 100
<}
<EOF
$curl "https://api.apify.com/v2/actors/maliksaid~html-to-pdf/runs?token=$API_TOKEN" \
< -X POST \
< -d @input.json \
< -H 'Content-Type: application/json'