Skip to main content

Scanner API

The Scanner API provides access to barcode and QR code scanning functionality on POS devices, allowing you to subscribe to scan events, monitor available scanner sources, and process scanned data in real-time. The API enables integration with device cameras, external scanners, and embedded scanning hardware.

  • Barcode scanning: Implement barcode scanning for product lookup or inventory management.
  • QR codes: Build QR code scanning for customer engagement or loyalty programs.
  • Custom workflows: Create scanning workflows that process data and trigger business logic.
  • Real-time feedback: Implement real-time scanning feedback with immediate processing.

The shopify global object provides barcode and QR code scanning capabilities. Access the following properties on shopify to read scan data, control the camera scanner, and detect available scanner hardware.

Anchor to scannerData
scannerData
required

Access current scan data and subscribe to new scan events. Use to receive real-time scan results.

Anchor to sources
sources
required

Access available scanner sources on the device. Use to check which scanners are available (camera, external, or embedded).


  • Handle scan events reactively: Use subscribe methods to process scan events as they occur for immediate feedback.
  • Validate scanned data: Validate before processing and handle invalid codes, unsupported formats, or errors.
  • Provide clear feedback: Show success confirmations, error messages, and guidance when scans fail.
  • Adapt to available sources: Check available scanner sources and provide alternatives when preferred methods aren't available.
  • Handle scan data processing: Scan data processing is reactive and requires proper subscription management to avoid memory leaks or unexpected behavior when components unmount.

The Scanner API is only available in action (modal) targets where scanning functionality is supported and can't be used in other targets.


Was this page helpful?