Class: Peddler::API::CatalogItems20220401

Inherits:
Peddler::API show all
Defined in:
lib/peddler/api/catalog_items_2022_04_01.rb

Overview

Selling Partner API for Catalog Items

The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, refer to the href="https://developer-docs.amazon.com/sp-api/docs/catalog-items-api-v2022-04-01-use-case-guide">https://developer-docs.amazon.com/sp-api/docs/catalog-items-api-v2022-04-01-use-case-guide Catalog Items API Use Case Guide.

Instance Attribute Summary

Attributes inherited from Peddler::API

#access_token, #endpoint

Instance Method Summary collapse

Methods inherited from Peddler::API

#cannot_sandbox!, #endpoint_uri, #http, #initialize, #meter, #must_sandbox!, #retriable, #sandbox, #sandbox?, #use, #via

Constructor Details

This class inherits a constructor from Peddler::API

Instance Method Details

#get_catalog_item(asin, marketplace_ids, included_data: ["summaries"], locale: nil, rate_limit: 2.0) ⇒ Hash

Note:

This operation can make a static sandbox call.

Retrieves details for an item in the Amazon catalog.

Parameters:

  • asin (String)

    The Amazon Standard Identification Number (ASIN) of the item.

  • marketplace_ids (Array<String>)

    A comma-delimited list of Amazon marketplace identifiers. Data sets in the response contain data only for the specified marketplaces.

  • included_data (Array<String>) (defaults to: ["summaries"])

    A comma-delimited list of data sets to include in the response. Default: summaries.

  • locale (String) (defaults to: nil)

    Locale for retrieving localized summaries. Defaults to the primary locale of the marketplace.

  • rate_limit (Float) (defaults to: 2.0)

    Requests per second

Returns:

  • (Hash)

    The API response



82
83
84
85
86
87
88
89
90
91
# File 'lib/peddler/api/catalog_items_2022_04_01.rb', line 82

def get_catalog_item(asin, marketplace_ids, included_data: ["summaries"], locale: nil, rate_limit: 2.0)
  path = "/catalog/2022-04-01/items/#{asin}"
  params = {
    "marketplaceIds" => marketplace_ids,
    "includedData" => included_data,
    "locale" => locale,
  }.compact

  meter(rate_limit).get(path, params:)
end

#search_catalog_items(marketplace_ids, identifiers: nil, identifiers_type: nil, included_data: ["summaries"], locale: nil, seller_id: nil, keywords: nil, brand_names: nil, classification_ids: nil, page_size: 10, page_token: nil, keywords_locale: nil, rate_limit: 2.0) ⇒ Hash

Note:

This operation can make a static sandbox call.

Search for and return a list of Amazon catalog items and associated information either by identifier or by keywords.

Parameters:

  • identifiers (Array<String>) (defaults to: nil)

    A comma-delimited list of product identifiers to search the Amazon catalog for. Note: Cannot be used with keywords.

  • identifiers_type (String) (defaults to: nil)

    Type of product identifiers to search the Amazon catalog for. Note: Required when identifiers are provided.

  • marketplace_ids (Array<String>)

    A comma-delimited list of Amazon marketplace identifiers for the request.

  • included_data (Array<String>) (defaults to: ["summaries"])

    A comma-delimited list of data sets to include in the response. Default: summaries.

  • locale (String) (defaults to: nil)

    Locale for retrieving localized summaries. Defaults to the primary locale of the marketplace.

  • seller_id (String) (defaults to: nil)

    A selling partner identifier, such as a seller account or vendor code. Note: Required when identifiersType is SKU.

  • keywords (Array<String>) (defaults to: nil)

    A comma-delimited list of words to search the Amazon catalog for. Note: Cannot be used with identifiers.

  • brand_names (Array<String>) (defaults to: nil)

    A comma-delimited list of brand names to limit the search for keywords-based queries. Note: Cannot be used with identifiers.

  • classification_ids (Array<String>) (defaults to: nil)

    A comma-delimited list of classification identifiers to limit the search for keywords-based queries. Note: Cannot be used with identifiers.

  • page_size (Integer) (defaults to: 10)

    Number of results to be returned per page.

  • page_token (String) (defaults to: nil)

    A token to fetch a certain page when there are multiple pages worth of results.

  • keywords_locale (String) (defaults to: nil)

    The language of the keywords provided for keywords-based queries. Defaults to the primary locale of the marketplace. Note: Cannot be used with identifiers.

  • rate_limit (Float) (defaults to: 2.0)

    Requests per second

Returns:

  • (Hash)

    The API response



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/peddler/api/catalog_items_2022_04_01.rb', line 48

def search_catalog_items(marketplace_ids, identifiers: nil, identifiers_type: nil, included_data: ["summaries"],
  locale: nil, seller_id: nil, keywords: nil, brand_names: nil, classification_ids: nil, page_size: 10,
  page_token: nil, keywords_locale: nil, rate_limit: 2.0)
  path = "/catalog/2022-04-01/items"
  params = {
    "identifiers" => identifiers,
    "identifiersType" => identifiers_type,
    "marketplaceIds" => marketplace_ids,
    "includedData" => included_data,
    "locale" => locale,
    "sellerId" => seller_id,
    "keywords" => keywords,
    "brandNames" => brand_names,
    "classificationIds" => classification_ids,
    "pageSize" => page_size,
    "pageToken" => page_token,
    "keywordsLocale" => keywords_locale,
  }.compact

  meter(rate_limit).get(path, params:)
end