Inspiration
Across Kenya and much of Africa, the chama is one of the oldest financial tools there is. A group of friends, neighbours or relatives meets, everyone puts in the same amount, and one person takes the whole pot home. Next time it's someone else's turn. Nobody needs a bank or a credit score. School fees, first businesses and roofs have all been paid for this way.
A chama runs on being in the same room, though. You come to the meeting with cash, the treasurer writes it down in a notebook, and everyone watches the draw.
Families don't stay in one room anymore. A cousin moves to Dubai, a sister goes to study in Germany, a friend finds work in the US. Each of them still wants to be part of the circle, and each of them is the person it usually loses first. They can't make the meeting, sending money home is slow and expensive, and from far away it's hard to trust a notebook you can't see.
We kept asking one question: what if the circle didn't depend on being in the same room? What if a member in Nairobi and a member in Toronto could save together, take turns, and trust the result as fully as if they were sitting at the same table?
Unitus is our answer. We weren't trying to replace the chama. We wanted to give it a way to travel.
What it does
Unitus runs a chama online for people who live far apart.
- Anyone can start a chama and set its rules: how often it runs, the contribution, savings per round, joining fee and loan terms. The rules lock the moment the chama is created.
- Members join with an invite link from any country and pay the joining fee with PayPal. That one approval also saves their PayPal for automatic payments.
- Every round runs itself. One member who hasn't received yet is drawn at random, everyone is charged automatically, and the whole pot lands in the winner's Unitus wallet. From there they can withdraw to PayPal whenever they like.
- Everyone sees the same records. A shared ledger and statement show every payment, so nobody has to take a treasurer's word for anything.
- Reliable savers can borrow from their own chama. Their limit grows each time they repay on time.
- It's free for members. Partner businesses offer deals sized to members' payouts and pay a small referral fee only when they make a sale.
No single person ever holds the group's money. Running a group never gives anyone access to its funds.
How we built it
We started with the experience and worked backwards to the money. Before writing any payment code, we designed what it should feel like to belong to a chama online. That meant a warm landing page, a five-step "start a chama" flow with a live preview, and a dashboard that answers the questions members ask each other at meetings. Whose turn is it? How much have I saved? When is the next deduction?
Then we made it real, one layer at a time:
- Identity. Members sign in with Log in with PayPal (OpenID Connect). Their PayPal account is their Unitus account, so we never store a password.
- Joining. The joining fee goes through PayPal's v6 Web SDK using vault-with-purchase. One approval pays the fee and saves the member's PayPal for future automatic charges.
- Rounds. A scheduler ticks every minute. When a chama is due, it draws a recipient with
crypto.getRandomValues, charges every member through the Orders API, and credits the pot to the winner's wallet. - Money we can account for. Every cent goes through a double-entry ledger in Supabase Postgres. Each transaction's entries must balance to zero, and the database refuses any posting that doesn't.
- Getting money out. Members withdraw to their own PayPal through the Payouts API. Signature-verified webhooks keep every payment's status honest.
- Rewarding reliability. Loans come from the chama's own savings, with limits based on each member's saving record.
The stack is Next.js 16 (App Router), React 19, TypeScript, Supabase, Tailwind v4 with shadcn/ui, and AG Grid and AG Studio for records and analytics.
Challenges we ran into
Being fair to people who join late. In a merry-go-round, a member who joins mid-cycle shouldn't pay into the pots of people who received theirs before they arrived, because those people never paid them. Working out rules where every member's payments and receipts come out even over a cycle took more whiteboard time than any API.
Making sure money moves exactly once. A server can crash halfway through charging eight people. We made every step idempotent: one round row per chama and round number, one PayPal request ID per round and member, and the round ID as the payout batch ID. If a run stops halfway, the next one finishes the job, and nobody is charged twice.
Separating power from money. Our first design said a chama's creator could never be a member of it. Real chamas don't work like that, because the organiser usually saves too. We rewrote the rule partway through. Creators can now join their own chama, but only the scheduler ever moves money.
Fees that shouldn't eat the pot. PayPal takes a fee on every payment, and we didn't want the chama to come up short. Members cover the fee on top of their contribution. We record PayPal's actual fee on every payment, and Unitus covers any gap, including the fee on payouts.
PayPal's real-world edge cases. Business accounts can't use Log in with PayPal. Accounts in some countries can send money but not receive it, so withdrawals to them fail with RECEIVER_COUNTRY_NOT_ALLOWED. PayPal won't accept localhost as a return URL. Vaulting does nothing until Save payment methods is switched on. We ran into each of these one at a time, and each one shaped the product.
Testing time-based money. You can't wait a month to see whether a monthly chama works. We added an "every 30 minutes" schedule and a sandbox command that runs a round immediately. That let us run through months of rounds in an afternoon.
Accomplishments that we're proud of
- It really works. On the PayPal sandbox, a chama runs end to end: members log in with PayPal, join, get charged automatically, a winner is drawn, the pot lands in their wallet, and they withdraw it to PayPal.
- The books always balance. Our double-entry ledger is append-only and refuses unbalanced or duplicate postings. We can compare Unitus's records with PayPal's live balance at any moment.
- Nobody can run off with the money. Admin rights and money are kept apart by design, which removes the oldest risk in a chama: trusting one treasurer.
- Loans that reward discipline. Members who save consistently can borrow from their own group, which turns good habits into opportunity.
- It feels like a chama. It's warm, readable on a phone, available in light and dark themes, and familiar. It doesn't feel like a cold banking app.
What we learned
- Trust is something you build. A random draw is only trusted if everyone can see it was random. Rules only feel fair if nobody can change them quietly. Locking the rules and recording every draw did more for trust than any copy we wrote.
- Money software has to be boring. Double-entry bookkeeping is centuries old, and it was the best decision we made. When every cent has a matching entry, bugs show up instead of hiding.
- Retries need idempotency. Retrying network errors with backoff only became safe once every PayPal call carried its own
PayPal-Request-Id. - The sandbox teaches you the most. Many of the things we now handle carefully were problems we only found by running the flow end to end with real sandbox accounts.
- Culture belongs in the design. Our best features came from asking how a real chama already handles something, then building that, instead of starting from a generic "group savings" template.
What's next for Unitus
- Savings share-out at mid-year and year end, including the interest earned on loans
- Reminders before every deduction, and a way to pay a missed round by hand
- Spending with partner businesses straight from the Unitus wallet
- Warnings for members whose PayPal country can't receive withdrawals, shown before they join
- Daily reconciliation that alerts us if PayPal and our ledger ever disagree
- Going live responsibly with the right payment licences and PayPal's multiparty onboarding, so real families can save together for real
The goal hasn't changed since the first sketch: wherever life takes the members, the chama can still run.