Class: Peddler::APIs::Messaging20260420

Inherits:
Peddler::API show all
Defined in:
lib/peddler/apis/messaging_2026_04_20.rb,
lib/peddler/apis/messaging_2026_04_20/error.rb,
lib/peddler/apis/messaging_2026_04_20/error_list.rb,
lib/peddler/apis/messaging_2026_04_20/pagination.rb,
lib/peddler/apis/messaging_2026_04_20/automation_details.rb,
lib/peddler/apis/messaging_2026_04_20/trigger_conditions.rb,
lib/peddler/apis/messaging_2026_04_20/marketplace_automation.rb,
lib/peddler/apis/messaging_2026_04_20/automation_configuration.rb,
lib/peddler/apis/messaging_2026_04_20/create_automation_config_request.rb,
lib/peddler/apis/messaging_2026_04_20/list_automation_configs_response.rb,
lib/peddler/apis/messaging_2026_04_20/update_automation_config_request.rb,
sig/peddler/apis/messaging_2026_04_20.rbs

Overview

The Selling Partner API for Messaging Automations

The Selling Partner API for Messaging Automations allows sellers to programmatically manage automated buyer-seller messaging configurations. An automation configuration defines rules for automatically responding to buyer messages (for example, auto-responses to common questions about shipping, returns, or product details). A seller can create multiple automation configurations, and each configuration can apply to one or more Amazon stores. Each store-specific entry within a configuration contains the response content and the automation trigger conditions. The marketplaceIds query parameter is required on all operations for store-scoped authorization.

Defined Under Namespace

Classes: AutomationConfiguration, AutomationDetails, CreateAutomationConfigRequest, Error, ErrorList, ListAutomationConfigsResponse, MarketplaceAutomation, Pagination, TriggerConditions, UpdateAutomationConfigRequest

Constant Summary

Constants inherited from Peddler::API

Peddler::API::TRANSIENT_STATUSES

Instance Attribute Summary

Attributes inherited from Peddler::API

#access_token, #base_url, #endpoint, #retries

Instance Method Summary collapse

Methods inherited from Peddler::API

#cannot_sandbox!, #delete, #endpoint_uri, #get, #host_header, #http, #initialize, #must_sandbox!, #parse_base_url, #patch, #percent_encode, #post, #put, #request, #sandbox, #sandbox?, #stringify_array, #timestamp, #user_agent

Constructor Details

This class inherits a constructor from Peddler::API

Instance Method Details

#create_automation_configuration(marketplace_ids, body) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Creates a new automation configuration for automated buyer-seller messaging. The configuration is ACTIVE as soon as it is created. The response returns the full automation configuration resource, including the server-generated automationId.

Parameters:

  • marketplace_ids (Array<String>) —

    A comma-delimited list of Amazon store identifiers for the request. Required for store-scoped operations and authorization. Your application must have permission to operate in the specified stores before processing the request body.

  • body (Hash) —

    The request body for creating an automation configuration.

  • (Array[String])
  • (Hash[untyped, untyped])

Returns:



29
30
31
32
33
34
35
36
# File 'lib/peddler/apis/messaging_2026_04_20.rb', line 29

def create_automation_configuration(marketplace_ids, body)
  path = "/messaging/2026-04-20/automationConfigurations"
  params = {
    "marketplaceIds" => stringify_array(marketplace_ids),
  }.compact
  parser = -> { AutomationConfiguration }
  post(path, body:, params:, parser:)
end

#get_automation_configuration(automation_id, marketplace_ids) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Returns the details of a specific automation configuration, including its store-specific automation entries with response content and trigger conditions.

Parameters:

  • automation_id (String) —

    The unique identifier of the automation configuration.

  • marketplace_ids (Array<String>) —

    A comma-delimited list of Amazon store identifiers for the request. Required for store-scoped operations and authorization. Your application must have permission to operate in the specified stores before processing the request body.

  • (String)
  • (Array[String])

Returns:



82
83
84
85
86
87
88
89
# File 'lib/peddler/apis/messaging_2026_04_20.rb', line 82

def get_automation_configuration(automation_id, marketplace_ids)
  path = "/messaging/2026-04-20/automationConfigurations/#{percent_encode(automation_id)}"
  params = {
    "marketplaceIds" => stringify_array(marketplace_ids),
  }.compact
  parser = -> { AutomationConfiguration }
  get(path, params:, parser:)
end

#list_automation_configurations(marketplace_ids, automation_type: nil, automation_sub_type: nil, include_marketplace_automations: "FALSE", page_size: nil, pagination_token: nil) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Returns a list of automation configurations that include the specified Amazon store. Results may include configurations that also apply to other stores, since a single configuration can span multiple stores.

Parameters:

  • marketplace_ids (Array<String>) —

    A comma-delimited list of Amazon store identifiers for the request. Required for store-scoped operations and authorization. Your application must have permission to operate in the specified stores before processing the request body.

  • automation_type (String) (defaults to: nil) —

    Filters results by automation type. Known values: AUTO_RESPONSE.

  • automation_sub_type (String) (defaults to: nil) —

    Filters results by automation sub-type. Known values: AUTO_RESPONSE.

  • include_marketplace_automations (String) (defaults to: "FALSE") —

    When set to true, the response includes the full, store-level automation details for each configuration, including response text, attachment URL, and the trigger conditions that define when the automation activates for that store. When false or omitted, only the top-level configuration metadata (identifier, status, display name, timestamps) is returned. Known values: TRUE, FALSE.

  • page_size (Integer) (defaults to: nil) —

    The number of results to return per page. Minimum: 1. Maximum: 50. Default: 10.

  • pagination_token (String) (defaults to: nil) —

    A token to fetch the next page of results. Use the nextToken value returned in the previous response's pagination object.

  • (Array[String])
  • automation_type: (String, nil) (defaults to: nil)
  • automation_sub_type: (String, nil) (defaults to: nil)
  • include_marketplace_automations: (String, nil) (defaults to: "FALSE")
  • page_size: (Integer, nil) (defaults to: nil)
  • pagination_token: (String, nil) (defaults to: nil)

Returns:



57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/peddler/apis/messaging_2026_04_20.rb', line 57

def list_automation_configurations(marketplace_ids, automation_type: nil, automation_sub_type: nil,
  include_marketplace_automations: "FALSE", page_size: nil, pagination_token: nil)
  path = "/messaging/2026-04-20/automationConfigurations"
  params = {
    "marketplaceIds" => stringify_array(marketplace_ids),
    "automationType" => automation_type,
    "automationSubType" => automation_sub_type,
    "includeMarketplaceAutomations" => include_marketplace_automations,
    "pageSize" => page_size,
    "paginationToken" => pagination_token,
  }.compact
  parser = -> { ListAutomationConfigsResponse }
  get(path, params:, parser:)
end

#update_automation_configuration(automation_id, marketplace_ids, body) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Updates an existing automation configuration. This is a full replacement operation using PUT semantics; you must provide the complete desired state, including automationDisplayName, automationStatus, and marketplaceAutomations. The marketplaceAutomations entries you provide replace all of the configuration's existing Amazon store entries; any store that you omit is removed from the configuration. To deactivate a configuration, send its complete current state with automationStatus set to DEACTIVATED.

Parameters:

  • automation_id (String) —

    The unique identifier of the automation configuration to update.

  • marketplace_ids (Array<String>) —

    A comma-delimited list of Amazon store identifiers for the request. Required for store-scoped operations and authorization. Your application must have permission to operate in the specified stores before processing the request body.

  • body (Hash) —

    The request body for updating an automation configuration.

  • (String)
  • (Array[String])
  • (Hash[untyped, untyped])

Returns:



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

def update_automation_configuration(automation_id, marketplace_ids, body)
  path = "/messaging/2026-04-20/automationConfigurations/#{percent_encode(automation_id)}"
  params = {
    "marketplaceIds" => stringify_array(marketplace_ids),
  }.compact
  parser = -> { AutomationConfiguration }
  put(path, body:, params:, parser:)
end