A quasi-contract (or implied-in-law contract or constructive contract) is a fictional contract created by courts for equitable, not contractual, purposes. A quasi-contract is not an actual contract, but is a legal substitute formed to impose equity between two parties. The concept of a quasi-contract is that of a contract that should have been formed, even though in actuality it was not. It is used when a court finds it appropriate to create an obligation upon a non-contracting party to avoid injustice and to ensure fairness. It is invoked in circumstances of and is connected with the concept of restitution.
Generally the existence of an actual or implied-in-fact contract is required for the defendant to be liable for services rendered, and a person who provides a service uninvited is an officious intermeddler who is not entitled to compensation. "Would-be plaintiffs cannot deliver unordered goods or services and demand payment for the benefit....A corollary is that one who does have an enforceable contract is bound by the contract's terms: subject to a few controversial exceptions, she cannot sue for restitution of the value of benefits conferred..." However, in many jurisdictions under certain circumstances plaintiffs may be entitled to restitution under quasi-contract (as in the example of Oklahoma below). They are used as remedies for unjust enrichment, management of another's affairs (negotiorum gestio), or payment of a thing not due (indebiti solutio).