Class: Peddler::API::MessagingV1
- Inherits:
-
Peddler::API
- Object
- Peddler::API
- Peddler::API::MessagingV1
- Defined in:
- lib/peddler/api/messaging_v1.rb
Overview
Selling Partner API for Messaging
With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the JSON Hypertext Application Language (HAL) standard.
Instance Attribute Summary
Attributes inherited from Peddler::API
Instance Method Summary collapse
-
#confirm_customization_details(amazon_order_id, marketplace_ids, body, rate_limit: 1.0) ⇒ Hash
Sends a message asking a buyer to provide or verify customization details such as name spelling, images, initials, etc.
-
#create_amazon_motors(amazon_order_id, marketplace_ids, body, rate_limit: 1.0) ⇒ Hash
Sends a message to a buyer to provide details about an Amazon Motors order.
-
#create_confirm_delivery_details(amazon_order_id, marketplace_ids, body, rate_limit: 1.0) ⇒ Hash
Sends a message to a buyer to arrange a delivery or to confirm contact information for making a delivery.
-
#create_confirm_order_details(amazon_order_id, marketplace_ids, body, rate_limit: 1.0) ⇒ Hash
Sends a message to ask a buyer an order-related question prior to shipping their order.
-
#create_confirm_service_details(amazon_order_id, marketplace_ids, body, rate_limit: 1.0) ⇒ Hash
Sends a message to contact a Home Service customer to arrange a service call or to gather information prior to a service call.
-
#create_digital_access_key(amazon_order_id, marketplace_ids, body, rate_limit: 1.0) ⇒ Hash
Sends a message to a buyer to share a digital access key needed to utilize digital content in their order.
-
#create_legal_disclosure(amazon_order_id, marketplace_ids, body, rate_limit: 1.0) ⇒ Hash
Sends a critical message that contains documents that a seller is legally obligated to provide to the buyer.
-
#create_negative_feedback_removal(amazon_order_id, marketplace_ids, rate_limit: 1.0) ⇒ Hash
Sends a non-critical message that asks a buyer to remove their negative feedback.
-
#create_unexpected_problem(amazon_order_id, marketplace_ids, body, rate_limit: 1.0) ⇒ Hash
Sends a critical message to a buyer that an unexpected problem was encountered affecting the completion of the order.
-
#create_warranty(amazon_order_id, marketplace_ids, body, rate_limit: 1.0) ⇒ Hash
Sends a message to a buyer to provide details about warranty information on a purchase in their order.
-
#get_attributes(amazon_order_id, marketplace_ids, rate_limit: 1.0) ⇒ Hash
Returns a response containing attributes related to an order.
-
#get_messaging_actions_for_order(amazon_order_id, marketplace_ids, rate_limit: 1.0) ⇒ Hash
Returns a list of message types that are available for an order that you specify.
-
#send_invoice(amazon_order_id, marketplace_ids, body, rate_limit: nil) ⇒ Hash
Sends a message providing the buyer an invoice.
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
#confirm_customization_details(amazon_order_id, marketplace_ids, body, rate_limit: 1.0) ⇒ Hash
This operation can make a static sandbox call.
Sends a message asking a buyer to provide or verify customization details such as name spelling, images, initials, etc.
52 53 54 55 56 57 58 59 |
# File 'lib/peddler/api/messaging_v1.rb', line 52 def confirm_customization_details(amazon_order_id, marketplace_ids, body, rate_limit: 1.0) path = "/messaging/v1/orders/#{amazon_order_id}/messages/confirmCustomizationDetails" params = { "marketplaceIds" => marketplace_ids, }.compact meter(rate_limit).post(path, body:, params:) end |
#create_amazon_motors(amazon_order_id, marketplace_ids, body, rate_limit: 1.0) ⇒ Hash
This operation can make a static sandbox call.
Sends a message to a buyer to provide details about an Amazon Motors order. This message can only be sent by Amazon Motors sellers.
169 170 171 172 173 174 175 176 |
# File 'lib/peddler/api/messaging_v1.rb', line 169 def create_amazon_motors(amazon_order_id, marketplace_ids, body, rate_limit: 1.0) path = "/messaging/v1/orders/#{amazon_order_id}/messages/amazonMotors" params = { "marketplaceIds" => marketplace_ids, }.compact meter(rate_limit).post(path, body:, params:) end |
#create_confirm_delivery_details(amazon_order_id, marketplace_ids, body, rate_limit: 1.0) ⇒ Hash
This operation can make a static sandbox call.
Sends a message to a buyer to arrange a delivery or to confirm contact information for making a delivery.
71 72 73 74 75 76 77 78 |
# File 'lib/peddler/api/messaging_v1.rb', line 71 def create_confirm_delivery_details(amazon_order_id, marketplace_ids, body, rate_limit: 1.0) path = "/messaging/v1/orders/#{amazon_order_id}/messages/confirmDeliveryDetails" params = { "marketplaceIds" => marketplace_ids, }.compact meter(rate_limit).post(path, body:, params:) end |
#create_confirm_order_details(amazon_order_id, marketplace_ids, body, rate_limit: 1.0) ⇒ Hash
This operation can make a static sandbox call.
Sends a message to ask a buyer an order-related question prior to shipping their order.
129 130 131 132 133 134 135 136 |
# File 'lib/peddler/api/messaging_v1.rb', line 129 def create_confirm_order_details(amazon_order_id, marketplace_ids, body, rate_limit: 1.0) path = "/messaging/v1/orders/#{amazon_order_id}/messages/confirmOrderDetails" params = { "marketplaceIds" => marketplace_ids, }.compact meter(rate_limit).post(path, body:, params:) end |
#create_confirm_service_details(amazon_order_id, marketplace_ids, body, rate_limit: 1.0) ⇒ Hash
This operation can make a static sandbox call.
Sends a message to contact a Home Service customer to arrange a service call or to gather information prior to a service call.
149 150 151 152 153 154 155 156 |
# File 'lib/peddler/api/messaging_v1.rb', line 149 def create_confirm_service_details(amazon_order_id, marketplace_ids, body, rate_limit: 1.0) path = "/messaging/v1/orders/#{amazon_order_id}/messages/confirmServiceDetails" params = { "marketplaceIds" => marketplace_ids, }.compact meter(rate_limit).post(path, body:, params:) end |
#create_digital_access_key(amazon_order_id, marketplace_ids, body, rate_limit: 1.0) ⇒ Hash
This operation can make a static sandbox call.
Sends a message to a buyer to share a digital access key needed to utilize digital content in their order.
225 226 227 228 229 230 231 232 |
# File 'lib/peddler/api/messaging_v1.rb', line 225 def create_digital_access_key(amazon_order_id, marketplace_ids, body, rate_limit: 1.0) path = "/messaging/v1/orders/#{amazon_order_id}/messages/digitalAccessKey" params = { "marketplaceIds" => marketplace_ids, }.compact meter(rate_limit).post(path, body:, params:) end |
#create_legal_disclosure(amazon_order_id, marketplace_ids, body, rate_limit: 1.0) ⇒ Hash
This operation can make a static sandbox call.
Sends a critical message that contains documents that a seller is legally obligated to provide to the buyer. This message should only be used to deliver documents that are required by law.
91 92 93 94 95 96 97 98 |
# File 'lib/peddler/api/messaging_v1.rb', line 91 def create_legal_disclosure(amazon_order_id, marketplace_ids, body, rate_limit: 1.0) path = "/messaging/v1/orders/#{amazon_order_id}/messages/legalDisclosure" params = { "marketplaceIds" => marketplace_ids, }.compact meter(rate_limit).post(path, body:, params:) end |
#create_negative_feedback_removal(amazon_order_id, marketplace_ids, rate_limit: 1.0) ⇒ Hash
This operation can make a static sandbox call.
Sends a non-critical message that asks a buyer to remove their negative feedback. This message should only be sent after the seller has resolved the buyer's problem.
110 111 112 113 114 115 116 117 |
# File 'lib/peddler/api/messaging_v1.rb', line 110 def create_negative_feedback_removal(amazon_order_id, marketplace_ids, rate_limit: 1.0) path = "/messaging/v1/orders/#{amazon_order_id}/messages/negativeFeedbackRemoval" params = { "marketplaceIds" => marketplace_ids, }.compact meter(rate_limit).post(path, params:) end |
#create_unexpected_problem(amazon_order_id, marketplace_ids, body, rate_limit: 1.0) ⇒ Hash
This operation can make a static sandbox call.
Sends a critical message to a buyer that an unexpected problem was encountered affecting the completion of the order.
245 246 247 248 249 250 251 252 |
# File 'lib/peddler/api/messaging_v1.rb', line 245 def create_unexpected_problem(amazon_order_id, marketplace_ids, body, rate_limit: 1.0) path = "/messaging/v1/orders/#{amazon_order_id}/messages/unexpectedProblem" params = { "marketplaceIds" => marketplace_ids, }.compact meter(rate_limit).post(path, body:, params:) end |
#create_warranty(amazon_order_id, marketplace_ids, body, rate_limit: 1.0) ⇒ Hash
This operation can make a static sandbox call.
Sends a message to a buyer to provide details about warranty information on a purchase in their order.
188 189 190 191 192 193 194 195 |
# File 'lib/peddler/api/messaging_v1.rb', line 188 def create_warranty(amazon_order_id, marketplace_ids, body, rate_limit: 1.0) path = "/messaging/v1/orders/#{amazon_order_id}/messages/warranty" params = { "marketplaceIds" => marketplace_ids, }.compact meter(rate_limit).post(path, body:, params:) end |
#get_attributes(amazon_order_id, marketplace_ids, rate_limit: 1.0) ⇒ Hash
This operation can make a static sandbox call.
Returns a response containing attributes related to an order. This includes buyer preferences.
206 207 208 209 210 211 212 213 |
# File 'lib/peddler/api/messaging_v1.rb', line 206 def get_attributes(amazon_order_id, marketplace_ids, rate_limit: 1.0) path = "/messaging/v1/orders/#{amazon_order_id}/attributes" params = { "marketplaceIds" => marketplace_ids, }.compact meter(rate_limit).get(path, params:) end |
#get_messaging_actions_for_order(amazon_order_id, marketplace_ids, rate_limit: 1.0) ⇒ Hash
This operation can make a static sandbox call.
Returns a list of message types that are available for an order that you specify. A message 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 message.
32 33 34 35 36 37 38 39 |
# File 'lib/peddler/api/messaging_v1.rb', line 32 def get_messaging_actions_for_order(amazon_order_id, marketplace_ids, rate_limit: 1.0) path = "/messaging/v1/orders/#{amazon_order_id}" params = { "marketplaceIds" => marketplace_ids, }.compact meter(rate_limit).get(path, params:) end |
#send_invoice(amazon_order_id, marketplace_ids, body, rate_limit: nil) ⇒ Hash
This operation can make a static sandbox call.
Sends a message providing the buyer an invoice
264 265 266 267 268 269 270 271 |
# File 'lib/peddler/api/messaging_v1.rb', line 264 def send_invoice(amazon_order_id, marketplace_ids, body, rate_limit: nil) path = "/messaging/v1/orders/#{amazon_order_id}/messages/invoice" params = { "marketplaceIds" => marketplace_ids, }.compact post(path, body:, params:) end |