Inspiration

My family is from Jaipur. I've watched textile and handicraft exporters here run their entire business off WhatsApp — orders from London, Dubai, New York, Tel Aviv all arrive as informal voice notes and casual messages, often in mixed Hindi and English. Then exporters spend hours every night translating, calculating GST, formatting invoices, and chasing payments through unreliable wire transfers.

Big SaaS tools assume English-only formal procurement. They don't fit how Indian SMBs actually work. I wanted to build the opposite: a tool that meets exporters where they are — in chaotic WhatsApp threads — and quietly turns those conversations into structured, compliant, payable orders.

The user I designed for has a name: Sunita Sharma, who runs a 12-person block-print export shop in Sanganer, Jaipur. Pacta is built for her.

What it does

Pacta is an AI-native order management tool for Indian SMB exporters.

Sunita gets a Hinglish WhatsApp message from Aisha in Dubai asking for 100 cushion covers before Diwali. She pastes it into Pacta. In about 3 seconds, Claude Haiku 4.5 extracts:

  • Buyer name, country, city, contact details
  • Items with realistic line-item descriptions
  • Indian HSN codes (the 4-8 digit customs classifications India requires for every exported item)
  • Quantities and Jaipur-wholesale-realistic price estimates
  • Delivery deadline (preserving casual phrasing like "before Diwali")
  • Buyer's preferred currency, auto-inferred from country (AED for Dubai, GBP for London, USD for New York)
  • Specific clarification questions Sunita should ask the buyer

Sunita reviews the parsed form, edits anything she wants, confirms pricing, and clicks Generate Quote. Pacta calculates GST, converts to the buyer's currency, and creates a Stripe payment link in one click. The buyer receives a clean mobile payment page — no login required — in their own currency. When they pay, Pacta auto-generates a GST-compliant tax invoice with proper HSN codes, GSTIN, and a unique invoice number in the format PCT-202605-0001.

What used to be a 2-hour nightly chore becomes a 60-second flow.

How we built it

Pacta is built end-to-end on MeDo, with no traditional development environment. Every page, database table, and business logic flow was generated through structured natural-language prompts to MeDo's AI scaffolding system, then iteratively refined across 5 major prompts.

Architecture:

  • Frontend: React + TypeScript, scaffolded via MeDo, mobile-first design with bottom navigation for phone-first exporters
  • Backend: Supabase auto-provisioned by MeDo — Postgres with proper foreign keys, order_status enum, UUID primary keys
  • AI parsing: Claude Haiku 4.5 via a custom MeDo plugin, routed through Supabase Edge Functions so the Anthropic API key never touches the client
  • Payments: Stripe via MeDo's native plugin — payment links with 8-character tokens, buyer-facing payment pages at /pay/{token}
  • Invoice generation: Print-to-PDF via window.print() with @media print CSS — no external PDF library needed

Why Claude Haiku 4.5 specifically: at $1 per million input tokens, each parse costs about ₹0.30. That makes Pacta economically viable for Indian SMBs. It also runs 2x faster than Sonnet — a 3-second parse feels magical, a 6-second parse feels slow.

Prompt engineering for structured output: The parsing pipeline uses three reinforcing techniques: (1) a strict system prompt with Indian-context hints — HSN code defaults for textiles, Jaipur wholesale price ranges, currency mappings by country; (2) Claude's assistant prefill trick where the response is constrained to start with {; (3) a markdown-fence stripper as a final safety net. Together these eliminate the "Claude wrapped JSON in code fences" failure mode.

Challenges we ran into

Forcing structured JSON output was the biggest unexpected challenge. Claude would occasionally wrap responses in markdown fences or add polite preambles like "Here's your parsed order:". The fix required combining three techniques simultaneously — any one alone wasn't reliable enough. This is a genuine production LLM problem and the solution is directly reusable by any builder doing structured extraction.

Customer matching across message types was the second hard problem. Pacta needs to recognize when an incoming message is from an existing customer and link the order to that record. The Supabase .or() query for matching on email-OR-whatsapp had to be conditional — buyers don't always share both identifiers, and Claude doesn't always extract both from a message. A malformed query was silently returning zero matches until we traced it through Edge Function logs.

Multi-currency quote accuracy required careful UX design. GBP, AED, and USD buyers each see prices in their own currency with correct symbols and formatting, while the exporter always works in INR. Getting the display layer right without confusing either party took several iterations.

Accomplishments that we're proud of

  • A Hinglish WhatsApp message becomes a structured order with correct HSN codes, AED currency, and buyer-specific clarification questions in under 3 seconds. The multilingual handling is what separates Pacta from generic AI-CRMs that assume English-only input.
  • The full flow — paste message → parse → quote → Stripe payment link → buyer pays → GST invoice downloaded — works end to end, in production, with real Stripe test transactions.
  • Real Indian-context throughout: GSTIN format, HSN code defaults for textiles, Indian number formatting (₹1,23,456 not $123,456), PCT-YYYYMM-NNNN invoice numbering that matches Indian accounting conventions.
  • Built entirely on MeDo with zero traditional dev environment — every feature shipped through structured natural-language prompts.

What we learned

Prompt engineering for production AI is its own discipline, distinct from chat-style prompting. Production prompts need defensive structure — force JSON, validate schema, handle partial extraction — not open-ended creativity.

Specificity beats scope. The entire product is designed for one person: Sunita Sharma, Sanganer Block Prints, Jaipur. That constraint forced every decision — the Hinglish parsing, the HSN code defaults, the INR-first pricing, the WhatsApp-native UX. Generic tools lose to specific tools when the specific tool is built for a real user with a real pain.

MeDo's constraint is a feature. Building through natural language prompts forces you to specify exactly what you want — schema, design tokens, error handling, mobile breakpoints — in one prompt. That discipline produces better software than iterating vaguely in a traditional IDE.

What's next for Pacta

  • WhatsApp Business API integration so messages flow in automatically without copy-paste
  • Multi-exporter accounts with team permissions
  • Automatic live exchange rate fetching (RBI API)
  • Hindi UI option for the exporter dashboard
  • An auto-respond mode where Pacta drafts the buyer reply in the buyer's language and Sunita approves with one tap
  • A Sanganer block-print cooperative version — 200+ exporters in Jaipur have this exact same pain

Built With

Share this project:

Updates