Client proposal template
A consulting proposal in one HTML page – situation, recommendation, three priced options with one recommended, scope, timeline, team, terms, and an approval block. Duplicate it, or hand the prompt to your agent.
Template
A system diagram as a drawing sheet in one HTML file – title block, inline SVG diagram with numbered callouts, latency budget, failure modes, and a change log. Duplicate it, or hand the prompt to your agent.
Publishing this from your own stack? See Display for architecture diagrams.
Preview
architecture-diagram.html<!doctype html>
<!-- Template: Architecture diagram. Replace the sample content and keep the structure. Sections: Title block, Scope, Authorization path (figure), Callouts, Latency budget, Failure modes, Change log, Footer. -->
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="color-scheme" content="light">
<meta name="description" content="Architecture reference drawing LS-ARCH-0031: the synchronous and asynchronous hops of a card authorization at Lodestar, with latency budgets and failure modes.">
<title>Payment authorization path – v3 – Lodestar</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap" rel="stylesheet">
<style>
:root {
--paper: oklch(1 0 0);
--ink: oklch(0.18 0.006 260);
--ink-soft: oklch(0.42 0.012 260);
--rule: oklch(0.18 0.006 260);
--rule-soft: oklch(0.84 0.004 260);
--grid: oklch(0.935 0.004 250);
--grid-major: oklch(0.885 0.005 250);
--tint: oklch(0.965 0.003 250);
--red: oklch(0.52 0.2 28);
--sans: "Barlow", Bahnschrift, "DIN Alternate", "Helvetica Neue", Arial, sans-serif;
--mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
--pad: clamp(16px, 3.2vw, 40px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
margin: 0;
padding: clamp(10px, 2vw, 32px);
background: var(--paper);
color: var(--ink);
font-family: var(--sans);
font-size: 16px;
line-height: 1.5;
}
code {
font-family: var(--mono);
font-size: 0.86em;
overflow-wrap: anywhere;
}
p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }
/* Sheet ---------------------------------------------------------------- */
.drawing {
max-width: 1180px;
margin: 0 auto;
border: 1px solid var(--rule);
background-color: var(--paper);
background-image:
linear-gradient(var(--grid-major) 1px, transparent 1px),
linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
linear-gradient(var(--grid) 1px, transparent 1px),
linear-gradient(90deg, var(--grid) 1px, transparent 1px);
background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
background-position: -1px -1px;
}
.mono-label {
font-family: var(--mono);
font-size: 10.5px;
font-weight: 500;
letter-spacing: 0.08em;
text-transform: uppercase;
color: var(--ink-soft);
}
/* Strip ---------------------------------------------------------------- */
.strip {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
gap: 6px 24px;
padding: 10px var(--pad);
border-bottom: 1px solid var(--rule);
background: var(--paper);
}
.strip p { margin: 0; }
.brand {
display: inline-flex;
align-items: center;
gap: 8px;
font-weight: 700;
font-size: 15px;
letter-spacing: 0.04em;
text-transform: uppercase;
color: var(--ink);
}
.brand svg { display: block; }
/* Title block ---------------------------------------------------------- */
.title-block {
display: grid;
grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
border-bottom: 1px solid var(--rule);
background: var(--paper);
}
.tb-title {
padding: 22px var(--pad) 24px;
border-right: 1px solid var(--rule);
}
.tb-title h1 {
margin: 6px 0 10px;
font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.375rem);
line-height: 1.05;
font-weight: 600;
letter-spacing: 0.01em;
text-transform: uppercase;
}
.tb-sub {
max-width: 44ch;
font-size: 15px;
color: var(--ink-soft);
}
.tb-fields {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
margin: 0;
}
.tb-fields > div {
padding: 12px 14px 14px;
border-left: 1px solid var(--rule);
border-bottom: 1px solid var(--rule);
}
.tb-fields > div:nth-child(3n+1) { border-left: 0; }
.tb-fields > div:nth-child(n+4) { border-bottom: 0; }
.tb-fields dt { margin: 0; }
.tb-fields dd {
margin: 5px 0 0;
font-size: 15px;
font-weight: 500;
line-height: 1.35;
}
.tb-fields dd code { font-size: 13px; font-weight: 500; }
/* Body ----------------------------------------------------------------- */
.sheet-body { padding: 4px var(--pad) 0; }
section {
padding: 26px 0 34px;
border-bottom: 1px solid var(--rule-soft);
}
section:last-of-type { border-bottom: 0; }
h2 {
display: flex;
align-items: center;
gap: 14px;
margin: 0 0 18px;
font-size: 0.875rem;
font-weight: 700;
letter-spacing: 0.05em;
text-transform: uppercase;
}
h2::after {
content: "";
flex: 1;
height: 1px;
background: var(--rule);
}
.prose { max-width: 76ch; }
/* Scope ---------------------------------------------------------------- */
.scope {
display: grid;
grid-template-columns: 128px minmax(0, 1fr);
gap: 14px 28px;
margin: 0;
max-width: 920px;
}
.scope dt { padding-top: 3px; }
.scope dd { margin: 0; }
/* Figures -------------------------------------------------------------- */
figure { margin: 0; }
.fig-scroll {
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
.fig-scroll svg {
display: block;
width: 100%;
height: auto;
}
.fig-path svg { min-width: 940px; }
.fig-budget { margin-top: 18px; }
.fig-budget svg { min-width: 640px; max-width: 840px; }
figcaption {
margin-top: 14px;
max-width: 88ch;
font-size: 0.8125rem;
line-height: 1.5;
color: var(--ink-soft);
}
.fig-no {
font-family: var(--mono);
font-weight: 700;
color: var(--red);
margin-right: 8px;
}
.scroll-hint { display: none; margin: 0 0 8px; }
.tbl-note + .scroll-hint { margin: 18px 0 6px; }
.legend {
display: flex;
flex-wrap: wrap;
gap: 8px 26px;
margin: 0 0 12px;
padding: 0;
list-style: none;
font-family: var(--mono);
font-size: 11px;
color: var(--ink-soft);
}
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.legend svg { display: block; }
/* Diagram SVG ---------------------------------------------------------- */
.dg text { font-family: var(--sans); fill: var(--ink); }
.dg .nm { font-size: 13.5px; font-weight: 600; text-anchor: middle; }
.dg .sv { font-family: var(--mono); font-size: 10.5px; fill: var(--ink-soft); text-anchor: middle; }
.dg .zone-label { font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.08em; fill: var(--ink-soft); }
.dg .el { font-family: var(--mono); font-size: 10px; fill: var(--ink-soft); text-anchor: middle; paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; }
.dg .el-start { text-anchor: start; }
.dg .node { fill: var(--paper); stroke: var(--ink); stroke-width: 1.25; }
.dg .ext { stroke-dasharray: 3 3; }
.dg .bus { fill: var(--tint); stroke: var(--ink); stroke-width: 1.25; }
.dg .e { fill: none; stroke: var(--ink); stroke-width: 1.4; marker-end: url(#arr); }
.dg .ea { fill: none; stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 6 4; marker-end: url(#arr-o); }
.dg .bnd { fill: none; stroke: var(--ink); stroke-width: 1; stroke-dasharray: 5 4; }
.dg .jn { fill: var(--ink); }
.dg .mk { fill: var(--ink); }
.dg .mk-o { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.dg .co circle { fill: var(--red); }
.dg .co line { stroke: var(--red); stroke-width: 1; }
.dg .co text { fill: var(--paper); font-family: var(--mono); font-weight: 700; font-size: 11px; text-anchor: middle; }
/* Budget bar SVG ------------------------------------------------------- */
.bb text { font-family: var(--mono); font-size: 12px; fill: var(--ink); text-anchor: middle; }
.bb .seg { fill: var(--tint); stroke: var(--ink); stroke-width: 1; }
.bb .seg-head { fill: var(--paper); }
.bb .ax { stroke: var(--ink); stroke-width: 1; }
.bb .ax-t { fill: var(--ink-soft); font-size: 11px; }
.bb .meas { stroke: var(--red); stroke-width: 1.5; stroke-dasharray: 3 2; }
.bb .meas-t { fill: var(--red); font-weight: 700; font-size: 11px; }
.bb .co circle { fill: var(--red); }
.bb .co line { stroke: var(--red); stroke-width: 1; }
.bb .co text { fill: var(--paper); font-weight: 700; font-size: 11px; }
/* Callouts ------------------------------------------------------------- */
.callouts {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 0 48px;
margin: 0;
padding: 0;
list-style: none;
}
.callouts li {
padding: 16px 0 18px;
border-top: 1px solid var(--rule-soft);
}
.callouts h3 {
display: flex;
align-items: center;
gap: 10px;
margin: 0 0 3px;
font-size: 1rem;
font-weight: 600;
}
.co-no {
display: inline-flex;
flex: none;
width: 22px;
height: 22px;
align-items: center;
justify-content: center;
border-radius: 50%;
background: var(--red);
color: var(--paper);
font: 700 12px/1 var(--mono);
}
.callouts .hop {
margin: 0 0 8px;
padding-left: 32px;
font-family: var(--mono);
font-size: 11.5px;
color: var(--ink-soft);
}
.callouts p { padding-left: 32px; font-size: 15px; }
/* Tables --------------------------------------------------------------- */
.tbl {
overflow-x: auto;
border: 1px solid var(--rule);
background: var(--paper);
}
table {
width: 100%;
border-collapse: collapse;
font-size: 0.875rem;
font-variant-numeric: tabular-nums;
}
caption {
caption-side: top;
padding: 10px 14px;
text-align: left;
font-size: 0.8125rem;
line-height: 1.45;
color: var(--ink-soft);
border-bottom: 1px solid var(--rule);
}
th, td {
padding: 9px 14px;
text-align: left;
vertical-align: top;
border-bottom: 1px solid var(--rule-soft);
}
thead th {
font-family: var(--mono);
font-size: 10.5px;
font-weight: 700;
letter-spacing: 0.05em;
text-transform: uppercase;
color: var(--ink-soft);
background: var(--tint);
border-bottom: 1px solid var(--rule);
white-space: nowrap;
}
tbody th { font-weight: 600; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-family: var(--mono); font-size: 0.8125rem; white-space: nowrap; }
thead th.num { text-align: right; }
tfoot th, tfoot td {
font-weight: 600;
background: var(--tint);
border-top: 1px solid var(--rule);
border-bottom: 0;
}
.lat table { min-width: 720px; }
.hop-id {
display: inline-flex;
width: 20px;
height: 20px;
align-items: center;
justify-content: center;
border-radius: 50%;
background: var(--red);
color: var(--paper);
font: 700 11px/1 var(--mono);
}
.mode { font-family: var(--mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
.tbl-note {
margin: 10px 0 0;
max-width: 88ch;
font-size: 0.8125rem;
color: var(--ink-soft);
}
/* Footer --------------------------------------------------------------- */
.foot {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
gap: 6px 32px;
padding: 14px var(--pad);
border-top: 1px solid var(--rule);
background: var(--paper);
font-family: var(--mono);
font-size: 11.5px;
line-height: 1.5;
color: var(--ink-soft);
}
.foot p { margin: 0; }
/* Narrow --------------------------------------------------------------- */
@media (max-width: 900px) {
.scroll-hint { display: block; }
.callouts { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
.title-block { grid-template-columns: 1fr; }
.tb-title { border-right: 0; border-bottom: 1px solid var(--rule); }
.tb-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tb-fields > div:nth-child(3n+1) { border-left: 1px solid var(--rule); }
.tb-fields > div:nth-child(2n+1) { border-left: 0; }
.tb-fields > div:nth-child(n+4) { border-bottom: 1px solid var(--rule); }
.tb-fields > div:nth-child(n+5) { border-bottom: 0; }
.scope { grid-template-columns: 1fr; gap: 4px 0; }
.scope dd { margin-bottom: 12px; }
.scope dd:last-child { margin-bottom: 0; }
.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.stack tr { display: block; padding: 10px 14px 12px; border-bottom: 1px solid var(--rule); }
.stack tbody tr:last-child { border-bottom: 0; }
.stack th, .stack td { display: block; padding: 3px 0 6px; border: 0; }
.stack tbody th { padding-bottom: 8px; }
.stack td::before {
content: attr(data-label);
display: block;
margin-bottom: 1px;
font-family: var(--mono);
font-size: 10.5px;
font-weight: 500;
letter-spacing: 0.05em;
text-transform: uppercase;
color: var(--ink-soft);
}
}
</style>
</head>
<body>
<div class="drawing">
<div class="strip">
<p class="brand"><svg width="14" height="14" viewBox="0 0 16 16" aria-hidden="true" fill="currentColor"><path d="M8 0 L9.6 6.4 L16 8 L9.6 9.6 L8 16 L6.4 9.6 L0 8 L6.4 6.4 Z"/></svg>Lodestar</p>
<p class="mono-label">Payments infrastructure · Architecture reference</p>
<p class="mono-label">LS-ARCH-0031 · Sheet 1 of 1</p>
</div>
<header class="title-block">
<div class="tb-title">
<p class="mono-label">Drawing</p>
<h1>Payment authorization <span class="nowrap">path – v3</span></h1>
<p class="tb-sub">Reference drawing for engineers and security review: every hop a card authorization takes on the public API, which hops are on the response path, and what each one is allowed to cost.</p>
</div>
<dl class="tb-fields">
<div><dt class="mono-label">Drawing no.</dt><dd><code>LS-ARCH-0031</code></dd></div>
<div><dt class="mono-label">Version</dt><dd>v3.0 · supersedes v2.4</dd></div>
<div><dt class="mono-label">Date</dt><dd>2026-09-18</dd></div>
<div><dt class="mono-label">Owner</dt><dd>Payments platform · <span class="nowrap">T. Reinholt</span></dd></div>
<div><dt class="mono-label">Status</dt><dd>In security review</dd></div>
<div><dt class="mono-label">Reviewers</dt><dd>P. Venkataraman (Security)<br>M. Lindqvist (SRE)</dd></div>
</dl>
</header>
<div class="sheet-body">
<section id="scope" aria-labelledby="h-scope">
<h2 id="h-scope">Scope</h2>
<dl class="scope">
<dt class="mono-label">Shows</dt>
<dd>The authorization of a card payment created with <code>POST /v3/authorizations</code> in <code>eu-central-1</code>: the five synchronous hops that decide the response and the asynchronous path that tells the merchant afterwards. Service names are the deployed names in the service registry.</dd>
<dt class="mono-label">Does not show</dt>
<dd>Captures, refunds and reversals (<code>LS-ARCH-0029</code>), the 3-D Secure challenge flow (<code>LS-ARCH-0032</code>), settlement files, and the regional failover between <code>eu-central-1</code> and <code>eu-west-1</code>. Internal retries inside a single service are omitted.</dd>
<dt class="mono-label">Trust boundaries</dt>
<dd>Two hops cross a boundary and deserve the most review time: hop 1, merchant to Edge over the public internet, and hop 5, connectors to PSP networks through allow-listed egress. Everything else runs inside the VPC over mTLS. Cardholder data is tokenized at Edge; no service right of Edge sees a PAN in clear text.</dd>
</dl>
</section>
<section id="path" aria-labelledby="h-path">
<h2 id="h-path">Authorization path</h2>
<ul class="legend" aria-label="Legend">
<li><svg width="44" height="10" viewBox="0 0 44 10" aria-hidden="true"><line x1="0" y1="5" x2="36" y2="5" stroke="currentColor" stroke-width="1.4"/><path d="M36 1 L44 5 L36 9 Z" fill="currentColor"/></svg>synchronous call, on the response path</li>
<li><svg width="44" height="10" viewBox="0 0 44 10" aria-hidden="true"><line x1="0" y1="5" x2="36" y2="5" stroke="currentColor" stroke-width="1.2" stroke-dasharray="6 4"/><path d="M36 1 L44 5 L36 9" fill="none" stroke="currentColor" stroke-width="1.4"/></svg>asynchronous message</li>
<li><svg width="28" height="14" viewBox="0 0 28 14" aria-hidden="true"><rect x="0.5" y="0.5" width="27" height="13" fill="none" stroke="currentColor" stroke-dasharray="4 3"/></svg>trust boundary</li>
<li><span class="hop-id" aria-hidden="true">n</span>callout, see notes below</li>
</ul>
<p class="scroll-hint mono-label">Scroll sideways to see the full drawing</p>
<figure class="fig-path">
<div class="fig-scroll">
<svg class="dg" viewBox="0 0 1160 600" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Authorization path: a request travels synchronously from the merchant client through the Edge gateway to the Auth API, which scores it with the risk engine, writes a hold in the ledger, then calls one of two PSP connectors that reach the external PSP networks. The outcome is published asynchronously through the event bus to the webhook dispatcher and back to the merchant. Six red callouts number the hops explained in the notes.">
<title>Figure 1. Payment authorization path, v3</title>
<desc>Left to right: Client (merchant-server) outside the Lodestar VPC calls Edge (edge-gw) with a synchronous request, callout 1. Edge calls Auth API (auth-api), callout 2. Auth API makes three synchronous calls: up to Risk engine (risk-scorer), callout 3; down to Ledger (ledger-core), callout 4; and right to PSP connector A (conn-north) or PSP connector B (conn-south), callout 5, which call the external PSP A and PSP B acquirer APIs across the trust boundary. Asynchronously, Auth API and Ledger publish events to the event bus, callout 6; the Webhooks service (webhook-dispatch) consumes the bus and posts a signed webhook back to the merchant client.</desc>
<defs>
<marker id="arr" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="8" markerHeight="8" markerUnits="userSpaceOnUse" orient="auto"><path d="M0 0 L10 5 L0 10 Z" class="mk"/></marker>
<marker id="arr-o" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="8" markerHeight="8" markerUnits="userSpaceOnUse" orient="auto"><path d="M1 1 L9 5 L1 9" class="mk-o"/></marker>
</defs>
<!-- zones -->
<rect class="bnd" x="200" y="36" width="800" height="548"/>
<text class="zone-label" x="28" y="58">MERCHANT SIDE</text>
<text class="zone-label" x="212" y="58">LODESTAR VPC · EU-CENTRAL-1 · PCI DSS SCOPE</text>
<text class="zone-label" x="1030" y="58">PSP NETWORKS</text>
<!-- edges -->
<g aria-hidden="true">
<path class="e" d="M160 252 H239"/>
<path class="e" d="M372 252 H439"/>
<path class="e" d="M590 228 H636 V126 H679"/>
<path class="e" d="M590 276 H636 V380 H679"/>
<path class="e" d="M590 252 H830 V196 H859"/>
<path class="e" d="M830 252 V316 H859"/>
<circle class="jn" cx="830" cy="252" r="2.6"/>
<path class="e" d="M990 196 H1029"/>
<path class="e" d="M990 316 H1029"/>
<path class="ea" d="M515 298 V469"/>
<path class="ea" d="M750 410 V469"/>
<path class="ea" d="M440 485 H373"/>
<path class="ea" d="M240 485 H94 V283"/>
<text class="el" x="200" y="306">POST /v3/authorizations</text>
<text class="el" x="406" y="306">mTLS · signed envelope</text>
<text class="el" x="658" y="118">score</text>
<text class="el" x="658" y="372">hold</text>
<text class="el" x="710" y="242">authorize · route by BIN + currency</text>
<text class="el el-start" x="524" y="424">authorization.approved</text>
<text class="el el-start" x="524" y="437">authorization.declined</text>
<text class="el el-start" x="760" y="445">ledger.hold_placed</text>
<text class="el" x="167" y="503">signed webhook</text>
<text class="el" x="167" y="516">retry up to 24 h</text>
</g>
<!-- nodes -->
<g>
<rect class="node" x="28" y="222" width="132" height="60" rx="2"/>
<text class="nm" x="94" y="247">Client</text>
<text class="sv" x="94" y="265">merchant-server</text>
<rect class="node" x="240" y="222" width="132" height="60" rx="2"/>
<text class="nm" x="306" y="247">Edge</text>
<text class="sv" x="306" y="265">edge-gw</text>
<rect class="node" x="440" y="206" width="150" height="92" rx="2"/>
<text class="nm" x="515" y="248">Auth API</text>
<text class="sv" x="515" y="266">auth-api</text>
<rect class="node" x="680" y="96" width="140" height="60" rx="2"/>
<text class="nm" x="750" y="121">Risk engine</text>
<text class="sv" x="750" y="139">risk-scorer</text>
<rect class="node" x="680" y="350" width="140" height="60" rx="2"/>
<text class="nm" x="750" y="375">Ledger</text>
<text class="sv" x="750" y="393">ledger-core</text>
<rect class="node" x="860" y="166" width="130" height="60" rx="2"/>
<text class="nm" x="925" y="191">PSP connector A</text>
<text class="sv" x="925" y="209">conn-north</text>
<rect class="node" x="860" y="286" width="130" height="60" rx="2"/>
<text class="nm" x="925" y="311">PSP connector B</text>
<text class="sv" x="925" y="329">conn-south</text>
<rect class="node ext" x="1030" y="166" width="112" height="60" rx="2"/>
<text class="nm" x="1086" y="191">PSP A</text>
<text class="sv" x="1086" y="209">acquirer API</text>
<rect class="node ext" x="1030" y="286" width="112" height="60" rx="2"/>
<text class="nm" x="1086" y="311">PSP B</text>
<text class="sv" x="1086" y="329">acquirer API</text>
<rect class="bus" x="440" y="470" width="390" height="30" rx="2"/>
<text class="sv" x="635" y="489">EVENT BUS · authorization.* · ledger.*</text>
<rect class="node" x="240" y="455" width="132" height="60" rx="2"/>
<text class="nm" x="306" y="480">Webhooks</text>
<text class="sv" x="306" y="498">webhook-dispatch</text>
</g>
<!-- callouts -->
<g aria-hidden="true">
<g class="co"><line x1="200" y1="240" x2="200" y2="251"/><circle cx="200" cy="230" r="10"/><text x="200" y="230" dy=".35em">1</text></g>
<g class="co"><line x1="406" y1="240" x2="406" y2="251"/><circle cx="406" cy="230" r="10"/><text x="406" y="230" dy=".35em">2</text></g>
<g class="co"><line x1="626" y1="170" x2="635" y2="170"/><circle cx="616" cy="170" r="10"/><text x="616" y="170" dy=".35em">3</text></g>
<g class="co"><line x1="626" y1="330" x2="635" y2="330"/><circle cx="616" cy="330" r="10"/><text x="616" y="330" dy=".35em">4</text></g>
<g class="co"><line x1="710" y1="266" x2="710" y2="254"/><circle cx="710" cy="276" r="10"/><text x="710" y="276" dy=".35em">5</text></g>
<g class="co"><line x1="502" y1="380" x2="514" y2="380"/><circle cx="492" cy="380" r="10"/><text x="492" y="380" dy=".35em">6</text></g>
</g>
</svg>
</div>
<figcaption><span class="fig-no">FIG. 1</span>Authorization path, v3. Solid arrows are synchronous calls whose response is awaited on the same edge; dashed arrows are asynchronous messages. The dashed frame is the Lodestar trust boundary. Red numbers are the callouts below. Not to scale; node placement follows the request order, not deployment topology.</figcaption>
</figure>
</section>
<section id="callouts" aria-labelledby="h-callouts">
<h2 id="h-callouts">Callouts</h2>
<ol class="callouts">
<li>
<h3><span class="co-no">1</span>Client to Edge</h3>
<p class="hop">merchant-server → edge-gw · sync · budget 60 ms</p>
<p>The merchant server calls <code>POST /v3/authorizations</code> over TLS 1.3 with an <code>Idempotency-Key</code> header. Edge terminates TLS, tokenizes the card fields, enforces the 2 MB body cap and a 300 req/s per-key rate limit, and answers <code>409 idempotency_conflict</code> if a key is reused with a different body, before anything downstream runs.</p>
</li>
<li>
<h3><span class="co-no">2</span>Edge to Auth API</h3>
<p class="hop">edge-gw → auth-api · sync · budget 15 ms</p>
<p>Inside the VPC the hop is mTLS with workload identities. Edge forwards the tokenized body in a signed envelope carrying the key id, arrival time and client IP; Auth API rejects an envelope older than 5 s. Schema validation and token resolution happen here.</p>
</li>
<li>
<h3><span class="co-no">3</span>Auth API to Risk engine</h3>
<p class="hop">auth-api → risk-scorer · sync · budget 120 ms</p>
<p>A synchronous score call with a hard 120 ms deadline. Below €500 a timeout is fail-open: the authorization continues with a provisional score of 0.5 and a <code>review</code> flag. At or above €500 it is fail-closed and the request is declined with <code>risk_unavailable</code>.</p>
</li>
<li>
<h3><span class="co-no">4</span>Auth API to Ledger</h3>
<p class="hop">auth-api → ledger-core · sync · budget 40 ms</p>
<p>Before any PSP call, Auth API writes a pending hold: double-entry, amount and currency, 7-day expiry. If the write fails the request is declined and no PSP is contacted, so money is never moved without a record. This ordering is the main change in v3.</p>
</li>
<li>
<h3><span class="co-no">5</span>Auth API to PSP connectors</h3>
<p class="hop">auth-api → conn-north | conn-south · sync · budget 550 ms</p>
<p>The router picks connector A or B by BIN range and currency. A 5xx or a 550 ms timeout on the primary triggers one retry on the secondary for dual-routed BINs. Connectors are the only services with egress to PSP networks: allow-listed destination IPs, TLS 1.2 or later, credentials from the vault at start-up.</p>
</li>
<li>
<h3><span class="co-no">6</span>Auth API to Webhooks</h3>
<p class="hop">auth-api → event bus → webhook-dispatch · async · budget 10 s</p>
<p>After the response is sent, Auth API publishes <code>authorization.approved</code> or <code>authorization.declined</code> to the event bus with at-least-once delivery. The dispatcher signs each delivery with the merchant's HMAC secret and retries with exponential backoff for up to 24 hours. The outcome is also readable at <code>GET /v3/authorizations/{id}</code>.</p>
</li>
</ol>
</section>
<section id="latency" aria-labelledby="h-latency">
<h2 id="h-latency">Latency budget</h2>
<div class="tbl lat">
<table>
<caption>Latency per hop, milliseconds.</caption>
<thead>
<tr>
<th scope="col">Hop</th>
<th scope="col">Path</th>
<th scope="col">Mode</th>
<th scope="col" class="num">p50</th>
<th scope="col" class="num">p95</th>
<th scope="col" class="num">Budget</th>
<th scope="col" class="num">Share</th>
</tr>
</thead>
<tbody>
<tr><th scope="row"><span class="hop-id">1</span></th><td><code>merchant-server → edge-gw</code></td><td class="mode">sync</td><td class="num">18</td><td class="num">42</td><td class="num">60</td><td class="num">7.5%</td></tr>
<tr><th scope="row"><span class="hop-id">2</span></th><td><code>edge-gw → auth-api</code></td><td class="mode">sync</td><td class="num">4</td><td class="num">9</td><td class="num">15</td><td class="num">1.9%</td></tr>
<tr><th scope="row"><span class="hop-id">3</span></th><td><code>auth-api → risk-scorer</code></td><td class="mode">sync</td><td class="num">38</td><td class="num">96</td><td class="num">120</td><td class="num">15.0%</td></tr>
<tr><th scope="row"><span class="hop-id">4</span></th><td><code>auth-api → ledger-core</code></td><td class="mode">sync</td><td class="num">12</td><td class="num">31</td><td class="num">40</td><td class="num">5.0%</td></tr>
<tr><th scope="row"><span class="hop-id">5</span></th><td><code>auth-api → connector → PSP</code></td><td class="mode">sync</td><td class="num">210</td><td class="num">480</td><td class="num">550</td><td class="num">68.8%</td></tr>
<tr><th scope="row"><span class="hop-id">6</span></th><td><code>auth-api → bus → webhook-dispatch → merchant</code></td><td class="mode">async</td><td class="num">900</td><td class="num">3,400</td><td class="num">10,000</td><td class="num">off path</td></tr>
</tbody>
<tfoot>
<tr><th scope="row" colspan="3">Synchronous path, end to end</th><td class="num">282</td><td class="num">612</td><td class="num">800</td><td class="num">100%</td></tr>
</tfoot>
</table>
</div>
<p class="tbl-note">p50 and p95 are measured over the 30 days to 2026-09-15 from the tracing sample (1 in 50 requests, eu-central-1); budget is the p95 target each hop owns. The per-hop budgets add to 785 ms; the remaining 15 ms (1.9%) is headroom for Auth API's own work. Per-hop p95 values do not add: the end-to-end p95 in the footer row is measured, not summed. Hop 6 is off the response path and its budget is time to first successful delivery.</p>
<p class="scroll-hint mono-label">Scroll sideways to see the full bar</p>
<figure class="fig-budget">
<div class="fig-scroll">
<svg class="bb" viewBox="0 0 800 96" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Where the 800 millisecond end-to-end budget goes: hop 5, the PSP round trip, owns 550 milliseconds or 69 percent; the risk call owns 120; Edge 60; the ledger hold 40; the internal hop 15; 15 milliseconds are headroom. The measured end-to-end p95 of 612 milliseconds sits inside the budget.">
<title>Figure 2. Allocation of the 800 ms end-to-end p95 budget</title>
<g aria-hidden="true">
<rect class="seg" x="0.5" y="32.5" width="60" height="24"/>
<rect class="seg" x="60.5" y="32.5" width="15" height="24"/>
<rect class="seg" x="75.5" y="32.5" width="120" height="24"/>
<rect class="seg" x="195.5" y="32.5" width="40" height="24"/>
<rect class="seg" x="235.5" y="32.5" width="550" height="24"/>
<rect class="seg seg-head" x="785.5" y="32.5" width="14" height="24"/>
<text x="30" y="49">60</text>
<text x="135" y="49">120</text>
<text x="215" y="49">40</text>
<text x="510" y="49">550 · PSP round trip</text>
<g class="co"><line x1="30" y1="24" x2="30" y2="32"/><circle cx="30" cy="14" r="9"/><text x="30" y="14" dy=".35em">1</text></g>
<g class="co"><line x1="67" y1="24" x2="67" y2="32"/><circle cx="67" cy="14" r="9"/><text x="67" y="14" dy=".35em">2</text></g>
<g class="co"><line x1="135" y1="24" x2="135" y2="32"/><circle cx="135" cy="14" r="9"/><text x="135" y="14" dy=".35em">3</text></g>
<g class="co"><line x1="215" y1="24" x2="215" y2="32"/><circle cx="215" cy="14" r="9"/><text x="215" y="14" dy=".35em">4</text></g>
<g class="co"><line x1="510" y1="24" x2="510" y2="32"/><circle cx="510" cy="14" r="9"/><text x="510" y="14" dy=".35em">5</text></g>
<line class="ax" x1="0.5" y1="57" x2="0.5" y2="63"/>
<line class="ax" x1="200" y1="57" x2="200" y2="63"/>
<line class="ax" x1="400" y1="57" x2="400" y2="63"/>
<line class="ax" x1="600" y1="57" x2="600" y2="63"/>
<line class="ax" x1="799.5" y1="57" x2="799.5" y2="63"/>
<text class="ax-t" x="2" y="76" style="text-anchor:start">0</text>
<text class="ax-t" x="200" y="76">200</text>
<text class="ax-t" x="400" y="76">400</text>
<text class="ax-t" x="600" y="76">600</text>
<text class="ax-t" x="798" y="76" style="text-anchor:end">800 ms</text>
<line class="meas" x1="612" y1="28" x2="612" y2="64"/>
<text class="meas-t" x="612" y="92">measured p95 · 612 ms</text>
</g>
</svg>
</div>
<figcaption><span class="fig-no">FIG. 2</span>Where the 800 ms budget goes. Segments are the per-hop budgets from the table; the red line is the measured end-to-end p95. The PSP round trip owns 69% of the budget, so latency work that does not touch hop 5 cannot move the total by much.</figcaption>
</figure>
</section>
<section id="failure" aria-labelledby="h-failure">
<h2 id="h-failure">Failure modes</h2>
<div class="tbl">
<table class="stack">
<caption>Failure modes on the path, what the merchant sees, and the designed response. Error codes are the public API codes.</caption>
<thead>
<tr>
<th scope="col">What fails</th>
<th scope="col">What the merchant sees</th>
<th scope="col">What we do</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Risk engine slow or down (hop 3)</th>
<td data-label="What the merchant sees">Under €500: the authorization proceeds and carries a <code>review</code> flag. €500 and above: <code>402 risk_unavailable</code>, safe to retry.</td>
<td data-label="What we do">Fail-open below the threshold, fail-closed above it. On-call is paged when the timeout rate exceeds 2% over 5 minutes.</td>
</tr>
<tr>
<th scope="row">Ledger hold write fails (hop 4)</th>
<td data-label="What the merchant sees"><code>503 ledger_unavailable</code>. No money has moved.</td>
<td data-label="What we do">Decline before the PSP call. A retry with the same idempotency key is safe; there is nothing to reverse.</td>
</tr>
<tr>
<th scope="row">Primary connector returns 5xx or exceeds 550 ms (hop 5)</th>
<td data-label="What the merchant sees">Usually nothing: the request is retried once on the secondary connector. Single-routed BINs get <code>503 psp_unavailable</code>.</td>
<td data-label="What we do">The circuit breaker opens after 20 failures in 30 s and sends all dual-routed traffic to the secondary until a probe succeeds.</td>
</tr>
<tr>
<th scope="row">PSP approves, Auth API fails before responding</th>
<td data-label="What the merchant sees">A timeout. A retry with the same idempotency key returns the stored outcome.</td>
<td data-label="What we do">The reconciler scans held-but-unanswered authorizations every 60 s and completes them or reverses the hold at the PSP within 5 minutes.</td>
</tr>
<tr>
<th scope="row">Merchant webhook endpoint unreachable (hop 6)</th>
<td data-label="What the merchant sees">No event arrives. The authorization is complete and readable through the API.</td>
<td data-label="What we do">Exponential backoff from 30 s to 6 h, for up to 24 h in total. After that the event is parked and listed under failed deliveries in the dashboard.</td>
</tr>
<tr>
<th scope="row">Idempotency key reused with a different body (hop 1)</th>
<td data-label="What the merchant sees"><code>409 idempotency_conflict</code> from Edge.</td>
<td data-label="What we do">Nothing downstream runs. Keys and their body hashes are kept for 24 h in the Edge key store.</td>
</tr>
</tbody>
</table>
</div>
</section>
<section id="changes" aria-labelledby="h-changes">
<h2 id="h-changes">Change log</h2>
<div class="tbl">
<table class="stack">
<caption>Revisions of this drawing. Earlier revisions are in the architecture repository under the same drawing number.</caption>
<thead>
<tr>
<th scope="col">Version</th>
<th scope="col">Date</th>
<th scope="col">Change</th>
<th scope="col">Author</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">v3.0</th>
<td data-label="Date" class="nowrap">2026-09-18</td>
<td data-label="Change">Ledger hold moved before the PSP call (previously written after the PSP response). Second PSP connector added with BIN-based routing and one cross-connector retry. Webhook delivery moved out of Auth API to the event bus and a dedicated dispatcher.</td>
<td data-label="Author" class="nowrap">T. Reinholt</td>
</tr>
<tr>
<th scope="row">v2.4</th>
<td data-label="Date" class="nowrap">2026-05-06</td>
<td data-label="Change">Risk budget reduced from 200 ms to 120 ms after the p95 review. Fail-closed threshold set at €500.</td>
<td data-label="Author" class="nowrap">M. Lindqvist</td>
</tr>
<tr>
<th scope="row">v2.3</th>
<td data-label="Date" class="nowrap">2026-02-11</td>
<td data-label="Change">Idempotency key check moved from Auth API to Edge. 2 MB body cap and per-key rate limit introduced.</td>
<td data-label="Author" class="nowrap">P. Venkataraman</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
<footer class="foot">
<p>LS-ARCH-0031 · Rev v3.0 · Supersedes v2.4 <span class="nowrap">(2026-05-06)</span></p>
<p>Source of truth: payments-platform/architecture · drawings/LS-ARCH-0031.md</p>
<p>Next review 2026-12-18 · Maintainer T. Reinholt</p>
</footer>
</div>
</body>
</html>
A diagram that reads like an engineering drawing, not a whiteboard photo. The SVG is real markup, so a reviewer can pin a comment on the exact box, and the callouts, latency budget, and failure modes sit beside it instead of in a separate doc.
The sample is Lodestar, a fictional payments company, documenting its authorization path. The structure fits any request path or data flow.
Title block, inline SVG diagram with numbered callouts, callout list, latency budget table, failure modes table, and change log. Inline CSS and SVG, no scripts.
More templates
A consulting proposal in one HTML page – situation, recommendation, three priced options with one recommended, scope, timeline, team, terms, and an approval block. Duplicate it, or hand the prompt to your agent.
A one-page PRD in HTML – problem, goals, non-goals, a requirements table with IDs and status, a flow diagram, rollout plan, open questions, and a decision log. Duplicate it, or hand the prompt to your agent.
Any agent, any model. Behind your company’s sign-in, at one flat price.
Free to start · Unlimited viewers