Need more details.
Do you have a barcode scanner already? If so, which one?
For the output side: flashing an LED is very simple, opening the lid of a box a little harder (but much more complex to build due to the mechanics).
How many boxes?
If opening a lid: how big and heavy would a lid be? Assume 90° movement is enough?
What do you need for this? Coding, coding + hardware suggestions, a fully built project, or something else?