@openinsure/coi package generates ACORD-compliant Certificates of Insurance (COIs). It produces print-ready HTML that is converted to PDF by @openinsure/documents, with built-in XSS sanitization and unique certificate numbering.
Certificate Format
OpenInsure generates ACORD 25 (2016/03) format certificates — the industry-standard evidence of property and casualty insurance. The generated HTML matches the ACORD 25 layout exactly:- Producer information block (name, address, phone, email)
- Insured information block
- Coverage table with carrier, policy number, effective/expiration dates, and limits
- Certificate holder block (named insured/mortgagee/loss payee)
- Additional insured endorsement checkbox
- Subrogation waiver checkbox
- Special provisions / description of operations
- ACORD disclaimer notice
API
buildCOIHTML(data: COIData): string
Generates the complete ACORD 25 HTML from structured coverage data.
generateCertificateNumber(orgId: string): string
Creates a unique, sortable certificate number from the org’s NAIC prefix:
validateCOIRequest(input: unknown): COIRequest
Validates a raw COI request payload with Zod, throwing a structured error if required fields are missing or malformed.
batchIssueCOIs(requests: COIRequest[], policy: Policy): Promise<COIResult[]>
Issues multiple certificates concurrently — useful for projects requiring COIs for multiple holders (e.g., a general contractor needing certs for each subcontractor).
Types
COIRequest
COICoverage
COILimit
Money objects ({ cents, currency }). The buildCOIHTML() function uses toDollars() internally to format amounts as currency strings in the rendered certificate.
Security
All user-supplied strings (insured name, special provisions, etc.) pass throughescapeHtml() before insertion into the HTML template:
COI Requests in the API
Certificates are requested through the API and stored in thecoi database table:
BUCKET binding on oi-sys-api) and returned as a signed download URL valid for 1 hour.
Portal Integration
COIs can be requested from three surfaces:- Policyholder Portal —
/certificatespage, self-service with standard holder template - Producer Portal —
/coipage, full holder customization and batch issuance - Underwriting Workbench — policy jacket → Coverages section → “Issue COI” button
Caution: COIs are evidence of insurance, not the policy itself. They do not expand, modify, or alter the coverage afforded by the referenced policies. Verify policy terms before issuing certificates with special provisions.