---
title: AI Document Invoice Data Extraction API
slug: extract-invoice-data
url: https://apyhub.com/apyhub/service/extract-invoice-data
provider: ApyHub
categories: [Ingestion Kit, Document Intelligence Kit]
tags: [invoice-parsing, invoice-ocr, data-extraction, accounts-payable, ocr]
auth: api_key
version: 1.0.0
service_type: sync
endpoints: 2
atoms: 500
mcp: true
alias: ai-document-extract-invoice
---

# AI Document Invoice Data Extraction API

Extract structured invoice data from a file or URL. Returns ApyHub or Azure invoice parsing output for accounts payable and ingestion workflows.

## Endpoints

| Method | URL | Description | Atoms |
| --- | --- | --- | --- |
| POST | `https://api.eu.apyhub.com/apyhub/extract-invoice-data/file` | What it does Uploads an invoice file and returns parsed invoice data in a JSON object. The response… | 500 |
| POST | `https://api.eu.apyhub.com/apyhub/extract-invoice-data/url` | What it does Extracts invoice data from a document available at a URL and returns parsed results in… | 500 |

## Endpoint reference

### Extract invoice data (file upload)

`POST https://api.eu.apyhub.com/apyhub/extract-invoice-data/file` · 500 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `file` | body | string (binary) | yes |  |
| `azure_key` | body | string | no | Example: `azure-key-val`. |
| `azure_region` | body | string | no | Example: `eastus`. |
| `azure_endpoint` | body | string | no | Example: `https://endpoint-val/`. |
| `azure_account_id` | body | string | no | Example: `account-id`. |
| `requested_service` | body | string | no | One of: azure, apyhub. Default: `apyhub`. Example: `apyhub`. |
| `azure_access_token` | body | string | no | Example: `token-val`. |

#### Quickstart

Upload an invoice file to extract its data with the default ApyHub parser.

```bash
curl -X POST "https://api.eu.apyhub.com/apyhub/extract-invoice-data/file" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/document.pdf" \
  -F "requested_service=apyhub"
```

#### What you'll get back

Returns a JSON object with a `data` object field. Inside `data`, the response may include `azure` for raw Azure Document Intelligence parsing output and/or `apyhub` for structured ApyHub Invoice Extraction parsing output.

```json
{
  "data": {
    "azure": {},
    "apyhub": {}
  }
}
```

### Extract invoice data (URL input)

`POST https://api.eu.apyhub.com/apyhub/extract-invoice-data/url` · 500 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `url` | body | string (uri) | yes | Example: `https://example.com/invoice.pdf`. |
| `azure.key` | body | string | no | Azure subscription key. Example: `your_azure_speech_or_vision_key`. |
| `azure.region` | body | string | no | Azure service region. Example: `westus2`. |
| `azure.endpoint` | body | string | no | Azure endpoint URL. Example: `https://westus2.api.cognitive.microsoft.com/`. |
| `azure.account_id` | body | string | no | Azure account ID. Example: `account-id-1234`. |
| `azure.access_token` | body | string | no | OAuth access token for Azure service. Example: `access_token_value`. |
| `requested_service` | body | string | no | One of: azure, apyhub. Default: `apyhub`. Example: `apyhub`. |

#### Quickstart

Send an invoice PDF URL to extract its data.

```bash
curl -X POST "https://api.eu.apyhub.com/apyhub/extract-invoice-data/url" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/invoice.pdf"}'
```

#### What you'll get back

Returns a JSON object with a `data` object field. `data.azure` contains the raw Azure Document Intelligence parsing output, and `data.apyhub` contains the structured ApyHub invoice extraction output.

```json
{
  "data": {
    "azure": {},
    "apyhub": {}
  }
}
```

## About

## What it does
Invoice Extraction pulls structured invoice data from a PDF or document URL and returns either ApyHub's parsed invoice output or raw Azure Document Intelligence output, depending on the service you request.

Send a file to `POST /file` or pass a document URL to `POST /url`. Both endpoints accept a `requested_service` value of `azure` or `apyhub`. The file endpoint also supports Azure credentials in the request body: `azure_key`, `azure_region`, `azure_endpoint`, `azure_account_id`, and `azure_access_token`. The URL endpoint accepts an `azure` object with `key`, `region`, `endpoint`, `account_id`, and `access_token`.

The response wraps the extraction result in `data.azure` or `data.apyhub`. Use the Azure branch when you need the raw parsing output from Document Intelligence. Use the ApyHub branch when you want the structured invoice extraction response for downstream automation, such as accounts payable workflows, expense ingestion, or invoice indexing.

Invoice Extraction fits into systems that need to turn invoices into machine-readable data without building your own document parser. It gives you a single interface for file uploads and remote documents, with output shaped for programmatic processing. 

| Provider (requested_service) | Atoms |
|------------------------------|------:|
| Azure                        |   500 |
| ApyHub                       |  2000 |

## Usage

Base URL: `https://api.eu.apyhub.com` (default region — see
`GET https://apyhub.com/api/public/regions` for the rest).

Authenticate with an ApyHub API key in the `apy-token` header.
Full docs and a live playground: https://apyhub.com/apyhub/service/extract-invoice-data
