Skip to main content

Lender Start Credit Application Convention

This document defines the naming and structure convention for post-enquiry lender launch flows (e.g. Bon Voyage). Use it when adding or migrating lender “start credit application” flows so that routes, modules, and events stay consistent.

Convention (schema / syntax)

ConceptPatternExample
Action keystart_<lender>_finance_applicationstart_zopa_finance_application
Module filecloud-run/finance-assistant/lenders/start_<lender>_finance_application_logic.jsstart_zopa_finance_application_logic.js
API route/api/lenders/start/<lender>/finance-application/api/lenders/start/zopa/finance-application
Event namingstart_credit_application_*start_credit_application_success, start_credit_application_failed
  • <lender> is the technical lender identifier used in code and URLs (e.g. zopa, snap). Customer-facing names (e.g. DivideBuy, Snap Finance) stay in config/UI.
  • Module: Each such flow is implemented in its own file under cloud-run/finance-assistant/lenders/ and exports a register function that mounts the route on the app.
  • Proxy: The Finance Assistant proxy (Cloudflare worker) must include a pass-through for the same path so browser calls go: proxy → Cloud Run route.
  • Events: Structured logs and telemetry for this flow should use the start_credit_application_* prefix for consistency.

Backward compatibility

  • Existing lender routes that do not follow this convention (e.g. /api/lenders/snap/session/start) remain supported until explicitly deprecated.
  • New lender flows should use this convention. When migrating an existing flow, add the new route/module and optionally keep the old route as an alias during transition.

References