The receipt upload feature is table stakes for any expense tracking app. Users photograph or upload a receipt; the app reads it and creates an expense entry automatically — no typing required. Here's how to build that feature from scratch using DocuParse API.
What We're Building
A backend route that:
- Accepts a receipt file uploaded by a user
- Sends it to DocuParse API
- Creates an expense record from the extracted data
- Returns the expense to the client
The same pattern works whether you're building a mobile app backend, a web app, or an internal tool.
Architecture Overview
The important thing: your API key never reaches the client. It stays on your server.
Frontend: Receipt Upload Component (React)
Preventing Duplicate Expenses
A user might accidentally upload the same receipt twice. Each upload gets its own document_id, so compare the extracted fields — merchant, date, total and receipt ID — to catch likely duplicates:
What to Show the User During Extraction
Extraction runs in the background. Use that time well:
- Immediately on upload: Show a progress indicator. "Reading your receipt..."
- On success: Pre-fill all form fields with extracted data. Let the user correct anything before saving.
- On failure: Give a specific, actionable error. "This image is too blurry — try taking the photo in better lighting, or upload a PDF." Not "something went wrong."
Pre-filling the form rather than silently saving is good UX — it builds trust by showing the user what was extracted and letting them verify it.
Pricing
The receipt upload feature runs on the Starter plan (see current pricing), billed per document with up to 10 pages per document; 11–20 count as two. For most expense tracking apps, that's months of receipts covered at a price that rounds to noise.