The first step is to create an AliExpress Affiliate Account. You can do so by going to AliExpress.com and clicking on Affiliate Program at the bottom of the page.
AliExpress is rather slow in approving new affiliates so it may take several days to get approved.
Once you are approved, login to your AliExpress Affiliate Account and click on Settings and then Tracking ID.
You can then create your Tracking ID
To get your API Key, click on Ad Center and then API Settings:
From there you can apply to get an API key.