{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/customermates-com/json-schema/customermates-com-record-address-schema.json",
  "title": "RecordAddress",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/customermates-com-addresses-api-openapi.yml#/components/schemas/RecordAddress",
  "type": "object",
  "properties": {
    "street": {
      "default": null,
      "anyOf": [
        {
          "type": "string",
          "maxLength": 200
        },
        {
          "type": "null"
        }
      ]
    },
    "line2": {
      "default": null,
      "anyOf": [
        {
          "type": "string",
          "maxLength": 200
        },
        {
          "type": "null"
        }
      ]
    },
    "postalCode": {
      "default": null,
      "anyOf": [
        {
          "type": "string",
          "maxLength": 20
        },
        {
          "type": "null"
        }
      ]
    },
    "city": {
      "default": null,
      "anyOf": [
        {
          "type": "string",
          "maxLength": 200
        },
        {
          "type": "null"
        }
      ]
    },
    "region": {
      "default": null,
      "anyOf": [
        {
          "type": "string",
          "maxLength": 200
        },
        {
          "type": "null"
        }
      ]
    },
    "countryCode": {
      "default": null,
      "description": "ISO 3166-1 alpha-2 country code in lowercase, such as de.",
      "anyOf": [
        {
          "type": "string",
          "pattern": "^[a-z]{2}$"
        },
        {
          "type": "null"
        }
      ]
    },
    "formatted": {
      "default": "",
      "description": "One-line address the server formats from the parts; a sent value is replaced.",
      "type": "string",
      "maxLength": 500
    },
    "location": {
      "default": null,
      "description": "Owned by the server: coordinates for maps, from an address lookup or the postal code.",
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "lat": {
              "type": "number",
              "minimum": -90,
              "maximum": 90
            },
            "lon": {
              "type": "number",
              "minimum": -180,
              "maximum": 180
            },
            "precision": {
              "type": "string",
              "enum": [
                "address",
                "postcode"
              ],
              "description": "address: the building, from an address lookup; postcode: the centre of the postal code."
            }
          },
          "required": [
            "lat",
            "lon",
            "precision"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "verification": {
      "default": {
        "status": "unverified",
        "provider": null,
        "checkedAt": null
      },
      "description": "Owned by the server: only a lookup candidateToken stores a verified address.",
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "verified",
            "unverified"
          ]
        },
        "provider": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 64
            },
            {
              "type": "null"
            }
          ]
        },
        "checkedAt": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 64
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "status",
        "provider",
        "checkedAt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "street",
    "line2",
    "postalCode",
    "city",
    "region",
    "countryCode",
    "formatted",
    "location",
    "verification"
  ],
  "additionalProperties": false
}