---
title: "Extract Invoice Data"
method: POST
path: "/api/v1/ai/extract-invoice"
tags: ["AI Document Intelligence"]
---

# Extract Invoice Data

`POST /api/v1/ai/extract-invoice`

## Request

- Base URL: `https://api.allpdfmagic.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.allpdfmagic.com/api/v1/ai/extract-invoice`
- Auth: HTTP bearer

Extract structured data from an invoice PDF using AI.

Returns vendor info, buyer info, amounts, tax details, and line items.
Supports multiple export formats: JSON, CSV, Excel, QuickBooks, Xero, Zoho.

## Response `200`

Successful Response

- InvoiceExtractionResponse
  - `success` boolean, required
  - `data` InvoiceData, required
    - `document_type` string
    - `confidence` number
    - `vendor` VendorInfo
      - `name` string, nullable
      - `address` string, nullable
      - `tax_id` string, nullable
      - `email` string, nullable
      - `phone` string, nullable
    - `buyer` BuyerInfo
      - `name` string, nullable
      - `address` string, nullable
      - `tax_id` string, nullable
    - `invoice` InvoiceDetails
      - `number` string, nullable
      - `date` string, nullable
      - `due_date` string, nullable
      - `po_number` string, nullable
    - `amounts` AmountInfo
      - `currency` string
      - `subtotal` number, nullable
      - `tax` TaxInfo
        - `type` 'VAT' | 'GST' | 'Sales Tax' | 'Consumption Tax' | 'HST' | 'PST' | 'Unknown'
        - `rate` number, nullable
        - `amount` number, nullable
      - `shipping` number, nullable
      - `discount` number, nullable
      - `total` number, nullable
    - `line_items` LineItem[]
      - `description` string, nullable
      - `quantity` number, nullable
      - `unit_price` number, nullable
      - `amount` number, nullable
      - `tax_rate` number, nullable
    - `raw_text` string, nullable
  - `export_file` FileResponse
    - `filename` string, required
    - `download_url` string, required
    - `size_bytes` integer, required
    - `expires_at` string, date-time, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/allpdfmagic/apis/allpdfmagic-api.md) · [All operations](https://skmtc.dev/allpdfmagic/apis/allpdfmagic-api/llms.txt) · [OpenAPI document](https://skmtc.dev/allpdfmagic/apis/allpdfmagic-api/revisions/92ad9e3b3b88?raw)
