POS CameraScanner product barcode lookup

Hi all,

I’ve implemented the CameraScanner component into my app, and it’s working as intended (it returns barcodes as strings when the device camera scans them).

However, I assumed there would be a way of using the ProductSearchApi to return a product/variant that matched the scanned barcode. Upon testing it looks as though that’s not possible, even with the searchProductsfunction.

Is there any way of performing a barcode lookup via the POS extension, or will I need to hit an endpoint in my admin app and return the data?

Any advice would be appreciated!

You can still use the Products GraphQL search query to search by barcode.

You might need to proxy the request through your app, but it should be possible from the POS.

Thanks @Dylan - I thought that might be the case!

You can use the product search api on POS, to run a query with the barcode. You just need to then filter the products down yourself checking if the barcode matches which is pretty straightforward :slight_smile:
It can avoid a external API call then too