ReadMe
The Open Bank Project API
About
The Open Bank Project is an open-source API for banks that enables account holders to interact with their bank using a wider range of applications and services.
The OBP API supports transparency options (enabling account holders to share configurable views of their transaction data with trusted individuals and even the public), data blurring (to preserve sensitive information) and data enrichment (enabling users to add tags, comments and images to transactions).
The OBP API abstracts away the peculiarities of each core banking system so that a wide range of apps can interact with multiple banks on behalf of the account holder. We want to raise the bar of financial transparency and enable a rich ecosystem of innovative financial applications and services.
Our tagline is: "Bank as a Platform. Transparency as an Asset".
The API supports OAuth 2, OpenID Connect OIDC, Direct Login, and other authentication methods.
Note: OAuth 1.0a support has been removed. Please use OAuth 2.0, OpenID Connect, or Direct Login for authentication.
Documentation
The API documentation is best viewed using the OBP API Explorer or a third-party tool that has imported the OBP Swagger definitions.
If you want to run your own copy of API Explorer II, see here
Writing documentation
Write glossary items, endpoint descriptions, error messages and code comments in plain English. Plain English is
not simplified English: it keeps the meaning and the detail, and says it clearly. Two UK guides explain how:
In short:
- Keep sentences to 15 to 20 words on average, and split any sentence over 25 words.
- Use the active voice: "OBP-API refuses the call", not "the call is refused".
- Use short, familiar words: "start", not "commence"; "before", not "prior to".
- Explain a technical term the first time you use it. Specialists prefer plain English too.
- Write full sentences. Avoid long chains joined by semicolons, and make sure every "it" and "they" clearly
refers to one thing.
- Give an example when a rule is hard to follow on its own.
scripts/plain_english_check.py lists the sentences over 25 words in ResourceDocs, glossary items and error
messages. Run it with --changed to check only the files you have changed. It measures length only, so a
text it passes can still need rewriting.
Status of API Versions
OBP instances support multiple versions of the API simultaneously (unless they are deactivated in config)
To see the status (DRAFT, STABLE or BLEEDING-EDGE) of an API version, look at the root endpoint. For example, /obp/v2.0.0/root or /obp/v3.0.0/root.
24.01.2017, [V1.2.1](https://apisandbox.openbankproject.com/obp/v1.2.1/root) was marked as stable.
24.01.2017, [V1.3.0](https://apisandbox.openbankproject.com/obp/v1.3.0/root) was marked as stable.
08.06.2017, [V2.0.0](https://apisandbox.openbankproject.com/obp/v2.0.0/root) was marked as stable.
27.10.2018, [V2.1.0](https://apisandbox.openbankproject.com/obp/v2.1.0/root) was marked as stable.
27.10.2018, [V2.2.0](https://apisandbox.openbankproject.com/obp/v2.2.0/root) was marked as stable.
18.11.2020, [V3.0.0](https://apisandbox.openbankproject.com/obp/v3.0.0/root) was marked as stable.
18.11.2020, [V3.1.0](https://apisandbox.openbankproject.com/obp/v3.1.0/root) was marked as stable.
16.12.2022, [V4.0.0](https://apisandbox.openbankproject.com/obp/v4.0.0/root) was marked as stable.
16.12.2022, [V5.0.0](https://apisandbox.openbankproject.com/obp/v5.0.0/root) was marked as stable.
License
This project is dual licensed under the AGPL V3 (see NOTICE) and commercial licenses from TESOBE GmbH.
Setup
Installing JDK
With sdkman
A good way to manage JDK versions and install the correct version for OBP is sdkman. If you have this installed then you can install the correct JDK easily using:
sdk env install
Manually
The project targets JDK 25 (LTS) with Scala 2.12.21. Any OpenJDK 25 distribution works,
for example:
The project uses Maven 3 as its build tool.
Running http4s server
To run the API using the http4s server, use the obp-api module from the project root:
MAVEN_OPTS="-Xms3G -Xmx6G -XX:MaxMetaspaceSize=2G" mvn -pl obp-api -am clean package -DskipTests=true -Dmaven.test.skip=true && \
java -jar obp-api/target/obp-api.jar
The http4s server binds to hostname / dev.port as configured in your props file (defaults are 127.0.0.1 and 8080).
obp-api.jar is a thin jar: it contains only this module's classes and resources. Its
runtime dependencies are copied to the sibling obp-api/target/lib/ directory by the build,
and the jar's manifest carries a Class-Path entry pointing at lib/, so the jar and lib/
must stay next to each other — copying the jar alone is not enough to run it.
No --add-opens flags are needed on the command line: the jar's manifest also carries
an Add-Opens attribute (JEP 261) with all modules the runtime needs (CGLib proxy generation,
Kryo serialization, Pekko remoting, Scala runtime reflection). Only when launching via a
custom classpath does the manifest not apply, since it is only honored by java -jar; the
equivalent form needs the flags passed explicitly:
java --add-opens java.base/java.lang=ALL-UNNAMED \
--add-opens java.base/java.lang.reflect=ALL-UNNAMED \
--add-opens java.base/java.util=ALL-UNNAMED \
--add-opens java.base/java.lang.invoke=ALL-UNNAMED \
--add-opens java.base/java.util.jar=ALL-UNNAMED \
--add-opens java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \
--add-opens java.base/java.io=ALL-UNNAMED \
--add-opens java.base/java.util.concurrent=ALL-UNNAMED \
--add-opens java.base/java.security=ALL-UNNAMED \
-cp "obp-api/target/obp-api.jar:obp-api/target/lib/*" bootstrap.http4s.Http4sServer
Note: How to run via IntelliJ IDEA
Run some tests
In obp-api/src/main/resources/props create a test.default.props for tests. Set connector=mapped.
Run a single test. For instance, right-click on obp-api/test/scala/code/branches/MappedBranchProviderTest and select "Run Mapp"...
Run multiple tests: Right-click on obp-api/test/scala/code and select Run. If need be:
Goto Run / Debug configurations
Test Kind: Select All in Package
Package: Select code
Add the absolute /path-to-your-OBP-API in the "working directory" field
You might need to assign more memory via VM Options. For example:
-Xmx1512M -XX:MaxPermSize=512M
or
-Xmx2048m -Xms1024m -Xss2048k -XX:MaxPermSize=1024m
Ensure your test.default.props has the minimum settings (see test.default.props.template).
Right-click obp-api/test/scala/code and select the Scala Tests in the code to run them all.
Note: You may want to disable some tests not relevant to your setup e.g.:
set bank_account_creation_listener=false in test.default.props.
Other ways to run tests
From the command line
Set memory options:
export MAVEN_OPTS="-Xmx3000m -Xss2m"
Run one test:
mvn -DwildcardSuites=code.api.directloginTest test
Run all tests and save the output to a file:
export MAVEN_OPTS="-Xss128m" && mvn clean test | tee obp-api-test-results.txt
Ubuntu
If you use Ubuntu (or a derivate) and encrypted home directories (e.g. you have ~/.Private), you might run into the following error when the project is built:
uncaught exception during compilation: java.io.IOException
[ERROR] File name too long
[ERROR] two errors found
[DEBUG] Compilation failed (CompilerInterface)
The current workaround is to move the project directory onto a different partition, e.g. under /opt/.
Running the docker image
Docker images of OBP API can be found on Dockerhub: https://hub.docker.com/r/openbankproject/obp-api - pull with docker pull openbankproject/obp-api.
Props values can be set as environment variables. Props need to be prefixed with OBP_, . replaced with _, and all upper-case, e.g.:
openid_connect.enabled=true becomes OBP_OPENID_CONNECT_ENABLED=true.
Databases
The default database for testing etc is H2. PostgreSQL is used for the sandboxes (user accounts, metadata, transaction cache). The list of databases fully tested is: PostgreSQL, MS SQL and H2.
Notes on using H2 web console in Dev and Test mode:
Set DB options in the props file:
db.driver=org.h2.Driver
db.url=jdbc:h2:./obp_api.db;DB_CLOSE_ON_EXIT=FALSE
Note: The H2 web console at /console was available when OBP-API ran on Jetty but is no longer served by the http4s server. To inspect the H2 database, connect directly using the H2 Shell or a database tool such as DBeaver.
Use the following connection values (make sure the JDBC URL matches your Props value):
Driver Class: org.h2.Driver
JDBC URL: jdbc:h2:./obp_api.db;AUTO_SERVER=FALSE
User Name:
Password:
Notes on the basic usage of Postgres
Once Postgres is installed (On macOS, use brew):
psql postgres
Create database obpdb; (or any other name of your choosing).
Create user obp; (this is the user that OBP-API will use to create and access tables etc).
Alter user obp with password daniel.says; (put this password in the OBP-API Props).
Grant all on database obpdb to obp; (So OBP-API can create tables etc.)
For newer versions of postgres 16 and above, you need to follow the following instructions
-- Connect to the sandbox database
\c sandbox;
-- Grant schema usage and creation privileges
GRANT USAGE ON SCHEMA public TO obp;
GRANT CREATE ON SCHEMA public TO obp;
-- Grant all privileges on existing tables (if any)
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO obp;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO obp;
-- Grant privileges on future tables and sequences
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TABLES TO obp;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON SEQUENCES TO obp;
Then, set the db.url in your Props:
db.driver=org.postgresql.Driver
db.url=jdbc:postgresql://localhost:5432/obpdb?user=obp&password=daniel.says
Then, restart OBP-API.
Notes on using MS SQL Server
Set the database connection properties in your props file. You can either embed credentials in the URL or use separate props:
Option 1: Credentials in the URL
db.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
db.url=jdbc:sqlserver://YOUR_HOST:1433;databaseName=YOUR_DB;user=YOUR_USER;password=YOUR_PASSWORD;encrypt=true;trustServerCertificate=true
Option 2: Separate props (recommended)
db.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
db.url=jdbc:sqlserver://YOUR_HOST:1433;databaseName=YOUR_DB;encrypt=true;trustServerCertificate=true
db.user=YOUR_USER
db.password=YOUR_PASSWORD
Option 2 is recommended because it keeps credentials out of the URL and avoids URL parsing issues. Note that db.user and db.password take priority over any credentials in the URL.
Notes on using Postgres with SSL
Postgres needs to be compiled with SSL support.
Use OpenSSL to create the files you need.
For the steps, see https://www.howtoforge.com/postgresql-ssl-certificates.
In short, edit postgresql.conf:
ssl = on
ssl_cert_file = '/etc/YOUR-DIR/server.crt'
ssl_key_file = '/etc/YOUR-DIR/server.key'
And restart Postgres.
Now, this should enable SSL (on the same port that Postgres normally listens on) - but it doesn't force it.
To force SSL, edit pg_hba.conf replacing the host entries with hostssl.
Now in OBP-API Props, edit your db.url and add &ssl=true. For example:
db.url=jdbc:postgresql://localhost:5432/my_obp_database?user=my_obp_user&password=the_password&ssl=true
Note: Your Java environment may need to be set up correctly to use SSL.
Restart OBP-API, if you get an error, check your Java environment can connect to the host over SSL.
Note: /obp-api/src/main/resources/logback.xml ships ready to use, defaulting to INFO. Set the
LOG_LEVEL