One who purchases an item from one of five people, and each of them claims from him and says, "I am the owner of the item," and he does not know from which of them he purchased, he places the value of the item between them and withdraws. This is not similar to what was written in siman 365 regarding one who robbed one of five, where he must return to each one when they claim from him, for there he committed a transgression and it is fitting that he should pay each one; but in a purchase, why should he pay more? And even though even without a transgression we find that he pays each one in the case of a deposit, where two deposited with him in two bundles, this one a maneh and this one two hundred, and each one says, "The two hundred is mine," and all the more so when only one of them deposited and each one says, "I deposited," that he pays each one as was written in siman 300—there too the reason is that he should have been precise as to who deposited with him, for a deposit is for a duration of time, and he was negligent in that he was not precise as to who the depositor was. But in a purchase, where he thinks that the seller will immediately come and take his money, he did not have to be precise [Shach]. According to this, if he purchased on credit for a set time, it is similar to a deposit [Netivot HaMishpat]. However, according to this view, if he purchased from one on credit and afterwards two or more claimed from him, he would have to pay each one, and it does not appear so from all the poskim. A proof for this is that this law also applies to the betrothal of a woman regarding the ketubah, as was written in Even HaEzer siman 49, and the Shas in Yevamot [118b] compares a sale to betrothal, and behold, the payment of the ketubah is over a long period of time. Furthermore, that which the sages, of blessed memory, said regarding a deposit, that "he should have been precise," its meaning is that he should have written the name of the depositor on the pouch of the deposit, as the Rambam wrote in the fifth chapter of She'elah, and in a purchase this is not applicable. Furthermore, regarding a deposit he is a guardian and it is incumbent upon him to be precise, but one who purchases with money for his purchase, the seller has no involvement in the purchaser's guarding of his money; and even if they are lost to an accident, he shall pay others even if he designated these specific coins that are with him to pay with them, and the law of guardianship does not apply to him at all. Therefore, the primary ruling is that in a purchase he does not need to pay all of them in any case, and even to fulfill his obligation toward Heaven he is not required [and therefore the Shas there compares purchase to betrothal, and in Bava Metzia 37 it compares deposit to robbery; and it appears to me that even the Shach only stated a general reason and not for the practical ruling].
הלוקח מקח מאחד מחמשה בני אדם וכל אחד מהם תובע אותו ואומר אני הוא בעל המקח והוא אינו יודע ממי מהם לקח מניח דמי המקח ביניהם ומסתלק ואינו דומה למ"ש בסימן שס"ה בגזל אחד מחמשה דצריך להחזיר לכל אחד כשתובעין אותו דהתם עשה עבירה וכדאי שישלם לכל אחד אבל במקח למה ישלם יותר ואע"ג דגם בלא עבירה מצינו שמשלם לכל אחד בפקדון כששנים הפקידו אצלו בשתי כריכות זה מנה וזה מאתים וכל אחד אומר המאתים שלי וכ"ש כשרק אחד מהם הפקיד וכל אחד אומר אני הפקדתי דמשלם לכל אחד כמ"ש בסימן ש' גם בשם הוי הטעם דהוה ליה למידק מי הפקיד אצלו דפקדון הוא למשך זמן ופשע במה שלא דקדק מי היה המפקיד אבל במקח דסבור שמיד יבא המוכר ויטול מעותיו לא ה"ל למידק [ש"ך] ולפ"ז אם לקח בהקפה על זמן דמי לפקדון [נה"מ] ולדעה זו אם לקח מאחד בהקפה ואח"כ תבעוהו שנים או יותר צריך לשלם לכל אחד ולא משמע כן מכל הפוסקים וראיה לזה דהא דין זה הוא ג"כ בקדושי אשה לענין כתובה כמ"ש באהע"ז סימן מ"ט והש"ס ביבמות [קי"ח:] מדמה מכר לקדושין והרי הכתובה התשלומין הוא על זמן מרובה ועוד דזה שאמרו חז"ל בפקדון דהו"ל למידק פירושו שהיה לו לכתוב על כיס הפקדון שם המפקיד כמ"ש הרמב"ם בפ"ה משאלה ובמקח לא שייך זה ועוד דלגבי פקדון הוא שומר ורמי עליה למידק אבל הלוקח במעות מקחו אין להמוכר עסק בשמירת הלוקח מעותיו ואף אם יאנסו ישלם אחרים אפי' כשייחד לו מעות אלו הנמצא אצלו שישלם בהם ואין עליו תורת שמירה כלל ולכן העיקר לדינא דבמקח א"צ לשלם לכולם בכל ענין ואף לצאת י"ש אינו מחוייב [ולכן הש"ס שם מדמי מקח לקדושין ובב"מ ל"ז מדמה פקדון לגזל ונ"ל דגם הש"ך טעמא בעלמא קאמר ולא לדינא]: