← Back to Maya For QuickBooks

Under the Hood

The AI Secret Sauce

How Maya uses AI to read receipt images and classify them into the right QuickBooks transaction type. The actual rules, explained in plain English.

Not magic. Rules.

Most receipt scanners use OCR — optical character recognition. They read text off an image and dump it into a spreadsheet. The text is accurate, but the scanner has no idea what it's looking at. It doesn't know the difference between a receipt and an invoice. It doesn't know what "PAID" means. It can't tell a refund from a charge.

Maya is different. It uses a vision-capable language model that doesn't just read text — it understands documents. It looks at a receipt the way an experienced bookkeeper would: checking the layout, reading the signals, evaluating the evidence, and making a decision it can explain.

This page is the technical version of that process. If you're evaluating Maya for a client, comparing it to another tool, or just curious how it works under the hood, here's what actually happens between "text a photo" and "draft appears in QuickBooks."

Step 1: Vision — reading the whole document

When a receipt photo arrives, Maya's vision model examines the entire image. Not just the text — the structure. Where is the total? Is there a balance due line? Are there negative numbers? Is there card-processing metadata? Does it look like a retail receipt or a business invoice?

This is fundamentally different from OCR. OCR extracts characters. Maya's vision model extracts meaning. It can tell the difference between "CREDIT" as a payment method and "CREDIT" as a refund indicator based on where the word appears and what surrounds it. It can read a handwritten "PAID" stamp and understand what it means. It can recognize that a trailing minus sign after an amount — 130.40- — means a negative value, even without a leading minus sign.

OCR reads words. Maya reads receipts. The difference is understanding.

Step 2: Feature extraction — what the AI looks for

Before making any classification decision, Maya extracts a set of features from the document. These are the signals that determine what kind of transaction this is. Think of it as a checklist the AI runs through mentally before deciding:

  • Receipt vs. invoice Does this look like a point-of-sale receipt or a business document?
  • Payment settlement Is there proof the transaction was actually paid — card metadata, "APPROVED," "PAID" stamp, or a zero balance?
  • Negative indicators Are there negative quantities, negative extended prices, or totals ending in "CR"?
  • Refund language Does the document mention "refund," "return," "exchange," or "credit issued"?
  • Business fields Does it have PO numbers, job numbers, account numbers, due dates, terms, or invoice numbers?
  • Retail formatting Is the layout a standard retail or restaurant receipt format?
  • Card metadata Are there card-brand identifiers, approval codes, terminal IDs, or masked card numbers?
  • Credit balance Is the total negative, or does the document state a credit balance with no amount due?

These features aren't guesses. Each one is a specific, checkable signal. The model extracts them, then uses them to evaluate classification rules.

Step 3: The four document types

Every receipt Maya receives gets checked against four possible transaction types. These map directly to QuickBooks transaction types — getting the type right is critical because an expense and a bill hit different accounts, and a credit card credit and a vendor credit are entirely different transactions.

Expense

You paid for something. The receipt shows itemization, a total, and proof the payment was processed.

Signal: card metadata + "APPROVED," or "PAID" stamp, or zero balance

Bill

You received an invoice but haven't paid yet. Business-style document with an amount owed and no payment proof.

Signal: PO number, due date, terms — but no card metadata or "PAID"

Credit Card Credit

A refund or return processed to your credit card. Retail receipt with refund language and a negative total.

Signal: "REFUND," negative total, card refund metadata

Vendor Credit

A formal credit from a vendor for returned materials. Business document with credit memo indicators.

Signal: credit memo, negative total, account/PO references, "CR" notation

Step 4: The classification rules

Here's where it gets specific. Each document type has a set of rules — required conditions that must all be true. Maya evaluates all four rule sets, every time, even after finding a match. This isn't a "first match wins" shortcut. It's thorough evaluation.

Expense rules

A document classifies as an expense only if all of these are true:

  • It's a receipt from a store, merchant, or service provider
  • It shows an itemized list of goods or services with prices and a total
  • It includes explicit payment settlement evidence — card-brand and processing metadata, "APPROVED," cash or check tendered, a zero balance with settlement confirmation, or a "PAID" notation
  • There are no refund indicators — no negative totals, no negative quantities, no "Refund" or "Return" language
  • The word "CREDIT" appears only as a payment type, not as a refund indicator

If there's no settlement evidence, it can't be an expense — even if it looks like a receipt. A handwritten total alone doesn't prove payment. That document becomes a bill.

Bill rules

A document classifies as a bill only if all of these are true:

  • It's an invoice, bill, statement, or acknowledgment
  • It includes business fields — PO number, job number, account number, due date, terms, or invoice number
  • It represents a net amount owed, not yet paid (positive total)
  • It does not show proof of completed payment settlement

The key distinction: if something looks like a receipt but shows no payment settlement evidence, it must be classified as a bill. This is the failsafe. No proof of payment means no expense — it's a bill until proven otherwise.

Credit card credit rules

A document classifies as a credit card credit only if all of these are true:

  • It's a retail-style receipt
  • It has machine-visible negative indicators — at least one line item with a leading minus sign, or an amount marked "CR," or parentheses indicating a negative value
  • The final total is also explicitly negative
  • It clearly indicates a return, refund, or exchange
  • It includes card metadata confirming the refund was processed to a credit card

If "CREDIT" appears only as a payment method, or the total is positive, or card refund metadata is missing — it's not a credit card credit. A positive total with a "Credit" amount equaling the balance due means the credit card was used to pay, not that a refund was issued.

Vendor credit rules

A document classifies as a vendor credit only if all of these are true:

  • It's a vendor-issued credit document — credit memo, credit acknowledgment, or material return credit
  • It represents a return, refund, or material credit against a previous bill or account
  • It includes business fields — account, PO, job numbers, invoice reference, or terms
  • It's net negative — the subtotal or total is negative, or the document states a credit balance with no amount due
  • It has at least one negative quantity or negative extended price contributing to the credit

Any total ending in "CR" counts as negative, even without a minus sign. But if the document has a positive total or an amount due greater than zero, it's not a vendor credit — even if it contains negative line items.

Step 5: The decision — evaluate all four, then pick

Maya doesn't stop at the first match. It evaluates all four rule sets and records the result of each — true or false — before making a decision. This ensures nothing is missed by short-circuiting.

After evaluating all four, it selects the first category whose rules are fully satisfied. But what if multiple categories match? That's where the specificity hierarchy comes in:

  1. Vendor credit The most specific — a formal credit document with business fields and a negative balance
  2. Credit card credit Specific — a retail refund with card metadata and a negative total
  3. Expense A settled receipt with payment proof and no refund indicators
  4. Bill The catch-all — anything with an amount owed and no proof of payment

If a receipt could plausibly be two types, Maya picks the most specific one. This ensures the most precise classification wins, which keeps your books accurate.

Step 6: Confidence scoring

Every classification comes with a confidence score from 0 to 100. This isn't a gut feeling — it's based on four factors:

  • Rule completeness — did all conditions match? All conditions met with no ambiguity means high confidence
  • Absence of contradictory signals — are there features that point in different directions?
  • Clarity of negative values and refund language — are the indicators explicit and machine-readable, or faint and ambiguous?
  • Strength of business vs. receipt fields — does the document clearly look like one type, or is it a hybrid?

High confidence means Maya creates the draft and you review it. Low confidence means Maya escalates — it uploads the receipt image to QuickBooks Attachments and texts you to handle it manually. You always have the final call.

The confidence score isn't a guess. It's a measurement of how completely the evidence matches the rules. When the evidence is clear, Maya acts. When it isn't, Maya asks.

What the output looks like

When Maya finishes classifying a receipt, it produces a structured JSON object. This is what gets mapped to a QuickBooks draft transaction. Here's a simplified example of what the classifier returns for a Home Depot receipt:

{ "type": "expense", "confidence": 95, "reason": "Retail receipt with itemized lines, card metadata (VISA ****1234, APPROVED), positive total, no refund indicators", "debug": { "observed": { "has_card_metadata": true, "has_refund_language": false, "has_negative_line_item": false, "has_negative_total": false, "total_line": "TOTAL $247.83" }, "rules": { "expense": true, "bill": false, "credit_card_credit": false, "vendor_credit": false } } }

The type determines which QuickBooks transaction gets created. The confidence determines whether Maya creates the draft automatically or escalates for manual review. The reason and debug fields are logged so you can always see exactly why Maya made its decision — useful for auditing or resolving disputes.

Why deterministic, not probabilistic

Maya's classifier follows rules. It doesn't use a neural network that guesses and can't explain itself. Every decision is traceable to specific features the model observed and specific rules those features satisfy.

This matters for three reasons:

  • Auditability — if a classification is wrong, you can see exactly which rule fired and why. You can't do that with a black-box model
  • Consistency — the same receipt always classifies the same way. There's no randomness in the decision
  • Trust — when money is involved, you need to know why the AI did what it did. Maya can always tell you

The AI isn't magic. It's rules, evidence, and a failsafe. It reads receipts the way an experienced bookkeeper would.

The failsafe — when it's not sure

Maya isn't trying to be perfect. It's trying to be helpful. When it knows what to do, it does it. When it doesn't, it asks for help.

If the confidence score is too low — missing key features, conflicting indicators, unusual format, illegible text — Maya doesn't guess. It uploads the receipt image to your QuickBooks Attachments and texts you to handle it manually. The receipt is right there in QuickBooks, waiting for you.

And because Maya creates drafts, not final transactions, even when it's confident, you review everything before it hits your books. The AI does the work. You make the call.

How accurate is it

These are real numbers from production processing:

94%
Transaction classification accuracy
96%
Data extraction accuracy
92%
End-to-end — no human correction needed

About 9 out of 10 receipts process perfectly without any correction. The 10th gets flagged for quick review — and the receipt image is already in QuickBooks, so the review takes seconds, not minutes.

What Maya handles well: handwritten amounts on printed receipts, faded receipts with poor contrast, receipts photographed at angles, mixed content, different currencies, multi-item line items, tax calculations. What requires human review: extremely damaged or illegible receipts, non-English receipts, and genuinely ambiguous cases that could be two transaction types.

The bottom line

You don't need to understand the classifier to use Maya. You text a receipt, a draft appears in QuickBooks. That's the whole product.

But if you're the kind of person who needs to know it's legit before you trust it — a skeptical owner, a bookkeeper evaluating tools, a CPA recommending software to clients — now you know. The AI reads receipts the way an experienced bookkeeper would. It follows rules, evaluates evidence, and when it's not sure, it hands it back to you. No black boxes. No guesswork. No lost receipts.

The best way to test it is to try it. Text 10 of your actual receipts. See how it does.

See it work on your receipts

Get a Maya number, connect QuickBooks, and text your own receipts. You'll see the drafts appear in minutes.

Get Your Maya For QuickBooks Number

Have questions? Contact us