Whenever a person is committed to jail for a bailable offense under the provisions of this chapter, the court must endorse on the commitment the amount of bail required and sign his name thereto. The sheriff of the county to which the defendant is committed may discharge him on giving sufficient bail in the amount so endorsed and must, in such case, return the undertaking to the court to which such person is bound to appear within five days thereafter.
Ala. Code § 15-11-11 (1975)