Skip to content
← All projects

Case study/SaaS platform/2026

SeloraX Messages

A multi-tenant SMS gateway for Bangladesh where every message is paid for exactly once.

01The problem

Businesses in Bangladesh needed one place to send SMS through their own accounts: separate teams, separate API keys, separate balances, all on a shared platform.

Because every message costs money, the hard part wasn't sending. It was making sure credit is never lost, never double-charged, and always explainable when a customer asks where it went.

02How it fits together

Customer appsAPI keys per orgPublic REST APIv1 · rate limitedCredit ledgerappend-only · MariaDBDispatcherdebit, then sendDashboardNext.js · Better AuthAdmin panelevery action auditedDelivery reportspolledSMS operatorcarrier networkEPS gatewaypaymentsTop-up checkserver-to-serverLink trackingper recipientidempotentorg-scopeddebitsendstatusrefund rejectsverifycredit

Money only moves through the ledger: top-ups credit it, sends debit it first, rejected sends refund it.

03Decisions

  1. 01

    An append-only ledger, not a balance column

    Every top-up, debit, and refund is its own row; the balance is the sum. Nothing is ever overwritten, so two requests can't silently clobber each other, and any balance can be explained line by line.

  2. 02

    Debit before dispatch, refund on rejection

    Credit is taken atomically before a message leaves, so nothing is sent unpaid even if two sends race. When the operator rejects a message, the refund is another ledger row, so the customer is made whole and the history stays honest.

  3. 03

    Verify top-ups server-to-server

    A top-up only counts after the EPS payment gateway confirms it directly to the server, never on the strength of a browser redirect that a user could fake or replay.

  4. 04

    Idempotent retries in a versioned API

    Clients can safely retry a request after a timeout without sending (or paying for) the message twice. Versioning (/v1) lets the API evolve without breaking integrations already in production.

04Trade-offs

05Results

↑ ↓ to move↵ to goT toggles the themeX x-ray? all shortcutsdrag on blank paper to doodle/ opens this anywhere

Keyboard shortcuts

Ctrl/⌘K
command palette
/
command palette, too
T
paper ⇄ chalkboard
X
x-ray: see the components behind the page
?
this sheet
drag
doodle on blank paper
Ctrl/⌘Z
undo the last doodle
Esc
close any dialog
↑↑↓↓←→←→BA
…you know what this does

psst: open the browser console too.