Brett Kelly recently posted his TextExpander snippet for creating links to Amazon products and automatically including an affiliate code. It's an impressive bit of hoop-jumping and is quite handy.
I take a completely different approach that works for me, although you might still prefer Brett's.
In my version, you define a expansion like this:
Define your trigger as you like, I use "pamazon".
To use this, go to a product's Amazon page and copy the product's ISBN (if it's a book) or the ASIN (if it's not a book) to your clipboard. The numbers are found in the "Product Details" section of all Amazon listings.
Type your trigger, and instantly, TextExpander spits out the full-formed URL to the product, complete with your affiliate code.