DocwiseSource

Developers · API v1

The same flow, as JSON.

Send an invoice, read back every value with its confidence and the checks it failed, and approve it with corrections. A key acts for this browser, so invoices you send with it also appear in your inbox and review queue.

Your API keys

No keys yet. A key acts for this browser: invoices you send with it appear in your inbox and review queue.

Up to 3 keys per browser. Only a hash of each key is stored.

Endpoints

POST/api/v1/invoices

Send an invoice as multipart form data in a field named file. Answers 202 with the invoice, status queued; the model reads it in the background.

curl -X POST https://docwise-extract.vercel.app/api/v1/invoices \
  -H "Authorization: Bearer $DOCWISE_KEY" \
  -F file=@invoice.pdf
GET/api/v1/invoices/:id

One invoice: status, the values (corrections applied), what the model read, each field's confidence and why, the checks that fail, and the model's tokens, time and cost. Poll until status is needs_review, approved or failed. Samples can be read too.

curl https://docwise-extract.vercel.app/api/v1/invoices/sample-056 \
  -H "Authorization: Bearer $DOCWISE_KEY"
GET/api/v1/invoices

This key's invoices, newest first. Optional: status (queued, extracting, needs_review, approved, failed) and limit (1 to 100, default 20).

curl "https://docwise-extract.vercel.app/api/v1/invoices?status=needs_review" \
  -H "Authorization: Bearer $DOCWISE_KEY"
POST/api/v1/invoices/:id/approve

Approve an invoice waiting for review. Send only the fields you correct; the rest keep their values, and corrections are stored beside the extracted ones. Add "accept_failing_checks": true to approve an invoice that doesn't add up as printed.

curl -X POST https://docwise-extract.vercel.app/api/v1/invoices/ID/approve \
  -H "Authorization: Bearer $DOCWISE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"invoice": {"total": "6782.62"}}'

Errors

Every error is JSON: {"error": {"code", "message", "details"?}}, with a stable code to branch on.

400
The request is malformed: no file, bad JSON, an unknown field or status
401
No key, or a key that doesn't exist (revoked keys stop working at once)
403
Approving a sample: they're shared by every visitor
404
No invoice with that id for this key
409
The invoice isn't waiting for review
413 · 415
The file is over 4 MB, or isn't a PDF, JPEG, PNG or WebP (judged by its bytes, not its name)
422
A PDF that can't be opened or has more than 5 pages; values that can't be approved (details lists them)
429
A rate limit or the demo's daily cap; Retry-After says when to try again

Limits

  • 60 requests a minute per key.
  • 10 uploads an hour per network, shared with uploads from the browser.
  • Files up to 4 MB; PDFs up to 5 pages.
  • This is a public demo on one API budget: across all visitors, 50 uploads and $2.00 of model use per 24 hours. Samples cost nothing and always work.