Skip to main content
Migrate to Polaris

Version 2025-07 is the last API version to support React-based UI components. Later versions use web components, native UI elements with built-in accessibility, better performance, and consistent styling with Shopify's design system. Check out the migration guide to upgrade your extension.

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 through subscription callbacks. 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 scanning: Build QR code scanning features for customer engagement or loyalty programs.
  • Custom workflows: Create custom scanning workflows that process scan data.
  • Real-time feedback: Implement real-time scanning feedback with immediate processing.

The Scanner API object provides access to barcode and QR code scanning functionality on POS devices. Access the following properties on the API object to subscribe to scan events, monitor available scanner sources, and process scanned data.

Anchor to scannerDataSubscribable
scannerDataSubscribable
RemoteSubscribable<>
required

Subscribe to scan events to receive barcode and QR code data when scanned. Supports one subscription at a time. Use for receiving real-time scan results.

Anchor to scannerSourcesSubscribable
scannerSourcesSubscribable
RemoteSubscribable<[]>
required

Subscribe to changes in available scanner sources on the device. Supports one subscription at a time. Use to monitor which scanners are available (camera, external, or embedded).


  • Validate scanned data appropriately: Validate scanned data before processing, implementing proper error handling for invalid codes, unsupported formats, or scanning errors.
  • Provide clear scanning feedback: Give users clear feedback about scan results, including success confirmations, error messages, and guidance when scans fail or produce invalid data.
  • Adapt to available scanner sources: Check available scanner sources and adapt your interface accordingly.

  • The Scanner API is only available in action (modal) targets where scanning functionality is supported and can't be used in other targets.
  • RemoteSubscribable supports only one subscription at a time. Use makeStatefulSubscribable if you need multiple components to subscribe to scan events simultaneously.
  • Scanning availability depends on device hardware capabilities and may vary between different POS devices and configurations.

Was this page helpful?