A fully-featured FastAPI backend that wraps Bread Africa’s Universal Offramp API. This project provides clean HTTP endpoints for quoting, transferring, and tracking crypto-to-fiat offramps using Bread's infrastructure.
⚠️ This project is independently built and not affiliated with Bread Africa.
- ✅ Generate real-time crypto-to-cash quotes
- 💸 Create off-ramp transfers directly to fiat bank accounts
- 🔎 Track transfer status via unique reference
- 🧾 View historical transfer data by wallet address
- 🏦 Lookup bank accounts and fetch supported institutions
- 🌐 List supported tokens, currencies, and blockchains
- 📑 Swagger UI ready out-of-the-box
.
├── app/
│ ├── __init__.py
│ ├── config.py # App settings & Bread API base URL
│ ├── logger.py # Logger setup
│ ├── models.py # Pydantic models for payloads & responses
│ ├── offramp_client.py # Bread API logic
│ └── routes.py # FastAPI endpoints
├── main.py # App entrypoint & lifespan management
├── requirements.txt
└── README.md
git clone https://github.com/your-username/bread-offramp-fastapi.git
cd bread-offramp-fastapi
pip install -r requirements.txt
BREAD_API_BASE_URL=https://api.bread.africa
uvicorn main:app --reload
Then visit:
- Swagger docs: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
All routes are prefixed with /offramp
.
Method | Endpoint | Description |
---|---|---|
POST |
/quote |
Get a crypto-to-fiat quote |
POST |
/transfer |
Create a transfer from crypto to fiat |
POST |
/lookup-account |
Lookup bank account details |
GET |
/status/{reference} |
Fetch the status of a transfer |
GET |
/get-transfers |
Fetch all past transfers for an address |
GET |
/tokens?blockchain=... |
Get tokens supported by a blockchain |
GET |
/currencies |
List supported fiat currencies |
GET |
/blockchains |
List supported blockchains |
GET |
/institutions?currency=NGN |
Get banks supported for a currency |
All endpoints return a consistent ApiResponse
.
QuoteRequestPayload
TransferRequestPayload
LookupPayload
ApiResponse
offramp_client
is a singleton stored inapp.state
during app lifespan.- Timeout is 30s for read, 60s for connect — adjust via
offramp_client.py
. - Handles both
httpx.RequestError
andhttpx.HTTPStatusError
gracefully with logs.
Got it. Here’s a clean closing section you can add under the README to reference your bot:
This API powers a Telegram bot that makes crypto offramps even more accessible.
Try it here: @bread_offramp_bot
WhatsApp version coming soon.
Let me know if you want to add a separate section for architecture, bot commands, or demo GIFs later.
Zero (Phantasm) Telegram: @iamphantasm0 GitHub: iamphantasm0 Twitter: @iamphantasm0
Bread is a third-party service. This backend is for educational or internal development purposes. For official documentation, visit Bread Africa.