{
  "openapi": "3.1.0",
  "info": {
    "title": "Oasis Food REST API",
    "description": "API endpoints for food ordering, Stripe verification, user cabinet management, and delivery zone calculations at Oasis Food Restaurant in Lamai, Koh Samui.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://oasisfood.net",
      "description": "Production Server"
    }
  ],
  "paths": {
    "/api/checkout/order": {
      "post": {
        "summary": "Submit a delivery or pickup food order",
        "description": "Validates cart items, calculates totals, saves order to D1 database, and dispatches localized confirmation emails.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "cart": { "type": "array" },
                  "formData": { "type": "object" },
                  "grandTotal": { "type": "number" },
                  "deliveryFee": { "type": "number" },
                  "lang": { "type": "string", "enum": ["en", "ua", "ru"] }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Order created successfully"
          }
        }
      }
    },
    "/api/checkout/verify": {
      "get": {
        "summary": "Verify Stripe Online Payment Session",
        "parameters": [
          {
            "name": "session_id",
            "in": "query",
            "required": true,
            "schema": { "type": "string" }
          }
        ],
        "responses": {
          "200": {
            "description": "Payment verification status"
          }
        }
      }
    }
  }
}
