> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pdf.co/llms.txt
> Use this file to discover all available pages before exploring further.

# AI Invoice Parser

> Automate invoice data extraction with PDF.co’s AI-powered invoice parser. Instantly convert PDFs into structured JSON by detecting key fields like invoice number, vendor name, amounts, dates, and itemized lines — no manual setup or templates required.

<Warning>
  **Important**

  * **Only invoice documents** are supported for parsing.
  * To ensure accurate processing, each invoice must be clearly separated. **If an invoice contains multiple pages, we recommend splitting it** into individual PDFs using the [PDF Split API](/integrations/n8n/split-pdf).
  * While AI Invoice Parser supports multi-page invoices, **the total page count for a single PDF must not exceed 100 pages**. Submitting large PDFs containing multiple invoices is not recommended.
</Warning>

<img src="https://mintcdn.com/pdfco/tXGo3rbTS_pEF5es/images/integrations/n8n/ai-invoice-parser.png?fit=max&auto=format&n=tXGo3rbTS_pEF5es&q=85&s=598be69fdcfe33427c5716ae229afcd1" alt="Ai Invoice Parser Pn" width="882" height="1172" data-path="images/integrations/n8n/ai-invoice-parser.png" />

## Input

| Name                  | Description                                                                                                                                                                                                                                                 | Required |
| :-------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------- |
| **Invoice File URL**  | Provide the URL to the source PDF document, or a `filetoken://` link from [PDF.co Built-In Files Storage](https://app.pdf.co/tools/files). If you use another cloud service such as **Google Drive** or **Dropbox** ensure the link is publicly accessible. | Yes      |
| **Custom Field**      | Specify custom fields beyond the default list. Use comma-separated format for multiple custom fields extraction (e.g., `storeNumber`, `lineTotal`, `financialCharges`).                                                                                     | No       |
| **lineItemStructure** | A JSON object that defines a [custom structure](/integrations/n8n/ai-invoice-parser#line-item-structure) for line items. Each key is a field name (in `camelCase`) and each value is `"string"` or `"number"`.                                              | No       |
| **Webhook URL**       | The callback URL or Webhook used to receive the output data.                                                                                                                                                                                                | No       |

## File Requirements and Limitations

The PDF.co AI Invoice Parser only supports files with **up to 100 pages**. Files exceeding this limit will **not be processed**, so please avoid uploading documents larger than 100 pages.

If your file contains **multiple invoices in a single PDF**, use the [Split PDF](/integrations/n8n/split-pdf) operation in n8n to separate each invoice before passing them to the AI Invoice Parser node.

## Source PDF URLs

If your previous node or trigger outputs a binary file (e.g., from Gmail or other apps), you’ll need to upload the file first using the PDF.co [Upload File operation](/integrations/n8n/upload-file) to generate a **valid URL**. This URL is required as the input for the Source File URL field in all subsequent PDF.co actions. You can integrate with **Google Drive**, **Dropbox**, or other apps to trigger your automation and pass files into PDF.co.

## Custom Field Extraction

AI Invoice Parser with custom fields support automatically detects invoice layouts and extracts both standard schema data and user-specified custom fields without requiring manual templates.

The customField parameter allows you to specify additional fields to extract beyond the standard schema. Some examples include:

* `storeNumber` – Store or branch identifier
* `deliveryDate` – Expected delivery date
* `financialCharges` – Additional financial charges
* `lineTotal` – Total amount for line items
* `purchaseOrderRef` – Purchase order reference number
* `customerReference` – Customer reference number
* `departmentCode` – Department or cost center code

<Warning>
  *If a custom field returns an empty value, please* [contact our support team](https://pdf.co/support/request?subject=ai-invoice-parser%20-%20custom%20fields) *to help improve the extraction accuracy.*
</Warning>

## Line Item Structure

The `lineItemStructure` parameter lets you define a custom schema for line items. Each key is a field name you choose (in `camelCase`) and each value is the expected data type — either `"string"` or `"number"`.

When provided, every object inside the `lineItems` array will contain exactly the fields you specified. If a value cannot be extracted from the invoice, the field will still be present with an empty or default value instead of being omitted.

<Note>
  Use `camelCase` for field names (e.g., `unitPrice`, `totalPrice`). The field names you define will be used as-is in the response, giving you full control over the output keys.
</Note>

## Output

| Name               | Description                                                                                    |
| :----------------- | :--------------------------------------------------------------------------------------------- |
| `PageCount`        | Total Page Count.                                                                              |
| `url`              | Direct URL to the final PDF file stored in S3.                                                 |
| `body`             | An object array containing the all invoice parsing result.                                     |
| `duration`         | The time it took for the process.                                                              |
| `error`            | Details of any errors (if any).                                                                |
| `status`           | The [**response status**](/api-reference/response-codes) code. If all good this will be `200`. |
| `jobId`            | Unique identifier for the background job.                                                      |
| `credits`          | The credits spent on the process.                                                              |
| `remainingCredits` | The credits left on your account.                                                              |

## Supported Languages

* **Albanian (Shqip)**
* **Bosnian (Bosanski)**
* **Bulgarian (Български)**
* **Croatian (Hrvatski)**
* **Czech (Čeština)**
* **Danish (Dansk)**
* **Dutch (Nederlands)**
* **English**
* **Estonian (Eesti)**
* **Finnish (Suomi)**
* **French (Français)**
* **German (Deutsch)**
* **Greek (Ελληνικά)**
* **Hungarian (Magyar)**
* **Icelandic (Íslenska)**
* **Italian (Italiano)**
* **Latvian (Latviešu)**
* **Lithuanian (Lietuvių)**
* **Norwegian (Norsk)**
* **Polish (Polski)**
* **Portuguese (Português)**
* **Romanian (Română)**
* **Russian (Русский)**
* **Serbian (Српски)**
* **Slovak (Slovenčina)**
* **Slovenian (Slovenščina)**
* **Spanish (Español)**
* **Swedish (Svenska)**
* **Turkish (Türkçe)**
* **Ukrainian (Українська)**
