{
  "openapi": "3.1.0",
  "info": {
    "title": "NeoDefender Managed Support Calculator API",
    "version": "1.0.1",
    "description": "Public API for calculating NeoDefender Managed Support monthly and annual estimates. Estimates are informational only; formal quotes require contact with NeoDefender.",
    "contact": {
      "name": "NeoDefender",
      "email": "hello@neodefender.com",
      "url": "https://neodefender.com/contact"
    },
    "license": {
      "name": "All rights reserved"
    }
  },
  "servers": [
    {
      "url": "https://neodefender.com",
      "description": "Production"
    }
  ],
  "externalDocs": {
    "description": "Managed Support Calculator API documentation",
    "url": "https://neodefender.com/managed-support/api"
  },
  "tags": [
    {
      "name": "Managed Support",
      "description": "Managed Support estimate operations"
    }
  ],
  "paths": {
    "/api/managed-support-calculator/calculate": {
      "get": {
        "tags": ["Managed Support"],
        "summary": "Calculate Managed Support estimate using query parameters",
        "description": "Returns estimated monthly and annual Managed Support totals based on user count and volume discount tier. Rate limit: 10 requests per IP per minute.",
        "operationId": "calculateManagedSupportEstimateGet",
        "security": [],
        "parameters": [
          {
            "name": "users",
            "in": "query",
            "required": true,
            "description": "Number of users in scope. Values above 500 return an enterprise contact-required response.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9999
            },
            "example": 200
          }
        ],
        "responses": {
          "200": {
            "description": "Managed Support estimate calculated successfully.",
            "headers": {
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "integer",
                  "example": 10
                },
                "description": "Maximum number of requests allowed per minute."
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer",
                  "example": 9
                },
                "description": "Requests remaining in the current minute window."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedSupportQuoteOutput"
                },
                "examples": {
                  "small50Users": {
                    "summary": "50 users, no discount",
                    "value": {
                      "users_count": 50,
                      "price_per_user_usd": 59,
                      "monthly_total_usd": 2950,
                      "annual_total_usd": 35400,
                      "list_price_per_user_usd": 59,
                      "discount_percentage": 0,
                      "monthly_savings_usd": 0,
                      "annual_savings_usd": 0,
                      "tier": "small",
                      "is_enterprise": false,
                      "contact_required": true,
                      "contact_message": "This is an estimate. Microsoft licenses (Microsoft 365, Defender, Intune, etc.) are sold separately. Contact us at hello@neodefender.com for a formal quote and to discuss your specific environment.",
                      "is_below_minimum": false,
                      "effective_users": 50
                    }
                  },
                  "mid200Users": {
                    "summary": "200 users, 5 percent discount",
                    "value": {
                      "users_count": 200,
                      "price_per_user_usd": 56.05,
                      "monthly_total_usd": 11210,
                      "annual_total_usd": 134520,
                      "list_price_per_user_usd": 59,
                      "discount_percentage": 5,
                      "monthly_savings_usd": 590,
                      "annual_savings_usd": 7080,
                      "tier": "mid",
                      "is_enterprise": false,
                      "contact_required": true,
                      "contact_message": "This is an estimate. Microsoft licenses (Microsoft 365, Defender, Intune, etc.) are sold separately. Contact us at hello@neodefender.com for a formal quote and to discuss your specific environment.",
                      "is_below_minimum": false,
                      "effective_users": 200
                    }
                  },
                  "large400Users": {
                    "summary": "400 users, 10 percent discount",
                    "value": {
                      "users_count": 400,
                      "price_per_user_usd": 53.1,
                      "monthly_total_usd": 21240,
                      "annual_total_usd": 254880,
                      "list_price_per_user_usd": 59,
                      "discount_percentage": 10,
                      "monthly_savings_usd": 2360,
                      "annual_savings_usd": 28320,
                      "tier": "large",
                      "is_enterprise": false,
                      "contact_required": true,
                      "contact_message": "This is an estimate. Microsoft licenses (Microsoft 365, Defender, Intune, etc.) are sold separately. Contact us at hello@neodefender.com for a formal quote and to discuss your specific environment.",
                      "is_below_minimum": false,
                      "effective_users": 400
                    }
                  },
                  "belowMinimum3Users": {
                    "summary": "3 users billed at the 5-user minimum",
                    "value": {
                      "users_count": 3,
                      "price_per_user_usd": 59,
                      "monthly_total_usd": 295,
                      "annual_total_usd": 3540,
                      "list_price_per_user_usd": 59,
                      "discount_percentage": 0,
                      "monthly_savings_usd": 0,
                      "annual_savings_usd": 0,
                      "tier": "small",
                      "is_enterprise": false,
                      "contact_required": true,
                      "contact_message": "This is an estimate. Microsoft licenses (Microsoft 365, Defender, Intune, etc.) are sold separately. Contact us at hello@neodefender.com for a formal quote and to discuss your specific environment.",
                      "is_below_minimum": true,
                      "effective_users": 5
                    }
                  },
                  "enterprise750Users": {
                    "summary": "750 users requires custom proposal",
                    "value": {
                      "users_count": 750,
                      "monthly_total_usd": 0,
                      "tier": "enterprise",
                      "is_enterprise": true,
                      "enterprise_reason": "user-count",
                      "contact_required": true,
                      "contact_message": "For organizations above 500 users, we design custom Managed Support plans with tailored pricing, dedicated resources and specific SLAs. Contact us at hello@neodefender.com for a custom proposal."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "Validation failed",
                  "details": ["users must be an integer between 1 and 9999."]
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "example": 60
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "Internal server error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": ["Managed Support"],
        "summary": "Calculate Managed Support estimate using a JSON body",
        "description": "Calculate using a JSON body. Returns estimated monthly and annual Managed Support totals based on user count and volume discount tier. Rate limit: 10 requests per IP per minute.",
        "operationId": "calculateManagedSupportEstimate",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagedSupportQuoteInput"
              },
              "examples": {
                "small50Users": {
                  "summary": "50 users, no discount",
                  "value": {
                    "users": 50
                  }
                },
                "mid200Users": {
                  "summary": "200 users, 5 percent discount",
                  "value": {
                    "users": 200
                  }
                },
                "large400Users": {
                  "summary": "400 users, 10 percent discount",
                  "value": {
                    "users": 400
                  }
                },
                "belowMinimum3Users": {
                  "summary": "3 users billed at the 5-user minimum",
                  "value": {
                    "users": 3
                  }
                },
                "enterprise750Users": {
                  "summary": "750 users requires custom proposal",
                  "value": {
                    "users": 750
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Managed Support estimate calculated successfully.",
            "headers": {
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "integer",
                  "example": 10
                },
                "description": "Maximum number of requests allowed per minute."
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer",
                  "example": 9
                },
                "description": "Requests remaining in the current minute window."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedSupportQuoteOutput"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "example": 60
                },
                "description": "Seconds to wait before retrying."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "options": {
        "tags": ["Managed Support"],
        "summary": "CORS preflight",
        "security": [],
        "responses": {
          "204": {
            "description": "CORS preflight accepted."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ManagedSupportQuoteInput": {
        "type": "object",
        "additionalProperties": false,
        "required": ["users"],
        "properties": {
          "users": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9999,
            "description": "Number of users in scope. Values above 500 return an enterprise contact-required response.",
            "examples": [200]
          }
        }
      },
      "ManagedSupportQuoteOutput": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ManagedSupportCalculatedOutput"
          },
          {
            "$ref": "#/components/schemas/ManagedSupportEnterpriseOutput"
          }
        ]
      },
      "ManagedSupportCalculatedOutput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "users_count",
          "price_per_user_usd",
          "monthly_total_usd",
          "annual_total_usd",
          "list_price_per_user_usd",
          "discount_percentage",
          "monthly_savings_usd",
          "annual_savings_usd",
          "tier",
          "is_enterprise",
          "contact_required",
          "contact_message",
          "is_below_minimum",
          "effective_users"
        ],
        "properties": {
          "users_count": {
            "type": "integer",
            "description": "Input user count."
          },
          "price_per_user_usd": {
            "type": "number",
            "description": "Discounted monthly price per user in USD."
          },
          "monthly_total_usd": {
            "type": "integer",
            "description": "Estimated monthly Managed Support total in USD."
          },
          "annual_total_usd": {
            "type": "integer",
            "description": "Estimated annual Managed Support total in USD."
          },
          "list_price_per_user_usd": {
            "type": "integer",
            "const": 59,
            "description": "Undiscounted monthly list price per user in USD."
          },
          "discount_percentage": {
            "type": "integer",
            "enum": [0, 5, 10],
            "description": "Volume discount percentage applied."
          },
          "monthly_savings_usd": {
            "type": "integer",
            "description": "Estimated monthly savings compared with list price."
          },
          "annual_savings_usd": {
            "type": "integer",
            "description": "Estimated annual savings compared with list price."
          },
          "tier": {
            "type": "string",
            "enum": ["small", "mid", "large"],
            "description": "Managed Support tier based on user count."
          },
          "is_enterprise": {
            "type": "boolean",
            "const": false
          },
          "contact_required": {
            "type": "boolean",
            "const": true,
            "description": "Formal quotes require contact with NeoDefender."
          },
          "contact_message": {
            "type": "string",
            "description": "Estimate disclaimer and formal quote guidance."
          },
          "is_below_minimum": {
            "type": "boolean",
            "description": "True when the user count is below the 5-user minimum. The price is calculated as if 5 users were specified. UI should display a contextual message to inform the user."
          },
          "effective_users": {
            "type": "integer",
            "description": "User count actually used for pricing (max(users, 5)). Equal to users_count when at or above the 5-user minimum."
          }
        }
      },
      "ManagedSupportEnterpriseOutput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "users_count",
          "monthly_total_usd",
          "tier",
          "is_enterprise",
          "enterprise_reason",
          "contact_required",
          "contact_message"
        ],
        "properties": {
          "users_count": {
            "type": "integer",
            "description": "Input user count."
          },
          "monthly_total_usd": {
            "type": "integer",
            "const": 0
          },
          "tier": {
            "type": "string",
            "const": "enterprise"
          },
          "is_enterprise": {
            "type": "boolean",
            "const": true
          },
          "enterprise_reason": {
            "type": "string",
            "const": "user-count",
            "description": "Reason the request requires custom planning."
          },
          "contact_required": {
            "type": "boolean",
            "const": true
          },
          "contact_message": {
            "type": "string",
            "description": "Custom proposal guidance."
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": ["error"],
        "properties": {
          "error": {
            "type": "string",
            "description": "Generic error message."
          },
          "details": {
            "type": "array",
            "description": "Sanitized validation details.",
            "items": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}
