{
  "openapi": "3.1.0",
  "info": {
    "title": "TallyDubai Lead Enquiry API",
    "description": "Public lead enquiry endpoint for TallyDubai, the UAE TallyPrime software and services website operated by Peniel Technology LLC.",
    "version": "1.0.0",
    "contact": {
      "name": "TallyDubai",
      "url": "https://tallydubai.com/contact"
    }
  },
  "servers": [
    { "url": "https://tallydubai.com" }
  ],
  "paths": {
    "/api/enquirymail.php": {
      "post": {
        "operationId": "submitTallyDubaiLeadEnquiry",
        "summary": "Submit a TallyDubai enquiry",
        "description": "Submits a consultation, demo, sales, implementation, training, support, or renewal enquiry. Do not include passwords or sensitive accounting data.",
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": { "$ref": "#/components/schemas/LeadEnquiry" }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Enquiry accepted for follow-up",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/LeadSuccess" }
              }
            }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "405": { "$ref": "#/components/responses/MethodNotAllowed" },
          "422": { "$ref": "#/components/responses/UnprocessableEntity" },
          "503": { "$ref": "#/components/responses/ServiceUnavailable" }
        }
      },
      "get": {
        "operationId": "getTallyDubaiLeadEnquiryMethodInformation",
        "summary": "Get endpoint method information",
        "responses": {
          "405": { "$ref": "#/components/responses/MethodNotAllowed" }
        }
      }
    },
    "/enquirymail": {
      "post": {
        "summary": "Submit a TallyDubai enquiry using the website form route",
        "description": "Compatibility route used by the existing website contact form. The canonical API documentation is /api/enquirymail.php.",
        "requestBody": {
          "$ref": "#/paths/~1api~1enquirymail.php/post/requestBody"
        },
        "responses": {
          "200": { "$ref": "#/paths/~1api~1enquirymail.php/post/responses/200" },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "405": { "$ref": "#/components/responses/MethodNotAllowed" },
          "422": { "$ref": "#/components/responses/UnprocessableEntity" },
          "503": { "$ref": "#/components/responses/ServiceUnavailable" }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "LeadEnquiry": {
        "type": "object",
        "required": ["name", "email", "phone", "message"],
        "properties": {
          "name": { "type": "string", "description": "Contact person's name.", "minLength": 1, "maxLength": 120 },
          "email": { "type": "string", "format": "email", "description": "Email address for follow-up." },
          "phone": { "type": "string", "description": "Phone number without alphabetic characters.", "minLength": 1, "maxLength": 40 },
          "message": { "type": "string", "description": "Short enquiry without URLs; maximum 150 characters.", "minLength": 1, "maxLength": 150 }
        },
        "additionalProperties": false
      },
      "LeadSuccess": {
        "type": "object",
        "required": ["status", "ok", "message"],
        "properties": {
          "status": { "type": "boolean", "const": true },
          "ok": { "type": "boolean", "const": true },
          "message": { "type": "string" }
        }
      },
      "ApiError": {
        "type": "object",
        "required": ["status", "ok", "error", "message"],
        "properties": {
          "status": { "type": "boolean", "const": false },
          "ok": { "type": "boolean", "const": false },
          "error": {
            "type": "object",
            "required": ["code", "message", "resolution_hint"],
            "properties": {
              "code": { "type": "string" },
              "message": { "type": "string" },
              "resolution_hint": { "type": "string" }
            }
          },
          "message": { "type": "string" }
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Required request data is missing or malformed.",
        "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiError" } } }
      },
      "MethodNotAllowed": {
        "description": "The endpoint only accepts POST requests.",
        "headers": { "Allow": { "schema": { "type": "string" } } },
        "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiError" } } }
      },
      "UnprocessableEntity": {
        "description": "A submitted field failed validation or the message was rejected as a URL or spam.",
        "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiError" } } }
      },
      "ServiceUnavailable": {
        "description": "The lead service could not be reached. Retry later or use the contact page.",
        "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiError" } } }
      }
    }
  }
}
