Documentation

AP Document Extraction

Extract purchase orders, delivery documents, payment advice, bank statements, and standalone e-invoices through the AP document API.


POST/v1/documents/extractPro

AP document extraction is separate from invoice extraction. Existing invoice endpoints keep returning the top-level invoice envelope, while AP document endpoints return a top-level document envelope.

Endpoints

EndpointInputPlan
POST /v1/documents/extractJSON body with textPro and Business
POST /v1/documents/extract/fileMultipart file with PDF, image, or XMLPro and Business
POST /v1/documents/extract/urlJSON body with urlPro and Business

Pro includes purchase orders, delivery notes, packing slips, goods receipts, remittance advice, and payment advice. Business also includes standalone XRechnung and Peppol e-invoice parsing plus bank statement extraction.

Document Type vs Source Format

document_type describes the business document: purchase_order, delivery_note, remittance_advice, bank_statement, invoice, credit_note, and related AP families.

source_format describes how the document arrived or which structured standard was parsed: text, pdf, image, url, zugferd, factur_x, xrechnung, peppol_bis_billing, or unknown_xml.

Structured e-invoices normally keep document_type as invoice or credit_note and set source_format to xrechnung, peppol_bis_billing, zugferd, or factur_x.

File Upload

curl -X POST "https://api.parsurai.com/v1/documents/extract/file?locale=de" \
  -H "X-API-Key: $PARSURAI_API_KEY" \
  -F "document_type_hint=purchase_order" \
  -F "file=@purchase-order.pdf"

Response

{
  "document_id": "6ed32f61-f826-4ce1-8d0d-508fb68d1f12",
  "document_type": "purchase_order",
  "source_format": "pdf",
  "schema_version": 1,
  "document": {
    "po_number": "PO-2026-0042",
    "supplier": { "name": "Muster GmbH" },
    "buyer": { "name": "Buyer GmbH" },
    "line_items": [],
    "currency": "EUR",
    "total_amount": "2975.00"
  },
  "raw_structured_metadata": {},
  "confidence": 0.91,
  "field_confidence": {},
  "warnings": []
}

Use POST /v1/extract/file when you want the classic invoice response. Use POST /v1/documents/extract/file when you need the AP document envelope or standalone XML e-invoice handling.

For more specialized AP workflows, you can also use: