# Barcode Lookup

**GET** `/v1/inventory/lookup`

Looks up a listing by barcode and returns its current stock, FEFO-ordered batches, and total on-hand quantity. Performs an exact match first, then falls back to a case-insensitive fuzzy match.

### Query parameters

| Field | Type | Description |
|---|---|---|
| `barcode` | string | Barcode to search (exact or partial) |

### Response fields

| Field | Type | Description |
|---|---|---|
| `listing` | object | Matched listing (id, sku, barcode, list_price) |
| `stock` | array | Stock rows per location |
| `batches` | array | Active batches in FEFO order (soonest expiry first) |
| `total_stock` | integer | Sum of quantity across all locations |

### Notes

- Returns `404` if no listing matches the barcode.
- Batches with `quantity = 0` are excluded.
- FEFO ordering: batches with no expiry date appear last.
