POST
/
api
/
panes
/
batch-scan
Batch scan multiple panes
curl --request POST \
  --url http://localhost:3000/api/panes/batch-scan \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "paneNumbers": [
    "<string>"
  ],
  "station": "<string>"
}
'
{
  "success": true,
  "message": "<string>",
  "data": {
    "updatedCount": 123,
    "panes": [
      {
        "_id": "<string>",
        "paneNumber": "PNE-0001",
        "qrCode": "STDPLUS:PNE-0001",
        "request": "<string>",
        "order": "<string>",
        "material": "<string>",
        "inventory": "<string>",
        "currentStation": "<string>",
        "currentStatus": "pending",
        "routing": [
          "<string>"
        ],
        "customRouting": false,
        "dimensions": {
          "width": 1,
          "height": 1,
          "thickness": 1
        },
        "jobType": "<string>",
        "rawGlass": {
          "glassType": "<string>",
          "color": "<string>",
          "thickness": 123,
          "sheetsPerPane": 1
        },
        "glassType": "<string>",
        "glassTypeLabel": "<string>",
        "cornerSpec": "<string>",
        "dimensionTolerance": "<string>",
        "holes": [],
        "notches": [],
        "processes": [
          "<string>"
        ],
        "edgeTasks": [
          {
            "side": "<string>",
            "edgeProfile": "<string>",
            "machineType": "<string>",
            "status": "pending"
          }
        ],
        "withdrawal": "<string>",
        "remakeOf": "<string>",
        "mergedInto": "<string>",
        "laminateMergedAt": "2023-11-07T05:31:56Z",
        "laminateRole": "single",
        "parentPane": "<string>",
        "childPanes": [
          "<string>"
        ],
        "sheetLabel": "<string>",
        "laminateStation": "<string>",
        "startedAt": "2023-11-07T05:31:56Z",
        "completedAt": "2023-11-07T05:31:56Z",
        "deliveredAt": "2023-11-07T05:31:56Z",
        "createdAt": "2023-11-07T05:31:56Z",
        "updatedAt": "2023-11-07T05:31:56Z"
      }
    ]
  }
}

How batch scan works

  • Same actions as single-pane scan (subset): scan_in, start, and complete only. Behavior for each pane matches Scan a pane for those actions (station, status, startedAt, optional material backfill from the order, PaneLog rows, WebSocket events after success).
  • Processing order: Panes are updated in the order they appear in paneNumbers. Only numbers that exist in the database are included; duplicates and unknown IDs are skipped. If no pane numbers resolve to documents, the API returns 400.
  • All-or-nothing (application rollback): The endpoint does not use MongoDB multi-document transactions. If validation fails partway through (e.g. one pane is already completed, merged_into, or wrong station for complete), the server restores earlier panes from a snapshot and deletes PaneLog documents created in that request. That works on standalone MongoDB as well as replica sets.
scan_out, qc_pass, qc_fail, and laminate are not supported here. Use Scan a pane for each pane when you need handoff, QC, or laminate merge. merged_into panes are rejected in batch operations.
Rollback is best-effort in the application layer (not full ACID). Unusual failures (e.g. crash mid-request, or concurrent scans on the same pane) can leave data inconsistent. For the strongest guarantees, prefer single-pane scans or a MongoDB deployment with transactions if you adopt them elsewhere.
For a concise workflow-oriented summary, see Batch scanning under QR Scanning.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
paneNumbers
string[]
required

Array of pane numbers to scan (e.g. ["PNE-0001", "PNE-0002"])

Minimum array length: 1
Minimum string length: 1
station
string
required

Station ObjectId where the scan is performed

Minimum string length: 1
action
enum<string>
required

Action to perform on all panes

Available options:
scan_in,
start,
complete

Response

Batch scan processed successfully

success
boolean
Example:

true

message
string
data
object