OpenAPI Draft · Aligned with docs/plans/locked-savings-app-deposit-plan.md

Kestrl App API — Locked Savings Deposit Contract

App-side API contract for funding a Locked Savings account via TrueLayer Open Banking into Kestrl's GBP merchant account, updating unfunded pending accounts, and syncing Growth tab balances and deposit transactions.

Auth: Kstrl-Authorization (HMAC-SHA256) + OAuth2 (customers:*)
Requests: integer pence
Responses: Amount (pounds) + ISO 8601 UTC (Z)
Zero Breaking Changes

Locked Design Decisions (26 Nov 2026)

Deposit Lifecycle & State Machine

No savings_deposits row is written before customer authorisation. Both the redirect and TrueLayer webhooks reconcile idempotently against unique truelayer_payment_id.

Stage / Trigger truelayer_payment_logs savings_deposits balance / funded_amount awaiting / can_add Maybank Batch?

Schemas

Shared request and response objects. Additive fields on SavingsTransaction are marked ADDED.

Error Codes

Standard ErrorResponse codes returned across the deposit and callback endpoints.

CodeHTTPEnum CaseMessage