Qr code reader (only my qr code)

I’m making an app that allows you to scan qr code on one of its pages.
The problem is that I need this to be able to scan only my qr codes (generated by a backend).
Is there a way that through API calls, for example, allows me to check if the qr is going to be scanned or not?
Thanks in advance.

PS: To the qr code are associated the same code that a bar code (es: AB1234578910)
Maybe i can use this code to check if it is once of my qr code?
Obiviusly if the code is not mine didn’t exit from camera/scanner.