Yosef Karo, Shulchan Aruch — Choshen Mishpat 40
“ How so? If one tells witnesses “you are witnesses that I owe so and so a maneh,” if there are no witnesses but he writes in a document “I owe you a maneh” or if he does not say “you are witnesses” but says in front of witnesses “I owe you a maneh via a document”- since he said the term “document” it is as if he said you should be witnesses for me- in all such cases he is required to pay even if both parties admit, and the witnesses are aware, that he did not in fact owe the other anything, because he has obligated himself in the same fashion a co-signer can obligate himself. ”
