Sending data to API and receive response and take action based on the response

I am trying to send tag data to an API server. Specifically, we use a barcode scanner at the end of our production line to scan the QR code of each tray.

The goal is to send the QR code to the API, receive a response indicating whether the result is "good" or "bad," and, in the case of a "bad" response, resend the QR code. Additionally, the timeout for retries will be exponential, and I need guidance on how to decide when to stop attempting to get a valid response.

It’s important to note that tray QR codes will continuously be coming in, so we can’t simply wait for one to return "good" before moving forward. We need to handle multiple QR code requests in parallel.

However, I am not very familiar with the specific features of the API, and I’m hoping if anyone can help assist or point me in the right direction.

There are thousands of types of API, your best bet is to tell us what hardware you are referring to, then we may be able to guide you on this.

I have used Datalogic scanners in this way, and they work just fine. They use an OPC-UA connection directly to ignition and I connected it to a database for data operations.

If the API is on the server side, let us know what software it is using.