http://webservices.amazon.com/onca/xml?
Service=AWSECommerceService&
AWSAccessKeyId=
[AWS Access Key ID]
&
Operation=ItemLookup&
ItemId=B0006PLAOE&
Availability=Available&
ResponseGroup=ItemAttributes,Offers&
Condition=All
&Timestamp=[YYYY-MM-DDThh:mm:ssZ]
&Signature=[Request Signature]
A snippet of the response shows that the Collection parent item is returned, so you might assume that it
is available. However, the item is not associated with any offers, so it cannot be purchased.
<Item>
<ASIN>B0006PLAOE</ASIN>
...
<Offers>
<TotalOffers>0</TotalOffers>
The contradiction of an item being available but not something you can buy shows that the Availability
parameter is helpful but not the final arbiter in determining what items a customer can actually purchase.
Instead, as was mentioned at the beginning of this chapter, a better test for availability is whether or not
an item has an OfferListingId. Also, in the preceding example, you can see that you can test the value of
TotalOffers to determine if an item has an offer.
Process to Include Item's Availability
Include in an ItemSearch request
Availability = Available
.
1
Include in the request
ResponseGroup = Offers
.
2
Test to see that the value in the response for
TotalOffers
is greater than zero.
3
Even though the
Availability
parameter is not foolproof, it does have value. The advantage gained
by using the parameter is that it prevents the return of items that certainly do not have an
OfferListingId
. This filtering reduces the amount of testing you need to do to make sure the returned
items have an
OfferListingId
.
Availability Parameter Restrictions and Constraints
The
Availability
parameter carries with it a restriction and some constraints. The restriction is that
the
Availability
parameter cannot be used with the Blended search index. When the Availability
parameter is set to "Available", the only optional constraint that can be present is MerchantId=Amazon.
Description
Parameter
An optional parameter that can be used to filter
search results and offer listings to only include
items sold by Amazon. By default, the API will
return items sold by various merchants including
Amazon. The only valid optional value for
MerchantId is "Amazon".
MerchantId
API Version 2011-08-01
90
Product Advertising API Developer Guide
Common ItemSearch Parameters