Invoice PDF API

Generate invoices, receipts, and quotes as PDF from JSON

Overview

The Invoice PDF API generates professional PDF documents — invoices, receipts, quotes, refunds, and cancellation notices — from structured JSON data. Send your data as a POST request and receive a formatted PDF in the response.

Automate document generation in your applications — online shops, billing systems, SaaS platforms, or any workflow that needs consistent, professional documents at scale.

Key Features

  • 5 document types: Invoice, Receipt, Quote, Refund (Credit Note), Cancellation
  • 3 visual themes: Modern, Classic, Minimal
  • 50 languages: Labels, dates, and currency formatting auto-adapted to locale
  • Native Shopify support: Send Shopify order data directly — document type is auto-detected

Quick Start

Save the following JSON to a file called invoice.json:

{
    "document_type": "invoice",
    "document_number": "INV-001",
    "issue_date": "2026-01-15",
    "currency": "USD",
    "customer": {
        "name": "Alice Smith"
    },
    "items": [
        {"description": "Consulting Services", "quantity": 5, "unit_price": 150.00}
    ],
    "total": 750.00
}

Then run this command to generate the PDF:

curl -X POST "https://api.pdfcrowd.com/templates/business/" \
  -u "demo:demo" \
  -d @invoice.json \
  -o invoice.pdf

Examples below use demo credentials for testing. For production use, start a free trial or purchase a license.

Try It

See it in action — generate a sample invoice PDF in seconds.

HTTP Request

Send a POST request with a JSON body to the conversion endpoint. This section covers the endpoint URL, authentication, and available parameters.

Endpoint

POST https://api.pdfcrowd.com/templates/business/

The request body is JSON. Configuration is passed via query parameters.

ParameterDefaultDescription
app pdfcrowd Data format. Omit for PDFCrowd native format, or set to shopify for Shopify order data.
style modern Visual theme: modern, classic, or minimal.
page_size A4 Page size: A4 or Letter.
orientation portrait Page orientation: portrait or landscape.

Visual Styles

StyleDescription
modernClean sans-serif design with blue accents, colored table headers, alternating row colors
classicTraditional serif font, double borders, formal document layout
minimalCompact, text-focused — no logo, tighter spacing, smaller fonts

Authentication

Show authentication details

On success, returns application/pdf. On error, returns a plain text error message with the original HTTP status code from the conversion API (see Error Handling).

JSON Format

The PDFCrowd native format is a clean, nested JSON structure. It is the default when the app parameter is omitted. Here is the overall shape of a document:

Tip: Numeric fields accept both JSON numbers and strings (e.g. "quantity": 3 or "quantity": "3"). Do not include currency symbols or thousand separators.

{
    "document_type": "invoice",
    "document_number": "INV-2026-001",
    "issue_date": "2026-03-15",
    "currency": "USD",

    "seller": { ... seller details ... },
    "customer": { ... customer details ... },

    "items": [ ... line items ... ],

    "subtotal": 1440.00,
    "discount": { ... discount ... },
    "shipping": { ... shipping ... },
    "tax": { ... tax ... },
    "total": 1608.80,

    "notes": "...",
    "legal_notice": "...",
    ... document-type-specific fields ...
}

The sections below describe each part in detail.

Required Fields

FieldTypeDescription
document_typestring invoice, receipt, quote, refund, credit_note, or cancellation
document_numberstring Document identifier (e.g. "INV-2026-001")
issue_datestring Document date (YYYY-MM-DD)
itemsarray Line items (see Line Items)
totalnumber Grand total amount
currencystring ISO 4217 currency code (e.g. USD, EUR). Determines currency symbol, number formatting, and document language. Defaults to en_US formatting when omitted.

Optional Fields

FieldTypeDescription
localestring Locale for labels and formatting (e.g. fr_FR, nl_NL). Overrides the locale derived from currency. Useful when multiple countries share a currency (e.g. EUR).
subtotalnumber Subtotal before adjustments. Hidden when equal to total with no breakdown rows
sellerobject Seller/company details (see Seller)
customerobject Customer details (see Customer)
discountobject Discount details (see Discount)
shippingobject Shipping details (see Shipping)
taxobject Tax details (see Tax)
notesstring Free-text notes displayed at the bottom
legal_noticestring Legal disclaimer text

Seller Object

"seller": {
    "name": "Acme Corp",
    "email": "billing@acmecorp.com",
    "phone": "+1 212 555 0199",
    "website": "https://acmecorp.com",
    "tax_id": "EIN 12-3456789",
    "logo_url": "https://acmecorp.com/logo.png",
    "address": {
        "address1": "100 Market St",
        "address2": "Suite 300",
        "city": "San Francisco",
        "province": "CA",
        "zip": "94105",
        "country": "United States",
        "country_code": "US"
    }
}
FieldTypeDescription
namestringCompany or shop name
emailstringContact email
phonestringContact phone
websitestringWebsite URL
tax_idstringTax ID / VAT number
bank_accountstringBank account number (invoice only)
ibanstringIBAN (invoice only)
bicstringBIC / SWIFT code (invoice only)
logo_urlstringURL to company logo
addressobjectStructured address (see Address)

Customer Object

"customer": {
    "name": "John Smith",
    "email": "john@example.com",
    "phone": "+1 555 0100",
    "company": "Smith & Co.",
    "tax_id": "US-TAX-001",
    "address": {
        "address1": "123 Main St",
        "address2": "Suite 4B",
        "city": "New York",
        "province": "NY",
        "zip": "10001",
        "country": "United States",
        "country_code": "US"
    }
}
FieldTypeDescription
namestringCustomer full name
emailstringCustomer email
phonestringCustomer phone
companystringCompany name
tax_idstringCustomer tax ID / VAT number
addressobjectStructured address (see Address)

Address Object

Used within seller, customer, and shipping objects. The country_code determines postal code placement — e.g. DE formats as 10117 Berlin while US formats as New York, NY 10001.

FieldTypeDescription
address1stringStreet address line 1
address2stringAddress line 2 (suite, unit, etc.)
citystringCity
provincestringState / Province
zipstringZIP / Postal code
countrystringCountry name (displayed)
country_codestringISO 3166-1 alpha-2 code (used for formatting, not displayed)

Line Items

"items": [
    {"description": "Web Design", "quantity": 10, "unit_price": 120.00, "sku": "SVC-01"},
    {"description": "Hosting", "quantity": 1, "unit_price": 240.00, "tax": 45.60}
]
FieldTypeDescription
descriptionstringRequired. Item name
quantitynumberRequired. Quantity
unit_pricenumberRequired. Price per unit
skustringSKU or product code
taxnumberTax for this item. Adds a Tax column when present
totalnumberItem total. Auto-computed as quantity × unit_price + tax when omitted

Discount Object

"discount": {
    "amount": 100.00,
    "label": "Loyalty discount 10%"
}
FieldTypeDescription
amountnumberDiscount amount (displayed with a minus sign)
labelstringCustom label (defaults to “Discount” in document language)

Available on: invoice, receipt, quote, cancellation.

Shipping Object

"shipping": {
    "amount": 15.00,
    "name": "Express Shipping",
    "address": {
        "address1": "456 Oak Ave",
        "city": "Austin",
        "province": "TX",
        "zip": "73301",
        "country": "United States",
        "country_code": "US"
    }
}
FieldTypeDescription
amountnumberShipping cost. Omitted from document when zero
namestringShipping method name
addressobjectShipping address (see Address)

Available on: invoice, quote.

Tax Object

"tax": {
    "amount": 136.40,
    "label": "Sales Tax",
    "rate": 8.25,
    "breakdown": [
        {"name": "TX State Tax 6.25%", "rate": 6.25, "amount": 103.44},
        {"name": "Austin Local Tax 2%", "rate": 2, "amount": 32.96}
    ]
}
FieldTypeDescription
amountnumberTotal tax amount. Omitted from document when zero
labelstringCustom tax label (defaults to “Tax” in document language)
ratenumberTax rate percentage. Shown next to the tax label when no breakdown is present
breakdownarrayOptional. Itemized tax rows: name, rate, amount. When omitted, a single tax line is shown

Document Types

Set the document_type field to select the document template. Each type supports the common fields above plus type-specific fields.

Invoice

Set "document_type": "invoice". Full invoice with seller and customer details, line items, tax breakdown, discounts, shipping, bank details, and payment terms.

FieldTypeDescription
due_datestringPayment due date (YYYY-MM-DD)
payment_termsstringPayment terms (e.g. “Net 30”)
payment_instructionsstringPayment instructions
purchase_order_numberstringPO number
fulfillment_statusstring Fulfillment status (auto-translated). Values: fulfilled, partial, unfulfilled, restocked

Receipt

Set "document_type": "receipt". Payment confirmation with transaction details, line items, and tip.

FieldTypeDescription
payment_methodstring Payment method (auto-translated). Values: credit_card, debit_card, cash, bank_deposit, money_order, gift_card, exchange, manual
payment_statusstring Payment status (auto-translated). Values: paid, pending, authorized, partially_paid, partially_refunded, refunded, voided
transaction_idstringTransaction reference
tip_amountnumberTip / gratuity amount
purchase_order_numberstringPO number

Quote

Set "document_type": "quote". Quotation with validity date and shipping details.

FieldTypeDescription
valid_untilstringQuote expiration date (YYYY-MM-DD)
reference_numberstringReference number
payment_termsstringPayment terms
purchase_order_numberstringPO number

Refund / Credit Note

Set "document_type": "refund" or "credit_note". Refund notice with reason and original invoice reference.

FieldTypeDescription
original_invoicestringOriginal invoice/order number
reasonstringRefund reason (free text)
refund_methodstring Refund method (auto-translated). Values: credit_card, debit_card, cash, bank_deposit, money_order, gift_card, exchange, manual
refund_statusstring Refund status (auto-translated). Values: paid, pending, authorized, partially_paid, partially_refunded, refunded, voided

Cancellation

Set "document_type": "cancellation". Order cancellation notice with reason and refund status.

FieldTypeDescription
cancellation_datestringCancellation date (YYYY-MM-DD)
cancellation_reasonstring Cancellation reason (auto-translated). Values: customer, fraud, inventory, declined, staff, other
refund_statusstring Refund status (auto-translated). Values: paid, pending, authorized, partially_paid, partially_refunded, refunded, voided

Complete Example

{
    "document_type": "invoice",
    "document_number": "INV-2026-0042",
    "issue_date": "2026-03-15",
    "due_date": "2026-04-15",
    "currency": "USD",
    "purchase_order_number": "PO-9981",
    "payment_terms": "Net 30",
    "payment_instructions": "Please remit payment via ACH or check.",
    "notes": "Thank you for your business.",
    "fulfillment_status": "unfulfilled",
    "seller": {
        "name": "Acme Corp",
        "email": "billing@acmecorp.com",
        "phone": "+1 212 555 0199",
        "website": "https://acmecorp.com",
        "tax_id": "EIN 12-3456789",
        "logo_url": "https://pdfcrowd.com/static/images/icon2.svg",
        "address": {
            "address1": "100 Market St",
            "address2": "Suite 300",
            "city": "San Francisco",
            "province": "CA",
            "zip": "94105",
            "country": "United States",
            "country_code": "US"
        }
    },
    "customer": {
        "name": "Jane Cooper",
        "email": "jane@cooperdesign.com",
        "phone": "+1 415 555 0100",
        "company": "Cooper Design LLC",
        "address": {
            "address1": "456 Oak Ave",
            "city": "Austin",
            "province": "TX",
            "zip": "73301",
            "country": "United States",
            "country_code": "US"
        }
    },
    "items": [
        {"description": "Web Design Services", "quantity": 10, "unit_price": 150.00, "sku": "SVC-WEB-01"},
        {"description": "Hosting (annual)", "quantity": 1, "unit_price": 240.00}
    ],
    "subtotal": 1740.00,
    "discount": {"amount": 100.00, "label": "Loyalty discount"},
    "shipping": {"amount": 15.00, "name": "Express Shipping"},
    "tax": {
        "amount": 136.40,
        "label": "Sales Tax",
        "breakdown": [
            {"name": "TX State Tax 6.25%", "rate": 6.25, "amount": 103.44},
            {"name": "Austin Local Tax 2%", "rate": 2, "amount": 32.96}
        ]
    },
    "total": 1791.40
}

Shopify Integration

Send Shopify order data directly with ?app=shopify. Both REST API and GraphQL formats are supported. The appropriate document type (invoice, receipt, quote, refund, or cancellation) is selected automatically based on the order data.

Example

curl -X POST "https://api.pdfcrowd.com/templates/business/?app=shopify" \
  -u "demo:demo" \
  -H "Content-Type: application/json" \
  -d @shopify_order.json \
  -o receipt.pdf

Shopify orders don't include seller details — pass your company information via query parameters such as seller_name, seller_email, logo_url, etc.

The document language and formatting are automatically detected from the customer's locale or the order currency. Status values (e.g. paid, fulfilled) are translated to the document language.

Localization

The currency field determines the currency symbol, number formatting, date formatting, and document language (labels, status translations).

Supported Currencies

The following currencies have full locale support with automatic language detection, labels, and date formatting. Any valid ISO 4217 currency code can be used.

CurrencyName
USDUS Dollar
EUREuro
GBPBritish Pound
CADCanadian Dollar
AUDAustralian Dollar
JPYJapanese Yen
CNYChinese Yuan
KRWSouth Korean Won
INRIndian Rupee
BRLBrazilian Real
MXNMexican Peso
CZKCzech Koruna
PLNPolish Zloty
SEKSwedish Krona
NOKNorwegian Krone
DKKDanish Krone
CHFSwiss Franc
RUBRussian Ruble
TRYTurkish Lira
THBThai Baht
HUFHungarian Forint
RONRomanian Leu
BGNBulgarian Lev
HRKCroatian Kuna
ILSIsraeli Shekel
SARSaudi Riyal
IDRIndonesian Rupiah
MYRMalaysian Ringgit
VNDVietnamese Dong
TWDTaiwan Dollar
ZARSouth African Rand
UAHUkrainian Hryvnia
BDTBangladeshi Taka
PKRPakistani Rupee

Supported Languages

Labels, status translations, and formatting are available in 50 languages: Afrikaans, Arabic, Bengali, Bulgarian, Catalan, Chinese (Simplified), Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, German, Greek, Gujarati, Hebrew, Hindi, Hungarian, Indonesian, Irish, Italian, Japanese, Kannada, Korean, Latvian, Lithuanian, Malay, Malayalam, Maltese, Marathi, Norwegian, Polish, Portuguese, Punjabi, Romanian, Russian, Serbian, Slovak, Slovenian, Spanish, Swedish, Tamil, Telugu, Thai, Turkish, Ukrainian, Urdu, Vietnamese.

Error Handling

400
Invalid JSON, missing required fields, or unknown document type.
405
Method not allowed. Only POST requests are accepted.
401
Invalid username or API key.
403
License expired, disabled, or no credits remaining.
429
Rate limit exceeded. Wait and retry.
430
Too many concurrent requests. Wait for current conversions to complete or upgrade your plan.
500
Internal server error.

AI Integration

Have your data in a custom JSON format? Ask an AI assistant to write the integration for you. Copy the prompt below, replace the placeholders, and paste it into ChatGPT, Claude, or any other AI coding assistant.

Write a Python script that:
1. Reads my JSON data file [DESCRIBE YOUR FILE OR PASTE A SAMPLE]
2. Transforms it to the PDFCrowd PDF Templates format
   (see https://pdfcrowd.com/invoice-pdf-api/)
3. Sends it to the API endpoint and saves the PDF to a local file