Whenever the officer or person to whom a writ of habeas corpus is directed and delivered is required thereby to make return and take the person in whose behalf the writ is issued into a county other than the county in which such person is imprisoned or restrained, the court awarding the writ, at the court's discretion, may ascertain, and by an entry thereon specifying the amount, but not exceeding fifteen cents per mile, may require the payment or tender, at the time of delivering the writ, of the charges of obeying the same. However, in no case when an entry is not made can the payment or tender of such charges be demanded before the return of the writ in accordance with its direction.
N.D.C.C. § 32-22-25