Class: WalmartApIs::WfsInventoryApi

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

Overview

WfsInventoryApi

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_wfs_inventory_items(skus: nil, page_size: 100, next_token: nil) ⇒ ApiResponse

Returns inventory for items managed by Walmart Fulfillment Services (WFS). Includes stock health, age buckets, and demand-intelligence fields not available on seller-fulfilled inventory. Rate limit: 300 items per page maximum. Requests retrieving more than 100 items per page will receive X-RateLimit-Limit and X-RateLimit-Remaining headers in the response. filter (max 50). Omit to return all WFS items. here

Parameters:

  • skus (String) (defaults to: nil)

    Optional parameter: Comma-separated seller SKUs to

  • page_size (Integer) (defaults to: 100)

    Optional parameter: Example:100

  • next_token (String) (defaults to: nil)

    Optional parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



21
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
# File 'lib/walmart_ap_is/apis/wfs_inventory_api.rb', line 21

def get_wfs_inventory_items(skus: nil,
                            page_size: 100,
                            next_token: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/inventory/v4/wfs/items',
                                 Server::DEFAULT1)
               .query_param(new_parameter(skus, key: 'skus'))
               .query_param(new_parameter(page_size, key: 'pageSize'))
               .query_param(new_parameter(next_token, key: 'nextToken'))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('walletAuth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(GetWfsInventoryResponse.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