Receipt data extraction

Receipt data extraction reads a till receipt, usually a phone photo, and returns the merchant, date, tax, total, payment details and items as structured data. docRefinery's receipt OCR API covers 35 field definitions and works on images and PDFs alike. Each value carries a confidence score, so a creased or faded figure reaches a reviewer before it reaches your books.

Updated

Where receipt extraction fits

Receipts are the small end of finance paperwork: expense claims, card reconciliation, and bookkeeping for firms that collect shoeboxes of them from clients. In each case someone is matching a slip of paper to a card line and a tax treatment, and the amounts are small enough that keying them feels absurd and large enough in aggregate that it can't be skipped.

The evidence standard is modest but real. For US business expenses, the IRS says documentary evidence will ordinarily be adequate if it shows the amount, date, place and essential character of the expense. Receipt Date, Supplier Name, Supplier Address, Total Amount and the item lines map onto that list. Whether a claim is deductible is your accountant's call, not ours.

Receipt fields docRefinery extracts

There are 35 definitions, including the item table. Till details such as Terminal ID and Authorization Code help tie a receipt to its card transaction.

The 35 receipt field definitions, by category
CategoryFields
TransactionReceipt ID, Receipt Date, Purchase Time, Invoice ID, Currency
MerchantSupplier Name, Supplier Address, Supplier City, Supplier Phone, Supplier Website, Supplier Tax ID
At the tillStore Number, Terminal ID, Cashier Name, Customer Name, Return Policy
AmountsNet Amount, Total Tax Amount, Tip Amount, Discount Amount, Total Amount, Amount Tendered, Change Amount
PaymentPayment Type, Card Last Four Digits, Authorization Code
Line Item (table)Description, Product Code, Quantity, Unit, Unit Price, Amount, Discount, Tax Code

Example receipt JSON

A trimmed excerpt with invented values. The handwritten tip scored under its threshold, so this run waits for a person. For the complete response, see Extract a document.

Excerpt: receipt result
{
  "document_type": "receipt",
  "result": {
    "fields": [
      { "alias": "Supplier Name", "text": "Sample Street Cafe", "field_confidence": 0.93,
        "location": { "page": 1, "bbox": [0.24, 0.05, 0.76, 0.08] } },
      { "alias": "Total Amount", "text": "18.40", "field_confidence": 0.96,
        "location": { "page": 1, "bbox": [0.64, 0.71, 0.86, 0.74] } },
      { "alias": "Tip Amount", "text": "3.00", "field_confidence": 0.62,
        "location": { "page": 1, "bbox": [0.60, 0.78, 0.80, 0.82] } },
      { "alias": "Supplier Tax ID", "text": null, "location": null },
      { "alias": "Line Item", "table": [[
        { "alias": "Description", "text": "FLAT WHT LGE", "field_confidence": 0.88,
          "location": { "page": 1, "bbox": [0.10, 0.33, 0.52, 0.35] } }
      ]] }
    ],
    "extraction_approval": "human-approval",
    "low_confidence_fields": [
      { "alias": "Tip Amount", "text": "3.00", "confidence": 0.62,
        "threshold": 0.8, "reason": "low_confidence" }
    ]
  }
}

What makes receipts hard to read

  • Thermal paper. Its coating stays active after printing, so heat, light and friction can fade a receipt or darken it. A claim filed weeks late may be reading a ghost.
  • The photo itself. Creases, shadows, curled edges, a thumb over the corner, and a long narrow strip shot at an angle.
  • Till abbreviations. Item names are cut to fit the printer, so FLAT WHT LGE is what the page says.
  • Handwriting on print. Tips and revised totals are often written in by hand beside the printed figure, so two candidate totals sit on one slip.
  • Several numbers that look like the total. Subtotal, total, amount tendered and change usually stack together.
  • Travel. Foreign currency, local tax names and unfamiliar scripts turn up in the same expense claim.

How low-confidence receipt values are handled

Faded print usually fails quietly: the digit is still there, just not certain. So each value is scored against its own threshold, and a total scored under the bar goes to the review queue with a box around the patch of the photo it came from. An expenses clerk confirms or corrects it in seconds, with no hunting along the strip. A tax ID that was never printed returns null, not an invented number. You might accept looser reads on Cashier Name and hold Total Amount tight; thresholds are set field by field.

What docRefinery adds for expenses and bookkeeping

A single receipt is worth little, so what matters is how little handling it needs once it has been read.

  • Expense tools get their own labels. Set Return as on Supplier Name to merchant and on Total Amount to amount_gross, and the API and CSV headers carry those names.
  • Receipts and invoices share one output format, so a bookkeeper's import handles both without a second parser.
  • Items come back as rows, ready to split across categories in your own system.
  • A client's stack scanned as one long PDF is segmented into the documents inside it.
  • Slips from a trip abroad are covered by 70+ languages and scripts.
  • A clerk's correction on a regular merchant becomes a suggested fix, tested on that layout's own receipts before anyone applies it.
  • The Chrome extension, in early access and not in the Chrome Web Store yet, runs a receipt and auto-fills a web form such as an expenses portal.
  • Starter is free up to 100 pages a month with no card, enough to try a real month of slips.

Where receipts fit docRefinery less well

Layout memory is our main advantage, and receipts test it. Regular chains print from a template, so an account's usual merchants are learned once and remembered. A traveller's one-off stops are all first sightings. That long tail still gets your field names, item rows, scoring, review and the same output format, with less of the benefit that builds as layouts repeat.

Common questions

Can I try receipt OCR on a real example?

Yes. The dashboard includes a creased phone photo of a receipt from the public CORD dataset. Running it counts one page against Starter's free 100 a month.

Does it work on phone photos as well as PDFs?

Yes. PNG, JPEG and TIFF images are accepted as well as PDF, up to 100 MB a file. Sharper photos mean fewer values waiting for a reviewer.

Does it read full card numbers?

The catalogue field is Card Last Four Digits, which is what receipts generally print. You choose which fields are on, so it can be switched off altogether.

Can receipts and invoices go through the same integration?

Yes. Every document type returns the same field and table format, and Return as aliases let you use one name, such as merchant, wherever your system expects it. Your code reads receipts and invoices the same way, and only the set of fields differs.

Sources

  1. IRS Publication 463: travel, gift and car expenses
  2. CHOICE: faded receipts
  3. CORD: A Consolidated Receipt Dataset for Post-OCR Parsing (CC BY 4.0)

Related

Try it on your own documents.

Upload a real file and see each field with its confidence score, ready to check.

100 pages a month free. No credit card, no sales call.