A contract is an exchange of promises between two or more parties to do or refrain from doing an act which is enforceable in a court of law. It is where an unqualified offer meets a qualified acceptance and the parties reach Consensus ad Idem. The parties must have the necessary capacity to contract and the contract must not be either trifling, indeterminate, impossible or illegal.
Contract law is based on the principle expressed in the Latin phrase pacta sunt servanda (pacts must be kept). Breach of contract is recognised by the law and remedies can be provided. Sometimes written contracts are required, such as when buying a house. However, most contracts can be and are made orally, such as purchasing a book or a sandwich. Contract law can be classified, as is habitual in civil law systems, as part of a general law of obligations (along with tort, unjust enrichment or restitution).
    According to legal scholar Sir John William Salmond, a contract is an agreement creating and defining the obligations between two or more parties.
In common law systems, the five key requirements for the creation of a contract are:
1. offer and acceptance (agreement)
2. consideration
3. an intention to create legal relations
4. legal capacity
5. formalities

In civil law systems, the concept of consideration is not central. In addition, for some contracts formalities must be complied with under what is sometimes called a statute of frauds.