AP Document Extraction
Extract purchase orders, delivery documents, payment advice, bank statements, and standalone e-invoices through the AP document API.
/v1/documents/extractProAP 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
| Endpoint | Input | Plan |
|---|---|---|
POST /v1/documents/extract | JSON body with text | Pro and Business |
POST /v1/documents/extract/file | Multipart file with PDF, image, or XML | Pro and Business |
POST /v1/documents/extract/url | JSON body with url | Pro 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.
Related Features
For more specialized AP workflows, you can also use:
- AP Classification: Categorise documents before extraction.
- Document Auto-Crop: Detect and isolate multiple documents from a single page scan.
- Document Auto-Split: Group multi-page PDF batches into logical page ranges.
- AP Document Workflow: Run these documents through a fixed pipeline with human-in-the-loop review and audit trails.