Upload a photo or PDF of an invoice or delivery order. You get structured JSON back, with a confidence score (0 to 1) for every field.
| Method / URL | POST https://docextract.egateai.com/v1/extract |
|---|---|
| Header | X-API-Key: <your key> |
| Body | multipart/form-data |
| file | required. JPG, PNG, WEBP, HEIC or PDF, max 10 MB |
| document_type | optional: auto (default, detects it), invoice or delivery_order |
curl -X POST https://docextract.egateai.com/v1/extract \ -H "X-API-Key: YOUR_KEY" \ -F "[email protected]" \ -F "document_type=auto"
import requests
r = requests.post("https://docextract.egateai.com/v1/extract",
headers={"X-API-Key": "YOUR_KEY"},
files={"file": open("invoice.jpg", "rb")}, data={"document_type": "auto"})
print(r.json())
Every response has success, document_type (invoice or delivery_order), document_type_confidence and data. Each field in data looks like {"value": "INV-001", "confidence": 0.98}. A value is null when it is not on the document. Fields below 0.6 should be reviewed by a person. warnings lists anything unclear.
Invoice data: invoice_number, invoice_date, due_date, po_number, payment_terms, currency, supplier{name, registration_no, tax_id, address, phone}, buyer{...}, line_items[{description, quantity, unit, unit_price, amount, confidence}], subtotal, tax_amount, total, warnings.
Delivery order data: do_number, do_date, po_number, reference_no, supplier{...}, customer{...}, delivery_address, vehicle_no, driver_name, items[{description, quantity, unit, confidence}], received{received_by_name, received_date, signature_present (yes/no), stamp_company_name, stamp_location}, remarks, warnings.
| Code | Meaning |
|---|---|
| 400 | Empty file or bad document_type |
| 401 | Missing or wrong X-API-Key |
| 413 | File over 10 MB |
| 415 | Unsupported file type |
| 422 | Not an invoice or delivery order (auto mode) |
| 502 | Reading service busy; retry in a few seconds |
eGate Messaging Sdn Bhd | [email protected] | +603 7877 6216