Inspiration

Across emerging markets and social commerce ecosystems, millions of micro-entrepreneurs and boutique brands conduct everyday trade over WhatsApp, Instagram DMs, and SMS. Customers send informal, conversational messages—often mixing Roman Urdu, colloquial shorthand, split quantities, and scattered delivery addresses. Small business owners spend hours manually copying names, calculating order sums, tracking down missing delivery details, and hand-writing paper receipts. We built Chat2Invoice to eliminate this friction entirely: transforming unstructured conversational messages into structured commerce data and print-ready dispatch invoices in seconds.

What it does

Chat2Invoice serves as an intelligent order-to-invoice pipeline:

  • Multilingual Shorthand Extraction: Parses colloquial, informal customer chats (including Roman Urdu and unstructured conversational fragments) with high precision.
  • Strict Data Validation: Extracts customer names, contact phone numbers, street addresses, items with unit prices/quantities, and payment methods into a strictly typed schema.
  • Automated Arithmetic Engine: Computes sub-totals, items breakdown, and final totals automatically.
  • Print-Ready PDF Dispatch Generation: Dynamically generates a clean, standardized, vector-based PDF invoice and shipping dispatch label using ReportLab with a single click.

How we built it

  • Gemini API & Google GenAI SDK: Serves as the core extraction intelligence, utilizing few-shot domain prompting and structured schema enforcement (response_mime_type="application/json" with Pydantic).
  • Python & Streamlit: Powers the responsive, rapid-turnaround web interface accessible across desktop and mobile browsers.
  • ReportLab: Dynamically renders professional PDF documents in-memory with custom palettes, formatted tables, and automated invoice numbering.
  • Streamlit Community Cloud & GitHub: Cloud-hosted CI/CD deployment enabling frictionless access on any device without local installation overhead.

Challenges we ran into

  • Unstructured Multilingual Phrasing: Handling localized shorthand (e.g., "AOA, mujhe 4 packet chahiye, COD pe") required careful system prompt calibration and zero-shot reasoning bounds to avoid hallucinated fields.
  • Strict JSON Enforcement: Ensuring the LLM consistently returns machine-readable JSON matching the backend Pydantic model without conversational prefixes or markdown backticks.
  • Cloud Dependency & PDF Buffering: Generating dynamic binary PDF streams in-memory rather than relying on persistent local disk storage to ensure seamless execution on cloud instances and mobile devices.

Accomplishments that we're proud of

  • Delivering a zero-latency workflow that turns 30 seconds of tedious manual data entry into an instantaneous, one-click PDF generation process.
  • Designing an application with zero onboarding complexity: no technical setup, database configuration, or manual typing required for small business merchants.
  • Building a mobile-friendly deployment directly usable by store managers on the shop floor or delivery riders.

What we learned

  • How to implement robust structured extraction pipelines with Google's latest Gemini models.
  • Techniques for handling edge cases in conversational e-commerce, such as implicit delivery addresses and mixed payment terminology.
  • Designing lightweight, stateless micro-apps optimized for deployment on Streamlit Cloud.

What's next for Chat2Invoice

  • Direct WhatsApp Business API Integration: Webhook listeners that automatically detect incoming order messages and instantly reply back with the generated PDF receipt.
  • Inventory & Sheet Sync: Direct two-way sync with Google Sheets, Shopify, and local courier portals (e.g., Trax, Leopards, TCS) for automatic tracking label generation.
  • Voice-Note Transcription: Allowing store owners to forward audio voice notes directly into the engine for hands-free order creation.

Built With

Share this project:

Updates

Submission history