{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/byrd/json-schema/byrd-warehouse-schema.json",
  "title": "Warehouse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/byrd-account-api-openapi.yml#/components/schemas/Warehouse",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "readOnly": true,
      "description": "ID of the record (UUID)."
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "readOnly": true,
      "description": "When the record was created (ISO 8601)."
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "readOnly": true,
      "description": "When the record was last changed (ISO 8601)."
    },
    "code": {
      "type": "string",
      "description": "Unique three-letter code of the warehouse."
    },
    "displayName": {
      "type": "string",
      "description": "Name of the warehouse as shown in the byrd dashboard, usually based on its location."
    },
    "name": {
      "type": "string",
      "description": "Name of the warehouse."
    },
    "legalName": {
      "type": "string",
      "readOnly": true,
      "description": "Legal name of the company operating the warehouse; `null` when not set."
    },
    "countryCode": {
      "type": "string",
      "readOnly": true,
      "description": "Country the warehouse is in (ISO 3166-1 alpha-2)."
    },
    "deliveryAddress": {
      "readOnly": true,
      "description": "Address of the warehouse, where deliveries of your stock are sent.",
      "allOf": [
        {
          "$ref": "#/$defs/DeliveryAddress"
        }
      ]
    },
    "disallowedShipmentOptions": {
      "type": "string",
      "readOnly": true,
      "description": "Shipment options the warehouse does not support, such as `express` or `pickup_point`; a shipment with one of these options cannot be fulfilled from this warehouse. `null` when every option is supported."
    },
    "openingHours": {
      "type": "string",
      "readOnly": true,
      "description": "Opening hours of the warehouse, keyed by ISO weekday number (`1` = Monday to `7` = Sunday). Each weekday holds a list of time ranges `[[start_hour, start_minute], [end_hour, end_minute]]`, earliest first. `null` when no opening hours are set."
    }
  },
  "required": [
    "code",
    "displayName",
    "name"
  ],
  "$defs": {
    "DeliveryAddress": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "readOnly": true,
          "description": "ID of the address (UUID)."
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "readOnly": true,
          "description": "When the record was created (ISO 8601)."
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time",
          "readOnly": true,
          "description": "When the record was last changed (ISO 8601)."
        },
        "adminArea": {
          "type": "string",
          "description": "State, province or region."
        },
        "subAdminArea": {
          "type": "string",
          "description": "County or district within the state."
        },
        "countryCode": {
          "type": "string",
          "minLength": 2,
          "maxLength": 2,
          "description": "Country (ISO 3166-1 alpha-2), for example `DE`."
        },
        "countryName": {
          "type": "string",
          "description": "Name of the country."
        },
        "locality": {
          "type": "string",
          "description": "City."
        },
        "subLocality": {
          "type": "string",
          "description": "District or neighbourhood within the city."
        },
        "postalCode": {
          "type": "string",
          "description": "Postal code. For countries with numeric postal codes, anything but digits is removed, such as a `DE-` prefix."
        },
        "thoroughfare": {
          "type": "string",
          "description": "Name of the street, without the house number."
        },
        "subThoroughfare": {
          "type": "string",
          "description": "House number."
        },
        "subSubThoroughfare": {
          "type": "string",
          "description": "Additional address details, such as building or floor."
        },
        "latitude": {
          "type": [
            "number",
            "null"
          ],
          "description": "Latitude of the address in decimal degrees; `null` if unknown."
        },
        "longitude": {
          "type": [
            "number",
            "null"
          ],
          "description": "Longitude of the address in decimal degrees; `null` if unknown."
        },
        "phone": {
          "type": [
            "string",
            "null"
          ],
          "description": "Phone number, with the country code where possible, for example `+49 1234567890`. For a recipient, it is given to the carrier, and characters other than digits and `+` are removed."
        }
      },
      "required": [
        "adminArea",
        "countryCode",
        "locality",
        "postalCode",
        "subAdminArea",
        "subLocality",
        "subSubThoroughfare",
        "subThoroughfare",
        "thoroughfare"
      ],
      "title": "Delivery address"
    }
  }
}