Class: Peddler::APIs::ListingsRestrictions20210801

Inherits:
Peddler::API
  • Object
show all
Defined in:
lib/peddler/apis/listings_restrictions_2021_08_01.rb,
lib/peddler/apis/listings_restrictions_2021_08_01/link.rb,
lib/peddler/apis/listings_restrictions_2021_08_01/error.rb,
lib/peddler/apis/listings_restrictions_2021_08_01/reason.rb,
lib/peddler/apis/listings_restrictions_2021_08_01/error_list.rb,
lib/peddler/apis/listings_restrictions_2021_08_01/restriction.rb,
lib/peddler/apis/listings_restrictions_2021_08_01/restriction_list.rb,
sig/peddler/apis/listings_restrictions_2021_08_01.rbs

Overview

Selling Partner API for Listings Restrictions

The Selling Partner API for Listings Restrictions provides programmatic access to restrictions on Amazon catalog listings.

For more information, see the Listings Restrictions API Use Case Guide.

Defined Under Namespace

Classes: Error, ErrorList, Link, Reason, Restriction, RestrictionList

Constant Summary

Constants inherited from Peddler::API

Peddler::API::TRANSIENT_STATUSES

Instance Attribute Summary

Attributes inherited from Peddler::API

#access_token, #endpoint, #retries

Instance Method Summary collapse

Methods inherited from Peddler::API

#cannot_sandbox!, #delete, #endpoint_uri, #get, #http, #initialize, #must_sandbox!, #patch, #percent_encode, #post, #put, #request, #sandbox, #sandbox?, #stringify_array, #timestamp, #user_agent

Constructor Details

This class inherits a constructor from Peddler::API

Instance Method Details

#get_listings_restrictions(asin, seller_id, marketplace_ids, condition_type: nil, reason_locale: nil, product_type: nil, rate_limit: 5.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Returns listing restrictions for an item in the Amazon Catalog.

Parameters:

  • asin (String) —

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

  • condition_type (String) (defaults to: nil) —

    The condition used to filter restrictions.

  • seller_id (String) —

    A selling partner identifier, such as a merchant account.

  • marketplace_ids (Array<String>) —

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

  • reason_locale (String) (defaults to: nil) —

    A locale for reason text localization. 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.

  • product_type (String) (defaults to: nil) —

    The product type of the item. When provided with the brand name, the API evaluates GTIN exemption restrictions in addition to brand restrictions for the specified product type.

  • rate_limit (Float) (defaults to: 5.0) —

    Requests per second

  • (String)
  • (String)
  • (Array[String])
  • condition_type: (String, nil) (defaults to: nil)
  • reason_locale: (String, nil) (defaults to: nil)
  • product_type: (String, nil) (defaults to: nil)
  • rate_limit: (Float) (defaults to: 5.0)

Returns:



32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/peddler/apis/listings_restrictions_2021_08_01.rb', line 32

def get_listings_restrictions(asin, seller_id, marketplace_ids, condition_type: nil, reason_locale: nil,
  product_type: nil, rate_limit: 5.0)
  path = "/listings/2021-08-01/restrictions"
  params = {
    "asin" => asin,
    "conditionType" => condition_type,
    "sellerId" => seller_id,
    "marketplaceIds" => stringify_array(marketplace_ids),
    "reasonLocale" => reason_locale,
    "productType" => product_type,
  }.compact
  parser = -> { RestrictionList }
  get(path, params:, rate_limit:, parser:)
end