Is there a way to do that? I would hate it to hard-code the app ID somewhere...
No way to do this. I think you are probably trying to link to your product page right? Try the link method using your name of your app
http://itunes.com/apps/
Try it