Skip to main content
Nodes used: Parse, Extract This example reads a receipt photo or scan and returns the merchant, the totals, the item count and how the purchase was paid. An enum field pins the payment method to a fixed set of names, and a boolean flags alcohol for expense policies.

The workflow

Run it and read the result

Send the photo as the files field. JPG, PNG and PDF all work. Poll the run until its status is processed.

Response

The results envelope of a processed run, trimmed. Every value is a string on the wire, including booleans ("True" / "False") and numbers. A field the model could not find comes back with value: null and confidence: null, as tax_amount does on this receipt.

Tips

  • Good lighting and a flat surface make a large difference to a receipt photo. A crumpled or shadowed receipt lowers parse_confidence.
  • Prefer PNG over a heavily compressed JPG when you control the capture.
  • An enum with explicit options stops free-text variations such as “Visa”, “credit card” and “CC”. The value is always one of your option names.
  • A boolean arrives as the string "True" or "False". Compare against the string, or cast it, before you branch on it.
  • Treat value: null as “not on the receipt”, not as zero. Faded thermal paper often loses the tax line first.
  • Set a lower confidence threshold on contains_alcohol than on total_amount. The flag matters less than the amount.

Next steps

Runs and results

The results envelope and the run status model

Errors

Rate limits, idempotency and retries