Process Receipt Images with GPT-4o-mini, WhatsApp & Google Sheets Automation
π§ΎAn intelligent automation system that turns WhatsApp into your personal receipt manager β integrating Meta WhatsApp Cloud API, Google Drive, Google Sheets, and OpenAI GPT-4o-mini via n8n.
π₯ Demo: Watch the Loom walkthrough
βοΈ What It Does
The AI-Powered WhatsApp Receipt Bot automates the complete invoice handling process through a conversational interface.
Workflow Summary:
User sends a receipt image via WhatsApp. The bot automatically downloads the media using the WhatsApp Cloud API. The image is uploaded to a Google Drive βInvoicesβ folder. The file is shared publicly, generating a shareable URL. The receipt is analyzed using OpenAI GPT-4o-mini to extract structured data:
Store name Items purchased Payment method Total amount The extracted details are appended to a Google Sheet for record-keeping. The bot sends a human-readable summary back to WhatsApp with emojis and the invoice link.
Output Example:
π¬ Store: Big Bazaar
π Items: Rice, Detergent, Snacks
π³ Payment: Card
π° Total: βΉ1520.75
π Link: https://drive.google.com/file/d/1abcXYZ/view
This system eliminates manual expense tracking, improves accuracy through OCR, and provides a seamless way to manage receipts in real time.
π‘ Use Cases
| Scenario | Description | | ------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | | Personal Expense Management | Automatically store and categorize receipts from daily purchases. | | Business Accounting | Collect employee expense receipts through WhatsApp and centralize them in Google Sheets. | | Freelancer or Consultant Tracking | Keep a digital record of client reimbursements or software purchase receipts. | | Family Budgeting | Family members send receipts to one shared WhatsApp number, all data gets logged centrally. | | E-commerce / Delivery Teams | Drivers or delivery agents send invoices from the field to WhatsApp; data automatically goes to the accounting sheet. |
π§ Setup
- Accounts and Tools Needed
| Tool | Purpose | Link | | -------------------------- | ------------------------------------------- | -------------------------------------------------------------------------------------------- | | Meta Developer Account | To access WhatsApp Business Cloud API | https://developers.facebook.com/apps | | Google Cloud Account | For enabling Drive and Sheets APIs | https://console.cloud.google.com | | n8n Instance | Workflow automation engine (local or cloud) | https://app.n8n.cloud | | OpenAI API Key | For GPT-4o-mini model OCR + reasoning | https://platform.openai.com/account/api-keys |
- Meta Developer Setup (WhatsApp Cloud API)
Go to Meta Developer Dashboard β My Apps β Create App β Business type. Add WhatsApp product under your app. Retrieve the following from WhatsApp > Configuration:
Permanent Access Token Phone Number ID WhatsApp Business Account ID Add these credentials in n8n β Credentials β WhatsApp API.
Use the same credentials for WhatsApp Trigger and Send Message nodes. Verify webhook in Meta with your n8n webhook URL.
Important: In your HTTP Node, set the header as:
Authorization: Bearer <access_token>
Replace <access_token> with your WhatsApp Cloud API permanent token. Without this, the workflow will fail to send or receive WhatsApp messages properly.
- Google Drive Setup
Create a folder named Invoices on your Google Drive. Copy the Folder ID (found in the Drive URL). In Google Cloud Console β APIs & Services β Enable APIs:
Enable Google Drive API Enable Google Sheets API Go to Credentials β Create Credentials β OAuth 2.0 Client ID. Download the credentials.json file. Upload this to n8n β Credentials β Google Drive OAuth2 API. Authorize the connection on first workflow run.
- Google Sheets Setup
Create a new Google Sheet titled Invoices. Add the following headers in Row 1:
store name | discription | image_url | payment | total
Copy the Sheet ID (from the URL). Add the ID under the Google Sheets Append node in n8n. Map each field to its corresponding value extracted from the OCR result.
- OpenAI Setup
Generate an API key from https://platform.openai.com/account/api-keys. Add it to n8n β Credentials β OpenAI API. Use model gpt-4o-mini in the βAnalyze Imageβ node.
Can upgrade to gpt-4o for better OCR accuracy if account supports it.
- n8n Workflow Setup
Import the provided n8n workflow JSON. Configure credentials for:
WhatsApp API Google Drive OAuth2 Google Sheets OAuth2 OpenAI API Activate workflow and set webhook in Meta Developer console. Send a test receipt image to your WhatsApp Business number.
The bot will automatically: Download β Upload β Extract β Log β Summarize β Reply
π Example Google Sheet Record
| store name | discription | image_url | payment | total | | ---------- | ----------------------- | -------------------------------------------------------------------------------------------- | ------- | ------- | | Big Bazaar | Rice, Detergent, Snacks | https://drive.google.com/file/d/1abcXYZ/view | Card | 1520.75 |
π§ Result
A fully automated AI pipeline that transforms WhatsApp into a smart expense-tracking interface β integrating vision, automation, and natural language processing for zero-manual financial documentation.
Support & Contact: If you face any issues during setup or execution, contact: π§ Email: atharvapj5@gmail.com π LinkedIn: Atharva Jaiswal
Related Templates
Instagram Full Profile Scraper with Apify and Google Sheets
πΈ Instagram Full Profile Scraper with Apify and Google Sheets This n8n workflow automates the process of scraping ful...
Technology News Workflow Explanation with Key Services
This workflow contains community nodes that are only compatible with the self-hosted version of n8n. Auto-Publish Techn...
Auto-classify Gmail emails with AI and apply labels for inbox organization
Who is this for? Professionals and individuals who receive high volumes of emails, those who want to automatically organ...
π Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments