# GetListingByExternalIdentifier

## Overview

GetListingByExternalIdentifier resolves the internal listing record from an external channel identifier. It is the lookup bridge used by channel-order ingestion and support tooling.

## Business Rules

- Channel identifier and external listing identifier are required.
- The query returns retired listings when they must remain referenceable for historical support.

## Process Flow

```mermaid
flowchart TD
    A[Receive channel id and external identifier] --> B[Query listing by channel and external identifier]
    B --> C{Found?}
    C -->|No| D[Return null]
    C -->|Yes| E[Return listing]
```

## External Dependencies

- None

## Error Scenarios

- **IDENTIFIER_REQUIRED**: Channel id and external identifier are required.

## Test Cases

- returns listing by external identifier
- returns retired listing when historical reference is needed
- returns null when no listing matches the external identifier
- throws when channel id or external identifier is missing
