
712 P.2d 678 (1985)
109 Idaho 977
Thomas M. QUINTANA; Thomas M. Quintana as personal representative for the Estate of Mitchell Quintana, Deceased; and Thomas Quintana and Mitchell Quintana DBA Quintana Sheep Company, Plaintiffs-Respondents,
v.
Robert ANTHONY, Defendant-Appellant.
No. 15629.
Court of Appeals of Idaho.
December 12, 1985.
*679 William J. Tway and Anton Hohler, (argued), Boise, for defendant-appellant.
Stanley W. Welsh and Sara M. Thorpe (argued), Clemons, Cosho & Humphrey, P.A., Boise, for plaintiffs-respondents.
BURNETT, Judge.
This appeal arises from a sale of real estate. The principal issue is whether a vendor's lien must be foreclosed, as provided in a judgment, before the sellers employ other remedies against a defaulting purchaser. We are also asked to decide whether the judgment should be amended to direct that any sums collected from the purchaser be applied to an underlying mortgage on the property. The district court answered each question in the negative. For reasons explained below, we uphold the judge's ruling on a motion to amend the judgment but we vacate his order on a motion relating to the vendor's lien.
These issues arise from the sale of a ranch in Owyhee County. The circumstances surrounding the sale are complex and portrayed obscurely in the record before us. It appears that Thomas Quintana, et al., sold the property to Robert Anthony for $1,075,000. The price was to be paid by several means. First, the buyer agreed to discharge in part, and to assume in part, a debt secured by a mortgage against the ranch. Second, the buyer arranged for a third party to issue the sellers a promissory note, secured by a deed of trust on other property in California, and the buyer agreed to make payments on the note. Finally, the buyer agreed to make a substantial cash payment to the sellers. Performance of the buyer's obligations was not secured by any second mortgage on the ranch. The buyer defaulted. The sellers sued to collect the payments due to them and to the underlying mortgagee. The sellers *680 also asserted a vendor's lien upon the ranch. The buyer counterclaimed for various alleged breaches of contract by the sellers.
The case went to trial and a jury heard the evidence. However, before a verdict was returned, the parties reached an apparent settlement. Pursuant to a stipulation recited in open court, judgment was entered against the buyer for various sums due. The judgment contained a series of temporary stays against execution to collect these sums. The judgment further provided as follows:
The Plaintiffs [sellers] have a vendors [sic] lien on the real property sold to the Defendant Robert Anthony... . In the event the judgment entered against the Defendant Robert Anthony is not paid in accordance with the terms set forth hereinabove, the Plaintiffs may proceed to foreclose on said vendors [sic] lien which is for all sums due from the Defendant Robert Anthony to the Plaintiffs as set forth hereinabove. [Emphasis added.]
The judgment was not timely satisfied. The sellers obtained a writ of execution and levied upon certain property in Idaho, other than the ranch. The buyer moved to quash the writ, arguing that the sellers' remedy was to foreclose the vendor's lien on the ranch. As noted earlier, the buyer also asked the court to modify the judgment by requiring any proceeds to be applied against the mortgage obligation. Both motions were denied.
We first consider the vendor's lien issue. The buyer argues that the judgment contemplates, and should be construed to require, foreclosure of the lien before other property is sold at execution. However, the sellers contend that the judgment merely acknowledges the existence of a vendor's lien and does not require the lien to be foreclosed. In our view, the judgment is ambiguous where it provides that the sellers "may proceed to foreclosure on said vendors [sic] lien." This phrase might be interpreted either to direct a specific remedy for the buyer's default or merely to recite that such a remedy exists. Because the judgment is the product of a stipulation, the stipulation itself must be consulted in construing the judgment. The trial transcript discloses that foreclosure of a vendor's lien was viewed by both parties as the remedy for collecting sums set forth in the stipulation. The sellers' counsel, while orally detailing the stipulation, informed the court that "this is going to be a judgment in the nature of a ... decree and foreclosure of a vendor's lien." The buyer's attorney similarly stated that the judgment would be "in the form of a decree of foreclosure." Thus, the parties mutually understood that foreclosure would follow if the buyer failed, as he ultimately did, to pay the sums specified in the judgment.
Nevertheless, the sellers maintain that such an agreement does not bar execution upon other property prior to foreclosure. In contrast, the buyer analogizes a vendor's lien to a mortgage and he argues that foreclosure of the lien must occur before other remedies are pursued. The question whether a vendor's lien should be foreclosed like a mortgage has received surprisingly little attention in appellate decisions and in legal literature. The question appears to be one of first impression in this state. The Idaho Code contains a comprehensive regulatory scheme governing mortgages. A mortgage is broadly defined by I.C. § 45-901 as "a contract[,] excepting a trust deed or transfer in trust[,] by which specific property is hypothecated for the performance of an act without the necessity of a change of possession." Idaho Code § 6-101 authorizes a single form of action to collect a debt secured by a mortgage. The mortgage must be foreclosed. A deficiency judgment may be obtained if the foreclosure sale does not satisfy the debt; but the deficiency is limited to the difference between the fair market value of the real property and the amount of the unpaid debt. I.C. § 6-108. See Eastern Idaho Production Credit Association v. Placerton, Inc., 100 Idaho 863, 606 P.2d 967 (1980). The creditor may not simply sue on *681 the debt and collect by execution on the judgment.
Title 45 of the Idaho Code also recognizes a vendor's lien. "One who sells real property has a vendor's lien thereon, independent of possession, for so much of the price as remains unpaid and unsecured otherwise than by the personal obligation of the buyer." I.C. § 45-801. A vendor's lien, like a mortgage, is a security device. But unlike a mortgage, which arises from agreement of the parties, a vendor's lien arises by operation of law, unless waived. It is a codified creature of equity. See generally D. DOBBS, HANDBOOK ON THE LAW OF REMEDIES § 12.15 (1973) (hereinafter cited as DOBBS). Accordingly, the vendor's lien is "not a specific and absolute charge on the realty but a mere equitable right to resort to it [i.e., the property] on failure of payment by the vendee." Estates of Somers v. Clearwater Power Co., 107 Idaho 29, 30, 684 P.2d 1006, 1007 (1984), quoting from Mills v. Mills, 147 Cal. App.2d 107, 305 P.2d 61, 68 (1956) (bracketed language added in Somers).
In light of this distinction, we think it would be unwise to lay down a rigid general rule that a vendor's lien must in all respects be treated as a mortgage. A court in equity may determine the scope of the lien and how it will be enforced in each case. This is especially true where, as in Idaho, the statute recognizing a vendor's lien makes no explicit provision for its enforcement. See generally 51 AM.JUR.2d Liens § 65 (1970). Nevertheless, the legislative policies underlying our mortgage foreclosure statutes should guide the court's exercise of its equitable powers when enforcing a vendor's lien. In Wells v. Francis, 7 Colo. 396, 4 P. 49 (1884), the Colorado Supreme Court held that a suit on a vendor's lien is analogous to an action seeking foreclosure of a mortgage. Indeed, our Supreme Court, in Farnsworth v. Pepper, 27 Idaho 154, 160, 148 P. 48, 51 (1915), has held that the statute now codified as I.C. § 6-101 may be applied to liens other than mortgages. See also Jaussaud v. Samuels, 58 Idaho 191, 205, 71 P.2d 426, 433 (1937) (characterizing I.C. § 6-101 as applicable to "foreclosure of mortgages and liens").
Idaho Code § 6-101 was supplemented by I.C. § 6-108, the deficiency limitation statute, during the Great Depression. The statutory scheme responded to a haunting spectre of mortgage debtors defaulting on loans, losing their property in distress sales and encountering massive deficiencies. These statutes have protected debtors by sheltering unmortgaged property from potential execution until mortgaged property has been sold in a judicially supervised foreclosure. The statutes also have established a right to redeem the property sold and, as noted earlier, they have restricted the amounts of deficiency judgments after foreclosure sales. In our view, parallel protections are appropriate, and may be provided in equity, where sellers of real property assert the existence of vendors' liens.
Of course, such protections might be waived in particular cases. Cf. Bank of California National Association v. Leone, 37 Cal. App.3d 444, 112 Cal. Rptr. 394 (1974) (mortgage foreclosure restrictions must be pleaded as an affirmative defense). However, in this case the record discloses no such waiver. As we have noted, the parties' stipulation explicitly denominates "foreclosure" of the "vendor's lien" as the remedy for untimely performance of the stipulated covenants. This agreement is consistent with the equitable powers we recognize today. In light of these powers and of the parties' agreement, we hold that the buyer is entitled to relief from any injustice shown to result from deferring a foreclosure sale of the ranch while other property is sold at execution.
The record before us does not disclose whether the district judge specifically addressed the question of potential injustice when he refused to quash the writ of execution. Neither does the record reveal the extent, if any, of execution sales that already may have occurred due to the buyer's failure to obtain a stay of execution *682 during this appeal. Our decision today simply clarifies the buyer's right to relief if injustice is shown. It remains for the district court to determine whether a showing has been made in the circumstances of this case. Accordingly, we hold that the order on the motion to quash must be vacated and the case remanded for reconsideration of the buyer's request for relief.
The buyer further contends that the district court should have amended the judgment by requiring all payments to be applied first to the underlying mortgage on the ranch. On this issue, the buyer appears to be asking for an equitable modification of his earlier stipulation and of his original contract, which contained no such requirement. The courts possess no roving commission to rewrite contracts. Equity will not intervene to change the terms of a contract unless it produces unconscionable harm, is unlawful or violates public policy. DOBBS, § 2.4 at 49. The buyer here has failed to show any violation of law or public policy. Neither are we persuaded that the contract and stipulation were unconscionable. Therefore, the judgment need not be modified in this respect. We sustain the district court's denial of the motion to amend.
In sum, the district court's order denying the motion to quash the writ of execution is vacated. The order denying the motion to amend the judgment is affirmed. The case is remanded for further proceedings consistent with this opinion. Both parties having prevailed in part, no costs or attorney fees on appeal are allowed.
WALTERS, C.J., and SWANSTROM, J., concur.
