Invoice Generator Input avatar

Invoice Generator Input

Pricing

from $10.00 / 1,000 results

Go to Apify Store
Invoice Generator Input

Invoice Generator Input

A flexible and developer-friendly tool to generate professional invoices from structured input data. Supports line items, tax, discounts, and optional HTML output.

Pricing

from $10.00 / 1,000 results

Rating

0.0

(0)

Developer

Jamshaid Arif

Jamshaid Arif

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

2

Monthly active users

25 days ago

Last modified

Share

🧾 Invoice Generator

A flexible and developer-friendly tool to generate professional invoices from structured input data. Supports line items, tax, discounts, and optional HTML output.


🚀 Features

  • 🧩 Structured invoice generation from JSON input
  • 📦 Supports multiple line items with quantity and pricing
  • 💰 Automatic subtotal, tax, discount, and total calculation
  • 🌐 Optional HTML invoice generation
  • 🛡️ Strong input validation with strict schema
  • 🔌 Easy integration into APIs, automation tools, and workflows

📥 Input Schema

FieldTypeRequiredDescription
invoiceNumberstring❌ NoUnique invoice ID (default: INV-001)
issueDatestring❌ NoFormat: YYYY-MM-DD (defaults to today)
dueDatestring❌ NoFormat: YYYY-MM-DD (defaults to +30 days)
fromNamestring✅ YesSender name or company
fromAddressstring❌ NoSender address
fromEmailstring❌ NoSender email
toNamestring✅ YesRecipient name or company
toAddressstring❌ NoRecipient address
toEmailstring❌ NoRecipient email
itemsarray✅ YesList of invoice items
taxRatenumber❌ NoTax percentage (0–100)
discountPercentnumber❌ NoDiscount percentage (0–100)
currencystring❌ NoCurrency symbol (default: $)
notesstring❌ NoNotes or payment terms
generateHTMLboolean❌ NoGenerate HTML invoice (default: true)

📦 Line Item Format

Each item in the items array must follow:

{
"description": "Web development service",
"quantity": 2,
"unitPrice": 150
}

⚙️ How It Works

💵 Calculations

  1. Subtotal
subtotal = sum(quantity × unitPrice)
  1. Discount
discount = subtotal × (discountPercent / 100)
  1. Tax
tax = (subtotal - discount) × (taxRate / 100)
  1. Total
total = subtotal - discount + tax

🧮 Example

Input

{
"fromName": "Umar Tech",
"toName": "Client Inc.",
"items": [
{ "description": "API Development", "quantity": 1, "unitPrice": 500 },
{ "description": "Hosting", "quantity": 2, "unitPrice": 50 }
],
"taxRate": 10,
"discountPercent": 5
}

Output

{
"subtotal": 600,
"discount": 30,
"tax": 57,
"total": 627
}

🏗️ Use Cases

  • Freelancers generating invoices
  • SaaS billing systems
  • Automation pipelines (Apify, scripts, etc.)
  • Backend invoice services
  • Client billing dashboards

🌐 HTML Output

If generateHTML is enabled, the tool returns a ready-to-use invoice template that can be:

  • Rendered in a browser
  • Converted to PDF
  • Sent via email

⚡ Notes

  • If dates are not provided, defaults are automatically applied
  • At least one item is required in the invoice
  • Discounts are applied before tax calculation
  • Currency symbol is customizable

🛠️ Example Logic (Pseudo Code)

subtotal = sum(item["quantity"] * item["unitPrice"] for item in items)
discount = subtotal * (discountPercent / 100)
tax = (subtotal - discount) * (taxRate / 100)
total = subtotal - discount + tax

📄 License

MIT License