{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/shipcloud/json-schema/shipcloud-address-with-id-schema.json",
  "title": "address_with_id",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/shipcloud-addresses-api-openapi.yml#/components/schemas/address_with_id",
  "allOf": [
    {
      "$ref": "#/$defs/address"
    },
    {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "identifier of a previously created address"
        }
      },
      "required": [
        "id",
        "first_name",
        "last_name",
        "company",
        "care_of",
        "state",
        "street_no"
      ]
    }
  ],
  "$defs": {
    "address": {
      "type": "object",
      "properties": {
        "care_of": {
          "type": [
            "string",
            "null"
          ],
          "description": "Additional care of field"
        },
        "city": {
          "type": "string",
          "description": "Name of the city"
        },
        "country": {
          "type": "string",
          "description": "Country as uppercase ISO 3166-1 alpha-2 code"
        },
        "first_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "A persons first name"
        },
        "state": {
          "type": [
            "string",
            "null"
          ],
          "description": "The state the address is in"
        },
        "street": {
          "type": "string",
          "description": "Name of the street. Can hold the house number"
        },
        "street_no": {
          "type": [
            "string",
            "null"
          ],
          "description": "House number of the address (when a carrier requires it separately)"
        },
        "zip_code": {
          "type": "string",
          "description": "Zipcode of the address"
        },
        "phone": {
          "type": "string",
          "description": "Telephone number (mandatory when using UPS and the following terms apply: service is `one_day` or `one_day_early` or ship to country is different than ship from country)"
        },
        "email": {
          "type": "string",
          "description": "Email address for this person. Some carrier are using the email address to send notifications"
        }
      },
      "required": [
        "street",
        "city",
        "zip_code",
        "country"
      ]
    }
  }
}