Short answer. Possibly. The usual rule is that no one can recover what they gave under an illegal contract — the law leaves both guilty parties where it finds them. But Article 1415 makes an exception when one party could not legally give consent, such as a minor. A court may then allow that person to recover.
What the law says
the courts may, if the interest of justice so demands allow recovery of money or property delivered by the incapacitated person.
Civil Code, Article 1415 — Recovery by an Incapacitated Party. Read the full provision →
Why illegal contracts usually cannot be undone
When a contract is illegal, the law's default response is unforgiving: it will not help either side. Under the principle that where both parties are equally at fault neither may recover, the courts simply leave the parties as they are. Someone who paid money or handed over property under an unlawful bargain normally cannot demand it back, because the law refuses to lend its machinery to enforce or unwind an illegal arrangement. This rule discourages people from entering illegal contracts in the first place, since they know the courts will not rescue them if the deal later goes wrong.
The exception for a party who could not consent
Article 1415 recognises that this harsh rule should not fall on someone who was never in a position to give real consent. Where one of the parties to an illegal contract is incapable of giving consent — a minor, or a person otherwise legally incapacitated — the statute provides that the courts may allow recovery of money or property delivered by the incapacitated person. The reason is fairness: a person who cannot bind himself in law is not treated as equally guilty with the party who dealt with him. He is more a protected person than a wrongdoer, so the door to recovery is left open. Crucially, the relief runs one way only: it rescues the incapacitated person, not the other party to the illegal contract, who stays barred from recovering anything he parted with.
The interest of justice is a discretion
Recovery here is not automatic. The provision says the courts may allow it, and only if the interest of justice so demands. That wording gives the judge discretion to weigh the circumstances — how the incapacitated person came to deliver the money or property, whether letting it stand would be unfair, and what result best serves justice. So the incapacitated party has a strong claim to be heard, but not a guaranteed refund. The practical step is to bring the matter to court and show why justice calls for the money or property to be returned.