The essential of lawful consideration
All the agreements are not enforceable by law and, therefore, all agreements are not contracts. Some agreements are enforceable by law and others not. For example, an agreement to rent house may be a contract but an agreement to play football may be a mere agreement not enforceable by law. Thus, all agreements are not contracts. Only those agreements which satisfy the essentials mentioned in section 10 becomes contracts  . But, all contracts are agreements.
Thus, an agreement becomes a contract when the following essentials are satisfied:
1. There is some consideration for it.
2. The parties are competent to contract.
3. Their consent is free.
4. Their object is lawful.
As per Section 2(d)
“When, at the desire of the promisor, the promisee or any other person has done or abstained from doing, or does or abstains from doing, or promises to do or to abstain from doing, something, such act or abstinence or promise is called a consideration for the promise " 
As per section 23  , the consideration or object of an agreement is lawful, unless –
“It is forbidden by law; or is of such nature that, if permitted it would defeat the provisions of any law or is fraudulent; of involves or implies, injury to the person or property of another; or the Court regards it as immoral, or opposed to public policy."
In each of these cases, the consideration or object of an agreement is said to be unlawful. Every agreement of which the object or consideration is unlawful is void."
The definition of consideration given in section 2(d) of the Indian Contract Act, 1872 is rather a practical definition. The purpose is to emphasize the simple fact that consideration is some act, done or promised to be done, at the desire of the promisor. It also avoids the practical difficulties caused by the theory of consideration as consisting of some act which is beneficial to one party or detrimental to the other. This antithesis has been described to be not altogether happy. The Act simplifies the matter by saying that any kind of act or abstinence which is done or undertaken to be done at the desire of the promisor is a sufficient consideration. 
- At The Desire Of The Promisor
The definition of consideration in Section 2(d) clearly emphasizes that an act shall not be good consideration for a promise unless it is done at the desire of the promisor.
“In Durga Prasad v. Baldeo, the plaintiff, on the order of the collector of a town, built at his own expense, certain shops in a bazaar. The shops came to be occupied by the defendants who, in consideration of the plaintiff having expended money in the construction, promised to pay him commission on articles sold through their agency in the bazaar. The plaintiff’s action to recover the commission was rejected." 
The only ground for making of the promise is the expense incurred by the plaintiff in establishing the Ganj(market) but it is clear than anything done in that way was not ‘at the desire’ of the defendants so as to constitute consideration . The act was the result of not the promise but of the collector’s order.
- Acts Done at Request
On the other hand, an act done at the promisor’s desire is good consideration for his promise even if it is of no personal significance or benefit to him. The decision of the Calcutta High court in Kedar Nath v. Gorie Mohamed  has become well known in this connection.
It was thought advisable to erect a town hall at Howrah provided sufficient subscription could be got together for the purpose. To this end, the Commissioners of Howrah municipality set out to work to obtain necessary funds by public subscription. The defendant was a subscriber to this fund for Rs. 100 having signed his name in the subscription book for that amount. On the faith of the promised subscription, the plaintiff entered into a contract with a contractor for the purpose of building the hall. But the defendant failed to pay the amount necessary for the purpose of building the hall. But the defendant failed to pay the amount and contended that there was no consideration for his promise.
He was, however, held liable: persons were asked to subscribe knowing the purpose for which the money was to be applied; they knew that on faith of their subscription, an obligation was to be incurred to pay the contractor for the work. The promise is: ‘in consideration of your agreeing to enter into a contract to erect, I undertake to supply money for it.’ The act of the plaintiff in entering into contract with the contractor was done at the desire of the defendant (the promisor) so as to constitute consideration within the meaning of Section 2(d).
It was indeed a promise to pay for the performance of an act and it could not have been revoked once the promise entered performance. In England, also the ‘law for centuries has been that an act done at the request of another, express or implied, is sufficient consideration to support a promise’. 
- Promisee or any other person
The second notable feature of the definition in section 2(d) is that the act which is done is to constitute a consideration may be done by the “promise or any other person". It means therefore, that as long as there is a consideration for a promise, it is immaterial who has furnished it. It may move from the promise or if the promisor has no objection, from any other person. This principle has it genesis in the English common law, having been adopted by the Court of King’s Bench as early as 1677 in Dutton v. Poole  :
A person had a daughter to marry and in order to provide her a marriage portion he intended to sell a wood of which he was possessed at the time. His son (the defendant) promised that if “the father would forebear to sell at his request, he would pay the daughter £ 1,000." The father accordingly forbore but the defendant did not pay. The daughter and her husband sued the defendant for the amount.
It is clear that the defendant gave his promise to his father and it was the father alone who, by abstaining from selling the wood, had furnished consideration for the promise. The plaintiff was neither privy to the contract nor interested in the consideration. But it is equally clear that the whole object of the agreement was to provide a portion to the plaintiff. It would have been highly inequitable to allow the son to keep the wood and yet to deprive his sister of her portion. He was accordingly held liable.
- Position of Beneficiary who is not a Party
Fundamental propositions of English law referred to by his Lordship Viscount Haldane are:
A) Consideration must move from the promisee and the promisee only. If it be furnished by any other person, the promisee becomes a stranger to the consideration and therefore, cannot enforce the promise. 
B) A contract cannot be enforced by a person who is not a party to it even though it is made for his benefit. He is a stranger to the contract and can claim no rights under it.
These propositions were formed as a result of the Tweedle v. Atkinson  case, which laid the foundation of what subsequently came to be known as ‘privity of contract’, which means that a contract is a contract between the parties only and no third person can sue upon it even when avowedly he is benefited. Whitman J. considered it to be an established principle “that no stranger to the consideration can take advantage of a contract, although made for his benefit".
Thus, although the sole object of the contract was to secure a benefit to the plaintiff, he was not allowed to sue as the contract was made with his father and not with him. This principle was affirmed by the House of Lords in Dunlop Pneumatic Tyre Co. v Selfridge & Co  .:
Plaintiffs (Dunlop & Co.) sold certain goods to one Dew & Co. and secured an agreement from them not to sell the goods below the list price and that if they sold the goods to another trader, they would obtain a similar undertaking to maintain the price list. Dew & Co. sold the motor tyres to the defendants (Selfridge & Co.) who agreed not to sell the tyres to any private customer at less than the list prices. The plaintiffs sued the defendants for breach of contract. It was held that assuming the plaintiffs were undisclosed principals, no consideration moved from them to the defendants and that the contract was unenforceable by them.
- Privity Of Consideration
In India, the two propositions mentioned above are not at all applicable. Here, in view of the clear language used in Section 2(d), it is not necessary that consideration should be furnished by the promise. A promise is not enforceable if there is some consideration for it and it is quite immaterial whether it moves from the promise or any other person. The leading authority in the decision of the Madras High Court in Chinnaya v. Ramayya  :
An old lady, by deed of gift, made over certain landed property to the defendant, her daughter. By the terms of the deed, which was registered, it was stipulated that an annuity of Rs. 653 should be paid every year to the plaintiff, who was the sister of the old woman. The defendant on the same day executed in plaintiff’s favour an Iqrarnama (agreement) promising to give effect to the stipulation. The annuity was, however, not paid and the plaintiff sued to recover it. It was clear that the only consideration for the defendant’s promise to pay the annuity was the gift of certain lands by the old woman to the defendant, the defendant, therefore, tried to defend herself on the ground that the promise (the plaintiff) had furnished no consideration for the same. Briefly, the whole situation was: the defendant’s promise was given to the plaintiff, but consideration was furnished by the plaintiff’s sister. The court could have easily allowed the plaintiff to recover the annuity, as consideration can be given by “any other person" and is equally effective. The court reached the same result but on a somewhat different ground. Innes J. tried to equate the situation with the facts of Dutton v. Poole. In that case, the defendants sister would have gotten the marriage portion but for the defendant’s promise. In this present case also it appeared that the plaintiff was already receiving from her sister an annuity of like amount out of the estate and when the estate was handed over to the defendant, it was stipulated that the payment to the plaintiff should be continued and she promised accordingly. That means that the failure to keep the promise would have deprived the plaintiff of an amount which she was already receiving and it is a legal commonplace that if a promise causes some loss to the promise, that is sufficient consideration for the promise. Thus, the plaintiff had given consideration.