Whenever any sum of money is so deposited in lieu of a bond, recognizance or undertaking the party depositing it shall be entitled to a receipt therefor, stating that the sum of money has been deposited and is held for the same purpose as would have been specified and conditioned in the bond, recognizance or undertaking in lieu whereof the sum of money is so deposited.