{
  "openapi": "3.1.0",
  "info": {
    "title": "Urban Craft & Co. Corporate Gifting API",
    "summary": "Official B2B quotation, catalogue lookup, and inquiry API",
    "description": "Programmatic API for AI agents and enterprise clients to submit corporate gifting inquiries, quote requests, and check service telemetry.",
    "version": "1.0.0",
    "contact": {
      "name": "Urban Craft & Co. Enterprise Sales",
      "email": "notifications@urbancraftgifts.com",
      "url": "https://urbancraftgifts.com/contact"
    }
  },
  "servers": [
    {
      "url": "https://urbancraftgifts.com/api",
      "description": "Production API Server"
    }
  ],
  "paths": {
    "/contact": {
      "post": {
        "summary": "Submit a Corporate Contact Inquiry",
        "description": "Submits a corporate inquiry with client contact info, target delivery date, estimated quantity, and project brief.",
        "operationId": "submitContactForm",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactFormRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inquiry accepted and reference ID issued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubmissionSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Validation error or invalid past date"
          },
          "429": {
            "description": "Rate limit exceeded"
          }
        }
      }
    },
    "/inquire": {
      "post": {
        "summary": "Submit a Detailed Multi-step Gift Set Inquiry",
        "description": "Submits a full corporate gifting proposal request including selected product SKUs, categories, and target date.",
        "operationId": "submitInquiry",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InquiryRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Proposal request accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubmissionSuccessResponse"
                }
              }
            }
          }
        }
      }
    },
    "/health": {
      "get": {
        "summary": "Service Health & Telemetry",
        "description": "Returns service status, current IST time, and system heartbeat.",
        "operationId": "getHealthStatus",
        "responses": {
          "200": {
            "description": "Service is healthy",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": { "type": "string", "example": "healthy" },
                    "service": { "type": "string", "example": "Urban Craft & Co. API" },
                    "timestampIST": { "type": "string" },
                    "timezone": { "type": "string", "example": "Asia/Kolkata" }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ContactFormRequest": {
        "type": "object",
        "required": ["name", "email", "phone", "message"],
        "properties": {
          "name": { "type": "string", "minLength": 2, "maxLength": 80 },
          "email": { "type": "string", "format": "email" },
          "phone": { "type": "string" },
          "company": { "type": "string" },
          "purpose": { "type": "string" },
          "quantity": { "type": "string" },
          "date": {
            "type": "string",
            "format": "date",
            "description": "Target delivery date (YYYY-MM-DD, cannot be in past)"
          },
          "message": { "type": "string", "minLength": 5, "maxLength": 2000 },
          "turnstileToken": { "type": "string" }
        }
      },
      "InquiryRequest": {
        "type": "object",
        "required": ["name", "email", "phone", "quantity", "intent"],
        "properties": {
          "name": { "type": "string" },
          "email": { "type": "string", "format": "email" },
          "phone": { "type": "string" },
          "company": { "type": "string" },
          "intent": { "type": "string" },
          "quantity": { "type": "string" },
          "date": { "type": "string", "format": "date" },
          "customization": { "type": "string", "enum": ["yes", "no", "unsure"] },
          "location": { "type": "string" },
          "categories": { "type": "array", "items": { "type": "string" } },
          "products": { "type": "array", "items": { "type": "string" } },
          "notes": { "type": "string" }
        }
      },
      "SubmissionSuccessResponse": {
        "type": "object",
        "properties": {
          "success": { "type": "boolean", "example": true },
          "id": { "type": "string", "example": "UC-202611-AB12" },
          "message": { "type": "string" }
        }
      }
    }
  }
}
