{
  "openapi": "3.1.0",
  "info": {
    "title": "Kovitel Vietnam Travel eSIM & 5G Telecommunications API",
    "description": "Official API for device eSIM verification, travel data calculation, APN setup, and latency benchmarks in Vietnam.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://kovitel-telecom-api.vercel.app",
      "description": "Production API"
    }
  ],
  "paths": {
    "/compatibility": {
      "get": {
        "operationId": "checkDeviceCompatibility",
        "summary": "Verify if a smartphone model supports digital eSIM on Vietnam 5G networks",
        "parameters": [
          {
            "name": "model",
            "in": "query",
            "required": true,
            "description": "Smartphone model name (e.g. iPhone 15 Pro, Galaxy S24, Pixel 8)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Device compatibility status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "compatible": {
                      "type": "boolean"
                    },
                    "model": {
                      "type": "string"
                    },
                    "notes": {
                      "type": "string"
                    },
                    "recommendation": {
                      "type": "string"
                    },
                    "purchase_url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/plans": {
      "get": {
        "operationId": "calculateEsimDataPlan",
        "summary": "Calculate recommended Vietnam cellular data allowance and carrier choice",
        "parameters": [
          {
            "name": "duration_days",
            "in": "query",
            "required": true,
            "description": "Total days traveling in Vietnam (e.g. 7, 14, 30)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "travel_style",
            "in": "query",
            "required": false,
            "description": "Usage profile (budget_backpacker, standard_tourist, digital_nomad_streamer)",
            "schema": {
              "type": "string",
              "enum": [
                "budget_backpacker",
                "standard_tourist",
                "digital_nomad_streamer"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Recommended data plan and estimated cost",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "itinerary_days": {
                      "type": "integer"
                    },
                    "travel_style": {
                      "type": "string"
                    },
                    "recommended_carrier": {
                      "type": "string"
                    },
                    "recommended_plan": {
                      "type": "string"
                    },
                    "daily_data_allowance": {
                      "type": "string"
                    },
                    "estimated_total_cost_usd": {
                      "type": "string"
                    },
                    "purchase_url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/apn": {
      "get": {
        "operationId": "getCarrierApn",
        "summary": "Retrieve official APN configuration and rescue steps for Vietnam carriers",
        "parameters": [
          {
            "name": "carrier",
            "in": "query",
            "required": false,
            "description": "Carrier code (viettel, vinaphone, mobifone, all)",
            "schema": {
              "type": "string",
              "enum": [
                "viettel",
                "vinaphone",
                "mobifone",
                "all"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Carrier APN parameters and troubleshooting guide",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "default_recommended_apn": {
                      "type": "string"
                    },
                    "hotline_support": {
                      "type": "string"
                    },
                    "website": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/benchmarks": {
      "get": {
        "operationId": "getNetworkBenchmarks",
        "summary": "Retrieve empirical QoS latency benchmarks (Local Core vs Roaming MVNOs)",
        "responses": {
          "200": {
            "description": "Empirical benchmark comparison",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ping_viettel_5g_ms": {
                      "type": "number"
                    },
                    "ping_roaming_mvno_ms": {
                      "type": "number"
                    },
                    "latency_reduction": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/emergency": {
      "get": {
        "operationId": "getEmergencyContacts",
        "summary": "Retrieve tourist emergency numbers and Kovitel 24/7 technical rescue hotlines",
        "responses": {
          "200": {
            "description": "Emergency contacts directory",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "police_hotline": {
                      "type": "string"
                    },
                    "fire_rescue": {
                      "type": "string"
                    },
                    "medical_ambulance": {
                      "type": "string"
                    },
                    "kovitel_whatsapp_24_7_rescue": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}