Class: WalmartApIs::ListingsRestrictionsApi

Inherits:
BaseApi
  • Object
show all
Defined in:
lib/walmart_ap_is/apis/listings_restrictions_api.rb

Overview

ListingsRestrictionsApi

Constant Summary

Constants inherited from BaseApi

BaseApi::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseApi

#config, #http_call_back

Instance Method Summary collapse

Methods inherited from BaseApi

#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent, user_agent_parameters

Constructor Details

This class inherits a constructor from WalmartApIs::BaseApi

Instance Method Details

#get_listings_restrictions(asin, condition_type, seller_id, marketplace_ids, reason_locale: 'en_US') ⇒ ApiResponse

Returns restrictions on listing an item for a given ASIN and seller. A successful response does not guarantee the seller can list — check the restrictions array. Walmart Seller API) here type description here restriction reason messages

Parameters:

  • asin (String)

    Required parameter: Walmart Item ID (maps to ASIN in

  • condition_type (ConditionType1)

    Required parameter: Example:

  • seller_id (String)

    Required parameter: TODO: type description

  • marketplace_ids (Array[MarketplaceId])

    Required parameter: TODO:

  • reason_locale (String) (defaults to: 'en_US')

    Optional parameter: Locale for localized

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/walmart_ap_is/apis/listings_restrictions_api.rb', line 22

def get_listings_restrictions(asin,
                              condition_type,
                              seller_id,
                              marketplace_ids,
                              reason_locale: 'en_US')
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/listings/v4/restrictions',
                                 Server::DEFAULT1)
               .query_param(new_parameter(asin, key: 'asin')
                             .is_required(true))
               .query_param(new_parameter(condition_type, key: 'conditionType')
                             .is_required(true))
               .query_param(new_parameter(seller_id, key: 'sellerId')
                             .is_required(true))
               .query_param(new_parameter(marketplace_ids, key: 'marketplaceIds')
                             .is_required(true))
               .query_param(new_parameter(reason_locale, key: 'reasonLocale'))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('walletAuth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(RestrictionList.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Bad Request',
                             ErrorListErrorException)
                .local_error('403',
                             'Forbidden',
                             ErrorListErrorException)
                .local_error('429',
                             'Rate limit exceeded',
                             ErrorListErrorException)
                .local_error('500',
                             'Internal Server Error',
                             ErrorListErrorException))
    .execute
end