smaple.tr
open banking

Open Banking API Development: PSD2, Consent Management, and Account Aggregation [2026]

Mehmet Kurtipek
March 1, 2026
11 min read
open banking
PSD2
API development
FAPI
consent management
account aggregation

Open banking regulation has turned bank data into a programmable resource. PSD2 in Europe — and equivalent frameworks in the UK, Australia, Brazil, and Singapore — requires banks to expose customer account data and payment initiation to licensed third-party providers through secure APIs. For fintech engineering teams, this creates both opportunity and significant technical complexity.

Building an open banking integration is not simply a matter of calling a bank's REST endpoint. You need to implement Financial-grade API (FAPI) security profiles, manage customer consent lifecycles, normalize data across banks with divergent schemas, and handle payment initiation with the reliability and audit trails that financial transactions demand.

This guide covers the full open banking API development stack: FAPI authentication architecture, consent management design, account aggregation patterns, and payment initiation implementation. By the end, you will have a clear map of the technical decisions that separate compliant, production-grade open banking platforms from brittle point integrations.

Open Banking API Development: The Regulatory Foundation

Open banking mandates differ across jurisdictions, but the core technical requirements converge on the same stack. PSD2 in Europe defines the regulatory framework; the Berlin Group's NextGenPSD2 specification and UK Open Banking (OBIE) define the API standards that most global implementations follow.

The regulatory core requires three service types:

Account Information Services (AISP) — read access to account balances, transaction history, and account details. Requires customer consent; consent is scoped, time-limited, and revocable.

Payment Initiation Services (PISP) — ability to initiate a payment from a customer's bank account without the customer needing to use online banking directly. Requires per-payment consent plus Strong Customer Authentication (SCA).

Card-Based Payment Instrument Issuers (CBPII) — confirmation of available funds for card-linked instruments. Less common; required in some jurisdictions.

The PSD3 revision (moving through EU legislative process) adds embedded finance provisions and tightens API performance SLAs. Teams building against PSD2 should design for PSD3 forward compatibility, particularly around consent portability and data standardization.

FAPI Security Architecture: OAuth 2.0 Beyond the Basics

Standard OAuth 2.0 is insufficient for financial-grade API access. The FAPI (Financial-grade API) specification — published by the OpenID Foundation — extends OAuth 2.0 with security requirements that address the threat model specific to financial data.

FAPI 1.0 Advanced Profile is the current production standard. Key requirements:

Proof Key for Code Exchange (PKCE) with S256 — mandatory for all authorization code flows. Prevents authorization code interception attacks.

Mutual TLS (mTLS) — client certificates required for all API calls. Unlike standard HTTPS where only the server presents a certificate, mTLS authenticates both parties. This means your application presents a certificate signed by the bank's CA, and the bank verifies it on every request.

JWS Request Objects — authorization requests must be signed with the client's private key. The bank verifies the signature before processing. This prevents parameter tampering between the client and the authorization endpoint.

JWT-Secured Authorization Response Mode (JARM) — authorization responses are signed and optionally encrypted. Prevents authorization response tampering.

Demonstrating Proof of Possession (DPoP) — emerging requirement in FAPI 2.0 and some PSD3 drafts. Binds access tokens to a specific client keypair, preventing token theft and replay.

In practice, implementing FAPI means managing certificate lifecycles, signing request objects at runtime, and verifying bank signatures on responses. Smart Maple fintech projects implement a shared FAPI client library that handles mTLS connection management, JWS signing, and certificate rotation — isolating this complexity from business logic in account aggregation and payment services.

Token Management

Open banking tokens have specific lifecycle requirements:

  • Access tokens: short-lived (15-60 minutes). Automatically refreshed using refresh tokens while consent is valid.
  • Refresh tokens: scoped to a specific consent grant. Invalidated when consent is revoked.
  • Consent tokens: represent the customer's authorization grant. Linked to specific account permissions and expiry.

Storing tokens securely requires encryption at rest. A pattern that works well: store the refresh token encrypted with AES-256 in PostgreSQL; store the access token in Redis with TTL matching the token expiry. Never log token values; log only token IDs.

Consent is the operational center of open banking. Every API call must be backed by a valid, in-scope consent. Consent lifecycle management is where most open banking implementations encounter production failures.

A consent grant moves through the following states:

AWAITING_AUTHORISATION → AUTHORISED → REJECTED
AUTHORISED → REVOKED (customer action)
AUTHORISED → EXPIRED (time-based)

The consent record must track: permissions granted (list of resource types), accounts covered (specific account IDs or "all accounts"), creation time, expiry time, last accessed time, and revocation reason if applicable.

Granular Permissions

The UK Open Banking specification defines permissions at a granular level:

Permission Scope
ReadAccountsBasic Account ID, currency, account type
ReadAccountsDetail Full account details including IBAN/BBAN
ReadTransactionsBasic Transaction summary
ReadTransactionsDetail Full transaction records
ReadBalances Real-time balances
ReadPAN Masked card number
WritePayments Payment initiation
WriteDomesticPayments UK Faster Payments / EU SCT

Your consent UI must present these permissions in plain language and capture explicit customer authorization for each scope. Bundling all permissions without customer understanding is a regulatory violation.

Every API call should pass through consent validation middleware before reaching business logic:

  1. Extract consent ID from the request context
  2. Load consent record from storage
  3. Verify consent state is AUTHORISED
  4. Verify requested permission is within consent scope
  5. Verify consent has not expired
  6. Update last-accessed timestamp
  7. Proceed to resource handler

This validation logic must be idempotent and fast — it runs on every API call. Cache consent records in Redis with a short TTL (30 seconds) to avoid database pressure on high-throughput deployments.

Account Aggregation: Multi-Bank Integration Patterns

Account aggregation retrieves account data from multiple banks and normalizes it into a unified view. The technical challenge is that even within a standard like UK Open Banking, banks implement subtly different schemas, field conventions, and error behaviors.

The Normalization Problem

A simple example: account type codes. Barclays returns "CACC" for current accounts; Nationwide returns "CurrentAccount". Both are valid within the OpenBanking.org schema extensions, but require normalization before aggregation.

The aggregation pattern that handles this reliably:

Bank API Response
    → Bank-Specific Adapter (normalize schema)
    → Canonical Domain Model
    → Aggregation Service
    → Unified Response

Each bank gets its own adapter. The adapter's responsibility is schema translation only — it produces a canonical account model regardless of what the bank returns. The aggregation service never knows which bank it is talking to; it works with canonical models exclusively.

Parallel Fetch with Partial Success

Aggregating across three banks cannot use serial requests — the latency compounds. Fetch in parallel, with per-bank timeouts:

const bankResults = await Promise.allSettled([
  bankA.getAccounts(consentToken, { timeout: 3000 }),
  bankB.getAccounts(consentToken, { timeout: 3000 }),
  bankC.getAccounts(consentToken, { timeout: 3000 }),
]);

const accounts = bankResults
  .filter(r => r.status === 'fulfilled')
  .flatMap(r => r.value.accounts);

const failures = bankResults
  .filter(r => r.status === 'rejected')
  .map((r, i) => ({ bank: banks[i].id, error: r.reason.message }));

Partial success is better than total failure. Return available accounts with a partial: true flag and list the failed banks. The UI can display "Barclays data unavailable — retry" while showing HSBC and Lloyds data normally.

Rate Limiting and Caching

Banks impose rate limits (typically 500–2000 requests/hour per TPP). For high-frequency aggregation, cache account data aggressively:

  • Balance data: 5-minute TTL (users tolerate slight staleness)
  • Transaction data: 15-minute TTL for historical; real-time for initiated payments
  • Account metadata (IBAN, account type): 24-hour TTL

Use conditional requests (If-Modified-Since or ETags where supported) to avoid counting toward rate limits when data hasn't changed.

Payment Initiation: Architecture and Implementation

Payment initiation (PISP) is technically more demanding than AISP. You are initiating a real money movement, which requires:

  1. A separate payment consent (different from account information consent)
  2. Strong Customer Authentication (SCA) for each payment
  3. Payment status tracking with bank callbacks
  4. Idempotency to prevent duplicate payment creation

Domestic Payment Flow

The standard sequence for a domestic payment:

  1. Create payment consent — POST to bank's payment consent endpoint with amount, creditor account, and payment reference. Returns a consent ID and authorization URL.
  2. Redirect for SCA — customer is redirected to bank's authentication portal. They authenticate (biometric, OTP, or app notification) and authorize the specific payment.
  3. Exchange authorization code — your application receives the authorization callback with a code. Exchange for an access token scoped to this payment consent.
  4. Submit payment — POST the signed payment resource to the bank's payment endpoint using the scoped access token.
  5. Track payment status — poll the bank's payment status endpoint, or receive webhook notifications for status changes.

Payment status follows a state machine: Pending → AcceptedSettlementInProcess → AcceptedSettlementCompleted for success, or Pending → Rejected / AcceptedSettlementInProcess → AcceptedCreditSettlementCompleted → Rejected for various failure paths.

Idempotency in Payment Initiation

Network failures between step 4 and the bank's processing create a dangerous uncertainty: did the payment submit? The solution is idempotency keys:

  • Generate a UUID for each payment attempt before the POST
  • Include it as x-idempotency-key in the request header
  • Banks that support idempotency (required by UK Open Banking, recommended by Berlin Group) will return the same response for duplicate keys without re-processing

Store the idempotency key and the payment consent ID together. If your POST times out, retry with the same key. The bank either processes the original request or returns the original response — you will not double-pay.

Security Architecture: Certificate Management

FAPI's mTLS requirement means managing X.509 client certificates throughout your platform's lifecycle.

Certificate Hierarchy

In a PSD2 deployment:

  • A Qualified Trust Service Provider (QTSP) issues QWAC (Qualified Website Authentication Certificate) and QSEAL (Qualified Electronic Seal Certificate) to your registered TPP entity
  • QWAC is used for mTLS channel authentication
  • QSEAL is used for JWS request object signing

Certificates expire (typically 1-2 years). Certificate rotation must be planned and tested well in advance. A certificate management service should:

  1. Monitor expiry dates (alert at 90 days, 30 days, 7 days)
  2. Provision new certificates before expiry
  3. Update mTLS configuration without service interruption (rolling update)
  4. Retire old certificates after confirming all connections have migrated

Hardware Security Modules (HSMs) are best practice for QSEAL private key storage — the private key never leaves the HSM; signing operations are performed inside it.

Audit Logging

Every open banking API call must produce an audit log entry containing:

  • Timestamp (microsecond precision)
  • Consent ID
  • Customer identifier (hashed — never plaintext in logs)
  • Bank identifier
  • Request type and parameters (excluding PAN, account numbers)
  • Response status code
  • Latency
  • Correlation ID (for tracing across services)

Audit logs are immutable and must be retained for the regulatory minimum (typically 5 years). Write them to a separate audit log store (not the application database) that application code can write to but not delete from.

Implementation Timeline and Cost Framework

A production-grade open banking platform for a regulated fintech:

Phase 1: FAPI Infrastructure (4 weeks) — OAuth 2.0 authorization server with FAPI profile, mTLS termination, certificate management service, JWS signing library.

Phase 2: Consent Management (3 weeks) — Consent lifecycle service, permission validation middleware, Redis-backed consent cache, consent UI components.

Phase 3: Account Aggregation (5 weeks) — Bank adapters (one per bank), normalization pipeline, parallel fetch with partial success, rate-limit-aware caching layer.

Phase 4: Payment Initiation (4 weeks) — Payment consent flow, SCA redirect handling, idempotency layer, payment status tracker, webhook listener.

Phase 5: Compliance and Testing (4 weeks) — Penetration testing against FAPI threat model, sandbox conformance testing with bank test environments, audit log validation, SCA exemption logic.

Total: approximately 20 weeks for a team of two senior backend engineers and one security engineer. Infrastructure costs (AWS with dedicated VPCs, HSM, RDS, ElastiCache) run approximately $8,000–$15,000/month at moderate transaction volumes.

Conclusion

Open banking API development is technically demanding but architecturally tractable. The complexity concentrates in three areas: FAPI security implementation (particularly mTLS and JWS), consent lifecycle management across multiple banks, and building a normalization layer that handles the real-world divergence between "standard" implementations.

Teams that solve these problems correctly gain access to a data layer that enables compelling financial products — real-time cash flow visibility, account-to-account payment initiation, automated financial management — without the overhead of building banking infrastructure from scratch.

The key architectural decisions: implement FAPI compliance as a shared library, not inline per-bank; design consent as a first-class domain entity with its own state machine; and build the normalization layer before you need it — retrofitting canonical models after per-bank integrations are live is significantly harder than building them first.

For open banking integration projects, visit smart-maple.com.

Related Articles

August 11, 2026

MLOps Guide: Taking Machine Learning Models to Production [2026]

87% of machine learning models built by data science teams never reach production. The models work — they pass cross-validation, they score well on holdout sets, they demonstrate genuine predictive value. The problem is not the modeling. The problem is everything that happens between a notebook experiment and a reliable, monitored, production system. MLOps is the discipline that closes that gap. This guide covers the full MLOps stack: maturity levels, tooling choices (MLflow, DVC, Kubeflow

Read More
August 10, 2026

LLM Fine-Tuning Guide: Custom Model Training with LoRA and QLoRA [2026]

General-purpose LLMs are impressive. They can write code, summarize documents, answer questions, and translate between languages with reasonable accuracy. But "reasonable" is not good enough when your application requires consistent output format, domain-specific terminology, a particular tone, or behavior that the base model was never trained to exhibit. That gap is where fine-tuning matters. Fine-tuning updates a model's weights on your specific data, changing how the model behaves — not

Read More
August 9, 2026

Computer Vision Applications: Object Detection, OCR, and Industrial AI [2026]

Computer vision has moved well past the research phase. The models are trained, the frameworks are mature, the hardware is accessible, and the use cases are generating measurable returns. What was a specialized capability requiring deep expertise in 2018 is now deployable infrastructure — if you know which component to reach for and where the real complexity lives. This guide covers computer vision applications across industrial, medical, logistics, and document processing domains. It expl

Read More