Best Programming Practices

The following checklist of best practices describes how you can increase the effectiveness of your Amazon Associates Web Service (Amazon Associates Web Service) 4.0 applications.

The Amazon Associates Web Service Terms and Conditions spell out in detail the limitations that Amazon enforces on all Amazon Associates Web Service applications. The thrust of all Amazon Associates Web Service applications should be to direct sales to Amazon and thus earn Associate sales commissions. If your application is designed around another purpose, please reconsider and make sure your proposed Amazon Associates Web Service application falls within the guidelines of the Amazon Associates Web Service Terms and Conditions. Applications that do not meet the Amazon Associates Web Service Terms and Conditions will be blocked from accessing Amazon Associates Web Service.

Amazon Associates Web Service makes frequent releases. Each release either adds functionality or increases the accuracy, speed, and stability of Amazon Associates Web Service. Most releases do all of these. Go to http://aws.amazon.com/resources frequently for documentation about the latest release.

To use the latest version of the API, you must include the Version parameter in your requests. Otherwise, Amazon Associates Web Service uses the default API version, which is from 2005-10-05.

Amazon Associates Web Service 3.0 has been deprecated and will be shut down at the end of March 2008. Make sure you develop against Amazon Associates Web Service 4.0.

Amazon Associates Web Service provides many different operations to facilitate product discovery. Using the right operations can dramatically enhance your customer’s shopping experience and increase your Associate commissions. See the Amazon Associates Web Service developer guide for a full description of all Amazon Associates Web Service operations. Some enable you to:

One of the great features of Amazon Associates Web Service is the control you have over the amount of information returned in responses. A response group is a collection of data returned by Amazon Associates Web Service. Amazon Associates Web Service has over 55 response groups, each serving a different need. So, you can get exactly the information you need and no more.

We recommend that you specify response groups that return only the information your application needs. Response groups, such as Large, ItemAttributes, and MerchantItemAttributes, return lots of data. Such large data sets sometimes incur performance penalties both in Amazon Associates Web Service fulfilling the request and in your application’s processing of the response.

To earn commissions for selling Amazon items, you must register with Amazon as an Associate. Go to http://amazon.com/associates. In return, you receive an Associate tag, which identifies you. By including your Associate tag in each Amazon Associates Web Service request, you receive commissions for customer purchases.

Amazon also uses your Associate tag to monitor your use of Amazon Associates Web Service, which helps us determine how to improve our web service.

Make sure your application handles errors gracefully. One way to do that is to check the status of the IsValid element. IsValid is returned with every request. If its value is “False,” there will be an error message with a description of why your request was not valid.

It’s generally a good practice to log any unexpected error that is returned by Amazon Associates Web Service. Errors are returned with an error code and message. The code is a descriptive string that identifies the error. The error message is a more ‘human friendly’ message that can be displayed to your customers. Your application should be able to handle expected error messages.

Your application, for example, should display error messages that are meaningful to the customer. For example, when Amazon Associates Web Service responds with the error, “AWS.ECommerceService.NoExactMatches,” your application should display an explanation, such as, “We did not find any matches for your request.”

If your application exceeds the number of allowed requests submitted per second, Amazon Associates Web Service returns a 503 error, which means that Amazon Associates Web Service is restricting the number of requests it is processing from your application. The Amazon Associates Web Service Terms and Conditions outline the number of allowed requests permitted per second.

Amazon Associates Web Service product data changes often. Prices can change hourly, Browsenode values change without notice, and product availability is volatile. For these reasons, you should not cache product data.

It is against the Amazon Associates Web Service Terms and Conditions to cache customer information derived from Amazon.

You can enhance the performance of your application by caching identifiers, such as the CartId, HMAC, and PurchaseURL.

To become an Amazon Associates Web Service developer, you must register with Amazon. Go to http://aws.amazon.com and create a web service account. Your account contains an AWSAccessKeyId and a SecretKey. Every Amazon Associates Web Service request you submit must include the AWSAccessKeyId. Because your account is linked to your e-mail address, Amazon can contact you easily

Amazon Associates Web Service has an active and passionate developer community. It’s a great place to get API questions answered or share ideas with other developers. To join, go to http://developer.amazonwebservices.com/connect/forum.jspa?forumID=9