{"components":{"schemas":{"Error":{"properties":{"details":{"type":"object"},"error":{"type":"string"}},"type":"object"},"Plan":{"properties":{"coverage_highlights":{"items":{"type":"string"},"type":"array"},"description":{"type":"string"},"id":{"example":"standard","type":"string"},"name":{"example":"Standard Travel Protection","type":"string"},"rate_percent":{"example":7.0,"type":"number"}},"type":"object"},"Quote":{"properties":{"cfar_available":{"type":"boolean"},"cfar_premium":{"nullable":true,"type":"string"},"checkout_url":{"format":"uri","type":"string"},"departure_date":{"format":"date","type":"string"},"destination":{"type":"string"},"expires_at":{"format":"date-time","type":"string"},"id":{"type":"string"},"quote_number":{"type":"string"},"return_date":{"format":"date","type":"string"},"standard_premium":{"type":"string"},"trip_cost":{"type":"string"}},"type":"object"},"QuoteRequest":{"properties":{"customer_state":{"description":"US state (2-letter code)","type":"string"},"departure_date":{"format":"date","type":"string"},"destination":{"type":"string"},"return_date":{"format":"date","type":"string"},"trip_cost":{"description":"Total trip cost in USD","minimum":1,"type":"number"}},"required":["trip_cost","departure_date","return_date","destination","customer_state"],"type":"object"}}},"info":{"contact":{"email":"support@travelprotection.insure","name":"Travel Protection Support","url":"https://staging.travelprotection.insure/contact"},"description":"Public API for getting travel insurance quotes and purchasing policies programmatically. No authentication required. Designed for AI agents and travel booking platforms. Available to US-based callers only.","title":"Travel Protection Insurance API","version":"1.0.0"},"openapi":"3.1.0","paths":{"/plans":{"get":{"operationId":"listPlans","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"plans":{"items":{"$ref":"#/components/schemas/Plan"},"type":"array"}},"type":"object"}}},"description":"List of plans"}},"summary":"List available insurance plans"}},"/plans/{plan_id}/coverage-details":{"get":{"description":"Returns structured coverage data including covered reasons, limits, state restrictions, and eligibility rules.","operationId":"getPlanCoverage","parameters":[{"in":"path","name":"plan_id","required":true,"schema":{"enum":["standard","cfar"],"type":"string"}}],"responses":{"200":{"description":"Coverage details"},"404":{"description":"Plan not found"}},"summary":"Get detailed coverage information for a plan"}},"/policies/{id}":{"get":{"description":"Retrieve details of a purchased insurance policy including status and certificate number.","operationId":"getPolicy","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"activated_at":{"format":"date-time","nullable":true,"type":"string"},"certificate_number":{"nullable":true,"type":"string"},"coverage_amount":{"type":"string"},"customer_email":{"type":"string"},"customer_name":{"type":"string"},"departure_date":{"format":"date","type":"string"},"failure_at":{"description":"ISO 8601 timestamp of issuance failure. Omitted on healthy policies.","format":"date-time","type":"string"},"failure_reason":{"description":"Reason code if policy issuance failed. One of: provider_unavailable, invalid_customer_details, coverage_unavailable, unknown. Omitted on healthy policies.","enum":["provider_unavailable","invalid_customer_details","coverage_unavailable","unknown"],"type":"string"},"id":{"format":"uuid","type":"string"},"payment_status":{"type":"string"},"policy_number":{"type":"string"},"premium_amount":{"type":"string"},"return_date":{"format":"date","type":"string"},"status":{"type":"string"}},"type":"object"}}},"description":"Policy details"},"404":{"description":"Policy not found"}},"summary":"Get policy details"}},"/quotes":{"post":{"operationId":"createQuote","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Quote"}}},"description":"Quote created"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Validation error"}},"summary":"Create a quote"}},"/quotes/{quote_id}":{"get":{"operationId":"getQuote","parameters":[{"in":"path","name":"quote_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Quote"}}},"description":"Quote details"},"404":{"description":"Quote not found"}},"summary":"Get quote details"}},"/quotes/{quote_id}/purchase":{"post":{"description":"Prepares a quote for payment and returns a Stripe checkout URL. The AI agent should redirect the user to this URL to complete payment.","operationId":"purchaseQuote","parameters":[{"in":"path","name":"quote_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"coverage_type":{"enum":["standard","cfar"],"type":"string"},"customer_address":{"description":"Required for SPT flow. Street address.","type":"string"},"customer_address_2":{"description":"Optional. Apartment, suite, unit, building, floor, etc.","type":"string"},"customer_city":{"description":"Required for SPT flow.","type":"string"},"customer_country":{"description":"Defaults to US.","type":"string"},"customer_email":{"format":"email","type":"string"},"customer_first_name":{"type":"string"},"customer_last_name":{"type":"string"},"customer_phone":{"type":"string"},"customer_state":{"description":"Required for SPT flow and for CFAR coverage. 2-letter state code.","type":"string"},"customer_zip":{"description":"Required for SPT flow. Postal code.","type":"string"},"destination_address":{"description":"Optional. Street address where the traveler is staying.","type":"string"},"destination_address_2":{"description":"Optional. Second line of the destination address.","type":"string"},"destination_city":{"description":"Optional. City where the traveler is staying.","type":"string"},"destination_country":{"description":"Optional. Two-letter country code of the destination.","type":"string"},"destination_state":{"description":"Optional. State or province code where the traveler is staying; needed before payment for US and Canadian destinations.","type":"string"},"destination_zip":{"description":"Optional. Postal code where the traveler is staying.","type":"string"},"initial_payment_date":{"description":"Needed before payment for every plan, and sent to the carrier as the trip booked date. The date the customer made their initial trip payment/deposit (YYYY-MM-DD). CFAR must be purchased within 14 days of this date, is only available to US residents, and is not available in all states.","format":"date","type":"string"},"shared_payment_token":{"description":"Stripe Shared Payment Token for inline agent checkout. If provided, payment is processed immediately (returns 202 with pending policy). If omitted, a checkout URL is returned (200). SPT purchases must include every checkout detail (customer_phone, customer_address, customer_city, customer_state, customer_zip, destination_address, destination_city, destination_country, destination_state for US and CA destinations, and initial_payment_date) or the request is refused with 422 and a missing_details list before any payment is attempted — policy activation would fail without them.","type":"string"}},"required":["coverage_type","customer_email","customer_first_name","customer_last_name"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"checkout_url":{"format":"uri","type":"string"},"coverage_type":{"type":"string"},"instructions":{"type":"string"},"premium":{"type":"string"},"quote_id":{"format":"uuid","type":"string"}},"type":"object"}}},"description":"Checkout session created"},"202":{"content":{"application/json":{"schema":{"properties":{"message":{"type":"string"},"policy_id":{"format":"uuid","type":"string"},"status":{"example":"pending","type":"string"}},"type":"object"}}},"description":"Payment authorized and policy issuance in progress (SPT flow), or a purchase for this quote already exists (idempotent retry)"},"404":{"description":"Quote not found"},"409":{"description":"Quote can no longer be purchased: already converted, a previous purchase attempt was cancelled, or a conflicting purchase attempt exists. Create a new quote."},"410":{"description":"Quote expired"},"422":{"description":"Validation error (including CFAR ineligibility, or missing checkout details on an SPT purchase; the response then carries a missing_details list)"}},"summary":"Initiate purchase for a quote"}}},"servers":[{"description":"Production","url":"https://staging.travelprotection.insure/api/v1"}]}