# Invoice Generator API

> Invoice Generator is an invoice generation API that creates downloadable PDF invoices from party addresses, line items, and payment terms. It computes subtotals with discounts and sales tax, returning an expiring download link.

**Endpoint:** `POST https://api.apiverve.com/v1/invoicegenerator`  
**Category:** Documents  
**Cost:** 20 credits per call  
**Canonical page:** https://apiverve.com/marketplace/invoicegenerator

## Overview

Send billing addresses, an invoice number, and line items with item quantities and unit prices. The endpoint applies discounts, calculates sales tax against the adjusted subtotal, fetches remote logos up to 2 MB, and labels amounts with the currency code you pass, using that currency's decimal places and digit grouping (for example 1,250.00 EUR or 375,000 JPY). Addresses work worldwide: state and postcode are optional, and each party can carry a country and a VAT, GST or tax ID. It returns a temporary download URL and a Unix expiration timestamp.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl -X POST "https://api.apiverve.com/v1/invoicegenerator" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"invoiceNumber":"INV000001","from_name":"John Doe","from_street":"123 Elm St","from_city":"Springfield","to_name":"Jane Smith","to_street":"456 Oak St","to_city":"Springfield","items":[{"qty":2,"description":"Web Design Services","unit_price":500},{"qty":1,"description":"Domain Registration","unit_price":100}],"date":"2025-02-01","from_state":"IL","from_zip":"62701","from_country":"value","from_taxId":"value","to_state":"IL","to_zip":"62702","to_country":"value","to_taxId":"value","job":"Web Development","paymentTerms":"Net 30","dueDate":"2025-03-03","discount":10,"salesTax":7.5,"taxLabel":"value","logoURL":"value","currency":"USD"}'
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `invoiceNumber` | string | Yes | The invoice number |
| `date` | string | No | The invoice date (YYYY-MM-DD format). date |
| `from_name` | string | Yes | The name of the person or company issuing the invoice |
| `from_street` | string | Yes | The street address of the person or company issuing the invoice |
| `from_city` | string | Yes | The city of the person or company issuing the invoice |
| `from_state` | string | No | The state, province or region of the person or company issuing the invoice (optional; left out of the address when blank). length 0-50 |
| `from_zip` | string | No | The postal or ZIP code of the person or company issuing the invoice (optional; any country's format). length 2-12 |
| `from_country` | string | No | The country of the person or company issuing the invoice, printed as its own address line (optional). length 0-60 |
| `from_taxId` | string | No | VAT, GST, ABN or other tax registration number of the person or company issuing the invoice, printed as a Tax ID line (optional). length 0-40 |
| `to_name` | string | Yes | The name of the person or company being invoiced |
| `to_street` | string | Yes | The street address of the person or company being invoiced |
| `to_city` | string | Yes | The city of the person or company being invoiced |
| `to_state` | string | No | The state, province or region of the person or company being invoiced (optional; left out of the address when blank). length 0-50 |
| `to_zip` | string | No | The postal or ZIP code of the person or company being invoiced (optional; any country's format). length 2-12 |
| `to_country` | string | No | The country of the person or company being invoiced, printed as its own address line (optional). length 0-60 |
| `to_taxId` | string | No | VAT, GST, ABN or other tax registration number of the person or company being invoiced, printed as a Tax ID line (optional). length 0-40 |
| `job` | string | No | The job or project associated with the invoice |
| `paymentTerms` | string | No | The payment terms for the invoice |
| `dueDate` | string | No | The due date for the invoice (YYYY-MM-DD format). date |
| `discount` | number | No | The discount to be applied to the invoice. range 0-inf |
| `salesTax` | number | No | The sales tax rate for the invoice as a percentage, applied to the subtotal after discount (e.g. 7.5 for 7.5%). range 0-100 |
| `taxLabel` | string | No | Label for the tax row, for example VAT or GST (default: Sales Tax). length 0-30 |
| `logoURL` | string | No | Public http(s) URL of an image to use as the invoice logo (max 2 MB, fetched with a 5 second timeout). The invoice has no logo when this is omitted or the image can't be loaded. url |
| `currency` | string | No | The currency code for the invoice; amounts are labelled with it and use its decimal places |
| `items` | array | Yes | The items being invoiced, one object per line: qty, description, unit_price |

## Response fields

- `pdfName` — string · Unique filename of generated PDF document
- `expires` — number · Unix timestamp when PDF link expires and is deleted
- `downloadURL` — string · Temporary download URL for generated PDF invoice

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "pdfName": "fc17c4bd-e660-4078-94ae-f46be56c9006.pdf",
    "expires": 1766096689189,
    "downloadURL": "https://storage.googleapis.com/apiverve-helpers.appspot.com/htmltopdf/fc17c4bd-e660-4078-94ae-f46be56c9006.pdf?GoogleAccessId=1089020767582-compute%40developer.gserviceaccount.com&Expires=1766096689&Signature=zZYB17Rj1yfbfhM3Epmjc9PEfmsVpgsCATX5%2Bx2yAo%2FV45xUatVzkAjUkPC48PkR4m%2BF7uIJBToUY2QAZMzNIOre4T0Md2eToXtcYF%2F%2FefS3sZocODRdiC%2BmEuMZjsAPMfkhbCMQZT4lZczQn9sfaWJlWJi%2FGWXKVUwZby3yn06Ed7OqianYbxQj87ENoqYudZFe5qFpI0hmwh4lBrnIM40hb4eZwwbGEvZL2WejNdBgD0cKb3C%2BHwJHkPvd2PAzFfNvuJolBxMN4jE3QCx9DN2MdHGUqb7t3vlP0Kder8m0lMpac%2BPbwZsDVmlF595cFzkKaE928uxzA1Mzkenffg%3D%3D"
  }
}
```

## Use cases

- **Order Fulfillment Billing** — When an order clears checkout, generate a branded PDF receipt with itemized charges and local sales tax to email buyers.
- **Monthly Subscription Receipts** — SaaS platforms turn recurring subscription renewals into downloadable invoice documents displaying custom payment terms and client billing addresses.
- **Contractor Payout Invoicing** — To process contractor payouts, convert milestone task descriptions and hourly rates into signed PDF invoices before issuing bank transfers.
- **Automated Accounts Receivable** — Accounting tools construct standardized PDF billing files complete with discounts and custom company logos directly from scheduled batch jobs.

## SDKs

- **npm** — `npm install @apiverve/invoicegenerator` (https://www.npmjs.com/package/@apiverve/invoicegenerator)
- **NuGet** — `dotnet add package APIVerve.API.InvoiceGenerator` (https://www.nuget.org/packages/APIVerve.API.InvoiceGenerator)
- **Source** — https://github.com/apiverve/invoicegenerator-api

## More

- Full reference: https://docs.apiverve.com/ref/invoicegenerator
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
