Class: WalmartApIs::IncentivesApi

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

Overview

IncentivesApi

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

#retrieve_price_incentives_data(limit, offset, sort_by, sort_order, incentive_type, incentive_status, wm_sec_access_token, wm_consumer_channel_type, wm_qos_correlation_id, wm_svc_name, accept) ⇒ ApiResponse

Retrieves a comprehensive list of all price incentives available for items in your catalog. The response includes detailed information such as Item ID, Product Name, Product URL, SKU ID, Target Price, current Price, Incentive Type, Incentive Status, Base referral fee, Reduced Referral Fee, Enrollment Type, Inventory count, Enrollment Date (epoch Timestamp), Expiration date (epoch timestamp), Start date (epoch timestamp), and Incentive ID. For Walmart-funded items, the Target Price, Expiration Date, Start Date, Incentive ID, Reduced Referral Fee, and Enrollment Type will not be displayed (null values). Additionally, Enrollment Type and Date will not be shown for items eligible for Reduced Referral Fee incentives. For more information and usage examples, refer to the <a href=“developer.walmart.com/us-marketplace/docs/retrieve-price-inc entives-data”>Pricing API Guide</a>. to return. Allowed range is 1 to 200. Default is 25. list to be returned. Minimum offset value is 0. for items. for given sort criteria. type to filter the incentive items. incentive status to retrieve items with ‘ELIGIBLE` or `ENROLLED` incentives. obtained from the Token API. This is required for authenticating requests to Walmart Marketplace APIs. to track the consumer request by channel. Use the Consumer Channel Type received during onboarding. identifies each API call and is used to track and debug issues. Use a randomly generated GUID for this ID. Walmart service being called.

Parameters:

  • limit (Integer)

    Required parameter: Specifies the number of items

  • offset (Integer)

    Required parameter: Specifies the offset of item

  • sort_by (String)

    Required parameter: Specifies the sort criteria

  • sort_order (String)

    Required parameter: Specifies the sort order

  • incentive_type (String)

    Required parameter: Specifies the incentive

  • incentive_status (String)

    Required parameter: Specifies the

  • wm_sec_access_token (String)

    Required parameter: Access token

  • wm_consumer_channel_type (String)

    Required parameter: A unique ID

  • wm_qos_correlation_id (String)

    Required parameter: A unique ID that

  • wm_svc_name (String)

    Required parameter: Specifies the name of the

  • accept (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/walmart_ap_is/apis/incentives_api.rb', line 49

def retrieve_price_incentives_data(limit,
                                   offset,
                                   sort_by,
                                   sort_order,
                                   incentive_type,
                                   incentive_status,
                                   wm_sec_access_token,
                                   wm_consumer_channel_type,
                                   wm_qos_correlation_id,
                                   wm_svc_name,
                                   accept)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/price/incentives',
                                 Server::SERVER_1)
               .query_param(new_parameter(limit, key: 'limit')
                             .is_required(true))
               .query_param(new_parameter(offset, key: 'offset')
                             .is_required(true))
               .query_param(new_parameter(sort_by, key: 'sortBy')
                             .is_required(true))
               .query_param(new_parameter(sort_order, key: 'sortOrder')
                             .is_required(true))
               .query_param(new_parameter(incentive_type, key: 'incentiveType')
                             .is_required(true))
               .query_param(new_parameter(incentive_status, key: 'incentiveStatus')
                             .is_required(true))
               .header_param(new_parameter(wm_sec_access_token, key: 'WM_SEC.ACCESS_TOKEN')
                              .is_required(true))
               .header_param(new_parameter(wm_consumer_channel_type, key: 'WM_CONSUMER.CHANNEL.TYPE')
                              .is_required(true))
               .header_param(new_parameter(wm_qos_correlation_id, key: 'WM_QOS.CORRELATION_ID')
                              .is_required(true))
               .header_param(new_parameter(wm_svc_name, key: 'WM_SVC.NAME')
                              .is_required(true))
               .header_param(new_parameter(accept, key: 'Accept')
                              .is_required(true)))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(SuccessfulOperation5.method(:from_hash))
                .is_api_response(true))
    .execute
end