
864 P.2d 815 (1993)
George SHANBOUR and Esber N. Scott Samara, Appellants, Counter-Appellees,
v.
PHILLIPS 66 NATURAL GAS COMPANY, Appellee, Counter-Appellant.
No. 74353.
Supreme Court of Oklahoma.
October 5, 1993.
As Corrected November 18, 1993.
Thomas A. Wallace, Oklahoma City, for appellants, counter-appellees.
William G. Paul, John L. Williford, Galen E. Ward, Shelley J. Himel, Oklahoma City, for appellee, counter-appellant.
*816 ALMA WILSON, Justice:
The appellants sued the appellee for an accounting and judgment for underpayment of royalties for gas produced and sold from oil and gas wells. The appellee counterclaimed seeking equitable recoupment for overpayments to the appellants. The trial court granted summary judgment in favor of the appellee. The trial court denied the motion of the appellee for attorney fees and prejudgment interest on the overpayments. The Court of Appeals affirmed. We have previously granted certiorari to consider two issues: (1) Is a payor entitled to receive prejudgment interest pursuant to 23 O.S. 1991, § 6, where the payor has because of a mistake overpaid its obligations on a contract and the payee has refused to return the overpayment? (2) Where a defendant to a lawsuit for accounting on an oil and gas contract has prevailed on summary judgment, is that party entitled to attorney fees? We answer both questions affirmatively.
George Shanbour and Esber Samara (appellants) own royalty interests in several producing, oil and gas wells. Phillips 66 (appellee) pays the royalties for gas produced and sold from these wells. Due to an inadvertent, unilateral mistake, the appellee substantially overpaid the royalties to the appellants from January of 1985, through late July of 1986. When the appellee discovered its error, it also discovered that it had made an overstatement of volumes purchased from one of the wells because of incorrect meter tube and orifice sizes. The appellee notified the appellants of the overpayments and immediately began to engage in self-help recoupment when the appellants failed to surrender the overpayments. In 1986, the appellee began to retain all of the monthly proceeds of each well to apply against the respective overpayments.
The trial court in its Journal Entry of Judgment granted judgment in favor of Phillips and against George Shanbour in the amount of $37,168.22 and credited him for the $13,172.99 recouped by Phillips through August, 1989. Judgment was granted in favor of Phillips against Esber N. Scott Samara in the amount of $31,858.43 and credited him for $11,291.12 recouped by Phillips through August, 1989. The judgment denies Phillips' request for prejudgment interest and attorney fees.
The appellee argues that it is entitled to prejudgment interest on its overpayment to the appellants pursuant to 23 O.S. 1991, § 6.[1] That statute provides:
Any person who is entitled to recover damages certain, or capable of being made certain by calculation, and the right to recover which is vested in him upon a particular day, is entitled also to recover interest thereon from that day, except during such time as the debtor is prevented by law, or by the act of the creditor from paying the debt.
Because the amount overpaid by the appellee was capable of being made certain by calculation on the day the overpayment was made to the respective owners, the appellee claims it is entitled to prejudgment interest thereon. It cites Cities Service Gas Co. v. Christian, 340 P.2d 929 (1959) to support its proposition that the statute must be construed to allow interest on damages from the date the injuries occur. But Cities Service was a case construing § 22 of title 23, "Breach of obligation to pay money."[2] In that case the plaintiff's *817 action was based upon breach of an agreement contained in the easements to pay damages for growing crops and improvements. Such a case is distinguishable from the case at bar because the appellee is the party who caused the appellants to be overpaid. Under the facts before this Court, the appellee has not shown that the appellants breached their contracts with the appellee by receiving these funds. In their petition the appellants alleged that the exact amount of oil, gas, and/or gas distillate taken was within the exclusive knowledge of the appellee, and that the appellants were unable to definitely allege the amount. This allegation was not denied in the answer. Accordingly, it is admitted.[3]
Interest as such is only recoverable under terms of a contract; but an award of interest for the detention of payment is made by way of damages. Fidelity-Phenix Fire Ins. Co. v. Board of Education, 201 Okla. 250, 204 P.2d 982, 987 (1949). Accordingly, 23 O.S. 1991, § 6 would permit recovery of interest as damages where contractual rights are involved. The cases cited by the appellee concerning when interest begins to accrue are not on point. They do not involve a unilateral mistake by a payor.
The Court of Appeals correctly decided that overpayments of royalty due to a mistake of fact may be recovered from the payee.[4] This rule is well established, and does not apply simply to overpayments of royalty.[5] The courts have also allowed interest on such overpayments.[6] In Second & Third Pass. R. Co. v. Philadelphia, 51 Pa. 465, 468 (1866), the Supreme Court of Pennsylvania reviewed what was already an established law:
The rule seems therefore to be this, that when a mutual mistake occurs between the payer and receiver of a sum of money, by which the whole has not been paid, or too much has been received, interest is not recoverable on the sum so withheld or received, unless it has been unjustly withheld or unjustly received. The party retaining the money by mistake, may well rely on the acquittance received or given, until the injured party makes known his claim and demands correction and payment. After such demand, if it be refused, and it turns out that there was money due which ought to have been paid, it will bear interest from demand until paid.
Citing Moylan v. Moylan, 49 Wash. 341, 95 P. 271 (1908), the United States District Court in Washington held that "interest is allowable for money paid by mistake from the time of demand for specific amounts." United States v. Skinner & Eddy Corp., 28 F.2d 373 (W.D.Wash. 1928), modified, 35 F.2d 889 (9th Cir.1929), cert. denied, 281 U.S. 770, 50 S.Ct. 248, 74 L.Ed. 1176 (1930). The United States Court of Appeals for the Eighth Circuit stated the rule concerning interest: "we think more applicable the rule that money paid or received by mistake does not draw interest until after discovery *818 of the mistake." Sykes v. United States, 392 F.2d 735, 739 n. 2 (8th Cir.1968).
Section 6 of title 23 includes provisions for just such a circumstance. According to the statute, the right to recover is vested on a particular day, that day being the day the damages to the party are capable of being made certain by calculation. Cook v. Oklahoma Bd. of Public Affairs, 736 P.2d 140, 153 (Okla. 1987). The exception where the damages can be calculated is explicitly "except during the time as the debtor is prevented by law, or by the act of the creditor from paying the debt." It is undisputed that the appellants did not know the exact amount of gas taken, and it follows that they did not know the amount of the royalties due them. Because these figures were within the knowledge of the appellee, and were figured erroneously, the appellants were not under obligation to repay the overpayment until the appellee presented the appellants with the figures necessary to calculate the overpayment. The appellants were prevented by the act of the appellee from repayment. The statute and the cited cases make it clear that prejudgment interest is due only from the time the appellee demanded repayment and backed up its demand with figures enabling the appellants to ascertain that they had been overpaid. Accordingly, the case must be remanded for the trial court to determine the time the appellants should have become aware of the correct amount of the overpayments.
The appellee asserts entitlement to attorney fees as the prevailing party pursuant to section 540 of title 52.[7] Subsection E provides:
The district court for the county in which the oil or gas well is located shall have jurisdiction over all proceedings brought pursuant to this act. The prevailing party in any proceeding brought pursuant to this act shall be entitled to recover any court costs and reasonable attorney's fees.
The substance of § 540(E) has remained unchanged since enactment in 1980.[8] The claim by the appellants was that the appellee failed to pay the royalties due. They asked for an accounting. The summary judgment in favor of the appellee revealed that it did not owe any payments to the appellants. By demonstrating that it did not owe royalties to the appellants, the appellee became the prevailing party pursuant to the statute, and were entitled to court costs and reasonable attorney's fees. Hull v. Sun Refining and Marketing Co., 789 P.2d 1272, 1280 (Okla. 1989).
The cause is remanded to determine the time the appellants should have become aware of the correct amount of the overpayments, subsequent to demand by the appellee, and the amount of prejudgment interest due if the court determine that appellees should have had such knowledge prior to the court's granting summary judgment. The cause is also remanded to determine an amount representing reasonable fees for the defense of appellant's claim.
CERTIORARI PREVIOUSLY GRANTED. COURT OF APPEALS OPINION AFFIRMED IN PART, VACATED IN PART. JUDGMENT OF THE TRIAL COURT REVERSED AND REMANDED.
LAVENDER, V.C.J., and SIMMS, OPALA, KAUGER, SUMMERS and WATT, JJ., concur.
HARGRAVE, J., concurs in part, dissents in part.
NOTES
[1]  R.L. 1910, § 2848.
[2]  Title 23 O.S. 1991, § 22 provides: "The detriment caused by the breach of an obligation to pay money only is deemed to be the amount due by the terms of the obligation, with interest thereon." R.L. 1910, § 2853.
[3]  Title 12 O.S. 1991, § 2008(D), 1987 Okla. Sess. Laws, ch. 78, § 2.
[4]  The Court of Appeals cited 3 E. Kuntz, A Treatise On the Law of Oil and Gas, 444-445 (1989): "A lessee may recover from the lessor any overpayment of royalty that was made because of mistake of law or fact. The lessee may also recoup from current royalties any overpayments made by mistake. This is so, because a payment by mistake is not a `voluntary' payment, and it may be recovered even though the payor was negligent in making the payment." (Footnotes omitted.)
[5]  Thurlwell v. Rabbit, 110 Okla. 285, 235 P. 923, 926 (1925), quoting Allsman v. Oklahoma City, 21 Okla. 142, 95 P. 468, 469 (1908): "It is true that at common law assumpsit would not lie except upon a parol or simple contract, but we think the modern rule well settled and more in keeping with the spirit of the law is that the action will lie whenever one has the money of another which he in equity and good conscience has no right to retain." Title 12 O.S. 1991, § 2027 (Form 6) even includes a form for a "Petition for Money Paid by Mistake."
[6]  Annotation: Good Faith in Receiving Payment Made Under Mistake of Fact as Affecting its Recovery, 87 A.L.R. 649 (1933) (see cases listed under subheading "Good faith as affecting interest on sum paid." 87 A.L.R. at 652-656.)
[7]  Because we find that the appellee is entitled to prevailing party attorney's fees pursuant to § 540 of title 52, we need not address whether this case also comes within the purview of 12 O.S. 1991, § 936, as an alternative basis for recovery as alleged by appellee.
[8]  1980 Okla. Sess. Laws, ch. 205, § 1. At its enactment, the subsection was C. In 1989, it was recodified as subsection E. In 1992, § 540 was renumbered as § 570.10, and amended effective July 1, 1993. 1992 Okla. Sess. Laws, ch. 190, § 28 and § 10, respectively. Title 52 O.S.Supp. 1992, §§ 570.1-570.15 is the Production Revenue Standards Act. Prevailing party attorney's fees are deleted from § 540.10, but provided for within the act, § 570.14(C).
