From my understanding, a QR code is just a static link which get opened up when I scan the code with my phone's camera.

Once opened, a customer can keep the browser tab even after he leaves the restaurant. If that's the case, my question is: How can I prevent a naughty customer from refreshing the page and placing an order when he's not physically at the restaurant?

One possible solution is to force the customer to pay online immediately everytime he submits an order. However, this solution doesn't work in countries where cash payment is still popular.

Another solution is to make the QR code work inside the restaurant WiFi network only. This solution makes it harder for customers to place an order which is not a good thing, especially if we have to serve older audience.

I tried to google this topic but all I found are links to QR ordering software. I wonder how people are solving this problem in those products. If you happen to know, I'd be very grateful if you could share it with me.

Someone mentioned a similar question in the comment. I find the answers/discussions there are not as engaging and fruitful as the ones I had here while the topic is the same. The author didn't even discuss any solutions he thought about in details. Yet, the question is not closed and mine is? What's the criteria for this?

  • 2
    This will probably be closed as it isn't a software engineering problem but a business decision, implementing the software would be pretty straightforward. I've written an answer anyway, maybe it's useful to you even if not generally interesting. Commented Apr 12, 2022 at 7:22
  • 1
    In some cases this will be actively unhelpful. I'm on the way to my local cafe and want my order to be ready to collect (I don't want to be hanging around, there's a pandemic on)? Sorry, you need to be at the physical location to order online.
    – jonrsharpe
    Commented Apr 12, 2022 at 12:39
  • 1
    How do you currently deal with customers who walk away between ordering and getting their order delivered? Commented Apr 12, 2022 at 13:43
  • 1
    for the record, where we have this QR thing around here you must pay before anything is actually happening. I would suggest you do the same. Commented Apr 12, 2022 at 15:16
  • 1
    There was a very similar question a few months ago: softwareengineering.stackexchange.com/questions/433149/… Commented Apr 12, 2022 at 16:41

4 Answers 4


A QR code is just a machine-readable representation of some string (in your case, an URL). Strings can be copied and kept using whatever mechanisms, you can't seriously protect against that.

The correct solution would be to give each customer a customer-specific or time-limited QR code, for example by showing it not on a printed medium but on a changeable display (big screen in the restaurant, small e-paper displays on the table whose content is updated after a customer leaves.)

However, such a solution is potentially costly, and the risk of being defrauded should be weighed against the cost of implementing such a scheme, as @Philip-Kendall noted.

This is actually not a software engineering problem but a business process decision. Implementing the software solution once you have a good understanding of the business process that you want to perform is pretty straightforward.

  • Thank you for the suggestion. It actually makes sense. However, I humbly disagree with the statement that this is not an engineering problem :). IMHO, a good engineer doesn't sit and wait for business users to come up with a business process for him to implement. Instead, he should aim to understand the limitations of a framework/technique and then help drive business decisions taking into account those limitations. I cannot speak for everyone but that's how I choose to work as an engineer and it has worked well for me personally so far :D.
    – JamesBoyZ
    Commented Apr 12, 2022 at 11:29
  • I added my own solution below. I look forward to hearing your inputs :)
    – JamesBoyZ
    Commented Apr 12, 2022 at 11:41

If your QR code is printed out, I can walk from restaurant to restaurant, take photos of QR codes, print them out, and use them at any time.

You can prevent this by having a changing QR code on a screen. The QR code contains the time, and if you receive a QR code and it’s time is off, you reject it.

Simpler, but less effective, you could have a QR code on each table containing the table number so at least you can check if there’s anyone sitting at that table.

  • Thank you for the suggestion. I learned something from it. I added my own solution below. I look forward to hearing your inputs :)
    – JamesBoyZ
    Commented Apr 12, 2022 at 11:42

Thank you all for providing very insightful inputs. What I learned from the comments and other answers is that I need an ever-changing QR code. I cannot print a static QR code, stick it on the table forever and expect it to be safe.

Taking this into account. I think the best solution is to change the workflow of my QR code ordering system a little bit. Instead of having waiters bring a menu to the customers when they enter the coffee shop, the waiter should open the table the customer chooses and print a new QR code on a piece of paper for the customer to scan to start ordering. When the customer gets the bill and pays, the waiter can then close the table and invalidate the printed QR code.

This way, noone can reuse the QR code nor reuse the session they created when they first scanned the QR code. In addition, once generated, the same QR code can be used by all customers at the same table. Their sessions can also live for the whole duration when the customers are still inside the coffee shop. They will not have to rescan the short-lived QR code on a TV screen every 5 minutes to order new stuff or see the menu. We can save the TV screen for advertisement, etc. which makes more sense economically.

Please let me know if you find any problems with this approach.

  • 1
    That's a reasonable implementation of the customer-specific QR code variant. Printing on paper might not be as environment-friendly as one could wish, but constant-on display aren't either :-) Commented Apr 12, 2022 at 12:02
  • 1
    A benefit of this approach is that the QR code is linked to the physical table. A restaurant near me does this and its quite nice as it means the kitchen knows which table places the order and can bring my food out directly to me.
    – GHP
    Commented Apr 12, 2022 at 13:31

You could be tempted to use geolocalisation but the accuracy would not prevent someone outside the restaurant to make a fake order. Moreover some regions of the globe are tough on personal data protection, which makes this solution a suboptimal fit.

The local wifi is another option. But this seems a bad idea: it might discourage some customers, since it is an additional cumbersome step to do and might moreover be perceived as diverting a part of user trafic to a network bearing the risk of being potentially insecure.

The simplest solution seems to be to have a new one-time QR code brought at the table when the customer arrive, and the waiter would disable this code when the customer leaves the restaurant.

Another way could be to display a temporary qr code on a screen in the restaurant for the checkin, use it to feed a session token? and subsequently use the table qr code (or just a table id) until the session expires.

There are a lot of other solutions as well.

  • Thanks for the suggestions. I added an answer right above along the same line of bringing a new one-time QR code to the table when customers arrive. From your answer, I might be on the right track :D. I didn't want to go for short-lived QR codes on TV screen because customers would have to re-scan the QR code every 5 min or so to view menus or place new orders. Instead, multiple customers at the same table can share one QR code for the whole visit with the other solution. We can save the TV screen for advertisement, etc. which makes more sense economically :D.
    – JamesBoyZ
    Commented Apr 12, 2022 at 17:28
  • 1
    @JamesBoyZ indeed, I didn’t read your answer because it started like a comment and you were the author of the question, and I was afraid of close votes that could stop me answering. But indeed, you are on a user experience journey: making things cumbersome will lead to lost sales. Moreover this approach brings flexibility, considering that sometimes people order and change place or join another table if they realise their friends are here as well. They just take their qr code with them. And waiters anyway have to open/close a table. I have yet another idea and may edit if’s viable.
    – Christophe
    Commented Apr 12, 2022 at 18:00

Not the answer you're looking for? Browse other questions tagged or ask your own question.