Extraction
One resource: the invoice. Create it from a document, poll it (or receive a webhook), list and filter it. Base URL: https://nzsktgwehyzltgagloox.supabase.co/functions/v1/api
Create: POST /v1/invoices
Three input modes; PDF, JPEG, PNG, and HTML up to 15 MB.
| Mode | How |
|---|---|
multipart/form-data | A form field named file. The usual choice. |
file_url | JSON body with a public https URL; we fetch it (20s timeout, 15 MB cap). |
file_base64 | JSON body with file_base64, file_name, and optional mime_type. |
# multipart
curl -X POST 'https://nzsktgwehyzltgagloox.supabase.co/functions/v1/api/v1/invoices' \
-H 'Authorization: Bearer $INVOICEJET_API_KEY' \
-F 'file=@invoice.pdf'
# from a URL
curl -X POST 'https://nzsktgwehyzltgagloox.supabase.co/functions/v1/api/v1/invoices' \
-H 'Authorization: Bearer $INVOICEJET_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"file_url": "https://example.com/invoices/june.pdf"}'Batch scans: automatic splitting
A multi-page PDF holding several invoices (a batch scan, or attachments merged into one file) is detected and split automatically: each invoice becomes its own record, named original (1 of N).pdf through (N of N). The create response is the first invoice; the rest arrive as separate invoices with their own invoice.completed webhook events, so consume webhooks or poll GET /v1/invoices rather than assuming one file means one invoice. Each split invoice counts against the monthly quota. Continuation pages (line-item overflow, terms, remittance slips) stay with their invoice.
Safe retries: Idempotency-Key
Send an Idempotency-Key header (any unique string, e.g. a UUID) with the create and retries within 24 hours replay the original response instead of ingesting the document again. Details on the Errors & limits page.
Async by default, sync when you want it
The default response is 202 with the invoice in queued state; extraction runs in the background (typically 10 to 30s). Get the result by polling GET /v1/invoices/:id or via webhooks. Add ?wait=true to hold the request up to 60 seconds and receive 200 with the finished resource; if extraction outruns the wait you get 202 with "wait_timed_out": true and it finishes in the background.
Retrieve: GET /v1/invoices/:id
curl 'https://nzsktgwehyzltgagloox.supabase.co/functions/v1/api/v1/invoices/9b2f0c1e-…' \
-H 'Authorization: Bearer $INVOICEJET_API_KEY'List: GET /v1/invoices
| Param | Meaning |
|---|---|
limit | 1–100, default 25. |
status | queued | processing | complete | failed |
source | app | email | api |
created_after / created_before | RFC 3339 timestamps. |
vendor | Substring match on vendor name. |
paid | true (paid only) or false (unpaid only). |
overdue | true: complete, unpaid, past due. |
min_amount / max_amount | Amount range. |
due_before / due_after | Due-date window (ISO dates). |
starting_after | Invoice id cursor: returns results strictly after it (newest first). |
Responses are { "object": "list", "data": [...], "has_more": true }. Page by passing the last id of a page as starting_after.
Update: PATCH /v1/invoices/:id
Two writable fields: paid (boolean; complete invoices only) and entity_tag (1-60 chars, or null to clear). Returns the updated resource.
curl -X PATCH 'https://nzsktgwehyzltgagloox.supabase.co/functions/v1/api/v1/invoices/9b2f0c1e-…' \
-H 'Authorization: Bearer $INVOICEJET_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"paid": true, "entity_tag": "EngCo LLC"}'Request approval: POST /v1/invoices/:id/approval
Emails the approver a signed approve/reject link for a complete invoice (the same flow as the app). One pending request per invoice; a new request after a rejection overwrites it.
curl -X POST 'https://nzsktgwehyzltgagloox.supabase.co/functions/v1/api/v1/invoices/9b2f0c1e-…/approval' \
-H 'Authorization: Bearer $INVOICEJET_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"email": "approver@company.com"}'Download the original: GET /v1/invoices/:id/file
Returns a signed, time-limited URL (1 hour) for the invoice's original source document (the PDF, image, or HTML that was ingested): {id, url, expires_in: 3600, file_name, mime_type}. Fetch the URL directly; no auth header is needed on the download itself.
curl 'https://nzsktgwehyzltgagloox.supabase.co/functions/v1/api/v1/invoices/9b2f0c1e-…/file' \
-H 'Authorization: Bearer $INVOICEJET_API_KEY'
# then download it
curl -o invoice.pdf "<url from the response>"Retry extraction: POST /v1/invoices/:id/extract
Re-runs extraction on the stored document. Meant for failed invoices; pass {"force": true} to re-extract a complete one (for example after correcting the source). Returns 202 with the invoice back in queued state plus "retry_accepted": true; poll or use webhooks for the result. Retries count against the monthly quota. A processing invoice returns 400 already_processing.
curl -X POST 'https://nzsktgwehyzltgagloox.supabase.co/functions/v1/api/v1/invoices/9b2f0c1e-…/extract' \
-H 'Authorization: Bearer $INVOICEJET_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"force": false}'Vendors: GET /v1/vendors
The account's vendors with aggregates, highest spend first: {id, object: "vendor", name, invoice_count, total_billed, last_seen_at, website, email, phone}. Takes limit (1-100, default 25).
curl 'https://nzsktgwehyzltgagloox.supabase.co/functions/v1/api/v1/vendors?limit=10' \
-H 'Authorization: Bearer $INVOICEJET_API_KEY'The invoice resource
| Field | Notes |
|---|---|
status | queued → processing → complete | failed. Extraction fields are null until complete. |
vendor_name, invoice_number | Strings. |
amount, tax | Numbers (invoice currency). |
currency | ISO 4217 (e.g. USD). |
issued_at, due_at | ISO dates. |
line_items[] | description, quantity, unit_price, confidence. |
field_confidence | high | mid | low per header field. high means validation passed AND two independent models agreed. |
auto_verified | true when every field is high-confidence and no duplicate was flagged. |
quality_score | 0–1 weighted confidence summary. |
source | app | email | api: how the document arrived. |