PDFHQ logo

Documents

DocumentationDocuments & intelligence

Invoice CSV export API

Download a private, review-only CSV of source-backed invoice fields with spreadsheet formula protection and audit citations.

Server-side API keys Signed storage uploads

Export a completed invoice extraction#

Run pdfhq.ai.extract using an accepted HQTools quote and wait for a succeeded job. GET /v1/ai/jobs/{job_id}/invoice.csv responds with a private text/csv download. Only the same owner/project that owns the AI job can retrieve it. Failed, pending or non-invoice jobs cannot be exported.

cURL
curl 'https://api.pdfhq.io/v1/ai/jobs/AI_JOB_UUID/invoice.csv' \
  -H 'x-api-key: PROJECT_API_KEY' -o invoice-review.csv

Columns: field, value, source_citations, review_required. All seven invoice fields are present, missing values are blank and all rows are marked review_required=true. CSV values that might be interpreted as spreadsheet formulas are escaped. Cache-Control is private, no-store; never publish exports or log document contents.

Structured invoice review workbooks#

GET /v1/ai/jobs/{job_id}/invoice.xlsx generates a private Excel file with the invoice header, line items, source excerpts and reconciliation/review notes. The server validates source revision and citation offsets and stores amounts as text to preserve exact decimals and defend against spreadsheet formula injection. No second provider call or HQTools reservation is made.

cURL
curl 'https://api.pdfhq.io/v1/ai/jobs/AI_JOB_UUID/invoice.xlsx' \
  -H 'x-api-key: PROJECT_API_KEY' -o invoice-review.xlsx

POST /v1/ai/jobs/invoices/batch.xlsx accepts 1 to 10 distinct owned, completed invoice job IDs from the same API project. The request is all-or-nothing: an expired, foreign, duplicate or invalid job prevents the entire export. Each invoice is still charged only when its original AI job was processed.

cURL
curl -X POST 'https://api.pdfhq.io/v1/ai/jobs/invoices/batch.xlsx' \
  -H 'x-api-key: PROJECT_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"job_ids":["FIRST_JOB_UUID","SECOND_JOB_UUID"]}' \
  -o invoice-batch-review.xlsx

Review-before-import policy#

Format validation checks ISO dates, uppercase three-letter currency codes, nonnegative decimal totals and revision-bound citation references. It can reject unsupported numeric or invoice-number claims. It does not establish that an invoice is genuine or that an amount is the legally correct amount due. Review against the original PDF before exporting to accounting, ERP, or payments.

CSV export itself is read-only: it does not create another provider request or incur a new AI model charge. The original AI processing job uses an approved HQTools HQ-credit quotation.

PDFHQ logo

PDF tools and document intelligence. Prepare, understand and work with your documents.

© 2026 PDFHQ. All rights reserved.