{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://getkavel.com/agents/quote-request.schema.json",
  "title": "Kavel quote request (draft 0.1)",
  "description": "A request for quote sent to a supplier's Kavel quote page by a person or an AI agent acting for them. A request is not an order and commits nobody to anything. Draft: it may change. See https://getkavel.com/agents/quote-requests/",
  "type": "object",
  "required": ["email", "items"],
  "properties": {
    "email": { "type": "string", "format": "email", "maxLength": 200, "description": "The buyer's email address. The supplier replies here directly." },
    "name": { "type": "string", "maxLength": 100, "description": "The buyer's name." },
    "company": { "type": "string", "maxLength": 100, "description": "The buyer's company." },
    "agent": { "type": "boolean", "description": "true when an AI agent sends the request on a person's behalf. The supplier is told." },
    "items": {
      "type": "array", "minItems": 1, "maxItems": 50,
      "items": {
        "type": "object", "required": ["description"],
        "properties": {
          "description": { "type": "string", "maxLength": 200, "description": "What is wanted, in plain words." },
          "spec": { "type": "string", "maxLength": 300, "description": "Size, grade, colour, finish or part number." },
          "quantity": { "type": ["number", "string"], "description": "A number where possible." },
          "unit": { "type": "string", "maxLength": 20, "description": "For example pcs, kg, m, boxes." }
        }
      }
    },
    "deliverTo": { "type": "string", "maxLength": 120, "description": "Town or postcode." },
    "neededBy": { "type": "string", "maxLength": 120, "description": "Date the goods are needed, ideally YYYY-MM-DD." },
    "replyBy": { "type": "string", "maxLength": 120, "description": "Date a quote is needed by." },
    "paymentTerms": { "type": "string", "maxLength": 120, "description": "Payment terms asked for, if any." },
    "notes": { "type": "string", "maxLength": 2000 }
  }
}
