{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aveco-app/json-schema/aveco-app-aveco-webapp-routes-domains-purchase-body-schema.json",
  "title": "PurchaseBody",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aveco-app-domains-api-openapi.yml#/components/schemas/aveco__webapp__routes__domains__PurchaseBody",
  "properties": {
    "domain": {
      "type": "string",
      "title": "Domain"
    },
    "years": {
      "type": "integer",
      "maximum": 5.0,
      "minimum": 1.0,
      "title": "Years",
      "default": 1
    },
    "contact": {
      "$ref": "#/$defs/ContactBody"
    },
    "privacy": {
      "type": "boolean",
      "title": "Privacy",
      "default": true
    },
    "expected_price_cents": {
      "type": "integer",
      "title": "Expected Price Cents"
    },
    "idempotency_key": {
      "type": "string",
      "maxLength": 80,
      "minLength": 8,
      "title": "Idempotency Key"
    },
    "terms_accepted": {
      "type": "boolean",
      "title": "Terms Accepted",
      "default": false
    }
  },
  "type": "object",
  "required": [
    "domain",
    "contact",
    "expected_price_cents",
    "idempotency_key"
  ],
  "$defs": {
    "ContactBody": {
      "properties": {
        "first_name": {
          "type": "string",
          "maxLength": 60,
          "minLength": 1,
          "title": "First Name"
        },
        "last_name": {
          "type": "string",
          "maxLength": 60,
          "minLength": 1,
          "title": "Last Name"
        },
        "email": {
          "type": "string",
          "maxLength": 120,
          "minLength": 5,
          "pattern": "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$",
          "title": "Email"
        },
        "phone": {
          "type": "string",
          "pattern": "^\\+[1-9]\\d{6,14}$",
          "title": "Phone"
        },
        "address1": {
          "type": "string",
          "maxLength": 120,
          "minLength": 1,
          "title": "Address1"
        },
        "address2": {
          "type": "string",
          "maxLength": 120,
          "title": "Address2",
          "default": ""
        },
        "city": {
          "type": "string",
          "maxLength": 80,
          "minLength": 1,
          "title": "City"
        },
        "state": {
          "type": "string",
          "maxLength": 80,
          "minLength": 1,
          "title": "State"
        },
        "zip": {
          "type": "string",
          "maxLength": 20,
          "minLength": 1,
          "title": "Zip"
        },
        "country": {
          "type": "string",
          "maxLength": 2,
          "minLength": 2,
          "title": "Country"
        },
        "company": {
          "type": "string",
          "maxLength": 120,
          "title": "Company",
          "default": ""
        }
      },
      "type": "object",
      "required": [
        "first_name",
        "last_name",
        "email",
        "phone",
        "address1",
        "city",
        "state",
        "zip",
        "country"
      ],
      "title": "ContactBody"
    }
  }
}