Class: Peddler::APIs::CatalogItems20220401

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

Overview

Selling Partner API for Catalog Items

Use the Selling Partner API for Catalog Items to retrieve information about items in the Amazon catalog.

For more information, refer to the [Catalog Items API Use Case Guide](developer-docs.amazon.com/sp-api/docs/:catalog-items-api-v2022-04-01-use-case-guide).

Instance Attribute Summary

Attributes inherited from Peddler::API

#access_token, #endpoint, #retries

Instance Method Summary collapse

Methods inherited from Peddler::API

#endpoint_uri, #http, #initialize, #meter, #retriable, #sandbox, #sandbox?, #typed, #typed?, #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) ⇒ Peddler::Response

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. To find the ID for your marketplace, refer to [Marketplace IDs](developer-docs.amazon.com/sp-api/docs/marketplace-ids).

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

    A comma-delimited list of datasets to include in the response.

  • locale (String) (defaults to: nil)

    The locale for which you want to retrieve localized summaries. Defaults to the primary locale of the marketplace.

  • rate_limit (Float) (defaults to: 2.0)

    Requests per second

Returns:



87
88
89
90
91
92
93
94
95
96
# File 'lib/peddler/apis/catalog_items_2022_04_01.rb', line 87

def get_catalog_item(asin, marketplace_ids, included_data: ["summaries"], locale: nil, rate_limit: 2.0)
  path = "/catalog/2022-04-01/items/#{percent_encode(asin)}"
  params = {
    "marketplaceIds" => stringify_array(marketplace_ids),
    "includedData" => stringify_array(included_data),
    "locale" => locale,
  }.compact
  parser = Peddler::Types::CatalogItems20220401::Item if typed?
  meter(rate_limit).get(path, params:, parser:)
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) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Search for a list of Amazon catalog items and item-related information. You can search by identifier or by keywords.

Parameters:

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

    A comma-delimited list of product identifiers that you can use to search the Amazon catalog. Note: You cannot include ‘identifiers` and `keywords` in the same request.

  • identifiers_type (String) (defaults to: nil)

    The type of product identifiers that you can use to search the Amazon catalog. Note: ‘identifiersType` is required when `identifiers` is in the request.

  • marketplace_ids (Array<String>)

    A comma-delimited list of Amazon marketplace identifiers. To find the ID for your marketplace, refer to [Marketplace IDs](developer-docs.amazon.com/sp-api/docs/marketplace-ids).

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

    A comma-delimited list of datasets to include in the response.

  • locale (String) (defaults to: nil)

    The locale for which you want to retrieve 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 keywords that you can use to search the Amazon catalog. Note: You cannot include ‘keywords` and `identifiers` in the same request.

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

    A comma-delimited list of brand names that you can use to limit the search in queries based on ‘keywords`. Note: Cannot be used with `identifiers`.

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

    A comma-delimited list of classification identifiers that you can use to limit the search in queries based on ‘keywords`. Note: Cannot be used with `identifiers`.

  • page_size (Integer) (defaults to: 10)

    The number of results to include on each page.

  • page_token (String) (defaults to: nil)

    A token that you can use to fetch a specific page when there are multiple pages of results.

  • keywords_locale (String) (defaults to: nil)

    The language of the keywords that are included in queries based on ‘keywords`. 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:



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/peddler/apis/catalog_items_2022_04_01.rb', line 53

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" => stringify_array(identifiers),
    "identifiersType" => identifiers_type,
    "marketplaceIds" => stringify_array(marketplace_ids),
    "includedData" => stringify_array(included_data),
    "locale" => locale,
    "sellerId" => seller_id,
    "keywords" => stringify_array(keywords),
    "brandNames" => stringify_array(brand_names),
    "classificationIds" => stringify_array(classification_ids),
    "pageSize" => page_size,
    "pageToken" => page_token,
    "keywordsLocale" => keywords_locale,
  }.compact
  parser = Peddler::Types::CatalogItems20220401::ItemSearchResults if typed?
  meter(rate_limit).get(path, params:, parser:)
end