@openinsure/carrier package is the carrier integration layer. It handles appetite evaluation, concurrent multi-carrier submission routing, best-quote selection, and bordereaux SFTP export. It ships with a built-in database of 6 pre-configured carriers.
Carrier Profiles
Every carrier is described by aCarrierProfile:
Built-in Carrier Database
Six carriers are pre-configured inCARRIER_DB:
| Carrier | Type | AM Best | Key LOBs | Max Limit |
|---|---|---|---|---|
| Lloyd’s Syndicate 2623 | Surplus-lines | A | Cyber, Prof Liability, D&O, Crime | $50M |
| Travelers Commercial | Admitted (all US) | A++ | GL, Property, Auto, WC, Umbrella | $25M |
| Beazley Specialty | Surplus-lines | A | Cyber, Prof Liability, Crime, EPL, D&O | $25M |
| Zurich North America | Admitted (most US) | A+ | GL, WC, Auto, Prof Liability, D&O | $50M |
| Markel Specialty | Surplus-lines | A | GL, Prof Liability, D&O, Crime, Excess, Marine | $100M |
| Hiscox USA | Surplus-lines | A | Prof Liability, Cyber, D&O, EPL, Crime | $10M |
Note: The built-in carrier database is a starting point for development and demo environments. Production MGA deployments will configure their own carrier panel via the Admin portal → Programs → Carrier Assignments.
Appetite Checking
checkCarrierAppetite(carrier, input)
Evaluates whether a carrier will write a given risk:
- 60% weight: AM Best rating tier (A++ = 100, A+ = 95, A = 90, A- = 85, B++ = 75, …)
- 40% weight: Limit headroom (requestedLimit / maxLimitPerRisk, capped at 1.0)
- LOB is not in
carrier.appetite - State is not in
carrier.admittedStates(and carrier is admitted-type) requestedLimit>carrier.maxLimitPerRiskpremium<carrier.minPremium
rankCarriers(carriers, input)
Filters eligible carriers and sorts by appetite score descending:
findCarrier(idOrNaic)
Lookup a carrier by internal ID or NAIC code:
Multi-Carrier Gateway
TheCarrierGateway routes submissions to one or more carriers concurrently and selects the best quote.
Single Carrier Submission
Multi-Carrier Submission
Submit to multiple carriers concurrently withPromise.allSettled — one carrier timeout or error does not block the others:
Auto-Eligible Routing
Submit to all carriers that pass appetite checking automatically:Response Status Values
| Status | Description |
|---|---|
pending | Submission received, awaiting underwriter review |
quoted | Premium quoted — quotedPremium is populated |
declined | Declined — declineReason is populated |
referred | Referred to senior underwriter |
error | Carrier API error or timeout |
Bordereaux SFTP Export
generateBordereauxCSV(records)
Generates a pipe-delimited CSV for bordereaux submission to carriers or reinsurers:
PolicyNumber | InsuredName | EffectiveDate | ExpirationDate | GrossPremium | CommissionAmount | NetPremium | State | LOB | TransactionType
transmitBordereauxSftp(csvContent, fileName, config)
Transmits a bordereaux CSV to a carrier’s SFTP endpoint:
Note:
The SFTP implementation in packages/carrier/src/sftp.ts is a mock that simulates an 800ms
upload. Production SFTP transmission uses Cloudflare Workers TCP Sockets or a dedicated Fly.io
SFTP microservice — the interface is identical.