API
Travel insurance API
A public service that quotes, books, takes payment for and issues international and domestic travel insurance policies.
- Role
- Sole developer
- When
- Jul – Aug 2026
- Stack
- TypeScript, Node.js 22, Express, AWS Lambda, Firestore, AWS SES, OpenAPI 3, Redoc
Overview
Travel insurance used to be a module inside the PHP monolith. I rebuilt it as a standalone service that anyone can buy from without an agency login: get a quote, create a booking, pay, and receive the policy by email.
The hard part is the gap between payment and issuance. A customer can pay and the underwriter can still reject, time out or issue twice. The service is built around making each of those outcomes recoverable.
Engineering notes
A stand-in for the underwriter
I wrote a local stub of the underwriter and the payment provider. A control endpoint switches it between success, failure and duplicate issuance, so the failure paths can be exercised on a laptop instead of waiting for them in production.
Tests on the money paths
The test suite covers issuance, payment-before-issue, the payment callback, reconciliation, the stuck queue and rate limiting. Signature and underwriting checks run with no network at all.
Docs that cannot drift
The deployed service ships only its build output, so the spec is copied into the build and served from there. The same file drives the hosted reference, Postman imports and the lint step.