Processing of Errors

Is it possible to submit a valid request and still have an error?

Yes. If you were to submit a request and no items in Amazon satisfied the request, you would receive an error. The following request is an example of this problem.

  • Following is a SearchItems request trying to search for Mystery Novels on Amazon under Automotive category having condition as Refurbished.
{
 "Keywords": "Mystery Novels",
 "SearchIndex": "Automotive",
 "Condition": "Refurbished",
 "PartnerTag": "xyz-20",
 "PartnerType": "Associates",
 "Marketplace": "www.amazon.com",
 "Operation": "SearchItems"
}
  • Since, looking for Refurbished edition of novels under Automotive category doesn't make much sense, hence we got No results for the request. The response we get from Product Advertising API in this case look like this:
{
 "Errors": [
  {
   "__type": "com.amazon.paapi#ErrorData",
   "Code": "NoResults",
   "Message": "No results found for your request."
  }
 ]
}

Is it possible to not get a resource response even after requesting it?

Yes. Resources determine what information will be returned in the API response. It is possible that a requested resource is not available for a particular product. In this case, Product Advertising API returns partial response where the unservable resource is absent from the response whereas other valid resources are served. For example, ContentRating resource from ItemInfo is usually applicable for digital products like Movies or VideoGames. Requesting for ContentRating for an Electronics product will not return ContentRating information.

  • Following is a GetItems request for a Fire TV Stick which requests for ItemInfo.ContentRating and ItemInfo.Title resources.
{
 "ItemIds": ["B00ZV9RDKK"],
 "ItemIdType": "ASIN",
 "Resources": ["ItemInfo.ContentRating", "ItemInfo.Title"],
 "PartnerTag": "xyz-20",
 "PartnerType": "Associates",
 "Marketplace": "www.amazon.com",
 "Operation": "GetItems"
}
  • As there is no ContentRating information for the item, the response only contains Title information which is the other resource requested.
{
 "Items": [
  {
   "ASIN": "B00ZV9RDKK",
   "DetailPageURL": "https://www.amazon.com/dp/B00ZV9RDKK?tag=dsf&linkCode=ogi&th=1&psc=1",
   "ItemInfo": {
    "Title": {
     "DisplayValue": "Fire TV Stick with Alexa Voice Remote | Streaming Media Player",
     "Label": "Title",
     "Locale": "en_US"
    }
   }
  }
 ]
}

Does Product Advertising API return Partial Response?

Yes. For example, if you try to get item info for 2 ASINs, one which is invalid, you'll get error for the invalid ASIN and desired response for the second one. For example:

  • Following is a GetItems request where one of the ASINs is invalid.
{
 "ItemIds": ["INVALID_ASIN", "B00ZV9RDKK"],
 "ItemIdType": "ASIN",
 "PartnerTag": "xyz-20",
 "PartnerType": "Associates",
 "Marketplace": "www.amazon.com",
 "Operation": "GetItems"
}
  • The response looks like this:
{
 "Errors": [
  {
   "__type": "com.amazon.paapi#ErrorData",
   "Code": "InvalidParameterValue",
   "Message": "The ItemId INVALID_ASIN provided in the request is invalid."
  }
 ],
 "Items": [
  {
   "ASIN": "B00ZV9RDKK",
   "DetailPageURL": "https://www.amazon.com/dp/B00ZV9RDKK?tag=dsf&linkCode=ogi&th=1&psc=1",
   "ItemInfo": {
    "Title": {
     "DisplayValue": "Fire TV Stick with Alexa Voice Remote | Streaming Media Player",
     "Label": "Title",
     "Locale": "en_US"
    }
   }
  }
 ]
}

results matching ""

    No results matching ""