{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/lightspeed/main/json-schema/lightspeed-customer-address-create-response-schema.json",
  "title": "Customer Address Create Response",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/lightspeed-customer-addresses-api-openapi.yml#/components/schemas/CustomerAddressCreateResponse",
  "properties": {
    "data": {
      "allOf": [
        {
          "$ref": "#/$defs/CustomerAddress"
        },
        {
          "properties": {
            "id_token": {
              "description": "Token to be used when associating this address with a sale.",
              "type": "string"
            }
          },
          "type": "object"
        }
      ]
    }
  },
  "type": "object",
  "$defs": {
    "CustomerAddress": {
      "properties": {
        "address_line_1": {
          "description": "Primary address line (street address, P.O. box, etc.).",
          "maxLength": 50,
          "type": "string"
        },
        "address_line_2": {
          "description": "Secondary address line (apartment, suite, unit, building, floor, etc.).",
          "maxLength": 50,
          "type": [
            "string",
            "null"
          ]
        },
        "city": {
          "description": "City or town name.",
          "maxLength": 28,
          "type": "string"
        },
        "country_code": {
          "description": "ISO 3166-1 alpha-2 country code (e.g., US, NZ, AU).",
          "type": "string"
        },
        "country_name": {
          "description": "Full country name derived from the country code.",
          "type": "string"
        },
        "created_at": {
          "description": "Creation timestamp in UTC.",
          "format": "date-time",
          "type": "string"
        },
        "customer_id": {
          "description": "The unique identifier of the customer this address belongs to.",
          "format": "uuid",
          "type": "string"
        },
        "id": {
          "description": "Auto-generated address ID.",
          "format": "int64",
          "type": "integer"
        },
        "postcode": {
          "description": "Postal code or ZIP code.",
          "type": "string"
        },
        "state": {
          "description": "State, province, or region name.",
          "maxLength": 35,
          "type": [
            "string",
            "null"
          ]
        },
        "state_code": {
          "description": "State or province code. Required for US and CA.",
          "type": [
            "string",
            "null"
          ]
        },
        "suburb": {
          "description": "Suburb or district.",
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "description": "The type of address.",
          "enum": [
            "BILLING",
            "SHIPPING"
          ],
          "type": "string"
        },
        "updated_at": {
          "description": "Last update timestamp in UTC.",
          "format": "date-time",
          "type": "string"
        }
      },
      "required": [
        "id",
        "customer_id",
        "address_line_1",
        "city",
        "postcode",
        "country_code",
        "type",
        "created_at",
        "updated_at"
      ],
      "title": "Customer Address",
      "type": "object"
    }
  }
}