# Scan GRN Box

**GET** `/v1/inventory/grn/boxes/scan`

Looks up a pending box by its QR code. Used when a scanner reads a box label at the receiving dock — returns the box details and its parent GRN so the operator can confirm or override the received quantity.

### Query parameters

| Field | Type | Description |
|---|---|---|
| `qr` | string | QR/barcode printed on the box label |

### Response fields

| Field | Type | Description |
|---|---|---|
| `box` | object | The matched box (status `pending`) |
| `box.listing` | object | Product details (id, sku, barcode) |
| `box.grn` | object | Parent GRN (id, status, location_id, reference) |

### Error responses

| Status | Reason | Message |
|---|---|---|
| `422` | Box exists but is already received or processed | `"Box already matched"` / `"Box already discrepancy"` |
| `404` | QR code has never been registered | `"QR code not found — add this box to a GRN first"` |

The `422` vs `404` distinction helps operators distinguish between a box that was already scanned (operational issue) and a box label that was never added to a GRN (setup issue).
