{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/monacloud/main/json-schema/monacloud-domain-reserve-request-schema.json",
  "title": "DomainReserveRequest",
  "description": "Giữ chỗ tên miền (spec monadomain §12) — guest hay user đều gọi được.\n\nEmail + phone bắt buộc: vừa là kênh gửi claim-link, vừa là lead rmkt (§12b).\n``registrant`` tuỳ chọn: agent đã hỏi đủ chủ thể trong phiên thì gửi luôn,\nlúc claim khỏi hỏi lại.",
  "x-generated": "2026-10-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/monacloud-api-openapi.json#/components/schemas/DomainReserveRequest",
  "properties": {
    "name": {
      "type": "string",
      "title": "Name"
    },
    "years": {
      "type": "integer",
      "maximum": 10.0,
      "minimum": 1.0,
      "title": "Years",
      "default": 1
    },
    "email": {
      "type": "string",
      "title": "Email"
    },
    "phone": {
      "type": "string",
      "maxLength": 20,
      "minLength": 8,
      "title": "Phone"
    },
    "marketing_consent": {
      "type": "boolean",
      "title": "Marketing Consent",
      "default": false
    },
    "spelling_confirmed": {
      "type": "boolean",
      "title": "Spelling Confirmed",
      "default": false
    },
    "registrant": {
      "anyOf": [
        {
          "$ref": "#/$defs/DomainRegistrant"
        },
        {
          "type": "null"
        }
      ]
    },
    "context": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 500
        },
        {
          "type": "null"
        }
      ],
      "title": "Context"
    }
  },
  "type": "object",
  "required": [
    "name",
    "email",
    "phone"
  ],
  "$defs": {
    "DomainRegistrant": {
      "properties": {
        "owner_type": {
          "type": "string",
          "enum": [
            "individual",
            "organization"
          ],
          "title": "Owner Type",
          "default": "individual"
        },
        "fullname": {
          "type": "string",
          "maxLength": 200,
          "minLength": 2,
          "title": "Fullname"
        },
        "email": {
          "type": "string",
          "title": "Email"
        },
        "phone": {
          "type": "string",
          "maxLength": 20,
          "minLength": 8,
          "title": "Phone"
        },
        "address": {
          "type": "string",
          "maxLength": 500,
          "minLength": 5,
          "title": "Address"
        },
        "province": {
          "type": "string",
          "maxLength": 100,
          "title": "Province",
          "default": ""
        },
        "ward": {
          "type": "string",
          "maxLength": 100,
          "title": "Ward",
          "default": ""
        },
        "country": {
          "type": "string",
          "maxLength": 10,
          "title": "Country",
          "default": "VN"
        },
        "cccd": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 12,
              "minLength": 0
            },
            {
              "type": "null"
            }
          ],
          "title": "Cccd"
        },
        "dob": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 20
            },
            {
              "type": "null"
            }
          ],
          "title": "Dob"
        },
        "gender": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "male",
                "female",
                ""
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Gender"
        },
        "org_name": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 300
            },
            {
              "type": "null"
            }
          ],
          "title": "Org Name"
        },
        "tax_code": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 20
            },
            {
              "type": "null"
            }
          ],
          "title": "Tax Code"
        },
        "representative": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 200
            },
            {
              "type": "null"
            }
          ],
          "title": "Representative"
        }
      },
      "type": "object",
      "required": [
        "fullname",
        "email",
        "phone",
        "address"
      ],
      "title": "DomainRegistrant"
    }
  }
}