Users Pricing

forum

Home Forums How should an OpenAI invoice extractor distinguish missing amounts from zero? – MindStick

How should an OpenAI invoice extractor distinguish missing amounts from zero?

Waldemar Thiessen 56 18 Oct 2026

I’m building an invoice-processing workflow with the OpenAI API, and I’m unsure how to represent an amount that the model cannot find. A blank tax field, an explicit tax amount of zero, and an unreadable tax amount should not mean the same thing to our accounting system.

With structured outputs for invoice extraction, would you keep the amount nullable and add a separate status field, or use a different structure?

  • The invoice explicitly shows “Tax: 0.00.”
  • There is no tax line anywhere on the invoice.
  • A tax line exists, but the scan cuts off the amount.
  • Tax could be calculated from the other totals, but is not actually printed.

I want to keep missing versus zero values distinct without encouraging the model to fill gaps with arithmetic. We can calculate derived amounts later, outside the extraction step.

What output contract and validation checks would you use so downstream code can tell an observed value from an inference? I’m particularly interested in examples where schema-valid output still caused an accounting mistake.


0 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md