Tools

Invoice to Markdown API

Submit an invoice PDF. Get back vendor, line items, totals, and dates as a readable Markdown document. No templates, no training.

Try it below:

FILEDrop a file or click to upload

Production-ready

Private by design

Security-first

Scalable

Production-ready

Private by design

Security-first

Scalable

Production-ready

Private by design

Security-first

Scalable

Turn invoices into Markdown

Upload an invoice PDF or submit a URL, get Markdown back.

# Invoice #1042

**Kind:** document
**Created:** 2025-06-01T10:00:00.000Z
**MIME Type:** application/pdf
**Size:** 98304 bytes
**Chunks:** 8

## Document

**Author:** Acme Corp
**Pages:** 2
**Created:** 2025-05-28T00:00:00.000Z

## Invoice

**Vendor:** Acme Corp
**Invoice number:** 1042
**Issue date:** 2025-05-28
**Due date:** 2025-06-28
**Line items:**
  - **Description:** API integration consulting
    **Quantity:** 12
    **Unit price:** 150
    **Amount:** 1800
  - **Description:** Infrastructure setup
    **Quantity:** 1
    **Unit price:** 2500
    **Amount:** 2500
  - **Description:** Monthly hosting (June)
    **Quantity:** 1
    **Unit price:** 320
    **Amount:** 320

**Total:** 4620

What is Exabase's invoice to Markdown API?

Submit an invoice PDF to the Exabase Extract API and get a Markdown document back instead of JSON. The API detects the document type automatically, extracts invoice-specific fields (vendor, invoice number, issue date, due date, line items, total), and renders them as a structured Markdown document. Pass ?format=markdown when retrieving the result.

The Markdown output includes document metadata at the top, followed by a ## Document section with page count, author, and creation date, then a ## Invoice section with all the extracted structured fields. Line items are rendered as a nested list with description, quantity, unit price, and amount for each. The result is ready to feed into an LLM for further processing, present to a human for review, or store as a readable record.

What you get back

The Markdown response is a single text document. The ## Invoice section contains vendor, invoice number, issue date, due date, line items (each with description, quantity, unit price, and amount), and total. No template configuration, no field mapping. The API recognises the invoice and renders the structured data automatically.

You can also configure webhooks with webhookFormat: "markdown" so completed jobs POST the Markdown document directly to your server.

One multi-modal API

The same POST /v2/extract endpoint handles every content type Exabase supports, and the ?format=markdown parameter works across all of them. For invoices, the structured fields render under an ## Invoice heading. For contracts: parties, dates, and clauses under ## Contract. For resumes: experience, education, and skills under ## Resume. For audio and video, you get the transcript. For images, you get OCR text.

The submission flow is identical across all types. The Extract docs cover each content type in detail.

What you can build with it

Feed invoice content into an LLM as readable Markdown for automated processing. Present extracted invoice data to AP teams as a readable document for review before it enters your ERP. Build an internal tool that shows invoice details without opening the original PDF.

Store processed invoices as Resources in a Base and search across all of them through Deep Search. Workers can process new invoices as they arrive.

Beyond Markdown

The Extract API also returns JSON (the default) with typed fields you can query programmatically. Use Markdown for LLM context and human review, JSON for structured processing and system integration. The Invoice to JSON tool page covers the JSON output.

How do I use it?

  1. Get your API key

Free, no credit card:

Sign up at exabase.io and copy your API key from the dashboard.

  1. Submit an invoice PDF

Using the SDK (Node.js):

import { Exabase } from "@exabase/sdk";
import { createReadStream } from "fs";

const api = new Exabase({
  apiKey: process.env.EXABASE_API_KEY,
});

const job = await api.extract.createFromFile({
  file: createReadStream("./invoice-1042.pdf"),
  name: "Invoice #1042",
});

console.log(job.id);    // extraction job id
console.log(job.state); // "pending"
  1. Get Markdown back

Poll the job until state reaches completed, or skip polling entirely with webhooks.

curl 'https://api.exabase.io/v2/extract/<jobId>?format=markdown' \
  -H 'X-Api-Key: <EXABASE_API_KEY>'

One API call. No templates, no field mapping, no Markdown conversion.

Example output

# Invoice #1042

**Kind:** document
**Created:** 2025-06-01T10:00:00.000Z
**MIME Type:** application/pdf
**Size:** 98304 bytes
**Chunks:** 8

## Document

**Author:** Acme Corp
**Pages:** 2
**Created:** 2025-05-28T00:00:00.000Z

## Invoice

**Vendor:** Acme Corp
**Invoice number:** 1042
**Issue date:** 2025-05-28
**Due date:** 2025-06-28
**Line items:**
  - **Description:** API integration consulting
    **Quantity:** 12
    **Unit price:** 150
    **Amount:** 1800
  - **Description:** Infrastructure setup
    **Quantity:** 1
    **Unit price:** 2500
    **Amount:** 2500
  - **Description:** Monthly hosting (June)
    **Quantity:** 1
    **Unit price:** 320
    **Amount:** 320

**Total:** 4620

API quick reference

Endpoint

Method

Description

/v2/extract

POST

Submit extraction job

/v2/extract

GET

List extraction jobs

/v2/extract/{jobId}

GET

Poll for result

/v2/extract/{jobId}/chunks

GET

Fetch text chunks (JSON only)

/v2/extract-settings

PUT

Configure webhook

Auth: X-Api-Key header on all requests.

File retention: Stored files are retained for 1 day from job creation. Download or copy anything you need before they expire.

Need file extraction or full page content?

Exabase offers a full set of tools to extract content from any media, document or website.

All your data extraction needs in one place.

Why Exabase

Use cases

FAQs

What is Exabase?

Exabase is infrastructure for AI agents. It gives your agents memory, versioned file storage, AI deep search, and context automation through a set of APIs. Store what your agent learns, search inside any content type, and keep knowledge bases current automatically. Built for production use. Give your agent precise context and cut your token spend by up to 81%.

Who uses Exabase?

Developers and teams building AI agents, copilots, and RAG applications. If your agent needs to remember things between sessions, store and retrieve files, search across documents and media, or stay up to date without manual maintenance, Exabase handles that infrastructure so you can focus on your product.

How do I get Markdown instead of JSON?

Add ?format=markdown to the GET /v2/extract/{jobId} request. For webhooks, set webhookFormat: "markdown".

What fields does the Markdown include?

Vendor, invoice number, issue date, due date, line items (description, quantity, unit price, amount), and total. Rendered under an ## Invoice heading.

Can I still get JSON?

Yes. JSON is the default. Both formats are available from the same extraction job. For programmatic processing, Invoice to JSON returns typed fields.

How accurate is the extraction?

Accuracy depends on document quality. The structured fields are a starting point. Validate critical values in your application logic.

What if the API doesn't recognise the PDF as an invoice?

The ## Invoice section will be absent. You still get document metadata and text in the Markdown output.

Does it handle scanned invoices?

Yes. OCR is built in.

Do I have to poll for results?

No. Configure a webhook with webhookFormat: "markdown".

What happens if extraction fails?

The job state moves to failed. You can call the reprocess endpoint to retry without re-uploading the original file.

How long are files retained?

Stored files are retained for 1 day from job creation, then permanently deleted. Download or copy anything you need before the retention window expires.

Does it work with password-protected PDFs?

No. Password-protected PDFs cannot be processed. Remove the password before submitting.

Can I use the extracted content with other Exabase features?

Yes. Store processed invoices as a Resource in a Base and the content becomes searchable through Deep Search. Extract key details into Memory so your agent retains invoice history. Workers can process new invoices automatically as they arrive.

Is there an SDK?

Yes. The @exabase/sdk package for Node.js/TypeScript handles file streaming, job polling, and chunk retrieval. Install with npm install @exabase/sdk. Or call the REST API directly from any language.

Deciding?

Ask your favourite AI about Exabase:

Cut your token spend and give your agent precise context.

Get started in minutes.

Cut your token spend and give your agent precise context.

Get started in minutes.