The defendant in an action for the recovery of money only may, at any time after service of notice and before the trial, serve upon the plaintiff or the plaintiff's attorney an offer in writing to allow judgment to be taken against the defendant for a specified sum with costs.
Iowa Code § 677.7