Class: Peddler::API::SolicitationsV1

Inherits:
Peddler::API show all
Defined in:
lib/peddler/api/solicitations_v1.rb

Overview

Selling Partner API for Solicitations

With the Solicitations API you can build applications that send non-critical solicitations to buyers. You can get a list of solicitation types that are available for an order that you specify, then call an operation that sends a solicitation to the buyer for that order. Buyers cannot respond to solicitations sent by this API, and these solicitations do not appear in the Messaging section of Seller Central or in the recipient’s Message Center. The Solicitations API returns responses that are formed according to the <a href=tools.ietf.org/html/draft-kelly-json-hal-08>JSON Hypertext Application Language</a> (HAL) standard.

Instance Attribute Summary

Attributes inherited from Peddler::API

#access_token, #endpoint

Instance Method Summary collapse

Methods inherited from Peddler::API

#cannot_sandbox!, #endpoint_uri, #http, #initialize, #meter, #must_sandbox!, #retriable, #sandbox, #sandbox?, #use, #via

Constructor Details

This class inherits a constructor from Peddler::API

Instance Method Details

#create_product_review_and_seller_feedback_solicitation(amazon_order_id, marketplace_ids, rate_limit: 1.0) ⇒ Hash

Note:

This operation can make a static sandbox call.

Sends a solicitation to a buyer asking for seller feedback and a product review for the specified order. Send only one productReviewAndSellerFeedback or free form proactive message per order.

Parameters:

  • amazon_order_id (String)

    An Amazon order identifier. This specifies the order for which a solicitation is sent.

  • marketplace_ids (Array<String>)

    A marketplace identifier. This specifies the marketplace in which the order was placed. Only one marketplace can be specified.

  • rate_limit (Float) (defaults to: 1.0)

    Requests per second

Returns:

  • (Hash)

    The API response



53
54
55
56
57
58
59
60
# File 'lib/peddler/api/solicitations_v1.rb', line 53

def create_product_review_and_seller_feedback_solicitation(amazon_order_id, marketplace_ids, rate_limit: 1.0)
  path = "/solicitations/v1/orders/#{amazon_order_id}/solicitations/productReviewAndSellerFeedback"
  params = {
    "marketplaceIds" => marketplace_ids,
  }.compact

  meter(rate_limit).post(path, params:)
end

#get_solicitation_actions_for_order(amazon_order_id, marketplace_ids, rate_limit: 1.0) ⇒ Hash

Note:

This operation can make a static sandbox call.

Returns a list of solicitation types that are available for an order that you specify. A solicitation type is represented by an actions object, which contains a path and query parameter(s). You can use the path and parameter(s) to call an operation that sends a solicitation. Currently only the productReviewAndSellerFeedbackSolicitation solicitation type is available.

Parameters:

  • amazon_order_id (String)

    An Amazon order identifier. This specifies the order for which you want a list of available solicitation types.

  • marketplace_ids (Array<String>)

    A marketplace identifier. This specifies the marketplace in which the order was placed. Only one marketplace can be specified.

  • rate_limit (Float) (defaults to: 1.0)

    Requests per second

Returns:

  • (Hash)

    The API response



34
35
36
37
38
39
40
41
# File 'lib/peddler/api/solicitations_v1.rb', line 34

def get_solicitation_actions_for_order(amazon_order_id, marketplace_ids, rate_limit: 1.0)
  path = "/solicitations/v1/orders/#{amazon_order_id}"
  params = {
    "marketplaceIds" => marketplace_ids,
  }.compact

  meter(rate_limit).get(path, params:)
end