{
  "openapi": "3.0.0",
  "info": {
    "title": "Farmasi Product Lookup API",
    "version": "1.0.0",
    "description": "Farmasi პროდუქტის ძიება კოდით"
  },
  "servers": [
    {
      "url": "https://farmasi.ge/public/tawk"
    }
  ],
  "paths": {
    "/product_lookup.php": {
      "get": {
        "operationId": "getProductByCode",
        "summary": "პროდუქტის მოძებნა კოდით ან სახელით",
        "description": "Farmasi-ს პროდუქტის ინფორმაციის მიღება პროდუქტის კოდით ან სახელით. უნდა მიეთითოს სულ მცირე ერთი: code ან name.",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": false,
            "description": "პროდუქტის კოდი (6 ან 7 ციფრი)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "query",
            "required": false,
            "description": "პროდუქტის სახელი ან სახელის ნაწილი (case-insensitive ძებნა)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "პროდუქტის ინფორმაცია",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "found": {
                      "type": "boolean"
                    },
                    "product": {
                      "type": "object",
                      "description": "ერთი შედეგი (კოდით ძებნისას ან სახელით ძებნისას ერთი შედეგი)",
                      "properties": {
                        "code": { "type": "string" },
                        "name": { "type": "string" },
                        "price": { "type": "string" },
                        "description": { "type": "string" },
                        "link": { "type": "string" },
                        "image": { "type": "string" }
                      }
                    },
                    "products": {
                      "type": "array",
                      "description": "მრავალი შედეგი (სახელით ძებნისას)",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": { "type": "string" },
                          "name": { "type": "string" },
                          "price": { "type": "string" },
                          "description": { "type": "string" },
                          "link": { "type": "string" },
                          "image": { "type": "string" }
                        }
                      }
                    },
                    "count": { "type": "integer" },
                    "message": { "type": "string" },
                    "search_url": { "type": "string" }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
