Mint a tokenized US equity from a Python FastAPI backend.
Heads up. The Flo sandbox API is in private beta for design partners. With no
FLO_SANDBOX_KEYset, this service runs in mock mode and returns canned responses. To call the live sandbox, apply for design-partner access.
A small FastAPI service that exposes POST /tokenize and GET /positions/{wallet}. Both call the Flo sandbox under the hood (POST /v1/mint, GET /v1/positions). Useful as a starting point for any Python backend that wants to ship US equity exposure to its users without the broker-dealer integration.
POST /tokenize takes { asset, quantity, wallet } and returns the minted token, its contract address, and the settlement tx hash. GET /positions/{wallet} returns every Flo-issued position for that wallet.
Behind the scenes Flo handles the broker-dealer leg, custody under SEC Rule 15c3-3, and the on-chain mint. From this service's perspective, it's two HTTP calls.
git clone https://github.com/flo-finance/flo-quickstart-fastapi
cd flo-quickstart-fastapi
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
uvicorn main:app --reloadThe service starts in mock mode. To call the live sandbox:
cp .env.example .env
# paste your sandbox key from https://flo.finance/dashboard/developers/keysdocker build -t flo-quickstart-fastapi .
docker run --rm -p 8000:8000 -e FLO_MOCK=1 flo-quickstart-fastapi
# or pass a real key
docker run --rm -p 8000:8000 -e FLO_SANDBOX_KEY=sk_test_... flo-quickstart-fastapipip install pytest
pytest -qThen in another terminal:
curl -X POST http://localhost:8000/tokenize \
-H "Content-Type: application/json" \
-d '{"asset":"AAPL","quantity":10,"wallet":"0x4a8B70fa12cC3d9d3c9b22Ac019bE40a7d11c5bE"}'You get back a mint ID, a token contract address on Base, and a settlement tx hash.
Swap FLO_SANDBOX_KEY for FLO_LIVE_KEY in .env and change BASE_URL in main.py from sandbox.flo.finance to api.flo.finance. KYB review takes about two business days.
- Flo docs
- Design partner program, $5K–$10K integration credit
- Other demos for Next.js, Privy, RainbowKit
MIT.