Skip to content

Extract and organize receipts

Read the merchant, date, total and currency from receipt photos into fields, sort them into expense categories, and file them by year and month.

Receipts pile up as photos with names like IMG_4471.jpg, and when you need one for a refund, a warranty claim or your taxes, you have to open them one by one. This guide builds a library workflow for a Receipts folder: upload a photo there, and an AI model reads the merchant, date, total and currency into fields, picks an expense category, renames the file after what it is, and files it under the year and month of the purchase. Receipts it can't read properly go to a Needs review folder. The photo itself is never changed, so you can always check a value against it.

  1. File uploaded (trigger)Folder Receipts
  2. Load content
  3. Read the receiptAI extract · Merchant, Purchase date, Total, Currency
    • Next
      1. Expense categoryAI classify
      2. Name partsSet values
      3. Set field × 5Merchant, Purchase date, Total, Currency, Expense category
      4. Keep the detailsAdd attachment
      5. Has a date?
        • True
          1. RenameDate, merchant, amount
          2. File by monthReceipts/‹yyyy›/‹MM›
        • False
          1. Needs reviewReceipts/Needs review
    • Error
      1. Needs reviewThe same step as on False

The two Needs review boxes are one step with two connections into it: the run reaches it when the receipt has no date, or when a required value couldn't be read.

What you'll build

BeforeAfter
Namereceipt-corner-bakery.jpg2026-11-14 Corner Bakery 15.98 USD.jpg
FolderReceiptsReceipts/2026/11
FieldsNoneMerchant Corner Bakery, Purchase date 2026-11-14, Total 15.98, Currency USD, Expense category Dining
AttachmentsNoneReceipt details, a short Markdown summary that search can find

The steps, names, folders and fields are verified from runs of this workflow. The values the AI read are illustrative: they're what the sample receipt shows, and a good model reads them the same way, but check your own results.

Before you start

DifficultyIntermediate
TimeAbout 30 minutes
Workflow kindLibrary workflow
ConnectionsAn AI connection whose model takes images
ModelsAn image model that reads text well, such as qwen2.5vl or gemma3:12b on Ollama, or a hosted model such as gpt-4.1-mini. An extraction model, on Cloudflare Workers AI or OpenRouter, gives a confidence for each value.
FoldersReceipts. Create it in Files. Needs review and the year and month folders are created as needed.
FieldsCreated in the first step below
TagsNone
Sample filereceipt-corner-bakery.jpg: a made-up bakery receipt
The built-in Extract receipt detailstemplate is a smaller version: it asks AI detect whether each new image is a receipt, sets Merchant, Receipt date and Total, and moves receipts into Receipts. It doesn't rename, sort by month, or send unreadable receipts to Needs review. Start from it if you upload receipts mixed with other images, and add the steps below that you want.

Build the workflow

Create the fields

In Settings › Fields, click New field for each of these. See Creating a field.

NameTypeChoices
MerchantText
Purchase dateDate
TotalNumber
CurrencyText
Expense categoryChoiceGroceries, Dining, Travel, Office, Household, Other

Create the workflow

Open Automations › Workflows, click New workflow, name it Read receipts, keep Library workflow, and choose File uploaded. Set its Folder to Receipts and File types to image/png, image/jpeg and image/webp.

Only uploads into Receipts itself start a run, so moving a receipt into a month folder later doesn't start it again.

Load the photo

Add Load content after the trigger.

Read the receipt

Add AI extract, rename it Read the receipt, and click Configure step.

  • Connection: your AI connection.
  • Method: Extraction model if the editor doesn't flag the connection; otherwise Language model, which works with every connection, including Ollama.
  • Add image input, then Image: Load content › Content.

Click Use existing fields. It adds a value for each of your fields with a matching type. Remove Expense category, which the next step decides, and any other fields you don't want filled. Then fill in the descriptions and Required:

ValueTypeRequiredDescription
MerchantTextYesThe shop, restaurant or company the purchase was made from, as printed at the top of the receipt.
Purchase dateDateNoThe date of the purchase. Ignore due dates and return-by dates.
TotalNumberYesThe final amount paid, including tax and tip, without the currency symbol.
CurrencyTextNoThe three-letter ISO 4217 code of the total, such as USD, EUR or GBP. Only when the receipt shows it or its symbol makes it unambiguous.

On the Advanced tab, add Additional instructions: Read printed text only. If several totals appear, use the one labelled Total or Amount paid. Then set If this step fails to Take the error path. The step gets an Error output, which you'll connect later.

A value the model can't find stays empty and is listed in the step's Missing values; Avenvail never guesses one. A Required value that's missing fails the step with ai_required_missing, and the run takes the error path.

Pick an expense category

Add AI classify after Read the receipt, rename it Expense category, and click Configure step.

  • Connection, Method and Image as for AI classify in the screenshot guide.
  • Add text input, then a template: Merchant: {{ steps.extract.merchant }}.
  • Allow no match when none of the categories fit: on.
CategoryWhat belongs in this category?
GroceriesSupermarkets and food shops for home.
DiningRestaurants, cafes, bakeries, bars and takeaway.
TravelTransport, fuel, parking, hotels and tickets.
OfficeOffice supplies, software, electronics and work equipment.
HouseholdHome goods, hardware, utilities and repairs.

Leave out Other: receipts that fit nothing get it below. Set If this step fails to Continue, so a failed category doesn't lose the values already read.

Prepare the name

Add Set values, rename it Name parts, and add two values, each as a template:

NameValue
merchant{{ steps.extract.merchant | replace: '/', '-' | truncate: 60 }}
amount{{ steps.extract.total }} {{ steps.extract.currency | default: '' }}

File names can't contain /: Avenvail keeps only what comes after the last one, so Harbor Hardware / Garden would become Garden. replace turns it into a dash instead, and truncate stops a long merchant name from crowding out the rest.

Store the values in fields

Add five Set field steps one after another. Pick the Field, then set Value:

FieldValue
MerchantFrom a step: Read the receipt › Merchant
Purchase dateFrom a step: Read the receipt › Purchase date
TotalFrom a step: Read the receipt › Total
CurrencyFrom a step: Read the receipt › Currency
Expense categoryTemplate: {{ steps.classify.label | default: 'Other' }}

A value that wasn't found leaves the field as it was. The category's name matches the field's choices, ignoring case; Other covers receipts nothing fits.

Keep a readable summary

Add Add attachment, rename it Keep the details:

  • Name: Receipt details
  • Kind: Markdown
  • Text: a template:
    ## Receipt details
    
    - **Merchant:** {{ steps.extract.merchant }}
    - **Date:** {{ steps.extract.purchaseDate | default: 'not found' }}
    - **Total:** {{ steps.extract.total }} {{ steps.extract.currency | optional }}
    - **Category:** {{ steps.classify.label | default: 'Other' }}
    
    Read by the *Read receipts* workflow. Check the original image before relying on these values.
    

Markdown attachments are searchable, so searching Files for bakery finds this receipt even after you rename it.

File it by date

Add a Condition, rename it Has a date?, with one rule: Read the receipt › Purchase date isn't null.

From True, add:

  1. Rename, with New name {{ steps.extract.purchaseDate }} {{ steps.set-values.merchant }} {{ steps.set-values.amount }}. Keep Keep the extension on.
  2. Move to folder, renamed File by month: Folder Receipts, Subfolders {{ steps.extract.purchaseDate | date: 'yyyy/MM' }}.

From False, add Move to folder, renamed Needs review: Folder Receipts, Subfolders Needs review.

The date is checked first because date can't format a missing value, and filing an undated receipt under today's month would hide it.

Send failures to review

Drag from Read the receipt's Error output to the Needs review step. It now has two connections into it, and runs when either is taken.

Test it

  1. Upload the sample receipt into Receipts with the workflow inactive.
  2. Click Test, choose it, turn on Allow sending content to outside services, and click Start test.
  3. Select Read the receipt. Its outputs show each value, and Missing values lists any it couldn't find. With an extraction model, Confidence shows how sure it was of each one.
  4. Select the Set field steps, Keep the details, Rename and File by month to see what they would write. Nothing is written to the real file during a test.

Try a photo of a real receipt too, and a picture that isn't a receipt at all: it should end at Needs review.

Turn it on

Click Publish, then turn on Active. Upload receipts into Receipts from the browser, from your phone's browser, or with a ShareX token whose uploads you file there.

What to expect

Verified runs, with the values the stand-in model returned:

CasePathResult
Every value foundNext → Has a date? TrueFields set, renamed 2026-11-14 Corner Bakery 15.98 USD.jpg, moved to Receipts/2026/11
No date or currency on the receiptNext → Has a date? FalseMerchant, Total and Expense category set; Purchase date and Currency left as they were; name unchanged; moved to Receipts/Needs review
Total not readableError: ai_required_missingNothing set; moved to Receipts/Needs review; run Completed with errors

A merchant read as Harbor Hardware / Garden became Harbor Hardware - Garden in the name.

A filed receipt with its fields set

Troubleshooting

ProblemCause and fix
Most receipts end in Needs reviewThe model can't read the photo. Use a model that reads text better, photograph receipts flat and well lit, and check the run's Missing values.
ai_model_missing_featureThe model doesn't take images. Choose a vision model.
Expense category is always OtherAI classify found no category or failed. Open the run: a failure shows its error, and No category fits means the descriptions need work.
Currency is a symbol, such as $The model didn't follow the description. Add Answer with a three-letter code to it, or make Additional instructions say so.
A field you corrected is overwritten on the next runOnly if Fields a person set in the workflow's Settings is Replace them. By default workflows keep values a person set.
input_missing on Rename or Keep the detailsA template uses a value that wasn't found, without default or optional. Add one, or make the value Required.
A receipt was filed in the wrong monthThe model read another date, such as a return-by date. Sharpen the Purchase date description, then move the file and correct the field in its details.
Receipts weren't processed at allThey were uploaded into a subfolder, or into another folder. The trigger only watches Receipts itself.

Make it your own

More details

Add values to Read the receipt, such as Tax (Number), Payment method (Text) or Items (List of text), create matching fields, and add a Set field for each.

Find receipts by field

Each receipt's details show its fields, marked as set by the workflow, and you can correct them there. Scripts can list receipts by field through the API, such as every Dining receipt; see Filtering by a field.

Notify on large purchases

Add a Condition after the Set field steps with Read the receipt › Total is greater than 200, and a Send notification on True. See Send rich Discord notifications.

Catch receipts anywhere

Instead of a Receipts folder, start with an AI detect step asking Is this a receipt, invoice or order confirmation? on every image, and continue on Yes. See AI detect. Every image is then sent to the model.

Read receipts with OCR first

With Avenvail OCR running, a text-only model can read receipts, and the photo never goes to the AI service: only its text does.

  1. Between Load content and Read the receipt, add Extract text with Preset set to Document, which keeps each amount on the line with its label.
  2. In Read the receipt, remove the image input, click Add text input, and set Text to Extract text › Text. Do the same in Expense category.
  3. Give the values clear Descriptions, such as The final total, on the line that says TOTAL, because OCR text loses the receipt's columns.

On the sample, Document read every line with its amount, such as TOTAL USD 15.98 (verified). Automatic dropped the right-hand column of amounts, so don't use it for receipts. Photos taken at an angle or in poor light read less reliably than scans; check Confidence on Extract text in a test run. Connect Extract text's No text found path to Needs review as well.

Privacy, cost and reliability

  • Receipts show what you bought, where and when, and sometimes part of a card number. Each photo is sent twice, to AI extract and AI classify, at the address of your AI connection. Use a local model to keep them on your network.
  • With a hosted service, each receipt costs two requests with an image. Set Tokens a day on the connection to cap spending.
  • AI reads numbers wrongly sometimes. The original photo is never changed, the summary says the values were read by a workflow, and each field shows that a workflow set it, so check before you rely on a value for anything that matters.
  • An intake workflow that also handles these uploads changes the photo before it's saved. Resizing to 2560 pixels keeps receipts readable; heavy compression may not.