Invoice Generator API

We built a simple API to generate invoice PDFs programmatically, the same engine that powers our app. Whether you're automating your billing workflow or integrating invoicing into your own product, this API has you covered.

The API accepts invoice details and returns a ready-to-use PDF. We don't store any of your invoice data.

Beyond PDF, the API also supports generating e-invoices in UBL (Universal Business Language) with the invoice PDF embedded. As e-invoicing becomes the global standard, UBL compliance can be complex to implement, our API handles it for you.

Use Case

Whether you're automating your billing workflow or building invoicing into your own product, our API is flexible enough to handle a wide range of use cases:

  • Automate invoice generation from your own application or backend
  • Generate a PDF from invoice details you already have, recipient, line items, and more.
  • Produce invoices for B2B buyers from an order or receipt
  • Create invoices for VAT compliance
  • Sell products or services on credit terms
  • Create e-invoices in UBL (Universal Business Language)
  • Integrate invoicing into your existing billing workflow

Getting Started

Before making your first API request, you'll need an API key to authenticate your requests. Follow these steps to get one:

  1. Create a free account or sign in if you already have one.
  2. Navigate to Settings > API Keys.
  3. Click New API Key, and copy your key somewhere safe.
  4. Include your API key in the Authorization header of every request

The free plan includes up to 100 invoices per month. If you need to generate more, upgrade to a paid API subscription. Paid plans come with higher limits and priority support.

PDF Invoice API

Use this to generate a professional invoice PDF from your invoice data. Pass in your sender details, client information, and line items, and get back a ready-to-download PDF.

Endpoints

POSThttps://hubinvo.com/api/generate-invoice

Headers

Authorization
string
Required

Bearer authentication header of the form Bearer api_key, where api_key is your api key.

Content-Type
enum<application/json | application/x-www-form-urlencoded>
Required

Content type one of: application/json, application/x-www-form-urlencoded

Body

name
string
default:INVOICE

The title or heading displayed at the top of the invoice document.

currency
string
default:USD

The 3-letter ISO 4217 currency code (e.g. USD, EUR, IDR).

color
string
default:#65a30d

Hex color code used as the accent color for the invoice template.

template
string
default:clasic

The invoice template design to use. Must be one of: clasic

logoUrl
string

URL of the logo to display on the invoice. Must be a PNG or JPG image, max 5MB.

numberLabel
string
default:Number

Custom label for the invoice number field.

number
string
Required

The invoice number used to uniquely identify this invoice.

dateLabel
string
default:Date

Custom label for the invoice date field.

date
string
default:"currentDate"

The invoice issue date in yyyy-mm-dd format. Defaults to the current date if not provided.

dueDateLabel
string
default:Due Date

Custom label for the due date field.

dueDate
string

The payment due date in yyyy-mm-dd format.

fromLabel
string
default:From

Custom label for the sender section.

senderName
string
Required

Full name or company name of the invoice sender.

senderEmail
string

Email address of the invoice sender.

senderAddress
string

Mailing address of the invoice sender.

senderPhone
string

Phone number of the invoice sender.

senderWebsite
string

Website URL of the invoice sender.

billToLabel
string
default:Bill To

Custom label for the client details section.

clientName
string
Required

Full name or company name of the client being billed.

clientEmail
string

Email address of the client.

clientAddress
string

Mailing address of the client.

itemLabel
string
default:Item

Custom label for the item name column in the line items table.

rateLabel
string
default:Rate

Custom label for the rate column in the line items table.

quantityLabel
string
default:Quantity

Custom label for the quantity column in the line items table.

amountLabel
string
default:Amount

Custom label for the amount column in the line items table.

items
array<object>
Required

List of line items to include on the invoice. At least one item is required.

adjustments
array<object>

List of adjustments to apply to the invoice subtotal, such as taxes or discounts. Order affects calculation.

notesLabel
string
default:Notes

Custom label for the notes section.

notes
string

Additional notes or remarks to display at the bottom of the invoice.

termsLabel
string
default:Terms

Custom label for the terms section.

terms
string

Terms and conditions to display at the bottom of the invoice.

subtotalLabel
string
default:Subtotal

Custom label for the subtotal line.

totalLabel
string
default:Total

Custom label for the total line.

amoutPaidLabel
string
default:Amount Paid

Custom label for the amount paid line.

amountPaid
number
default:0

The amount already paid by the client. Must be greater than or equal to 0. Deducted from the total to calculate the balance due.

balanceDueLabel
string
default:Balance Due

Custom label for the balance due line.

Example

curl -X POST https://hubinvo.com/api/generate-invoice \ -H "Authorization: Bearer api_key" \ -H "Content-Type: application/json" \ -o simple-invoice.pdf \ -w "%{http_code}" \ -d '{ "number": "INV-1", "senderName": "Acme Inc", "clientName": "John Doe", "items": [ { "name": "Brand Identity Design", "quantity": 1, "rate": 1200 }, { "name": "Website UI Design (5 pages)", "quantity": 5, "rate": 150 } ] }'

UBL Invoice API

Use this to generate an e-invoice in UBL (Universal Business Language) XML format. Ideal for businesses that require machine-readable invoices for VAT compliance, B2B transactions, or PEPPOL network integration.

Endpoints

POSThttps://hubinvo.com/api/generate-invoice/ubl

Headers

Authorization
string
Required

Bearer authentication header of the form Bearer api_key, where api_key is your api key.

Content-Type
enum<application/json>
Required

Content type application/json

Body

customizationID
string
default:urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0

An identification of the specification containing the total set of rules regarding semantic content, cardinalities and business rules to which the data contained in the instance document conforms. Learn more.

profileID
string
default:urn:fdc:peppol.eu:2017:poacc:billing:01:1.0

Identifies the business process context in which the transaction appears, to enable the Buyer to process the Invoice in an appropriate way. Learn more.

ID
string
Required

A unique identification of the Invoice. The sequential number required in Article 226(2) of the directive 2006/112/EC [2], to uniquely identify the Invoice within the business context, time-frame, operating systems and records of the Seller. No identification scheme is to be used. Learn more.

issueDate
string
Required

The date when the Invoice was issued. Format "YYYY-MM-DD"

dueDate
string

The date when the payment is due.Format "YYYY-MM-DD". In case the Amount due for payment (BT-115) is positive, either the Payment due date (BT-9) or the Payment terms (BT-20) shall be present.

invoiceTypeCode
number
Required

A code specifying the functional type of the Invoice. Learn more.

notes
array<object>
taxPointDate
string

The date when the VAT becomes accountable for the Seller and for the Buyer in so far as that date can be determined and differs from the date of issue of the invoice, according to the VAT directive. This element is required if the Value added tax point date is different from the Invoice issue date. Format "YYYY-MM-DD".

documentCurrencyCode
string
Required

The currency in which all Invoice amounts are given, except for the Total VAT amount in accounting currency. Only one currency shall be used in the Invoice, except for the VAT accounting currency code (BT-6) and the invoice total VAT amount in accounting currency (BT-111). Example: USD, EUR, JPY, etc.

taxCurrencyCode
string

The currency used for VAT accounting and reporting purposes as accepted or required in the country of the Seller. Shall be used in combination with the Invoice total VAT amount in accounting currency (BT-111), when the VAT accounting currency code differs from the Invoice currency code. Example: USD, EUR, JPY, etc.

accountingCost
string

A textual value that specifies where to book the relevant data into the Buyer's financial accounts.

buyerReference
string

An identifier assigned by the Buyer used for internal routing purposes. An invoice must have buyer reference or purchase order reference (BT-13).

invoicePeriod
string

A group of business terms providing information on the invoice period. Also called delivery period. If the group is used, the invoiceing period start date and/or end date must be used.

orderReference
array<object>

Order and sales order reference

billingReference
array<object>

A group of business terms providing information on one or more preceding Invoices.

despatchDocumentReference
string

An identifier of a referenced despatch advice.

receiptDocumentReference
string

An identifier of a referenced receiving advice.

originatorDocumentReference
string

The identification of the call for tender or lot the invoice relates to.

contractDocumentReference
string

The identification of a contract.

additionalDocumentReference
array<object>

A group of business terms providing information about additional supporting documents substantiating the claims made in the Invoice. The additional supporting documents can be used for both referencing a document number which is expected to be known by the receiver, an external document (referenced by a URL) or as an embedded document, Base64 encoded (such as a time report).

projectReference
string

The identification of the project the invoice refers to.

seller
object
Required

A group of business terms providing information about the Seller.

buyer
object
Required

A group of business terms providing information about the Buyer.

payeeParty
object

A group of business terms providing information about the Payee, i.e. the role that receives the payment. Shall be used when the Payee is different from the Seller.

taxRepresentativeParty
object

A group of business terms providing information about the Seller's tax representative.

delivery
object

A group of business terms providing information about where and when the goods and services invoiced are delivered.

paymentMeans
object

A group of business terms providing information about the payment.

paymentTermsNote
string

A textual description of the payment terms that apply to the amount due for payment (Including description of possible penalties). In case the Amount due for payment (BT-115) is positive, either the Payment due date (BT-9) or the Payment terms (BT-20) shall be present.

allowanceCharge
array<object>

A group of business terms providing information about allowances applicable to the Invoice as a whole. A group of business terms providing information about charges and taxes other than VAT, applicable to the Invoice as a whole.

taxTotal
array<object>

When tax currency code is provided, two instances of the tax total must be present, but only one with tax subtotal.

legalMonetaryTotal
object
Required

A group of business terms providing the monetary totals for the Invoice.

invoiceLines
array<object>
Required

A group of business terms providing information on individual Invoice lines.

Example

curl -X POST https://hubinvo.com/api/generate-invoice/ubl \ -H "Authorization: Bearer api_key" \ -H "Content-Type: application/json" \ -o simple-ubl-invoice.xml \ -w "%{http_code}" \ -d '{ "ID": "TEST-003", "issueDate": "2026-04-06", "invoiceTypeCode": 380, "documentCurrencyCode": "USD", "seller": { "name": "Mary Inc", "endPoint": { "scheme": "9925", "id": "0732788874" }, "legalEntity": { "registrationName": "Mary Inc" }, "address": { "streetName": "1784 Kembery Drive", "cityName": "Chicago", "postalZone": "60605", "country": "US" } }, "buyer": { "name": "James Inc", "endPoint": { "scheme": "9925", "id": "0732788874" }, "legalEntity": { "registrationName": "James Inc" }, "address": { "streetName": "2169 Sunrise Road", "cityName": "Las Vegas", "postalZone": "89109", "country": "US" } }, "taxTotal": [ { "taxAmountCurrency": "USD", "taxAmount": 21, "subTotals": [ { "taxableAmount": 100, "taxAmount": 21, "taxCategory": { "categoryCode": "S", "percent": 21 } } ] } ], "legalMonetaryTotal": { "currency": "USD", "lineExtensionAmount": 100, "taxExclusiveAmount": 100, "taxInclusiveAmount": 121, "payableAmount": 121 }, "invoiceLines": [ { "id": "1", "invoicedQuantity": 1, "lineExtensionAmount": 100, "price": 100, "name": "Wireless Mouse", "currency": "USD", "unitCode": "H67", "taxCategory": { "percent": 21, "categoryCode": "S" } } ] }'

Support

Have a question about the API, found a bug, or need help integrating? Visit our feedback portal to submit bug reports, ask questions, or request new features, we read every submission and do our best to help.