Invoice triage
Read an invoice or bill — PDF, Excel, Word or a photo — and decide whether to pay it, send it to review or reject it, and whether it is due soon, with the Invoice Triage template.
Goal: accounts payable receives invoices by e-mail, forms and upload. Dcision reads each document and decides what happens: regular invoices are paid, unusual ones are reviewed, duplicates are rejected — and urgent ones reach a person today.
Create the decision
Templates → Invoice triage → Create decision:
| Part | Content |
|---|---|
| State | invoice (file, required), message (string) |
| Context | Your payment rules — edit the suppliers, limits and checks |
document_type | choice — invoice, receipt, contract, other |
decision | choice — pay, review, reject, other; minimum confidence 0.7 |
due_soon | probability — due within 3 days, or overdue |
| Policies | decision = reject → block; decision = review → escalate; document_type ≠ invoice → escalate; document_type = invoice and due_soon ≥ 0.8 → escalate; fallback action escalate |
invoice is a file field. PDFs with text, Word, Excel, CSV and similar documents are read by Dcision at no cost; scanned PDFs and photos of paper invoices are read by OpenAI with your OpenAI key.
Call it
Send the file as base64, or a URL Dcision downloads:
curl -X POST https://api.dcision.io/v1/decisions/invoice-triage \
-H "Authorization: Bearer $DCISION_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"state": {
"invoice": {"url":"https://example.com/invoice-1042.pdf","filename":"invoice-1042.pdf"},
"message": "Monthly hosting, as usual."
}
}'{
"schema": "invoice-triage",
"result": { "document_type": "invoice", "decision": "pay", "due_soon": 0.12 },
"action": "continue",
"action_reason": { "type": "default" },
"metrics": { "engine": "jev", "input_files": 1, "input_cost_usd": 0 }
}From a mailbox or a form, the webhook trigger takes the file as multipart/form-data — no code:
curl -X POST https://api.dcision.io/v1/hooks/whk_… \
-F "invoice=@invoice-1042.pdf" -F "message=Monthly hosting, as usual."Act on it
const decision = await dcisionDecide("invoice-triage", { invoice: fileFromBytes(pdf, "invoice-1042.pdf") });
if (decision.action === "continue") return schedulePayment(decision);
if (decision.action === "block") return archiveAsRejected(decision);
return assignToAccountsPayable(decision); // review, unusual document or due soonTune it
- Write your rules in
context: known suppliers, the amount that needs approval, what makes an invoice unusual. - Add a question for what you check by hand today — "Do the bank details differ from the supplier's usual ones?".
- Read the text Dcision extracted in the execution log (
invoice.text) when a decision surprises you.