Class: Peddler::APIs::ListingsItems20210801

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

Overview

Listings Items v2021-08-01

The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the Listings Items API Use Case Guide.

Instance Attribute Summary

Attributes inherited from Peddler::API

#access_token, #endpoint, #parser, #retries

Instance Method Summary collapse

Methods inherited from Peddler::API

#endpoint_uri, #http, #initialize, #meter, #retriable, #sandbox, #sandbox?, #use, #via

Constructor Details

This class inherits a constructor from Peddler::API

Instance Method Details

#delete_listings_item(seller_id, sku, marketplace_ids, issue_locale: nil, rate_limit: 5.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Delete a listings item for a selling partner. Note: The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to URL Encoding.

Parameters:

  • seller_id (String)

    A selling partner identifier, such as a merchant account or vendor code.

  • sku (String)

    A selling partner provided identifier for an Amazon listing.

  • marketplace_ids (Array<String>)

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

  • issue_locale (String) (defaults to: nil)

    A locale for localization of issues. When not provided, the default language code of the first marketplace is used. Examples: en_US, fr_CA, fr_FR. Localized messages default to en_US when a localization is not available in the specified locale.

  • rate_limit (Float) (defaults to: 5.0)

    Requests per second

Returns:



34
35
36
37
38
39
40
41
42
# File 'lib/peddler/apis/listings_items_2021_08_01.rb', line 34

def delete_listings_item(seller_id, sku, marketplace_ids, issue_locale: nil, rate_limit: 5.0)
  path = "/listings/2021-08-01/items/#{seller_id}/#{sku}"
  params = {
    "marketplaceIds" => marketplace_ids,
    "issueLocale" => issue_locale,
  }.compact

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

#get_listings_item(seller_id, sku, marketplace_ids, issue_locale: nil, included_data: ["summaries"], rate_limit: 5.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Returns details about a listings item for a selling partner. Note: The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to URL Encoding.

Parameters:

  • seller_id (String)

    A selling partner identifier, such as a merchant account or vendor code.

  • sku (String)

    A selling partner provided identifier for an Amazon listing.

  • marketplace_ids (Array<String>)

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

  • issue_locale (String) (defaults to: nil)

    A locale for localization of issues. When not provided, the default language code of the first marketplace is used. Examples: en_US, fr_CA, fr_FR. Localized messages default to en_US when a localization is not available in the specified locale.

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

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

  • rate_limit (Float) (defaults to: 5.0)

    Requests per second

Returns:



59
60
61
62
63
64
65
66
67
68
69
# File 'lib/peddler/apis/listings_items_2021_08_01.rb', line 59

def get_listings_item(seller_id, sku, marketplace_ids, issue_locale: nil, included_data: ["summaries"],
  rate_limit: 5.0)
  path = "/listings/2021-08-01/items/#{seller_id}/#{sku}"
  params = {
    "marketplaceIds" => marketplace_ids,
    "issueLocale" => issue_locale,
    "includedData" => included_data,
  }.compact

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

#patch_listings_item(seller_id, sku, marketplace_ids, body, included_data: ["issues"], mode: nil, issue_locale: nil, rate_limit: 5.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Partially update (patch) a listings item for a selling partner. Only top-level listings item attributes can be patched. Patching nested attributes is not supported. Note: This operation has a throttling rate of one request per second when mode is VALIDATION_PREVIEW. Note: The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to URL Encoding.

Parameters:

  • seller_id (String)

    A selling partner identifier, such as a merchant account or vendor code.

  • sku (String)

    A selling partner provided identifier for an Amazon listing.

  • marketplace_ids (Array<String>)

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

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

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

  • mode (String) (defaults to: nil)

    The mode of operation for the request.

  • issue_locale (String) (defaults to: nil)

    A locale for localization of issues. When not provided, the default language code of the first marketplace is used. Examples: en_US, fr_CA, fr_FR. Localized messages default to en_US when a localization is not available in the specified locale.

  • body (Hash)

    The request body schema for the patchListingsItem operation.

  • rate_limit (Float) (defaults to: 5.0)

    Requests per second

Returns:



90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/peddler/apis/listings_items_2021_08_01.rb', line 90

def patch_listings_item(seller_id, sku, marketplace_ids, body, included_data: ["issues"], mode: nil,
  issue_locale: nil, rate_limit: 5.0)
  path = "/listings/2021-08-01/items/#{seller_id}/#{sku}"
  params = {
    "marketplaceIds" => marketplace_ids,
    "includedData" => included_data,
    "mode" => mode,
    "issueLocale" => issue_locale,
  }.compact

  meter(rate_limit).patch(path, body:, params:)
end

#put_listings_item(seller_id, sku, marketplace_ids, body, included_data: ["issues"], mode: nil, issue_locale: nil, rate_limit: 5.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Creates or fully updates an existing listings item for a selling partner. Note: This operation has a throttling rate of one request per second when mode is VALIDATION_PREVIEW. Note: The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to URL Encoding.

Parameters:

  • seller_id (String)

    A selling partner identifier, such as a merchant account or vendor code.

  • sku (String)

    A selling partner provided identifier for an Amazon listing.

  • marketplace_ids (Array<String>)

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

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

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

  • mode (String) (defaults to: nil)

    The mode of operation for the request.

  • issue_locale (String) (defaults to: nil)

    A locale for localization of issues. When not provided, the default language code of the first marketplace is used. Examples: en_US, fr_CA, fr_FR. Localized messages default to en_US when a localization is not available in the specified locale.

  • body (Hash)

    The request body schema for the putListingsItem operation.

  • rate_limit (Float) (defaults to: 5.0)

    Requests per second

Returns:



122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/peddler/apis/listings_items_2021_08_01.rb', line 122

def put_listings_item(seller_id, sku, marketplace_ids, body, included_data: ["issues"], mode: nil,
  issue_locale: nil, rate_limit: 5.0)
  path = "/listings/2021-08-01/items/#{seller_id}/#{sku}"
  params = {
    "marketplaceIds" => marketplace_ids,
    "includedData" => included_data,
    "mode" => mode,
    "issueLocale" => issue_locale,
  }.compact

  meter(rate_limit).put(path, body:, params:)
end