15 flows
A payments API built like Lego
Small, reusable blocks that compose into full flows. New business use cases get assembled from what exists instead of built from scratch.
- Organisation
- TransFi
- When
- 2024 - now
- Areas
- API design, Payments, Platform architecture
Problem
TransFi's volume grew from $20M to $150M+ a month across 40+ countries and 250+ payment methods. Every new business use case needs some mix of the same steps: identity checks, a quote, collecting funds, holding them, converting through stablecoins and paying out.
Before the composable API, we had several APIs, each built for whichever customer came in next. The same field had different parameter names in different APIs, so integrations were hard to understand, and every new use case meant yet another API.
To break that loop, I started by segregating the APIs logically: by configuration, end users, payment flows and compliance checks. Those groups became the building blocks.
Constraints
-
Local rails and stablecoin infrastructure behave very differently, but clients need one consistent API.
-
Partners go down, slow down or run out of balance, so routing can't be hard-coded.
-
Every partner company brings its own compliance rules and regulations, and the blocks have to respect all of them.
-
Existing customers were live, so moving them to the new API had to be a phased migration, customer by customer.
-
All of this happened while I was also running the team and customer support.
What I built
A payments API built from small, reusable building blocks. Each block does one job. Blocks compose into end-to-end flows, and new business use cases are assembled from blocks that already exist instead of being built from scratch.
- end-to-end flows
- 15
- business use cases
- 10+
- verticals: FX, Ramp, Gaming
- 3
- One API for payins and payouts, with standardized error codes, over both local rails and stablecoin infrastructure.
- Dynamic routing across partners, based on speed, downtime and balance availability.
Each block does one job and behaves independently, so each one is tested on its own before it's composed into a flow.
One recent example is lending, a high-risk business. A client merchant lends USDT to its users, but those users need fiat currency. Instead of building a new API, the flow reuses the existing crypto payin and fiat payout blocks, with high-risk compliance checks on top.
Outcome
-
15 end-to-end flows built from the shared blocks.
-
10+ business use cases supported.
-
3 verticals: FX, Ramp and Gaming.
-
A new use case now launches in about a week, by arranging existing blocks.
What I'd do differently
I'd set naming conventions and a versioning policy for the blocks before building the first one. Inconsistent parameter names were the original problem, and agreeing on the rules up front would have kept them from creeping back as more blocks were added.