Does what have a "legal basis in court"?

You have provided us with no information about the nature or terms of the sale, or the basis of your intention to foreclose. Are we talking about a contract for deed / land contract?

it will help if you belatedly follow the instruction to identify your state.