Class: WalmartApIs::SolicitationsApi

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

Overview

SolicitationsApi

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

#create_product_review_and_seller_feedback_solicitation(sp_api_order_id, marketplace_ids) ⇒ ApiResponse

TODO: type endpoint description here identifier. This specifies the order for which a solicitation is sent. identifier. This specifies the marketplace in which the order was placed. Only one marketplace can be spec

Parameters:

  • sp_api_order_id (String)

    Required parameter: An SP-API order

  • marketplace_ids (Array[String])

    Required parameter: A marketplace

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



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

def create_product_review_and_seller_feedback_solicitation(sp_api_order_id,
                                                           marketplace_ids)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/solicitations/v4/orders/{sp-apiOrderId}/solicitations/productReviewAndSellerFeedback',
                                 Server::DEFAULT1)
               .template_param(new_parameter(sp_api_order_id, key: 'sp-apiOrderId')
                                .is_required(true)
                                .should_encode(true))
               .query_param(new_parameter(marketplace_ids, key: 'marketplaceIds')
                             .is_required(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('walletAuth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:json_deserialize))
                .is_api_response(true)
                .local_error('400',
                             'Bad Request',
                             ErrorListErrorException)
                .local_error('403',
                             'Forbidden',
                             ErrorListErrorException)
                .local_error('404',
                             'Not Found',
                             ErrorListErrorException)
                .local_error('429',
                             'Rate limit exceeded',
                             ErrorListErrorException)
                .local_error('500',
                             'Internal Server Error',
                             ErrorListErrorException))
    .execute
end

#get_solicitation_actions_for_order(sp_api_order_id, marketplace_ids) ⇒ ApiResponse

TODO: type endpoint description here identifier. This specifies the order for which you want a list of available solicitation types. identifier. This specifies the marketplace in which the order was placed. Only one marketplace can be spec

Parameters:

  • sp_api_order_id (String)

    Required parameter: An SP-API order

  • marketplace_ids (Array[String])

    Required parameter: A marketplace

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



17
18
19
20
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
# File 'lib/walmart_ap_is/apis/solicitations_api.rb', line 17

def get_solicitation_actions_for_order(sp_api_order_id,
                                       marketplace_ids)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/solicitations/v4/orders/{sp-apiOrderId}',
                                 Server::DEFAULT1)
               .template_param(new_parameter(sp_api_order_id, key: 'sp-apiOrderId')
                                .is_required(true)
                                .should_encode(true))
               .query_param(new_parameter(marketplace_ids, key: 'marketplaceIds')
                             .is_required(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('walletAuth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:json_deserialize))
                .is_api_response(true)
                .local_error('400',
                             'Bad Request',
                             ErrorListErrorException)
                .local_error('403',
                             'Forbidden',
                             ErrorListErrorException)
                .local_error('404',
                             'Not Found',
                             ErrorListErrorException)
                .local_error('429',
                             'Rate limit exceeded',
                             ErrorListErrorException)
                .local_error('500',
                             'Internal Server Error',
                             ErrorListErrorException))
    .execute
end