Possibly using something comparable to the German Flaschenpfand[1] system? I'm unsure of how to develop a suitable packing system that would be machine-friendly, possibly wooden crates packed with shredded cardboard packing. The lid could be press-in cardboard, something like that used in tinfoil food storage boxes, but reliant on the cardboard bending to get past the lip and into the region where it is secured. Alternately, a suitable slide-in wooden lid with a stopping peg inserted and sealed with a wax-type substance could be used (as per [2], with the addition of a sealing peg setup). Sealing wax would probably be used in the cardboard variant also.
[1] https://de.wikipedia.org/wiki/Flaschenpfand [2] https://commons.m.wikimedia.org/wiki/File:Wooden_Matchbox_E_...