Document Generator: invoices, receipts and quotes to PDF avatar

Document Generator: invoices, receipts and quotes to PDF

Pricing

from $9.00 / 1,000 document generateds

Go to Apify Store
Document Generator: invoices, receipts and quotes to PDF

Document Generator: invoices, receipts and quotes to PDF

Turns JSON rows into PDF invoices, receipts, quotes and packing slips, or into any document from your own HTML template. Computes line totals, discounts, tax by rate, shipping and balance due. Returns a download link for each PDF.

Pricing

from $9.00 / 1,000 document generateds

Rating

0.0

(0)

Developer

Ed Rayyis

Ed Rayyis

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

3 days ago

Last modified

Security

Limited permissions

Share

Turn JSON rows into finished PDF documents. Pick a built in template (invoice, receipt, quote or packing slip) or bring your own HTML template, give one JSON object per document, and get one PDF per row with a download link.

Built in templates

  • Invoice: number, date, due date, order number, bill to and ship to, line items, discounts, tax, shipping, amount paid and balance due. A fully paid invoice gets a PAID stamp.
  • Receipt: number, date, payment method, received from, line items and totals. When you give no amount paid, the receipt is marked paid in full.
  • Quote: number, date, valid until, prepared for, line items and totals.
  • Packing slip: order number, date, ship to and bill to, items with SKU and quantity, and an empty box per line to check off. No prices.

Every template shows your logo, seller details, notes and terms, and uses your accent color. Long item lists run onto more pages with the table header repeated. Page numbers (1 / 3) print at the foot of each page.

The numbers

Totals are computed with decimal arithmetic and rounded half up to the currency's minor unit (cents, or whole yen for JPY):

  • Line amount = quantity × unit price, less the line's discount percent
  • Document discount: a percent of the subtotal, a fixed amount, or both
  • Tax: each line uses its own taxRate or the document's. Tax is computed per rate on the discounted amounts and shown as one line per rate.
  • Total = subtotal, less discount, plus tax, plus shipping
  • Balance due = total less amount paid

Each dataset item carries the totals as numbers, with tax broken down by rate, so you can check them against your books.

Currency symbols are built in for USD, EUR, GBP, JPY, CNY, INR, KRW, CAD, AUD, NZD, CHF, SEK, NOK, DKK, PLN, BRL, MXN, ZAR, SGD, HKD, ILS, AED and TRY. Any other code prints before the amount, or set your own currencySymbol.

Input

  • Template: invoice, receipt, quote, packing slip or custom
  • Documents: a JSON list, one object per document
  • Shared values: an object merged under every document, so the seller, currency, accent color, payment instructions and terms are written once. A document's own value wins.
  • Documents from URL: a URL returning a JSON list of more documents
  • Custom HTML template: Jinja2 HTML for the custom template
  • PDF: page size (Letter, A4, Legal, A5), margin, page numbers, the field used to name each file, and an option to save the HTML too

Document fields:

FieldMeaning
documentNumber, date, dueDate, validUntil, orderNumberHeader details, printed as given
seller, buyer, shipToObjects with name, contactName, address (text with line breaks, or a list of lines), email, phone, taxId. seller.logoUrl adds a logo.
itemsList of description, details, sku, quantity (default 1), unit, unitPrice, discountPercent, taxRate
currency, currencySymbolISO code (default USD) and an optional symbol
taxRate, discountPercent, discountAmount, shipping, amountPaidDocument level amounts
paymentMethod, paymentInstructions, notes, termsText blocks
title, accentColor, labelsYour own heading, a hex color such as #1f4e79, and replacement words for any label (for example {"billTo": "Customer"}) to print the document in another language

Custom templates

Write any document in HTML with Jinja2 placeholders: certificates, letters, tickets, statements. Every document field is available by name, such as {{ name }}. When the document has items, the computed items (with amountText and unitPriceText) and totals (such as totals.totalText) are added. A placeholder with no value in the row stops that row with an error that names it. Templates run in a sandbox and values are HTML escaped.

Output

Each PDF goes to the run's key value store, named from the document number (or the field you choose). The dataset holds one item per row with index, documentNumber, template, ok, totals, lineItems, pages, bytes, pdfUrl, and htmlUrl when HTML is saved.

A row that cannot be generated gets ok: false and an error, for example item 1 quantity must be a number, got "two", "items" must be a list with at least one line item, or 'course' is undefined in a custom template. The other rows still run.

Pricing

Pay per event: one event per PDF generated. A row that fails is not charged. The run stops when it reaches the maximum charge you set.

Scope and conduct

Your document data is used only to build the PDFs in your run and is not sent anywhere else. A logo URL is loaded once per document.

Support

Questions and problems: the Issues tab on this page.