{
  "openapi": "3.1.0",
  "info": {
    "title": "Next Wave Cloud Oracle APEX Hosting",
    "version": "1.0.0",
    "description": "Current public hosting offers and plan configuration links. Preparing a configuration does not create an account, place an order or charge a payment method.",
    "contact": { "email": "support@nwavecloud.com" }
  },
  "servers": [{ "url": "https://nwavecloud.com" }],
  "paths": {
    "/api/hosting/plans": {
      "get": {
        "operationId": "listHostingPlans",
        "summary": "Compare current Oracle APEX hosting plans, prices and resources",
        "responses": {
          "200": { "description": "Current public console offers", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Catalog" } } } },
          "503": { "description": "Live pricing unavailable; use the pricing console" }
        }
      }
    },
    "/api/hosting/configure": {
      "get": {
        "operationId": "configureHostingPlan",
        "summary": "Prepare a review and secure checkout link for a selected plan",
        "description": "Choose a plan code from listHostingPlans and a supported billing interval. The customer enters account details in the Next Wave console and confirms payment in Stripe.",
        "parameters": [
          { "name": "plan", "in": "query", "required": true, "schema": { "type": "string" }, "description": "Exact public plan code from the current catalogue" },
          { "name": "billing", "in": "query", "schema": { "type": "string", "enum": ["MONTH", "YEAR"], "default": "MONTH" } },
          { "name": "lang", "in": "query", "schema": { "type": "string", "enum": ["en", "es", "de", "fr", "pt-br", "ja"], "default": "en" }, "description": "Language of the public review/configuration page. Prices remain USD and the account/checkout console remains English." }
        ],
        "responses": {
          "200": { "description": "Selected plan, billing conditions and checkout handoff", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Configuration" } } } },
          "400": { "description": "Unknown plan or unsupported billing interval" },
          "503": { "description": "Live pricing unavailable; use the pricing console" }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Plan": {
        "type": "object",
        "required": ["code", "name", "category", "currency", "prices", "specifications", "included", "url"],
        "properties": {
          "code": { "type": "string" },
          "name": { "type": "string" },
          "category": { "type": "string", "enum": ["launch", "scale", "enterprise"] },
          "description": { "type": "string" },
          "currency": { "type": "string", "const": "USD" },
          "prices": { "type": "object", "required": ["MONTH"], "properties": { "MONTH": { "type": "number", "exclusiveMinimum": 0 }, "YEAR": { "type": "number", "exclusiveMinimum": 0 } } },
          "specifications": { "type": "object", "additionalProperties": { "type": "string" } },
          "included": { "type": "array", "items": { "type": "string" } },
          "database_policy": { "type": "object", "description": "Database edition and resource limits; Free-edition Oracle security patch/support availability is explicit.", "additionalProperties": true },
          "url": { "type": "string", "format": "uri" }
        }
      },
      "Catalog": {
        "type": "object",
        "required": ["provider", "source_url", "retrieved_at", "billing_note", "plans"],
        "properties": {
          "provider": { "type": "string" }, "service": { "type": "string" }, "currency": { "type": "string" },
          "source_url": { "type": "string", "format": "uri" },
          "retrieved_at": { "type": "string", "format": "date-time" },
          "billing_note": { "type": "string" },
          "service_terms": { "$ref": "#/components/schemas/ServiceTerms" },
          "website_languages": { "type": "array", "description": "Localized public website languages. The account and checkout console remains English.", "items": { "type": "object", "properties": { "code": { "type": "string" }, "name": { "type": "string" }, "url": { "type": "string", "format": "uri" } } } },
          "plans": { "type": "array", "items": { "$ref": "#/components/schemas/Plan" } }
        }
      },
      "Configuration": {
        "type": "object",
        "required": ["plan", "billing_interval", "amount", "currency", "configuration_url", "checkout_url", "purchase_status"],
        "properties": {
          "plan": { "$ref": "#/components/schemas/Plan" },
          "billing_interval": { "type": "string", "enum": ["MONTH", "YEAR"] },
          "amount": { "type": "number" }, "currency": { "type": "string", "const": "USD" },
          "billing_note": { "type": "string" },
          "service_terms": { "$ref": "#/components/schemas/ServiceTerms" },
          "configuration_url": { "type": "string", "format": "uri" },
          "checkout_url": { "type": "string", "format": "uri" },
          "purchase_status": { "type": "string", "const": "not_started" },
          "next_step": { "type": "string" }
        }
      },
      "ServiceTerms": {
        "type": "object",
        "description": "Published service facts and operational terms that require a written order; these fields do not promise numerical SLAs.",
        "properties": {
          "details_url": { "type": "string", "format": "uri" },
          "backups": { "type": "string" }, "restores": { "type": "string" },
          "support": { "type": "string" }, "uptime_sla": { "type": "string" },
          "residency_dpa": { "type": "string" }, "oracle_licensing": { "type": "string" },
          "patching": { "type": "string" }
        }
      }
    }
  }
}
