{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/handsforagents-com/json-schema/handsforagents-com-quote-request-schema.json",
  "title": "QuoteRequest",
  "description": "A quote request in either shape; the two can also be mixed, and the nested value wins if a field is sent both ways. Required in the flat shape: description, email, name; in the nested shape: task.description, client.email, client.name.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/handsforagents-com-openapi.yaml#/components/schemas/QuoteRequest",
  "anyOf": [
    {
      "$ref": "#/$defs/QuoteRequestFlat"
    },
    {
      "$ref": "#/$defs/QuoteRequestNested"
    }
  ],
  "$defs": {
    "QuoteRequestFlat": {
      "type": "object",
      "properties": {
        "description": {
          "type": "string",
          "description": "What is to be done, in plain language: everything the user told you (quantity, material, colour, size, tolerances, what counts as done). A detail that has no field of its own belongs here.",
          "maxLength": 20000
        },
        "services": {
          "type": "array",
          "description": "Service ids from the service list, if you know them.",
          "items": {
            "type": "string",
            "enum": [
              "design",
              "make",
              "assemble",
              "measure",
              "test",
              "verify",
              "ship"
            ]
          }
        },
        "deliverables": {
          "type": "string",
          "description": "What you expect to receive (item, files, report, photos, video). Optional - if you are not sure, leave it out and put it in task.description instead.",
          "maxLength": 5000
        },
        "deadline": {
          "type": "string",
          "description": "Latest acceptable delivery or dispatch date (ISO 8601). Optional; omit if the user gave none.",
          "format": "date",
          "maxLength": 32
        },
        "delivery_address": {
          "type": "string",
          "description": "Required whenever a physical item is to be shipped, handed over in person or collected; omit it only for purely digital results (files, a report). One plain string, not an object and not a list: recipient name, street, postcode and city, country; a phone number at the end only if you already have one (phone is optional - never stop to ask the user for it). If you do not have the address, ask the user for it; never invent one.",
          "maxLength": 1000
        },
        "input_files": {
          "type": "array",
          "description": "HTTPS URLs of input files, for example photos, a sketch, a CAD model (STEP, STL), a PDF drawing, or other instructions, or attach the files to the e-mail. At most 20, each at most 2000 characters.",
          "items": {
            "type": "string",
            "maxLength": 2000,
            "pattern": "^https://"
          },
          "maxItems": 20
        },
        "currency": {
          "type": "string",
          "description": "Currency of the quote. Default EUR.",
          "enum": [
            "EUR",
            "USD"
          ]
        },
        "email": {
          "type": "string",
          "description": "E-mail of the operator. The quote, the payment link and the invoice go here.",
          "format": "email",
          "maxLength": 254,
          "pattern": "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"
        },
        "name": {
          "type": "string",
          "description": "Required. The name of the person or company for the invoice: the registered name of the company that operates the agent, or a person's full name. Use a company name or address already in the conversation; if you have none, ask the user.",
          "minLength": 1,
          "maxLength": 200,
          "pattern": "^[^\\r\\n]+$"
        },
        "country": {
          "type": "string",
          "description": "Country of the operator, ISO 3166-1 alpha-2 (upper case). Optional, but include it whenever you can derive it (for example from the operator's address) rather than leaving it out or asking the user.",
          "pattern": "^[A-Z]{2}$"
        },
        "vat_id": {
          "type": "string",
          "description": "VAT or tax id of the operator, printed on the invoice. Optional. Only if the user gave it; never guess or make one up (a wrong number goes on the invoice). Leave it out otherwise.",
          "maxLength": 32
        },
        "agent_name": {
          "type": "string",
          "description": "Name of the agent or platform sending the request. Optional, for our records.",
          "maxLength": 200
        },
        "allow_anonymised_example": {
          "type": "boolean",
          "description": "Consent to publish this task as an anonymised example (no names, addresses or personal data), under the confidentiality section of the terms of service. Only set true if the client explicitly agreed to this; otherwise omit the field or leave it false. Default false; can be withdrawn.",
          "default": false
        }
      },
      "required": [
        "description",
        "email",
        "name"
      ]
    },
    "QuoteRequestNested": {
      "type": "object",
      "properties": {
        "task": {
          "type": "object",
          "properties": {
            "description": {
              "type": "string",
              "description": "What is to be done, in plain language: everything the user told you (quantity, material, colour, size, tolerances, what counts as done). A detail that has no field of its own belongs here.",
              "maxLength": 20000
            },
            "services": {
              "type": "array",
              "description": "Service ids from the service list, if you know them.",
              "items": {
                "type": "string",
                "enum": [
                  "design",
                  "make",
                  "assemble",
                  "measure",
                  "test",
                  "verify",
                  "ship"
                ]
              }
            },
            "deliverables": {
              "type": "string",
              "description": "What you expect to receive (item, files, report, photos, video). Optional - if you are not sure, leave it out and put it in task.description instead.",
              "maxLength": 5000
            },
            "deadline": {
              "type": "string",
              "description": "Latest acceptable delivery or dispatch date (ISO 8601). Optional; omit if the user gave none.",
              "format": "date",
              "maxLength": 32
            },
            "delivery_address": {
              "type": "string",
              "description": "Required whenever a physical item is to be shipped, handed over in person or collected; omit it only for purely digital results (files, a report). One plain string, not an object and not a list: recipient name, street, postcode and city, country; a phone number at the end only if you already have one (phone is optional - never stop to ask the user for it). If you do not have the address, ask the user for it; never invent one.",
              "maxLength": 1000
            },
            "input_files": {
              "type": "array",
              "description": "HTTPS URLs of input files, for example photos, a sketch, a CAD model (STEP, STL), a PDF drawing, or other instructions, or attach the files to the e-mail. At most 20, each at most 2000 characters.",
              "items": {
                "type": "string",
                "maxLength": 2000,
                "pattern": "^https://"
              },
              "maxItems": 20
            },
            "currency": {
              "type": "string",
              "description": "Currency of the quote. Default EUR.",
              "enum": [
                "EUR",
                "USD"
              ]
            }
          },
          "required": [
            "description"
          ]
        },
        "client": {
          "type": "object",
          "properties": {
            "email": {
              "type": "string",
              "description": "E-mail of the operator. The quote, the payment link and the invoice go here.",
              "format": "email",
              "maxLength": 254,
              "pattern": "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"
            },
            "name": {
              "type": "string",
              "description": "Required. The name of the person or company for the invoice: the registered name of the company that operates the agent, or a person's full name. Use a company name or address already in the conversation; if you have none, ask the user.",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[^\\r\\n]+$"
            },
            "country": {
              "type": "string",
              "description": "Country of the operator, ISO 3166-1 alpha-2 (upper case). Optional, but include it whenever you can derive it (for example from the operator's address) rather than leaving it out or asking the user.",
              "pattern": "^[A-Z]{2}$"
            },
            "vat_id": {
              "type": "string",
              "description": "VAT or tax id of the operator, printed on the invoice. Optional. Only if the user gave it; never guess or make one up (a wrong number goes on the invoice). Leave it out otherwise.",
              "maxLength": 32
            }
          },
          "required": [
            "email",
            "name"
          ]
        },
        "agent": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "Name of the agent or platform sending the request. Optional, for our records.",
              "maxLength": 200
            }
          }
        },
        "allow_anonymised_example": {
          "type": "boolean",
          "description": "Consent to publish this task as an anonymised example (no names, addresses or personal data), under the confidentiality section of the terms of service. Only set true if the client explicitly agreed to this; otherwise omit the field or leave it false. Default false; can be withdrawn.",
          "default": false
        }
      }
    }
  }
}