{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://developer-production-s.squarecdn.com/schemas/v1/common.json",
  "type": "object",
  "connectApiVersion": "2021-07-21",
  "definitions": {
    "squareup.common.String": {
      "$id": "#squareup.common.String",
      "description": "A String with maximum length of 1000.",
      "type": "string",
      "maxLength": 1000
    },
    "squareup.common.Number": {
      "$id": "#squareup.common.Number",
      "description": "A number with up to 5 decimal places, represented by a String",
      "type": "string",
      "pattern": "^-?[0-9]*(\\.[0-9]{0,5})?$",
      "not": {
        "enum": [
          "-",
          ".",
          ""
        ]
      }
    },
    "squareup.common.Boolean": {
      "$id": "#squareup.common.Boolean",
      "description": "A boolean field: true or false.",
      "type": "boolean"
    },
    "squareup.common.PhoneNumber": {
      "$id": "#squareup.common.PhoneNumber",
      "description": "A phone number in the standard E.164 format.",
      "type": "string",
      "pattern": "^\\+[1-9][0-9]{1,14}$"
    },
    "squareup.common.Email": {
      "$id": "#squareup.common.Email",
      "description": "An email address. Emails must use ascii characters and match the [HTML5 Email RegEx](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email#validation).",
      "type": "string",
      "format": "email"
    },
    "squareup.common.Date": {
      "$id": "#squareup.common.Date",
      "description": "A date in the ISO 8601 format.",
      "type": "string",
      "format": "date"
    },
    "squareup.common.DateTime": {
      "$id": "#squareup.common.DateTime",
      "description": "Date and time together; in the ISO 8601 format.",
      "type": "string",
      "format": "date-time"
    },
    "squareup.common.Duration": {
      "$id": "#squareup.common.Duration",
      "description": "A duration as defined by the ISO 8601 ABNF for “duration”.",
      "type": "string",
      "pattern": "^P(?!$)([0-9]+Y)?([0-9]+M)?([0-9]+W)?([0-9]+D)?(T(?=[0-9])([0-9]+H)?([0-9]+M)?([0-9]+S)?)?$"
    },
    "squareup.common.Address": {
      "$id": "#squareup.common.Address",
      "description": "An Address object as defined by [Square's Connect API](https://developer.squareup.com/reference/square_2021-07-21/objects/Address)",
      "type": "object",
      "additionalProperties": false,
      "minProperties": 1,
      "properties": {
        "address_line_1": {
          "$ref": "#squareup.common.String",
          "description": "The first line of the address."
        },
        "address_line_2": {
          "$ref": "#squareup.common.String",
          "description": "The second line of the address, if any."
        },
        "address_line_3": {
          "$ref": "#squareup.common.String",
          "description": "The third line of the address, if any."
        },
        "locality": {
          "$ref": "#squareup.common.String",
          "description": "The city or town of the address."
        },
        "sublocality": {
          "$ref": "#squareup.common.String",
          "description": "A civil region within the address's `locality`, if any."
        },
        "sublocality_2": {
          "$ref": "#squareup.common.String",
          "description": "A civil region within the address's `sublocality`, if any."
        },
        "sublocality_3": {
          "$ref": "#squareup.common.String",
          "description": "A civil region within the address's `sublocality_2`, if any."
        },
        "administrative_district_level_1": {
          "$ref": "#squareup.common.String",
          "description": "A civil entity within the address's country. In the US, this is the state."
        },
        "administrative_district_level_2": {
          "$ref": "#squareup.common.String",
          "description": "A civil entity within the address's `administrative_district_level_1`. In the US, this is the county."
        },
        "administrative_district_level_3": {
          "$ref": "#squareup.common.String",
          "description": "A civil entity within the address's `administrative_district_level_2`, if any."
        },
        "postal_code": {
          "$ref": "#squareup.common.String",
          "description": "The address's postal code."
        },
        "country": {
          "enum": [
            "ZZ",
            "AD",
            "AE",
            "AF",
            "AG",
            "AI",
            "AL",
            "AM",
            "AO",
            "AQ",
            "AR",
            "AS",
            "AT",
            "AU",
            "AW",
            "AX",
            "AZ",
            "BA",
            "BB",
            "BD",
            "BE",
            "BF",
            "BG",
            "BH",
            "BI",
            "BJ",
            "BL",
            "BM",
            "BN",
            "BO",
            "BQ",
            "BR",
            "BS",
            "BT",
            "BV",
            "BW",
            "BY",
            "BZ",
            "CA",
            "CC",
            "CD",
            "CF",
            "CG",
            "CH",
            "CI",
            "CK",
            "CL",
            "CM",
            "CN",
            "CO",
            "CR",
            "CU",
            "CV",
            "CW",
            "CX",
            "CY",
            "CZ",
            "DE",
            "DJ",
            "DK",
            "DM",
            "DO",
            "DZ",
            "EC",
            "EE",
            "EG",
            "EH",
            "ER",
            "ES",
            "ET",
            "FI",
            "FJ",
            "FK",
            "FM",
            "FO",
            "FR",
            "GA",
            "GB",
            "GD",
            "GE",
            "GF",
            "GG",
            "GH",
            "GI",
            "GL",
            "GM",
            "GN",
            "GP",
            "GQ",
            "GR",
            "GS",
            "GT",
            "GU",
            "GW",
            "GY",
            "HK",
            "HM",
            "HN",
            "HR",
            "HT",
            "HU",
            "ID",
            "IE",
            "IL",
            "IM",
            "IN",
            "IO",
            "IQ",
            "IR",
            "IS",
            "IT",
            "JE",
            "JM",
            "JO",
            "JP",
            "KE",
            "KG",
            "KH",
            "KI",
            "KM",
            "KN",
            "KP",
            "KR",
            "KW",
            "KY",
            "KZ",
            "LA",
            "LB",
            "LC",
            "LI",
            "LK",
            "LR",
            "LS",
            "LT",
            "LU",
            "LV",
            "LY",
            "MA",
            "MC",
            "MD",
            "ME",
            "MF",
            "MG",
            "MH",
            "MK",
            "ML",
            "MM",
            "MN",
            "MO",
            "MP",
            "MQ",
            "MR",
            "MS",
            "MT",
            "MU",
            "MV",
            "MW",
            "MX",
            "MY",
            "MZ",
            "NA",
            "NC",
            "NE",
            "NF",
            "NG",
            "NI",
            "NL",
            "NO",
            "NP",
            "NR",
            "NU",
            "NZ",
            "OM",
            "PA",
            "PE",
            "PF",
            "PG",
            "PH",
            "PK",
            "PL",
            "PM",
            "PN",
            "PR",
            "PS",
            "PT",
            "PW",
            "PY",
            "QA",
            "RE",
            "RO",
            "RS",
            "RU",
            "RW",
            "SA",
            "SB",
            "SC",
            "SD",
            "SE",
            "SG",
            "SH",
            "SI",
            "SJ",
            "SK",
            "SL",
            "SM",
            "SN",
            "SO",
            "SR",
            "SS",
            "ST",
            "SV",
            "SX",
            "SY",
            "SZ",
            "TC",
            "TD",
            "TF",
            "TG",
            "TH",
            "TJ",
            "TK",
            "TL",
            "TM",
            "TN",
            "TO",
            "TR",
            "TT",
            "TV",
            "TW",
            "TZ",
            "UA",
            "UG",
            "UM",
            "US",
            "UY",
            "UZ",
            "VA",
            "VC",
            "VE",
            "VG",
            "VI",
            "VN",
            "VU",
            "WF",
            "WS",
            "YE",
            "YT",
            "ZA",
            "ZM",
            "ZW"
        ],
          "description": "The address's country, in ISO 3166-1-alpha-2 format."
        },
        "first_name": {
          "$ref": "#squareup.common.String",
          "description": "Optional first name when the address represents an individual recipient."
        },
        "last_name": {
          "$ref": "#squareup.common.String",
          "description": "Optional last name when the address represents an individual recipient."
        },
        "organization": {
          "$ref": "#squareup.common.String",
          "description": "Optional organization name when the address represents a recipient who is an individual at an organization or is the organization itself."
        }
      }
    }
  }
}
