By Rabbi Chaim Chazzan
A person deposited money into a vending machine that malfunctioned swallowing the money and not providing the service expected. Later another person banged the machine and the money that had been lodged in it came pouring out. May he keep the money or does it belong to the owner of the machine?
The rationale that perhaps the money belongs to the owner of the machine is the halachic principle of kinyan chatzer – the court yard of a person acquires ownership on behalf of the person. The principle of one’s property as a method of kinyan also applies to items in a vessel.
One of the stages in the process required to attain halachic ownership of an object that was lost is the concept of yi’ush – the original owner’s despair of ever recovering the item. There is a dispute among the rishonim whether a chatzer can acquire an object that was left in it prior to the owner being meya’esh – despairing. In our case of the vending machine, when the money was deposited into the machine, the person had not despaired of it because he thought he would be receiving something else in return or his money back. Only once he realized that the machine was faulty did he despair ever seeing his money. The Rambam holds that even when the object was placed in one’s property before the original owner was meya’esh, the property still acquires the object, accordingly the money would belong to the owner of the vending machine.
However, in truth, according to all opinions the owner of the vending machine wouldn’t acquire the money via a kinyan chatzer. In order for a chatzer to acquire it must be a “protected” chatzer. For example: money found in a store in front of the cashier’s counter is not acquired by the store owner via kinyan chatzer because it’s a place frequented by many people and the lost money cannot be protected by the owner. However in our case of the vending machine the owner only acquires the money when it drops down into the compartment where the money is stored. When the money is stuck in the machine and anyone could come and give the machine a bang and the money would be released, it cannot be considered a chatzer hamishtameres – a protected chatzer, thus the one who “found” the money may keep it.
 שו”ע חו”מ סי’ ר’ ס”ג, ובנתה”מ שם ס”ק ו בשם השיטה מקובצת ב”מ ט: בשם הרמב”ן, רשב”א, וריטבא
 דעת הרא”ש ב”מ כה:, נמוק”י שם כו:, וראב”ד פט”ז מהל’ גזלה ואבדה ה”ד ע”פ דברי המחנה אפרים ה’ מכירה וקנין סי’ ה, ורמב”ן במלחמות שם כו:, דלפני יאוש אין חצרו קונה, וכן הביא ה”ה שם מהרשב”א. אבל דעת הרמב”ם שם, וכ”כ המהרש”ל בב”מ שם בדעת תוס’, דאף לפני יאוש חצרו קונה
 ראה רמב”ם שם ובריטב”א ע”ז עא: כתב דגם בכלים בעינן חצר המשתמרת וכן מוכח מרש”י ב”מ ט
 כן פסק בשו”ת להורות נתן ח”ח סי’ קטז- קכ ע”פ הש”ך סי’ רס סקי”ח