{"openapi":"3.1.0","info":{"title":"ExpeditionInsure ACP (Agentic Commerce Protocol)","version":"2026-01-16","description":"Structured checkout sessions for AI agents purchasing expedition travel insurance.\n\nACP enables ChatGPT Instant Checkout and other ACP-compatible agents to browse plans, create checkout sessions, and complete purchases using Stripe Shared Payment Tokens (SPT).\n\n## Protocol\n\nAll mutation endpoints require the `API-Version` header (minimum: `2026-01-16`).\nPOST /checkout_sessions accepts an `Idempotency-Key` header for safe retries.\n\n## Flow\n\n1. **Create session** — POST /checkout_sessions with trip details\n2. **Review** — GET /checkout_sessions/:id to inspect line items and totals\n3. **Update** (optional) — POST /checkout_sessions/:id to change plan or buyer\n4. **Complete** — POST /checkout_sessions/:id/complete with SPT\n5. **Cancel** (optional) — POST /checkout_sessions/:id/cancel\n\nSessions expire after 1 hour. Insurance premiums are tax-exempt (tax is always 0)."},"servers":[{"url":"https://mcp.expedition.insure"}],"paths":{"/acp/v1/checkout_sessions":{"post":{"operationId":"createCheckoutSession","summary":"Create a checkout session","description":"Create a new ACP checkout session with trip details and get premium estimates.","parameters":[{"name":"API-Version","in":"header","required":true,"schema":{"type":"string","example":"2026-01-16"}},{"name":"Idempotency-Key","in":"header","description":"Unique key for safe retries","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSessionRequest"}}}},"responses":{"201":{"description":"Session created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSession"}}}},"400":{"description":"Invalid request or missing API-Version","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcpError"}}}}}}},"/acp/v1/checkout_sessions/{sessionId}":{"get":{"operationId":"getCheckoutSession","summary":"Get checkout session","description":"Retrieve the current state of a checkout session.","parameters":[{"name":"sessionId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Session state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSession"}}}},"404":{"description":"Session not found"},"410":{"description":"Session expired"}}},"post":{"operationId":"updateCheckoutSession","summary":"Update checkout session","description":"Update a session's plan selection or buyer information.","parameters":[{"name":"sessionId","in":"path","required":true,"schema":{"type":"string"}},{"name":"API-Version","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSessionRequest"}}}},"responses":{"200":{"description":"Session updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSession"}}}},"404":{"description":"Session not found"},"410":{"description":"Session expired"}}}},"/acp/v1/checkout_sessions/{sessionId}/complete":{"post":{"operationId":"completeCheckoutSession","summary":"Complete checkout with payment","description":"Complete the checkout session by providing a Stripe Shared Payment Token (SPT). Creates a PaymentIntent, records the payment, and returns the order.","parameters":[{"name":"sessionId","in":"path","required":true,"schema":{"type":"string"}},{"name":"API-Version","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteRequest"}}}},"responses":{"200":{"description":"Payment succeeded, order created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSession"}}}},"402":{"description":"Payment failed"},"409":{"description":"Session in invalid state"},"410":{"description":"Session expired"}}}},"/acp/v1/checkout_sessions/{sessionId}/cancel":{"post":{"operationId":"cancelCheckoutSession","summary":"Cancel checkout session","description":"Cancel a checkout session. Cannot cancel completed sessions.","parameters":[{"name":"sessionId","in":"path","required":true,"schema":{"type":"string"}},{"name":"API-Version","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Session canceled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSession"}}}},"409":{"description":"Cannot cancel completed session"}}}}},"components":{"schemas":{"CreateSessionRequest":{"type":"object","properties":{"trip_context":{"type":"object","required":["destination","startDate","durationDays","tripCost","travelers","travelerAges","residence"],"properties":{"destination":{"type":"string","description":"e.g. 'Antarctica', 'Arctic', 'African Safari'"},"startDate":{"type":"string","format":"date","description":"ISO date"},"durationDays":{"type":"integer"},"tripCost":{"type":"number","description":"Total cost in USD for all travelers"},"travelers":{"type":"integer"},"travelerAges":{"type":"array","items":{"type":"integer"}},"residence":{"type":"string","description":"Country code (e.g. 'US')"},"state":{"type":"string","description":"US state code if US resident"}}},"items":{"type":"array","description":"Optional: specific plan to quote","items":{"type":"object","properties":{"id":{"type":"string","description":"Plan ID from list_products"},"quantity":{"type":"integer","default":1}},"required":["id"]}},"buyer":{"type":"object","properties":{"email":{"type":"string","format":"email"},"name":{"type":"string"}}}}},"UpdateSessionRequest":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"quantity":{"type":"integer"}},"required":["id"]}},"buyer":{"type":"object","properties":{"email":{"type":"string","format":"email"},"name":{"type":"string"}}}}},"CompleteRequest":{"type":"object","required":["payment_data"],"properties":{"payment_data":{"type":"object","required":["instrument"],"properties":{"instrument":{"type":"object","required":["type","credential"],"properties":{"type":{"type":"string","const":"stripe_payment_token"},"credential":{"type":"object","required":["type","token"],"properties":{"type":{"type":"string","const":"stripe_token"},"token":{"type":"string","description":"Stripe SPT token"}}}}}}}}},"CheckoutSession":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["not_ready_for_payment","ready_for_payment","completed","canceled"]},"line_items":{"type":"array","items":{"$ref":"#/components/schemas/LineItem"}},"totals":{"$ref":"#/components/schemas/Totals"},"buyer":{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"}}},"fulfillment_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"description":{"type":"string"}}}},"payment_methods":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"brands":{"type":"array","items":{"type":"string"}}}}},"merchant":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string","format":"uri"}}},"order":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"permalink":{"type":"string","format":"uri"}}},"metadata":{"type":"object","properties":{"quote_id":{"type":"string"},"session_id":{"type":"string"},"trip_context":{"type":"object"}}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"expires_at":{"type":"string","format":"date-time"}}},"LineItem":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"quantity":{"type":"integer"},"unit_amount":{"type":"integer","description":"Amount in cents"},"currency":{"type":"string"}}},"Totals":{"type":"object","properties":{"subtotal":{"type":"integer","description":"Amount in cents"},"tax":{"type":"integer","description":"Always 0 (insurance is tax-exempt)"},"shipping":{"type":"integer","description":"Always 0 (digital)"},"total":{"type":"integer","description":"Amount in cents"},"currency":{"type":"string"}}},"AcpError":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"supported_versions":{"type":"array","items":{"type":"string"}}},"required":["type","message"]}}}}}}