Skip to main content

Overview

Divvy’s core value proposition is bringing expense splitting to the moment of payment. Instead of manually logging expenses after the fact, Divvy integrates with Plaid to detect bank transactions automatically and prompt users to split expenses in real-time.
Implementation Status: The Plaid integration is currently in the planning/development phase. This documentation describes the intended architecture based on the project vision outlined in the README.

Key Features (Planned)

  • Automatic Transaction Detection: Monitor user bank accounts for new transactions
  • Smart Categorization: Use LLM-powered categorization to identify potentially shared expenses
  • Real-time Notifications: Alert users immediately when a splittable expense is detected
  • Receipt Matching: Link detected transactions to scanned receipts for itemized splitting
  • Multi-bank Support: Connect multiple bank accounts through Plaid’s unified API

How It Works

The Plaid integration follows this workflow:
1

Bank Account Linking

Users connect their bank accounts through Plaid Link, a secure OAuth-like flow that never exposes credentials to Divvy.
2

Transaction Monitoring

Divvy receives webhook notifications from Plaid whenever new transactions appear in the user’s account.
3

AI Categorization

Transactions are sent to Vercel Edge Functions with LLM capabilities to determine if they’re likely to be shared expenses.Example categories:
  • Restaurant/dining (high likelihood)
  • Groceries (medium likelihood)
  • Entertainment/events (high likelihood)
  • Gas/transportation (low likelihood)
  • Personal shopping (low likelihood)
4

User Notification

When a potentially shared expense is detected, Divvy sends a push notification with a deep link to quickly create a split.
5

Expense Creation

The user can:
  • Accept the suggested split and choose group members
  • Scan the receipt for itemized splitting
  • Dismiss if it’s not a shared expense

Architecture

Plaid Link is a drop-in module that handles the OAuth flow for bank connection:

Android Implementation (Planned)

Dependencies (To Be Added)

Backend Components

The backend (likely a Vercel serverless function) creates a link_token:

Token Exchange

Webhook Handler

LLM-Powered Categorization

As mentioned in the README, Divvy uses Vercel’s Edge Functions with LLM capabilities to categorize transactions:

Database Schema (Planned)

New tables to support Plaid integration:

plaid_items

detected_transactions

Security: Access tokens must be encrypted at rest. Consider using Supabase Vault or a secrets management service like AWS Secrets Manager.

Environment Variables

Add to your Vercel project or backend .env:

Privacy & Security

Data Minimization

Divvy should only request the minimum data needed:
  • Transactions product only (not Identity, Assets, etc.)
  • Last 30 days of transactions (configurable)
  • No storage of sensitive account numbers
Clearly communicate:
  • What data is being accessed
  • How it will be used
  • How to disconnect banks
  • Data retention policies

Encryption

  • Store Plaid access tokens encrypted
  • Use HTTPS for all API calls
  • Implement row-level security in Supabase

Testing

Plaid Sandbox

Plaid provides a sandbox environment for testing:

Mock Transactions

Create test transactions in sandbox:

Implementation Checklist

1

Set Up Plaid Account

  • Sign up at plaid.com
  • Get API keys (client_id and secret)
  • Enable Transactions product
2

Backend API Development

  • Create link token endpoint
  • Create token exchange endpoint
  • Implement webhook handler
  • Set up LLM categorization
3

Database Schema

  • Create plaid_items table
  • Create detected_transactions table
  • Set up RLS policies
  • Add encryption for access tokens
4

Android Integration

  • Add Plaid SDK dependency
  • Implement PlaidLink activity
  • Handle token exchange callback
  • Add deep link routing
5

Notifications

  • Set up Firebase Cloud Messaging
  • Implement push notification handler
  • Create deep link actions
6

Testing

  • Test in Plaid sandbox
  • Verify webhook delivery
  • Test categorization accuracy
  • User acceptance testing
7

Production Launch

  • Switch to production Plaid environment
  • Complete Plaid compliance questionnaire
  • Implement monitoring and error tracking
  • Deploy with feature flag

Cost Considerations

Plaid pricing is based on:
  • Active Items: Number of connected bank accounts
  • API Calls: Transaction syncs count toward quota
Typical costs:
  • Development (sandbox): Free
  • Production: Pay-as-you-go or monthly plans
See Plaid Pricing for current rates.

Alternatives to Plaid

If Plaid is not suitable:
  • Manual CSV Import: Let users upload bank statements
  • Email Parsing: Parse transaction notification emails
  • Receipt Scanning Only: Focus on OCR without bank integration
  • Teller.io: Open banking API (Europe/UK focused)
  • Finicity: Mastercard’s bank data aggregation