Integrations
Stripe, settlement import, inbound connection webhooks, SMTP, timed expiry, and the MCP endpoint.
Payments
Two adapters live in features/integrations/payment: manual and stripe. See Payment providers for setup.
POST /api/payments/webhooks/[providerKey]verifies the Stripe signature, stores aWebhookEvent, and appliescheckout.session.completedon the same request. A failure is recorded on the event and answered with 500 so Stripe redelivers. Events for other sites' sessions on a shared Stripe account are acknowledged and ignored. The secret is read from an env variable namedAIRLINE_WEBHOOK_SECRET_<NAME>, set in the provider'swebhookSecretEnvconfiguration. Without it the route answers 200 and ignores the delivery, and the app's one-minute Checkout reconcile records the payment instead.POST /api/integrations/settlements/[connectionKey]accepts settlement evidence from an outside ledger with a machine credential (audiencesettlement-import, scopesettlements:write).
Connection webhooks
POST /api/integrations/webhooks/[connectionKey] verifies an x-openfront-signature for an active ProviderConnection, using the AIRLINE_WEBHOOK_SECRET_<NAME> named in its webhookSecretEnv configuration. No event handler is installed yet, so a verified event is refused with 501 and nothing is accepted.
WebhookEndpoint records (url, eventTypes, status, secret) are edited at /dashboard/webhook-endpoints. URLs must be HTTPS and their host listed in OUTBOUND_WEBHOOK_HOSTS; the app does not deliver events to them.
SMTP (SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASSWORD, SMTP_FROM) sends password resets and booking access recovery. Without SMTP_HOST and SMTP_FROM, the recovery form is hidden and recoverCustomerBookingAccess answers "Access codes can't be emailed right now. Contact the airline." Recovery is limited to 5 requests per client per hour.
Timed expiry
There is no worker. An unpaid storefront booking past its 24-hour payment window is expired by the next request that touches it. On the Bookings desk, Refresh in the Held offers section (refreshAirlineClocks) releases expired holds and cancels unpaid bookings past their deadline.
Each web process starts a one-minute Stripe Checkout reconcile (instrumentation.ts) that records paid Checkout sessions whose traveler closed the tab.
GET /api/health returns { status: "ok" }, or 503 when the database is unreachable or the process is draining (DRAIN_FILE).
AI assistant and MCP
The dashboard chat at /api/completion uses OpenRouter (OPENROUTER_API_KEY, OPENROUTER_MODEL, OPENROUTER_MAX_TOKENS). /api/mcp-transport exposes listModels, queryData, searchModels, getFieldsForType, lookupInputType, createData, updateData, deleteData, and modelSpecificSearch, run as the signed-in user. In production it returns 404 unless AI_ASSISTANT_ENABLED=true.
Machine credentials
issueMachineCredential(name, audience, scopes, expiresAt) returns a token once. Only a hash and a preview are stored. machineCredentialSummaries lists them; revokeMachineCredential(credentialId) revokes.