Skip to content
rav4nnPublic

About

A WhatsApp bot for splitting expenses, built with Python + Flask + WhatsApp Business Cloud API.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SplitWala 🤖

A WhatsApp bot for splitting expenses, built with Python + Flask + WhatsApp Business Cloud API.

What it does

Send commands to the bot in WhatsApp to track shared expenses:

Command Description
/split <amount> Splits amount equally among all registered members
/balances Shows what you owe and what others owe you
/settle Marks all your debts as cleared

Any member who messages the bot is automatically registered in the shared pool.

Tech Stack

  • Python + Flask (webhook server)
  • WhatsApp Business Cloud API (Meta)
  • ngrok (local tunnel for development)
  • In-memory data store (no database, MVP)

Setup

1. Clone and install

git clone https://github.com/YOUR_USERNAME/splitwala.git
cd splitwala
python -m venv venv
venv\Scripts\activate       # Windows
pip install -r requirements.txt

2. Configure environment

Create a .env file (never commit this):

PHONE_NUMBER_ID=your_phone_number_id
WABA_ID=your_waba_id
ACCESS_TOKEN=your_whatsapp_access_token
WEBHOOK_VERIFY_TOKEN=your_chosen_verify_token

Get your credentials from Meta for Developers.

3. Run the server

python app.py

4. Expose with ngrok

ngrok http 5000

5. Connect webhook on Meta dashboard

  • Go to your Meta app → WhatsApp → Configuration
  • Set Callback URL to: https://your-ngrok-url.ngrok-free.app/webhook
  • Set Verify Token to match your WEBHOOK_VERIFY_TOKEN
  • Subscribe to the messages field

Usage

  1. Each person messages the bot directly (this registers them)
  2. Anyone can run /split 500 — splits equally among all registered members
  3. Run /balances to see the current state
  4. After paying in real life, run /settle to clear your debts

Notes

  • Data is in-memory: balances reset if the server restarts
  • Works in development mode with up to 5 test numbers (no business verification needed)
  • ngrok URL changes on every restart (free plan)

About

A WhatsApp bot for splitting expenses, built with Python + Flask + WhatsApp Business Cloud API.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages