{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://ucp.dev/2026-08-25/schemas/common/location_lookup.json",
  "name": "dev.ucp.common.location.lookup",
  "title": "Location Lookup",
  "description": "Location lookup by identifiers. Supports batch retrieval and single-location detail.",
  "type": "object",
  "$defs": {
    "lookup_location": {
      "description": "Location with required correlation metadata for lookup responses.",
      "allOf": [
        {
          "$ref": "https://ucp.dev/2026-08-25/schemas/common/types/location.json"
        },
        {
          "type": "object",
          "required": [
            "inputs"
          ],
          "properties": {
            "inputs": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "id"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The identifier exactly as supplied in the lookup request.",
                    "ucp_request": "omit"
                  }
                }
              },
              "minItems": 1,
              "description": "Which request identifiers resolved to this Location. Each entry preserves one identifier exactly as supplied in the request.",
              "ucp_request": "omit"
            }
          }
        }
      ]
    },
    "lookup_request": {
      "type": "object",
      "description": "Request body for batch location lookup. The Business resolves and deduplicates `ids` before applying `distance`, `serves`, and every supplied `filters` predicate; all structured predicates combine with AND.",
      "required": [
        "ids"
      ],
      "properties": {
        "ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "minItems": 1,
          "description": "Identifiers of the Locations to look up. The Business MUST support canonical `Location.id` values and MAY support secondary or alias identifiers."
        },
        "distance": {
          "$ref": "https://ucp.dev/2026-08-25/schemas/common/types/location_distance.json",
          "description": "Optional explicit-center radius predicate applied after ID resolution. It combines with `serves` and every supplied `filters` predicate using AND.",
          "ucp_request": "optional"
        },
        "serves": {
          "$ref": "https://ucp.dev/2026-08-25/schemas/common/types/location_serves.json",
          "description": "Optional authoritative service-target predicate applied after ID resolution. It combines with `distance` and every supplied `filters` predicate using AND.",
          "ucp_request": "optional"
        },
        "filters": {
          "$ref": "https://ucp.dev/2026-08-25/schemas/common/types/location_filter.json"
        },
        "context": {
          "$ref": "https://ucp.dev/2026-08-25/schemas/common/types/context.json"
        },
        "signals": {
          "$ref": "https://ucp.dev/2026-08-25/schemas/common/types/signals.json"
        }
      }
    },
    "lookup_response": {
      "type": "object",
      "required": [
        "ucp",
        "locations"
      ],
      "properties": {
        "ucp": {
          "$ref": "https://ucp.dev/2026-08-25/schemas/ucp.json#/$defs/response_location_schema"
        },
        "locations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/lookup_location"
          },
          "description": "Locations matching the requested identifiers and refinements. May contain fewer Locations if some identifiers do not resolve or their resolved Locations are filtered out, or more if one identifier resolves to multiple Locations. When multiple identifiers resolve to the same Location, one returned Location carries all corresponding `inputs` entries."
        },
        "messages": {
          "type": "array",
          "items": {
            "$ref": "https://ucp.dev/2026-08-25/schemas/common/types/message.json"
          },
          "description": "Errors, warnings, or informational messages about the requested Locations, including `batch_limit_applied` when the Business processes only its configured maximum number of identifiers."
        }
      }
    }
  },
  "version": "2026-08-25"
}