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 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, or "restitution of the undue".
Quasi-contracts are defined to be "the lawful and purely voluntary acts of a man, from which there results any obligation whatever to a third person, and sometime a reciprocal obligation between the parties." Quasi-contracts are stipulated in the 3rd Book, Title IV, Chapter 1 of the French Civil Code (articles 1371-1381). One authority defines a quasi-contract as "A licit and voluntary act from which derives obligations subject to a regime close to the contractual one imposing on the author of the act and a third party, not-bound by a contract".
Contract compared 
In contracts, it is the consent of the contracting parties which produces the obligation; in quasi-contracts no consent is required, and the obligation arises from the law or natural equity, on the facts of the case. These acts are called quasi-contracts, because, without being contracts, they bind the parties as contracts do. "A quasi-contract is not really a contract at all in the normal meaning of a contract," according to one scholar, but rather is "an obligation imposed on a party to make things fair."
The Oklahoma Supreme Court has:
described the distinction between a contract and a quasi-contract in T & S Inv. Co. v. Coury, 593 P.2d 503 (Okla. 1979), as follows: A "quasi" or constructive contract is an implication of law. An "implied" contract is an implication of fact. In the former the contract is a mere fiction, imposed in order to adapt the case to a given remedy. In the latter, the contract is a fact legitimately inferred. In one the intention is disregarded; in the other, it is ascertained and enforced. In one, the duty defines the contract; in the other, the contract defines the duty.
The defendant's liability under quasi-contract is equal to the value of the benefit conferred by the plaintiff. The value is the fair market value of the benefit and not necessarily the subjective value that the defendant enjoys. A traditional measure of the fair market value is called quantum meruit, for "as much as is deserved." For example, accountant prepares tax-payer's taxes, finding a way to get him an unusually large refund. Tax-payer doesn't pay accountant. Assuming a court finds no contract, tax-payer is only liable for the fair market value of tax preparation services, which is not inflated up to account for the unusually large refund he enjoyed.
Under Oklahoma law:
The measure of damages in a quasi-contract action is the amount which will compensate the party aggrieved for the detriment proximately caused thereby, and, if the obligation is to pay money, the detriment caused by the breach in the amount due by the terms of the obligation.
For example, suppose that vacationing physician Jane Doe is driving down the highway and finds Joey Bloggs lying unconscious on the side of the road. Doe renders medical aid that saves Bloggs's life. Although the injured, unconscious Bloggs did not solicit the medical aid and was not aware that the aid had been rendered, he received a valuable benefit, and the requirements for a quasi contract were fulfilled. In such a situation, the law will impose a quasi contract.
See also 
- Douglas Laycock, Modern American Remedies, 3rd edition (2002) pg. 566
- Chapitre Ier : Des quasi-contrats Code civil Legifrance.gouv.fr Retrieved 31 March 2013;
- "Quasi-contrat", Lexique des Termes Juridiques, Dalloz, 2013, pg. 745