{
  "openapi": "3.1.0",
  "info": {
    "title": "Visa Benefits Companion showcase (fictional data)",
    "version": "3.0.0",
    "summary": "Read fictional card benefits and talk to the showcase concierge.",
    "description": "All data is fictional. Every cardholder, card, partner, venue, price and offer is invented for a showcase and is not a real Visa benefit. Nothing can be booked, reserved, held or paid. No authentication exists for any real person: sample_profile and profileId only select one of three fictional sample cards that any visitor may choose. Paths are relative to the origin this document was loaded from.\n\nAgent instructions: (1) Say the offers are fictional. (2) Never claim anything was booked or paid. (3) Eligibility covers only the sample card type; quote the party size, days, notice, age, payment and terms. (4) Never send card numbers, security codes or passwords.\n\nRead-only agent routes (/api/agent/*, /benefits) need no cookie. Session routes (/api/login, /api/chat, /api/clear, /api/bootstrap, /api/benefits, /api/benefit) use a demo cookie session: the server sets an HttpOnly cookie named visa_showcase_v3; keep it and send it back on every later request. Sessions expire after one hour idle. POST requests that carry an Origin header must come from this same site."
  },
  "servers": [{ "url": "/", "description": "This site's origin" }],
  "tags": [
    { "name": "agent", "description": "Stateless, read-only, no cookie." },
    { "name": "readable", "description": "Server-rendered HTML pages, no JavaScript needed." },
    { "name": "session", "description": "Demo cookie-session workflow used by the website." }
  ],
  "paths": {
    "/api/agent/options": {
      "get": {
        "tags": ["agent"],
        "operationId": "agentOptions",
        "summary": "Valid cities, categories and fictional sample cards",
        "responses": {
          "200": { "description": "Options", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgentOptions" } } } }
        }
      }
    },
    "/api/agent/benefits": {
      "get": {
        "tags": ["agent"],
        "operationId": "agentListBenefits",
        "summary": "Search fictional benefits, 12 per page",
        "description": "With a sample card other than guest, offers the card does not meet are left out unless include_ineligible=true.",
        "parameters": [
          { "$ref": "#/components/parameters/City" },
          { "$ref": "#/components/parameters/Category" },
          { "$ref": "#/components/parameters/Q" },
          { "$ref": "#/components/parameters/SampleProfile" },
          { "$ref": "#/components/parameters/IncludeIneligible" },
          { "$ref": "#/components/parameters/Page" },
          { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 12, "default": 12 } }
        ],
        "responses": {
          "200": { "description": "One page of results", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgentList" } } } },
          "400": { "$ref": "#/components/responses/AgentError" },
          "414": { "$ref": "#/components/responses/AgentError" }
        }
      }
    },
    "/api/agent/benefits/{id}": {
      "get": {
        "tags": ["agent"],
        "operationId": "agentGetBenefit",
        "summary": "One fictional benefit with full terms",
        "parameters": [
          { "$ref": "#/components/parameters/BenefitId" },
          { "$ref": "#/components/parameters/SampleProfile" }
        ],
        "responses": {
          "200": { "description": "The benefit", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgentDetail" } } } },
          "400": { "$ref": "#/components/responses/AgentError" },
          "404": { "$ref": "#/components/responses/AgentError" }
        }
      }
    },
    "/benefits": {
      "get": {
        "tags": ["readable"],
        "operationId": "readableListBenefits",
        "summary": "Readable HTML list of fictional benefits, 12 per page",
        "parameters": [
          { "$ref": "#/components/parameters/City" },
          { "$ref": "#/components/parameters/Category" },
          { "$ref": "#/components/parameters/Q" },
          { "$ref": "#/components/parameters/SampleProfile" },
          { "$ref": "#/components/parameters/IncludeIneligible" },
          { "$ref": "#/components/parameters/Page" }
        ],
        "responses": {
          "200": { "description": "HTML page", "content": { "text/html": { "schema": { "type": "string" } } } },
          "400": { "description": "HTML page explaining the invalid value", "content": { "text/html": { "schema": { "type": "string" } } } }
        }
      }
    },
    "/benefits/{id}": {
      "get": {
        "tags": ["readable"],
        "operationId": "readableGetBenefit",
        "summary": "Readable HTML page for one fictional benefit",
        "parameters": [
          { "$ref": "#/components/parameters/BenefitId" },
          { "$ref": "#/components/parameters/SampleProfile" }
        ],
        "responses": {
          "200": { "description": "HTML page", "content": { "text/html": { "schema": { "type": "string" } } } },
          "404": { "description": "HTML not-found page", "content": { "text/html": { "schema": { "type": "string" } } } }
        }
      }
    },
    "/api/health": {
      "get": {
        "tags": ["session"],
        "operationId": "health",
        "summary": "Service check",
        "responses": {
          "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "ok": { "type": "boolean" }, "assistantAvailable": { "type": "boolean" } } } } } }
        }
      }
    },
    "/api/login": {
      "post": {
        "tags": ["session"],
        "operationId": "chooseSampleCard",
        "summary": "Choose a fictional sample card for this demo session",
        "description": "Not authentication. Selects one fictional sample card and resets the conversation. Sets or refreshes the visa_showcase_v3 cookie.",
        "security": [{}, { "demoSession": [] }],
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": {
            "type": "object", "additionalProperties": false, "required": ["profileId"],
            "properties": { "profileId": { "type": "string", "enum": ["guest", "mei", "priya", "alex"] } }
          } } }
        },
        "responses": {
          "200": {
            "description": "Sample card selected",
            "headers": { "Set-Cookie": { "$ref": "#/components/headers/SessionCookie" } },
            "content": { "application/json": { "schema": { "type": "object", "properties": { "profile": { "oneOf": [{ "$ref": "#/components/schemas/SampleProfile" }, { "type": "null" }] } } } } }
          },
          "400": { "$ref": "#/components/responses/SessionError" },
          "403": { "$ref": "#/components/responses/SessionError" },
          "409": { "$ref": "#/components/responses/SessionError" }
        }
      }
    },
    "/api/chat": {
      "post": {
        "tags": ["session"],
        "operationId": "chat",
        "summary": "Send one message to the showcase concierge",
        "description": "One reply at a time per session, at most 12 messages per minute. Messages that look like card numbers, security codes or passwords are refused. Replies may take several seconds.",
        "security": [{ "demoSession": [] }],
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": {
            "type": "object", "additionalProperties": false, "required": ["message"],
            "properties": { "message": { "type": "string", "minLength": 1, "maxLength": 3000 } }
          } } }
        },
        "responses": {
          "200": { "description": "Concierge reply", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatResponse" } } } },
          "400": { "$ref": "#/components/responses/SessionError" },
          "403": { "$ref": "#/components/responses/SessionError" },
          "409": { "$ref": "#/components/responses/SessionError" },
          "429": { "$ref": "#/components/responses/SessionError" }
        }
      }
    },
    "/api/clear": {
      "post": {
        "tags": ["session"],
        "operationId": "clearConversation",
        "summary": "Start the conversation again, keeping the sample card",
        "security": [{ "demoSession": [] }],
        "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "additionalProperties": false } } } },
        "responses": {
          "200": { "description": "Cleared", "content": { "application/json": { "schema": { "type": "object", "properties": { "ok": { "type": "boolean" } } } } } },
          "409": { "$ref": "#/components/responses/SessionError" }
        }
      }
    },
    "/api/bootstrap": {
      "get": {
        "tags": ["session"],
        "operationId": "bootstrap",
        "summary": "Session state for the website: sample card, cities, featured offers, conversation",
        "security": [{}, { "demoSession": [] }],
        "responses": {
          "200": {
            "description": "Session state",
            "headers": { "Set-Cookie": { "$ref": "#/components/headers/SessionCookie" } },
            "content": { "application/json": { "schema": {
              "type": "object",
              "properties": {
                "profile": { "oneOf": [{ "$ref": "#/components/schemas/SampleProfile" }, { "type": "null" }] },
                "profiles": { "type": "array", "items": { "$ref": "#/components/schemas/SampleProfile" } },
                "featured": { "type": "array", "items": { "$ref": "#/components/schemas/SessionBenefit" } },
                "cities": { "type": "array", "items": { "type": "object" } },
                "categories": { "type": "array", "items": { "type": "string" } },
                "conversation": { "type": "array", "items": { "$ref": "#/components/schemas/Turn" } },
                "context": { "type": "object", "description": "What the concierge has learnt about the trip so far." },
                "tripOptions": { "type": "array", "items": { "$ref": "#/components/schemas/SessionBenefit" } },
                "opportunityThemes": { "type": "array", "items": {} },
                "demoRequests": { "type": "array", "items": { "type": "object" } },
                "coverage": { "type": "object", "properties": { "cities": { "type": "integer" }, "benefits": { "type": "integer" } } }
              }
            } } }
          }
        }
      }
    },
    "/api/benefits": {
      "get": {
        "tags": ["session"],
        "operationId": "sessionListBenefits",
        "summary": "Website list of offers, eligibility from the session's sample card",
        "description": "Unknown cities return an empty list here. The stateless /api/agent/benefits route validates input and is better for AI tools.",
        "security": [{}, { "demoSession": [] }],
        "parameters": [
          { "name": "city", "in": "query", "schema": { "type": "string", "maxLength": 80 } },
          { "name": "category", "in": "query", "schema": { "type": "string", "maxLength": 80 } },
          { "name": "q", "in": "query", "schema": { "type": "string", "maxLength": 200 } },
          { "name": "page", "in": "query", "schema": { "type": "integer", "minimum": 1 } }
        ],
        "responses": {
          "200": { "description": "One page", "content": { "application/json": { "schema": {
            "type": "object",
            "properties": {
              "benefits": { "type": "array", "items": { "$ref": "#/components/schemas/SessionBenefit" } },
              "total": { "type": "integer" }, "page": { "type": "integer" }, "pages": { "type": "integer" }
            }
          } } } }
        }
      }
    },
    "/api/benefit": {
      "get": {
        "tags": ["session"],
        "operationId": "sessionGetBenefit",
        "summary": "Website view of one offer",
        "security": [{}, { "demoSession": [] }],
        "parameters": [{ "name": "id", "in": "query", "required": true, "schema": { "type": "string", "maxLength": 120 } }],
        "responses": {
          "200": { "description": "The offer", "content": { "application/json": { "schema": { "type": "object", "properties": { "benefit": { "$ref": "#/components/schemas/SessionBenefit" } } } } } },
          "404": { "$ref": "#/components/responses/SessionError" }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "demoSession": {
        "type": "apiKey",
        "in": "cookie",
        "name": "visa_showcase_v3",
        "description": "Demo session cookie issued by the server (HttpOnly, SameSite=Strict, Path=/, Max-Age=3600). Not authentication of any real person. Keep the cookie the server sets and send it back; do not create your own value."
      }
    },
    "headers": {
      "SessionCookie": {
        "description": "visa_showcase_v3=<48 hex characters>; HttpOnly; SameSite=Strict; Path=/; Max-Age=3600",
        "schema": { "type": "string" }
      }
    },
    "parameters": {
      "City": { "name": "city", "in": "query", "required": false, "description": "City ID or name, for example hanoi or Hanoi. Omit or use all for every city. Unknown values return 400.", "schema": { "type": "string", "maxLength": 80 } },
      "Category": { "name": "category", "in": "query", "required": false, "description": "Category name or its hyphenated form, for example Live music or live-music. Unknown values return 400.", "schema": { "type": "string", "maxLength": 80 } },
      "Q": { "name": "q", "in": "query", "required": false, "description": "Case-insensitive search words.", "schema": { "type": "string", "maxLength": 200 } },
      "SampleProfile": { "name": "sample_profile", "in": "query", "required": false, "description": "Fictional sample card to check the card rule against. Not authentication.", "schema": { "type": "string", "enum": ["guest", "mei", "priya", "alex"], "default": "guest" } },
      "IncludeIneligible": { "name": "include_ineligible", "in": "query", "required": false, "schema": { "type": "string", "enum": ["true", "false", "1", "0"], "default": "false" } },
      "Page": { "name": "page", "in": "query", "required": false, "description": "Page number. A page past the last returns 400.", "schema": { "type": "integer", "minimum": 1, "maximum": 99999, "default": 1 } },
      "BenefitId": { "name": "id", "in": "path", "required": true, "description": "Benefit record ID: lowercase letters, digits and hyphens.", "schema": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{0,119}$" } }
    },
    "responses": {
      "AgentError": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgentError" } } } },
      "SessionError": { "description": "Request refused", "content": { "application/json": { "schema": { "type": "object", "required": ["error"], "properties": { "error": { "type": "string" } } } } } }
    },
    "schemas": {
      "Notice": { "type": "string", "description": "Fictional-data disclosure. Show it to the user." },
      "SampleProfile": {
        "type": "object",
        "description": "Fictional sample cardholder. Not a real person or account.",
        "properties": {
          "id": { "type": "string", "enum": ["mei", "priya", "alex"] },
          "name": { "type": "string" },
          "card": { "type": "string" },
          "tier": { "type": "string", "enum": ["Signature", "Infinite", "Infinite Privilege"] },
          "description": { "type": "string" }
        }
      },
      "AgentSampleProfile": {
        "type": "object",
        "required": ["id", "fictional", "isAuthentication"],
        "properties": {
          "id": { "type": "string", "enum": ["guest", "mei", "priya", "alex"] },
          "fictional": { "const": true },
          "isAuthentication": { "const": false },
          "name": { "type": ["string", "null"] },
          "card": { "type": ["string", "null"] },
          "tier": { "type": ["string", "null"] },
          "note": { "type": "string" }
        }
      },
      "Eligibility": {
        "type": "object",
        "required": ["state", "reason"],
        "properties": {
          "state": { "type": "string", "enum": ["confirmed", "ineligible", "unknown"] },
          "label": { "type": "string" },
          "reason": { "type": "string" },
          "requiredCardTypes": { "type": "array", "items": { "type": "string" } },
          "basis": { "type": "string", "description": "Only the sample card type is checked. Every other condition still applies." }
        }
      },
      "AgentBenefit": {
        "type": "object",
        "required": ["id", "title", "city", "value", "terms", "eligibility", "links"],
        "properties": {
          "id": { "type": "string" },
          "title": { "type": "string" },
          "partner": { "type": "string", "description": "Fictional partner name." },
          "category": { "type": "string" },
          "city": { "type": "string" },
          "cityId": { "type": "string" },
          "country": { "type": "string" },
          "region": { "type": ["string", "null"] },
          "neighbourhood": { "type": ["string", "null"] },
          "airport": { "type": ["object", "null"], "properties": { "name": { "type": "string" }, "code": { "type": ["string", "null"] } } },
          "summary": { "type": "string" },
          "value": { "type": "string", "description": "What the benefit gives." },
          "mechanism": { "type": ["string", "null"] },
          "price": {
            "type": "object",
            "properties": {
              "usual": { "type": ["number", "null"], "description": "Usual fictional price before the benefit." },
              "unit": { "type": ["string", "null"] },
              "currency": { "type": ["string", "null"] },
              "minimumSpend": { "type": ["number", "null"] }
            }
          },
          "party": { "type": "object", "properties": { "min": { "type": "integer" }, "max": { "type": ["integer", "null"] } } },
          "guestPolicy": { "type": ["string", "null"] },
          "minimumAge": { "type": ["integer", "null"] },
          "childrenAllowed": { "type": "boolean" },
          "minimumNights": { "type": "integer" },
          "validDays": { "type": "array", "items": { "type": "string", "enum": ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"] } },
          "timeOfDay": { "type": "array", "items": { "type": "string", "enum": ["day", "evening", "late"] } },
          "notice": { "type": "object", "properties": { "leadTimeHours": { "type": "number" }, "text": { "type": "string" } } },
          "paymentRequirement": { "type": ["string", "null"] },
          "howItWouldWork": { "type": "string", "description": "What a real service would do. The demo does none of it." },
          "offerPeriod": { "type": "object", "properties": { "starts": { "type": "string", "format": "date" }, "expires": { "type": "string", "format": "date" } } },
          "availability": { "type": "string", "description": "Always simulated and unconfirmed." },
          "eligibility": { "$ref": "#/components/schemas/Eligibility" },
          "conditionNotes": { "type": "array", "items": { "type": "string" } },
          "features": { "type": "array", "items": { "type": "string" } },
          "interests": { "type": "array", "items": { "type": "string" } },
          "terms": { "type": "string", "description": "Full fictional terms." },
          "details": { "type": "object", "description": "Extra structured facts that vary by offer type." },
          "source": {
            "type": "object",
            "properties": {
              "dataset": { "type": ["string", "null"] },
              "recordId": { "type": "string" },
              "offerPattern": { "type": ["string", "null"] },
              "venueId": { "type": ["string", "null"] },
              "localVariant": { "type": "boolean" },
              "illustrative": { "type": "boolean" }
            }
          },
          "links": { "type": "object", "properties": { "json": { "type": "string" }, "readable": { "type": "string" } } }
        }
      },
      "AgentList": {
        "type": "object",
        "required": ["notice", "sampleProfile", "total", "page", "pages", "benefits", "links"],
        "properties": {
          "notice": { "$ref": "#/components/schemas/Notice" },
          "sampleProfile": { "$ref": "#/components/schemas/AgentSampleProfile" },
          "query": { "type": "object" },
          "total": { "type": "integer" },
          "page": { "type": "integer" },
          "pages": { "type": "integer" },
          "pageSize": { "type": "integer" },
          "excludedIneligible": { "type": "integer", "description": "Offers left out because the sample card does not meet the card rule." },
          "benefits": { "type": "array", "maxItems": 12, "items": { "$ref": "#/components/schemas/AgentBenefit" } },
          "links": {
            "type": "object",
            "properties": {
              "self": { "type": "string" }, "next": { "type": ["string", "null"] }, "prev": { "type": ["string", "null"] },
              "readable": { "type": "string" }, "options": { "type": "string" }
            }
          }
        }
      },
      "AgentDetail": {
        "type": "object",
        "required": ["notice", "sampleProfile", "benefit"],
        "properties": {
          "notice": { "$ref": "#/components/schemas/Notice" },
          "sampleProfile": { "$ref": "#/components/schemas/AgentSampleProfile" },
          "benefit": { "$ref": "#/components/schemas/AgentBenefit" }
        }
      },
      "AgentOptions": {
        "type": "object",
        "properties": {
          "notice": { "$ref": "#/components/schemas/Notice" },
          "sampleProfiles": { "type": "array", "items": { "type": "object" } },
          "cities": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "country": { "type": "string" }, "region": { "type": ["string", "null"] } } } },
          "categories": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "id": { "type": "string" } } } },
          "pageSize": { "type": "integer" },
          "benefitRecords": { "type": "integer" },
          "routes": { "type": "object" }
        }
      },
      "AgentError": {
        "type": "object",
        "required": ["error", "status"],
        "properties": {
          "error": { "type": "string" },
          "status": { "type": "integer" },
          "help": { "type": "string" },
          "options": { "type": "string" },
          "notice": { "$ref": "#/components/schemas/Notice" }
        }
      },
      "SessionBenefit": {
        "type": "object",
        "description": "Raw catalogue record as used by the website, plus fit and eligibility for the session's sample card.",
        "properties": {
          "id": { "type": "string" },
          "title": { "type": "string" },
          "partner": { "type": "string" },
          "category": { "type": "string" },
          "city": { "type": "string" },
          "summary": { "type": "string" },
          "value": { "type": "string" },
          "terms": { "type": "string" },
          "tiers": { "type": "array", "items": { "type": "string" } },
          "guestPolicy": { "type": "string" },
          "price": { "type": ["number", "null"] },
          "priceUnit": { "type": "string" },
          "currency": { "type": "string" },
          "validDays": { "type": "array", "items": { "type": "string" } },
          "leadTimeHours": { "type": "number" },
          "fit": { "type": "object", "properties": { "allowed": { "type": "boolean" }, "state": { "type": "string" }, "notes": { "type": "array", "items": { "type": "string" } } } },
          "eligibility": { "$ref": "#/components/schemas/Eligibility" }
        },
        "additionalProperties": true
      },
      "Turn": {
        "type": "object",
        "properties": {
          "role": { "type": "string", "enum": ["user", "assistant"] },
          "content": { "type": "string" },
          "references": { "type": "array", "items": {} }
        }
      },
      "ChatResponse": {
        "type": "object",
        "required": ["reply", "conversation"],
        "properties": {
          "reply": { "type": "string", "description": "Concierge reply in plain text." },
          "benefits": { "type": "array", "items": { "$ref": "#/components/schemas/SessionBenefit" } },
          "suggestions": { "type": "array", "items": {} },
          "stage": { "type": "string" },
          "context": { "type": "object" },
          "conversation": { "type": "array", "items": { "$ref": "#/components/schemas/Turn" } },
          "tripOptions": { "type": "array", "items": { "$ref": "#/components/schemas/SessionBenefit" } },
          "opportunityThemes": { "type": "array", "items": {} },
          "mode": { "type": "string", "description": "fallback when the concierge could not prepare a reply." }
        },
        "additionalProperties": true
      }
    }
  }
}
