parse.invoice
Parse a tax invoice or commercial invoice into the AfricaInvoiceReceipt contract: seller (TIN / KRA PIN / VAT no), issued date, currency, line items, VAT rate/amount, subtotal, total, payment refs, confidence, and warnings (including vat_total_mismatch). Built for NG/KE/GH/ZA AP automation and multi-line SKU invoices — not a thin keyword grep. Use when the document is an invoice rather than a till slip; still accept OCR text or image/PDF base64. Nulls mean unknown; do not treat low-confidence totals as ledger truth without checking confidence and warnings. Costs $0.15 (15 credits) per successful response; fail-closed prepaid or x402.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | OCR or plain-text dump of the tax invoice. Example: 'TAX INVOICE\nDANGOTE CEMENT PLC\nTIN: 01012345-0001' | |
| tier | No | Processing tier. Example: auto | auto |
| filename | No | Original filename hint. Example: invoice.pdf | |
| file_base64 | No | PDF or image bytes as base64 | |
| content_type | No | MIME type of file_base64. Example: application/pdf |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tax | Yes | ||
| buyer | No | ||
| total | Yes | ||
| payment | No | ||
| currency | Yes | ||
| doc_type | Yes | ||
| merchant | Yes | ||
| subtotal | Yes | ||
| warnings | Yes | ||
| issued_at | Yes | YYYY-MM-DD or null | |
| confidence | Yes | ||
| line_items | Yes | ||
| amount_paid | No | ||
| balance_due | No | ||
| document_id | No | ||
| locale_hints | No | ||
| raw_text_excerpt | No |