Class: InventoryManagementAndItemManagementAndOrderManagementAndPriceManagement::OrdersController

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

Overview

OrdersController

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

#allorders(sku, customer_order_id, purchase_order_id, status, created_start_date, created_end_date, from_expected_ship_date, to_expected_ship_date, last_modified_start_date, last_modified_end_date, limit, product_info, ship_node_type, shipping_program_type, replacement_info, order_type, wm_sec_access_token, wm_consumer_channel_type, wm_qos_correlation_id, wm_svc_name, accept) ⇒ SuccessfulOperation52

Retrieves the details of all the orders for specified search criteria. Only orders created in last 180 days and a maximum of 20000 orders can be fetched at a time. Attempting to download more than 20000 orders will return an error. ID ID. One customer may have multiple purchase orders. Valid statuses are: Created, Acknowledged, Shipped, Delivered and Cancelled. purchase orders that were created after this date. Default is current date

  • 7 days. Use either UTC or ISO 8601 formats. Date example:

‘2020-03-16’(yyyy-MM-dd). Date with Timestamp example: ‘2020-03-16T10:30:15Z’(yyyy-MM-dd’T’HH:mm:ssZ). orders that were created before this date. Default is current date. Use either UTC or ISO 8601 formats. Date example: ‘2020-03-16’(yyyy-MM-dd). Date with Timestamp example: ‘2020-03-16T10:30:15Z’(yyyy-MM-dd’T’HH:mm:ssZ). purchase orders that have order lines with an expected ship date after this date. Use either UTC or ISO 8601 formats. Date example: ‘2020-03-16’(yyyy-MM-dd). Date with Timestamp example: ‘2020-03-16T10:30:15Z’(yyyy-MM-dd’T’HH:mm:ssZ) purchase orders that have order lines with an expected ship date before this date. Use either UTC or ISO 8601 formats. Date example: ‘2020-03-16’(yyyy-MM-dd). Date with Timestamp example: ‘2020-03-16T10:30:15Z’(yyyy-MM-dd’T’HH:mm:ssZ) purchase orders that were modified after this date. Use either UTC or ISO 8601 formats. Date example: ‘2020-03-16’(yyyy-MM-dd). Date with Timestamp example: ‘2020-03-16T10:30:15Z’(yyyy-MM-dd’T’HH:mm:ssZ). purchase orders that were modified before this date. Use either UTC or ISO 8601 formats. Date example: ‘2020-03-16’(yyyy-MM-dd). Date with Timestamp example: ‘2020-03-16T10:30:15Z’(yyyy-MM-dd’T’HH:mm:ssZ). returned. Cannot be larger than 200. the image URL and product weight in response, if available. Allowed values are true or false. shipNode. Allowed values are SellerFulfilled(Default), WFSFulfilled and 3PLFulfilled. type of program. Allowed value is TWO_DAY, ONE_DAY. Provides additional attributes - originalCustomerOrderID, orderType - related to Replacement order, in response, if available. Allowed values are true or false. regular order , replacement order or preorder. Possible values are REGULAR, REPLACEMENT or PREORDER. The REGULAR or REPLACEMENT will be provided in response only if query parameter replacementInfo=true. 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: A seller-provided Product ID

  • customer_order_id (String)

    Required parameter: The customer order

  • purchase_order_id (String)

    Required parameter: The purchase order

  • status (String)

    Required parameter: Status of purchase order line.

  • created_start_date (String)

    Required parameter: Fetches all

  • created_end_date (String)

    Required parameter: Fetches all purchase

  • from_expected_ship_date (String)

    Required parameter: Fetches all

  • to_expected_ship_date (String)

    Required parameter: Fetches all

  • last_modified_start_date (String)

    Required parameter: Fetches all

  • last_modified_end_date (String)

    Required parameter: Fetches all

  • limit (Integer)

    Required parameter: The number of orders to be

  • product_info (TrueClass | FalseClass)

    Required parameter: Provides

  • ship_node_type (String)

    Required parameter: Specifies the type of

  • shipping_program_type (String)

    Required parameter: Specifies the

  • replacement_info (TrueClass | FalseClass)

    Required parameter:

  • order_type (String)

    Required parameter: Specifies if the order is a

  • 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:



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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/controllers/orders_controller.rb', line 80

def allorders(sku,
              customer_order_id,
              purchase_order_id,
              status,
              created_start_date,
              created_end_date,
              from_expected_ship_date,
              to_expected_ship_date,
              last_modified_start_date,
              last_modified_end_date,
              limit,
              product_info,
              ship_node_type,
              shipping_program_type,
              replacement_info,
              order_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,
                                 '/orders',
                                 Server::DEFAULT)
               .query_param(new_parameter(sku, key: 'sku'))
               .query_param(new_parameter(customer_order_id, key: 'customerOrderId'))
               .query_param(new_parameter(purchase_order_id, key: 'purchaseOrderId'))
               .query_param(new_parameter(status, key: 'status'))
               .query_param(new_parameter(created_start_date, key: 'createdStartDate'))
               .query_param(new_parameter(created_end_date, key: 'createdEndDate'))
               .query_param(new_parameter(from_expected_ship_date, key: 'fromExpectedShipDate'))
               .query_param(new_parameter(to_expected_ship_date, key: 'toExpectedShipDate'))
               .query_param(new_parameter(last_modified_start_date, key: 'lastModifiedStartDate'))
               .query_param(new_parameter(last_modified_end_date, key: 'lastModifiedEndDate'))
               .query_param(new_parameter(limit, key: 'limit'))
               .query_param(new_parameter(product_info, key: 'productInfo'))
               .query_param(new_parameter(ship_node_type, key: 'shipNodeType'))
               .query_param(new_parameter(shipping_program_type, key: 'shippingProgramType'))
               .query_param(new_parameter(replacement_info, key: 'replacementInfo'))
               .query_param(new_parameter(order_type, key: 'orderType'))
               .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(SuccessfulOperation52.method(:from_hash)))
    .execute
end