I'm finishing a letter to a friend by asking the tracking number of a parcel he sent to me. Can I finish my letter with
Thank you for letting me know the tracking number
OR
Thank you to let me know the tracking number
If you want to request [something], you would probably not use "Thank you" at the start of the sentence. It is possible to make a request and start a sentence in this way, but it might be construed as a little rude because you are essentially giving a command but hiding it in the form of gratitude.
The other option that Ronald Sole proposes in his comment is valid, but I think it is a little formal (even haughty), especially for a letter between friends.
You'd be better off saying something like:
... and if you would send me the tracking info when you get the chance, I would appreciate it.
Thank you for letting me know the tracking number.
Thank you to let me know the tracking number.
The first sentence is grammatical; you thank somebody for something/doing something. You don't use a to-infinitive with "thank" if you want to say that you are grateful to somebody for something.