Class: InventoryManagementAndItemManagementAndOrderManagementAndPriceManagement::InventoryController

Inherits:
BaseController
  • Object
show all
Defined in:
lib/inventory_management_and_item_management_and_order_management_and_price_management/controllers/inventory_controller.rb

Overview

InventoryController

Constant Summary

Constants inherited from BaseController

BaseController::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseController

#config, #http_call_back

Instance Method Summary collapse

Methods inherited from BaseController

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

Constructor Details

This class inherits a constructor from InventoryManagementAndItemManagementAndOrderManagementAndPriceManagement::BaseController

Instance Method Details

#inventory(sku, ship_node, wm_sec_access_token, wm_consumer_channel_type, wm_qos_correlation_id, wm_svc_name, accept) ⇒ SuccessfulOperation

You can use this API to get the inventory for a given item. alphanumeric unique ID, specified by the seller, which identifies each item. This will be used by the seller in the XSD file to refer to each item. Special characters in the sku needing encoding are: ‘:’, ‘/’, ‘?’, ‘#’, ‘[’, ‘]’, ‘@’, ‘!’, ‘$’, ‘&’, “‘”, ’(‘, ’)‘, ’*‘, ’+‘, ’,‘, ’;‘, ’=‘, ‘ ’, ’’‘ as well as ’%‘ itself if it’s a part of sku. Make sure to encode space with %20. Other characters don’t need to be encoded. inventory is requested access token retrieved in the Token API call to track the consumer request by channel. Use the Consumer Channel Type received during onboarding unique ID which identifies each API call and used to track and debug issues; use a random generated GUID for this ID Name

Parameters:

  • sku (String)

    Required parameter: (Required) An arbitrary

  • ship_node (String)

    Required parameter: The shipNode for which the

  • wm_sec_access_token (String)

    Required parameter: (Required) The

  • wm_consumer_channel_type (String)

    Required parameter: A unique ID

  • wm_qos_correlation_id (String)

    Required parameter: (Required) A

  • wm_svc_name (String)

    Required parameter: (Required) Walmart Service

  • accept (String)

    Required parameter: TODO: type description here

Returns:



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/controllers/inventory_controller.rb', line 32

def inventory(sku,
              ship_node,
              wm_sec_access_token,
              wm_consumer_channel_type,
              wm_qos_correlation_id,
              wm_svc_name,
              accept)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/inventory',
                                 Server::DEFAULT)
               .query_param(new_parameter(sku, key: 'sku'))
               .query_param(new_parameter(ship_node, key: 'shipNode'))
               .header_param(new_parameter(wm_sec_access_token, key: 'WM_SEC.ACCESS_TOKEN'))
               .header_param(new_parameter(wm_consumer_channel_type, key: 'WM_CONSUMER.CHANNEL.TYPE'))
               .header_param(new_parameter(wm_qos_correlation_id, key: 'WM_QOS.CORRELATION_ID'))
               .header_param(new_parameter(wm_svc_name, key: 'WM_SVC.NAME'))
               .header_param(new_parameter(accept, key: 'Accept')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(SuccessfulOperation.method(:from_hash)))
    .execute
end

#updateinventory(sku, ship_node, wm_sec_access_token, wm_consumer_channel_type, wm_qos_correlation_id, wm_svc_name, accept, body) ⇒ SuccessfulOperation

Updates the inventory for a given item. alphanumeric unique ID, specified by the seller, which identifies each item. This will be used by the seller in the XSD file to refer to each item. Special characters in the sku needing encoding are: ‘:’, ‘/’, ‘?’, ‘#’, ‘[’, ‘]’, ‘@’, ‘!’, ‘$’, ‘&’, “‘”, ’(‘, ’)‘, ’*‘, ’+‘, ’,‘, ’;‘, ’=‘, ‘ ’, ’’‘ as well as ’%‘ itself if it’s a part of sku. Make sure to encode space with %20. Other characters don’t need to be encoded. inventory is to be updated. access token retrieved in the Token API call to track the consumer request by channel. Use the Consumer Channel Type received during onboarding unique ID which identifies each API call and used to track and debug issues; use a random generated GUID for this ID Name description here

Parameters:

  • sku (String)

    Required parameter: (Required) An arbitrary

  • ship_node (String)

    Required parameter: The shipNode for which the

  • wm_sec_access_token (String)

    Required parameter: (Required) The

  • wm_consumer_channel_type (String)

    Required parameter: A unique ID

  • wm_qos_correlation_id (String)

    Required parameter: (Required) A

  • wm_svc_name (String)

    Required parameter: (Required) Walmart Service

  • accept (String)

    Required parameter: TODO: type description here

  • body (SuccessfulOperation)

    Required parameter: TODO: type

Returns:



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/controllers/inventory_controller.rb', line 80

def updateinventory(sku,
                    ship_node,
                    wm_sec_access_token,
                    wm_consumer_channel_type,
                    wm_qos_correlation_id,
                    wm_svc_name,
                    accept,
                    body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::PUT,
                                 '/inventory',
                                 Server::DEFAULT)
               .query_param(new_parameter(sku, key: 'sku'))
               .query_param(new_parameter(ship_node, key: 'shipNode'))
               .header_param(new_parameter(wm_sec_access_token, key: 'WM_SEC.ACCESS_TOKEN'))
               .header_param(new_parameter(wm_consumer_channel_type, key: 'WM_CONSUMER.CHANNEL.TYPE'))
               .header_param(new_parameter(wm_qos_correlation_id, key: 'WM_QOS.CORRELATION_ID'))
               .header_param(new_parameter(wm_svc_name, key: 'WM_SVC.NAME'))
               .header_param(new_parameter(accept, key: 'Accept'))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body))
               .body_serializer(proc do |param| param.to_json unless param.nil? end))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(SuccessfulOperation.method(:from_hash)))
    .execute
end

#wfs_inventory(sku, from_modified_date, to_modified_date, limit, offset, ship_node_type, wm_sec_access_token, wm_consumer_channel_type, wm_qos_correlation_id, wm_svc_name, accept) ⇒ SuccessfulOperation6

You can use this API to get the current Available to Sell inventory quantities for all WFS items in your catalog. You can also query specific SKUs or filter to only items updated after a specific date in order to reduce the response size. ID, specified by the seller, which identifies each item. This will be used by the seller in the XSD file to refer to each item. Special characters in the sku needing encoding are: ‘:’, ‘/’, ‘?’, ‘#’, ‘[’, ‘]’, ‘@’, ‘!’, ‘$’, ‘&’, “‘”, ’(‘, ’)‘, ’*‘, ’+‘, ’,‘, ’;‘, ’=‘, ‘ ’ as well as ’%‘ itself if it’s a part of sku. Make sure to encode space with %20. Other characters don’t need to be encoded. modified date - starting range. modified date - starting range. Cannot be larger than 300. records you wish to skip before selecting records. multichannel. This param is enabled only for multi channel sellers. sku becomes mandatory and other params are ineffective while using this param. sku can either contain one item or list of sku’s separated by comma (example: sku1,sku2) access token retrieved in the Token API call to track the consumer request by channel. Use the Consumer Channel Type received during onboarding unique ID which identifies each API call and used to track and debug issues; use a random generated GUID for this ID Name

Parameters:

  • sku (String)

    Required parameter: An arbitrary alphanumeric unique

  • from_modified_date (String)

    Required parameter: last inventory

  • to_modified_date (String)

    Required parameter: last inventory

  • limit (Integer)

    Required parameter: Number of Sku to be returned.

  • offset (Integer)

    Required parameter: Offset is the number of

  • ship_node_type (String)

    Required parameter: Currently supported:

  • wm_sec_access_token (String)

    Required parameter: (Required) The

  • wm_consumer_channel_type (String)

    Required parameter: A unique ID

  • wm_qos_correlation_id (String)

    Required parameter: (Required) A

  • wm_svc_name (String)

    Required parameter: (Required) Walmart Service

  • accept (String)

    Required parameter: TODO: type description here

Returns:



144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/controllers/inventory_controller.rb', line 144

def wfs_inventory(sku,
                  from_modified_date,
                  to_modified_date,
                  limit,
                  offset,
                  ship_node_type,
                  wm_sec_access_token,
                  wm_consumer_channel_type,
                  wm_qos_correlation_id,
                  wm_svc_name,
                  accept)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/fulfillment/inventory',
                                 Server::DEFAULT)
               .query_param(new_parameter(sku, key: 'sku'))
               .query_param(new_parameter(from_modified_date, key: 'fromModifiedDate'))
               .query_param(new_parameter(to_modified_date, key: 'toModifiedDate'))
               .query_param(new_parameter(limit, key: 'limit'))
               .query_param(new_parameter(offset, key: 'offset'))
               .query_param(new_parameter(ship_node_type, key: 'shipNodeType'))
               .header_param(new_parameter(wm_sec_access_token, key: 'WM_SEC.ACCESS_TOKEN'))
               .header_param(new_parameter(wm_consumer_channel_type, key: 'WM_CONSUMER.CHANNEL.TYPE'))
               .header_param(new_parameter(wm_qos_correlation_id, key: 'WM_QOS.CORRELATION_ID'))
               .header_param(new_parameter(wm_svc_name, key: 'WM_SVC.NAME'))
               .header_param(new_parameter(accept, key: 'Accept')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(SuccessfulOperation6.method(:from_hash)))
    .execute
end