Class: Peddler::APIs::MessagingV1

Inherits:
Peddler::API show all
Defined in:
lib/peddler/apis/messaging_v1.rb,
lib/peddler/apis/messaging_v1/error.rb,
lib/peddler/apis/messaging_v1/attachment.rb,
lib/peddler/apis/messaging_v1/error_list.rb,
lib/peddler/apis/messaging_v1/link_object.rb,
lib/peddler/apis/messaging_v1/invoice_request.rb,
lib/peddler/apis/messaging_v1/invoice_response.rb,
lib/peddler/apis/messaging_v1/messaging_action.rb,
lib/peddler/apis/messaging_v1/get_schema_response.rb,
lib/peddler/apis/messaging_v1/create_warranty_request.rb,
lib/peddler/apis/messaging_v1/get_attributes_response.rb,
lib/peddler/apis/messaging_v1/create_warranty_response.rb,
lib/peddler/apis/messaging_v1/create_amazon_motors_request.rb,
lib/peddler/apis/messaging_v1/create_amazon_motors_response.rb,
lib/peddler/apis/messaging_v1/get_messaging_action_response.rb,
lib/peddler/apis/messaging_v1/create_legal_disclosure_request.rb,
lib/peddler/apis/messaging_v1/create_legal_disclosure_response.rb,
lib/peddler/apis/messaging_v1/create_digital_access_key_request.rb,
lib/peddler/apis/messaging_v1/create_unexpected_problem_request.rb,
lib/peddler/apis/messaging_v1/create_digital_access_key_response.rb,
lib/peddler/apis/messaging_v1/create_unexpected_problem_response.rb,
lib/peddler/apis/messaging_v1/create_confirm_order_details_request.rb,
lib/peddler/apis/messaging_v1/create_confirm_order_details_response.rb,
lib/peddler/apis/messaging_v1/create_confirm_service_details_request.rb,
lib/peddler/apis/messaging_v1/create_confirm_delivery_details_request.rb,
lib/peddler/apis/messaging_v1/create_confirm_service_details_response.rb,
lib/peddler/apis/messaging_v1/create_confirm_delivery_details_response.rb,
lib/peddler/apis/messaging_v1/get_messaging_actions_for_order_response.rb,
lib/peddler/apis/messaging_v1/create_confirm_customization_details_request.rb,
lib/peddler/apis/messaging_v1/create_confirm_customization_details_response.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.

Defined Under Namespace

Classes: ErrorList

Constant Summary collapse

Error =

Error response returned when the request is unsuccessful.

Structure.new do
  # @return [String] An error code that identifies the type of error that occurred.
  attribute(:code, String)

  # @return [String] A message that describes the error condition.
  attribute(:message, String)

  # @return [String] Additional details that can help the caller understand or fix the issue.
  attribute?(:details, String)
end
Attachment =

Represents a file that was uploaded to a destination that was created by the Uploads API createUploadDestinationForResource operation.

Structure.new do
  # @return [String] The name of the file, including the extension. This is the file name that will appear in the
  #   message. This does not need to match the file name of the file that you uploaded.
  attribute(:file_name, String, from: "fileName")

  # @return [String] The identifier for the upload destination. To retrieve this value, call the Uploads API
  #   [`createUploadDestinationForResource`](https://developer-docs.amazon.com/sp-api/reference/createuploaddestinationforresource)
  #   operation.
  attribute(:upload_destination_id, String, from: "uploadDestinationId")
end
LinkObject =

A Link object.

Structure.new do
  # @return [String] A URI for this object.
  attribute(:href, String)

  # @return [String] An identifier for this object.
  attribute?(:name, String)
end
InvoiceRequest =

The request schema for the sendInvoice operation.

Structure.new do
  # @return [Array<Attachment>] Attachments to include in the message to the buyer.
  attribute?(:attachments, [Attachment])
end
InvoiceResponse =

The response schema for the sendInvoice operation.

Structure.new do
  # @return [Array<Error>]
  attribute?(:errors, [Error])
end
MessagingAction =

A simple object containing the name of the template.

Structure.new do
  # @return [String] The name of the template.
  attribute(:name, String)
end
GetSchemaResponse =

The GET request schema response.

Structure.new do
  # @return [Hash] The links response that is associated with the object.
  attribute?(:_links, Hash)

  # @return [Array<Error>]
  attribute?(:errors, [Error])

  # @return [Hash]
  attribute?(:payload, Hash)
end
CreateWarrantyRequest =

The request schema for the createWarranty operation.

Structure.new do
  # @return [Array<Attachment>] Attachments to include in the message to the buyer. If any text is included in the
  #   attachment, the text must be written in the buyer's language of preference, which can be retrieved from the
  #   GetAttributes operation.
  attribute?(:attachments, [Attachment])

  # @return [Time] The end date of the warranty coverage to include in the message to the buyer.
  attribute?(:coverage_end_date, Time, from: "coverageEndDate")

  # @return [Time] The start date of the warranty coverage to include in the message to the buyer.
  attribute?(:coverage_start_date, Time, from: "coverageStartDate")
end
GetAttributesResponse =

The response schema for the GetAttributes operation.

Structure.new do
  # @return [Hash] The list of attributes related to the buyer.
  attribute?(:buyer, Hash)

  # @return [Array<Error>]
  attribute?(:errors, [Error])
end
CreateWarrantyResponse =

The response schema for the createWarranty operation.

Structure.new do
  # @return [Array<Error>]
  attribute?(:errors, [Error])
end
CreateAmazonMotorsRequest =

The request schema for the createAmazonMotors operation.

Structure.new do
  # @return [Array<Attachment>] Attachments to include in the message to the buyer. If any text is included in the
  #   attachment, the text must be written in the buyer's language of preference, which can be retrieved from the
  #   GetAttributes operation.
  attribute?(:attachments, [Attachment])
end
CreateAmazonMotorsResponse =

The response schema for the createAmazonMotors operation.

Structure.new do
  # @return [Array<Error>]
  attribute?(:errors, [Error])
end
GetMessagingActionResponse =

Describes a messaging action that can be taken for an order. Provides a JSON Hypertext Application Language (HAL) link to the JSON schema document that describes the expected input.

Structure.new do
  # @return [Hash] The embedded response associated with the messaging action.
  attribute?(:_embedded, Hash)

  # @return [Hash] The links response that is associated with the messaging action.
  attribute?(:_links, Hash)

  # @return [Array<Error>]
  attribute?(:errors, [Error])

  # @return [MessagingAction]
  attribute?(:payload, MessagingAction)
end
CreateLegalDisclosureRequest =

The request schema for the createLegalDisclosure operation.

Structure.new do
  # @return [Array<Attachment>] Attachments to include in the message to the buyer. If any text is included in the
  #   attachment, the text must be written in the buyer's language of preference, which can be retrieved from the
  #   GetAttributes operation.
  attribute?(:attachments, [Attachment])
end
CreateLegalDisclosureResponse =

The response schema for the createLegalDisclosure operation.

Structure.new do
  # @return [Array<Error>]
  attribute?(:errors, [Error])
end
CreateDigitalAccessKeyRequest =

The request schema for the createDigitalAccessKey operation.

Structure.new do
  # @return [Array<Attachment>] Attachments that you want to include in the message to the buyer.
  attribute?(:attachments, [Attachment])

  # @return [String] The text that is sent to the buyer. Only links that are related to the digital access key are
  #   allowed. Do not include HTML or email addresses. The text must be written in the buyer's preferred language,
  #   which you can retrieve from the `GetAttributes` operation.
  attribute?(:text, String)
end
CreateUnexpectedProblemRequest =

The request schema for the createUnexpectedProblem operation.

Structure.new do
  # @return [String] The text to be sent to the buyer. Only links related to unexpected problem calls are allowed.
  #   Do not include HTML or email addresses. The text must be written in the buyer's language of preference,
  #   which can be retrieved from the GetAttributes operation.
  attribute?(:text, String)
end
CreateDigitalAccessKeyResponse =

The response schema for the createDigitalAccessKey operation.

Structure.new do
  # @return [Array<Error>]
  attribute?(:errors, [Error])
end
CreateUnexpectedProblemResponse =

The response schema for the createUnexpectedProblem operation.

Structure.new do
  # @return [Array<Error>]
  attribute?(:errors, [Error])
end
CreateConfirmOrderDetailsRequest =

The request schema for the createConfirmOrderDetails operation.

Structure.new do
  # @return [String] The text to be sent to the buyer. Only links related to order completion are allowed. Do not
  #   include HTML or email addresses. The text must be written in the buyer's language of preference, which can
  #   be retrieved from the GetAttributes operation.
  attribute?(:text, String)
end
CreateConfirmOrderDetailsResponse =

The response schema for the createConfirmOrderDetails operation.

Structure.new do
  # @return [Array<Error>]
  attribute?(:errors, [Error])
end
CreateConfirmServiceDetailsRequest =

The request schema for the createConfirmServiceDetails operation.

Structure.new do
  # @return [String] The text to be sent to the buyer. Only links related to Home Service calls are allowed. Do
  #   not include HTML or email addresses. The text must be written in the buyer's language of preference, which
  #   can be retrieved from the GetAttributes operation.
  attribute?(:text, String)
end
CreateConfirmDeliveryDetailsRequest =

The request schema for the createConfirmDeliveryDetails operation.

Structure.new do
  # @return [String] The text to be sent to the buyer. Only links related to order delivery are allowed. Do not
  #   include HTML or email addresses. The text must be written in the buyer's language of preference, which can
  #   be retrieved from the GetAttributes operation.
  attribute?(:text, String)
end
CreateConfirmServiceDetailsResponse =

The response schema for the createConfirmServiceDetails operation.

Structure.new do
  # @return [Array<Error>]
  attribute?(:errors, [Error])
end
CreateConfirmDeliveryDetailsResponse =

The response schema for the createConfirmDeliveryDetails operation.

Structure.new do
  # @return [Array<Error>]
  attribute?(:errors, [Error])
end
GetMessagingActionsForOrderResponse =

The response schema for the getMessagingActionsForOrder operation.

Structure.new do
  # @return [Hash] The messaging actions response that is associated with the specified `amazonOrderId`.
  attribute?(:_embedded, Hash)

  # @return [Hash] The links response that is associated with the specified `amazonOrderId`.
  attribute?(:_links, Hash)

  # @return [Array<Error>]
  attribute?(:errors, [Error])
end
CreateConfirmCustomizationDetailsRequest =

The request schema for the confirmCustomizationDetails operation.

Structure.new do
  # @return [Array<Attachment>] Attachments to include in the message to the buyer.
  attribute?(:attachments, [Attachment])

  # @return [String] The text to be sent to the buyer. Only links related to customization details are allowed. Do
  #   not include HTML or email addresses. The text must be written in the buyer's language of preference, which
  #   can be retrieved from the GetAttributes operation.
  attribute?(:text, String)
end
CreateConfirmCustomizationDetailsResponse =

The response schema for the confirmCustomizationDetails operation.

Structure.new do
  # @return [Array<Error>]
  attribute?(:errors, [Error])
end

Instance Attribute Summary

Attributes inherited from Peddler::API

#access_token, #endpoint, #retries

Instance Method Summary collapse

Methods inherited from Peddler::API

#endpoint_uri, #http, #initialize, #meter, #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) ⇒ Peddler::Response

Note:

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.

Parameters:

  • amazon_order_id (String)

    An Amazon order identifier. This identifies the order for which a message is sent.

  • marketplace_ids (Array<String>)

    A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace.

  • body (Hash)

    This contains the message body for a message.

  • rate_limit (Float) (defaults to: 1.0)

    Requests per second

Returns:



47
48
49
50
51
52
53
54
# File 'lib/peddler/apis/messaging_v1.rb', line 47

def confirm_customization_details(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
  path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}/messages/confirmCustomizationDetails"
  params = {
    "marketplaceIds" => stringify_array(marketplace_ids),
  }.compact
  parser = -> { CreateConfirmCustomizationDetailsResponse }
  meter(rate_limit).post(path, body:, params:, parser:)
end

#create_amazon_motors(amazon_order_id, marketplace_ids, body, rate_limit: 1.0) ⇒ Peddler::Response

Note:

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.

Parameters:

  • amazon_order_id (String)

    An Amazon order identifier. This identifies the order for which a message is sent.

  • marketplace_ids (Array<String>)

    A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace.

  • body (Hash)

    This contains the message body for a message.

  • rate_limit (Float) (defaults to: 1.0)

    Requests per second

Returns:



145
146
147
148
149
150
151
152
# File 'lib/peddler/apis/messaging_v1.rb', line 145

def create_amazon_motors(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
  path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}/messages/amazonMotors"
  params = {
    "marketplaceIds" => stringify_array(marketplace_ids),
  }.compact
  parser = -> { CreateAmazonMotorsResponse }
  meter(rate_limit).post(path, body:, params:, parser:)
end

#create_confirm_delivery_details(amazon_order_id, marketplace_ids, body, rate_limit: 1.0) ⇒ Peddler::Response

Note:

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.

Parameters:

  • amazon_order_id (String)

    An Amazon order identifier. This identifies the order for which a message is sent.

  • marketplace_ids (Array<String>)

    A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace.

  • body (Hash)

    This contains the message body for a message.

  • rate_limit (Float) (defaults to: 1.0)

    Requests per second

Returns:



66
67
68
69
70
71
72
73
# File 'lib/peddler/apis/messaging_v1.rb', line 66

def create_confirm_delivery_details(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
  path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}/messages/confirmDeliveryDetails"
  params = {
    "marketplaceIds" => stringify_array(marketplace_ids),
  }.compact
  parser = -> { CreateConfirmDeliveryDetailsResponse }
  meter(rate_limit).post(path, body:, params:, parser:)
end

#create_confirm_order_details(amazon_order_id, marketplace_ids, body, rate_limit: 1.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Sends a message to ask a buyer an order-related question prior to shipping their order.

Parameters:

  • amazon_order_id (String)

    An Amazon order identifier. This identifies the order for which a message is sent.

  • marketplace_ids (Array<String>)

    A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace.

  • body (Hash)

    This contains the message body for a message.

  • rate_limit (Float) (defaults to: 1.0)

    Requests per second

Returns:



105
106
107
108
109
110
111
112
# File 'lib/peddler/apis/messaging_v1.rb', line 105

def create_confirm_order_details(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
  path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}/messages/confirmOrderDetails"
  params = {
    "marketplaceIds" => stringify_array(marketplace_ids),
  }.compact
  parser = -> { CreateConfirmOrderDetailsResponse }
  meter(rate_limit).post(path, body:, params:, parser:)
end

#create_confirm_service_details(amazon_order_id, marketplace_ids, body, rate_limit: 1.0) ⇒ Peddler::Response

Note:

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.

Parameters:

  • amazon_order_id (String)

    An Amazon order identifier. This identifies the order for which a message is sent.

  • marketplace_ids (Array<String>)

    A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace.

  • body (Hash)

    This contains the message body for a message.

  • rate_limit (Float) (defaults to: 1.0)

    Requests per second

Returns:



125
126
127
128
129
130
131
132
# File 'lib/peddler/apis/messaging_v1.rb', line 125

def create_confirm_service_details(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
  path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}/messages/confirmServiceDetails"
  params = {
    "marketplaceIds" => stringify_array(marketplace_ids),
  }.compact
  parser = -> { CreateConfirmServiceDetailsResponse }
  meter(rate_limit).post(path, body:, params:, parser:)
end

#create_digital_access_key(amazon_order_id, marketplace_ids, body, rate_limit: 1.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Sends a buyer a message to share a digital access key that is required to utilize digital content in their order.

Parameters:

  • amazon_order_id (String)

    An Amazon order identifier. This identifies the order for which a message is sent.

  • marketplace_ids (Array<String>)

    A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace.

  • body (Hash)

    This contains the message body for a message.

  • rate_limit (Float) (defaults to: 1.0)

    Requests per second

Returns:



202
203
204
205
206
207
208
209
# File 'lib/peddler/apis/messaging_v1.rb', line 202

def create_digital_access_key(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
  path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}/messages/digitalAccessKey"
  params = {
    "marketplaceIds" => stringify_array(marketplace_ids),
  }.compact
  parser = -> { CreateDigitalAccessKeyResponse }
  meter(rate_limit).post(path, body:, params:, parser:)
end
Note:

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.

Parameters:

  • amazon_order_id (String)

    An Amazon order identifier. This identifies the order for which a message is sent.

  • marketplace_ids (Array<String>)

    A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace.

  • body (Hash)

    This contains the message body for a message.

  • rate_limit (Float) (defaults to: 1.0)

    Requests per second

Returns:



86
87
88
89
90
91
92
93
# File 'lib/peddler/apis/messaging_v1.rb', line 86

def create_legal_disclosure(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
  path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}/messages/legalDisclosure"
  params = {
    "marketplaceIds" => stringify_array(marketplace_ids),
  }.compact
  parser = -> { CreateLegalDisclosureResponse }
  meter(rate_limit).post(path, body:, params:, parser:)
end

#create_unexpected_problem(amazon_order_id, marketplace_ids, body, rate_limit: 1.0) ⇒ Peddler::Response

Note:

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.

Parameters:

  • amazon_order_id (String)

    An Amazon order identifier. This identifies the order for which a message is sent.

  • marketplace_ids (Array<String>)

    A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace.

  • body (Hash)

    This contains the message body for a message.

  • rate_limit (Float) (defaults to: 1.0)

    Requests per second

Returns:



222
223
224
225
226
227
228
229
# File 'lib/peddler/apis/messaging_v1.rb', line 222

def create_unexpected_problem(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
  path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}/messages/unexpectedProblem"
  params = {
    "marketplaceIds" => stringify_array(marketplace_ids),
  }.compact
  parser = -> { CreateUnexpectedProblemResponse }
  meter(rate_limit).post(path, body:, params:, parser:)
end

#create_warranty(amazon_order_id, marketplace_ids, body, rate_limit: 1.0) ⇒ Peddler::Response

Note:

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.

Parameters:

  • amazon_order_id (String)

    An Amazon order identifier. This identifies the order for which a message is sent.

  • marketplace_ids (Array<String>)

    A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace.

  • body (Hash)

    This contains the message body for a message.

  • rate_limit (Float) (defaults to: 1.0)

    Requests per second

Returns:



164
165
166
167
168
169
170
171
# File 'lib/peddler/apis/messaging_v1.rb', line 164

def create_warranty(amazon_order_id, marketplace_ids, body, rate_limit: 1.0)
  path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}/messages/warranty"
  params = {
    "marketplaceIds" => stringify_array(marketplace_ids),
  }.compact
  parser = -> { CreateWarrantyResponse }
  meter(rate_limit).post(path, body:, params:, parser:)
end

#get_attributes(amazon_order_id, marketplace_ids, rate_limit: 1.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Returns a response containing attributes related to an order. This includes buyer preferences.

Parameters:

  • amazon_order_id (String)

    An Amazon order identifier. This identifies the order for which a message is sent.

  • marketplace_ids (Array<String>)

    A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace.

  • rate_limit (Float) (defaults to: 1.0)

    Requests per second

Returns:



182
183
184
185
186
187
188
189
# File 'lib/peddler/apis/messaging_v1.rb', line 182

def get_attributes(amazon_order_id, marketplace_ids, rate_limit: 1.0)
  path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}/attributes"
  params = {
    "marketplaceIds" => stringify_array(marketplace_ids),
  }.compact
  parser = -> { GetAttributesResponse }
  meter(rate_limit).get(path, params:, parser:)
end

#get_messaging_actions_for_order(amazon_order_id, marketplace_ids, rate_limit: 1.0) ⇒ Peddler::Response

Note:

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.

Parameters:

  • amazon_order_id (String)

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

  • marketplace_ids (Array<String>)

    A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace.

  • rate_limit (Float) (defaults to: 1.0)

    Requests per second

Returns:



27
28
29
30
31
32
33
34
# File 'lib/peddler/apis/messaging_v1.rb', line 27

def get_messaging_actions_for_order(amazon_order_id, marketplace_ids, rate_limit: 1.0)
  path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}"
  params = {
    "marketplaceIds" => stringify_array(marketplace_ids),
  }.compact
  parser = -> { GetMessagingActionsForOrderResponse }
  meter(rate_limit).get(path, params:, parser:)
end

#send_invoice(amazon_order_id, marketplace_ids, body) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Sends a message providing the buyer an invoice

Parameters:

  • amazon_order_id (String)

    An Amazon order identifier. This identifies the order for which a message is sent.

  • marketplace_ids (Array<String>)

    A marketplace identifier. This identifies the marketplace in which the order was placed. You can only specify one marketplace.

  • body (Hash)

    This contains the message body for a message.

Returns:



240
241
242
243
244
245
246
247
# File 'lib/peddler/apis/messaging_v1.rb', line 240

def send_invoice(amazon_order_id, marketplace_ids, body)
  path = "/messaging/v1/orders/#{percent_encode(amazon_order_id)}/messages/invoice"
  params = {
    "marketplaceIds" => stringify_array(marketplace_ids),
  }.compact
  parser = -> { InvoiceResponse }
  post(path, body:, params:, parser:)
end