Lodestar
Payments infrastructure · Architecture reference
LS-ARCH-0031 · Sheet 1 of 1
Drawing
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.
LS-ARCH-0031POST /v3/authorizations in eu-central-1: 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.LS-ARCH-0029), the 3-D Secure challenge flow (LS-ARCH-0032), settlement files, and the regional failover between eu-central-1 and eu-west-1. Internal retries inside a single service are omitted.Scroll sideways to see the full drawing
merchant-server → edge-gw · sync · budget 60 ms
The merchant server calls POST /v3/authorizations over TLS 1.3 with an Idempotency-Key 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 409 idempotency_conflict if a key is reused with a different body, before anything downstream runs.
edge-gw → auth-api · sync · budget 15 ms
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.
auth-api → risk-scorer · sync · budget 120 ms
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 review flag. At or above €500 it is fail-closed and the request is declined with risk_unavailable.
auth-api → ledger-core · sync · budget 40 ms
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.
auth-api → conn-north | conn-south · sync · budget 550 ms
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.
auth-api → event bus → webhook-dispatch · async · budget 10 s
After the response is sent, Auth API publishes authorization.approved or authorization.declined 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 GET /v3/authorizations/{id}.
| Hop | Path | Mode | p50 | p95 | Budget | Share |
|---|---|---|---|---|---|---|
| 1 | merchant-server → edge-gw | sync | 18 | 42 | 60 | 7.5% |
| 2 | edge-gw → auth-api | sync | 4 | 9 | 15 | 1.9% |
| 3 | auth-api → risk-scorer | sync | 38 | 96 | 120 | 15.0% |
| 4 | auth-api → ledger-core | sync | 12 | 31 | 40 | 5.0% |
| 5 | auth-api → connector → PSP | sync | 210 | 480 | 550 | 68.8% |
| 6 | auth-api → bus → webhook-dispatch → merchant | async | 900 | 3,400 | 10,000 | off path |
| Synchronous path, end to end | 282 | 612 | 800 | 100% | ||
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.
Scroll sideways to see the full bar
| What fails | What the merchant sees | What we do |
|---|---|---|
| Risk engine slow or down (hop 3) | Under €500: the authorization proceeds and carries a review flag. €500 and above: 402 risk_unavailable, safe to retry. |
Fail-open below the threshold, fail-closed above it. On-call is paged when the timeout rate exceeds 2% over 5 minutes. |
| Ledger hold write fails (hop 4) | 503 ledger_unavailable. No money has moved. |
Decline before the PSP call. A retry with the same idempotency key is safe; there is nothing to reverse. |
| Primary connector returns 5xx or exceeds 550 ms (hop 5) | Usually nothing: the request is retried once on the secondary connector. Single-routed BINs get 503 psp_unavailable. |
The circuit breaker opens after 20 failures in 30 s and sends all dual-routed traffic to the secondary until a probe succeeds. |
| PSP approves, Auth API fails before responding | A timeout. A retry with the same idempotency key returns the stored outcome. | The reconciler scans held-but-unanswered authorizations every 60 s and completes them or reverses the hold at the PSP within 5 minutes. |
| Merchant webhook endpoint unreachable (hop 6) | No event arrives. The authorization is complete and readable through the API. | 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. |
| Idempotency key reused with a different body (hop 1) | 409 idempotency_conflict from Edge. |
Nothing downstream runs. Keys and their body hashes are kept for 24 h in the Edge key store. |
| Version | Date | Change | Author |
|---|---|---|---|
| v3.0 | 2026-09-18 | 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. | T. Reinholt |
| v2.4 | 2026-05-06 | Risk budget reduced from 200 ms to 120 ms after the p95 review. Fail-closed threshold set at €500. | M. Lindqvist |
| v2.3 | 2026-02-11 | Idempotency key check moved from Auth API to Edge. 2 MB body cap and per-key rate limit introduced. | P. Venkataraman |