FNB Gateway
Our own read-only service that reads the company's FNB transaction history, stores every entry once, and serves it to internal Thought services by API and signed webhooks.
Overview#
FNB Gateway sits between FNB's Transaction History API and the internal services of Thought (Pty) Ltd. It polls the bank, stores each transaction exactly once, and lets internal services read those transactions without each of them talking to the bank.
The code is public at github.com/thoughtful-za/fnb-gateway. Banking is sensitive, and the simplest way to show that this service does not and cannot move money is to let anyone read it.
Status: beta, live in sandbox at https://fnb.thought.bz/v1/ since release v0.1.3. The sandbox serves clearly labelled synthetic demo data (every item carries simulated: true) until the bank's test credentials are in place. Webhooks are live for an internal consumer once it has shown that it verifies signatures. Production starts only on the owner's explicit go-ahead.
What it does#
- Calls one bank endpoint, FNB's Transaction History read, plus the bank's OAuth token endpoint to log in. That is the whole bank surface.
- Stores each transaction once (DynamoDB in AWS Cape Town, encrypted at rest, point-in-time recovery on).
- Serves transactions to internal services over a private API where every route is a
GET. - Sends a signed webhook when a transaction appears, changes, or looks like a reversal.
- Runs a daily balance-chain check and raises an alarm when the bank's running balance and the stored entries disagree.
What it does not do#
- It makes no payments, transfers, debit orders, beneficiary changes or any other instruction to the bank. There is no code for it, and the bank credentials it uses are for the Transaction History API only.
- It never edits or deletes bank history. If the bank later reports an entry differently, the original is kept and the difference is recorded beside it. Suspected reversals are flagged, never applied.
- It exposes nothing publicly. Only AWS SigV4-signed calls from IAM roles on the gateway's allow list get through.
- It keeps no real bank data in the code repository. Tests use a synthetic feed.
If a money-moving capability is ever added, it will live in its own separately named part of the code, with its own permissions, explicit per-payment approval and an append-only audit log, so the exact code that can move money is easy to find and review. It is not part of any current release.
How it works#
schedule (every 5 min) --> poller --GET--> FNB Transaction History API
|
v
database <-- api <-- API Gateway (SigV4, IAM only) <-- internal services
|
v
dispatcher --signed POST--> internal webhook
- Every poll re-reads the last 3 days, and once a day the last 14, so late or amended entries are caught.
- Duplicates are prevented by a content hash plus an occurrence index, never by position.
- Failures back off and alarm. An expired bank login raises an alert instead of failing silently.
Documentation#
Versions and releases#
| API version | Paths | Docs | Status |
|---|---|---|---|
| v1 | https://fnb.thought.bz/v1/... |
/fnb/gateway/v1 | Beta, live in sandbox (v0.1.3) |
Releases are git tags vMAJOR.MINOR.PATCH. GET /v1/health returns the release the running service was built from, so anyone can match what is deployed to the published code. Within v1, changes are additive only: new fields, endpoints or event types may appear, and clients should ignore what they do not recognise. A breaking change would ship as /v2/ with its own docs at /fnb/gateway/v2, while v1 stays available during the move.
Changelog#
- 2026-12-01: Addresses now have no trailing slash.
- 2026-11-30: Updated for release v0.1.3: live in sandbox at fnb.thought.bz, webhooks live for verified consumers.
- 2026-11-29: First version.
Updated 2026-12-01