Class: MWS::Webstore::Client

Inherits:
Peddler::Client show all
Defined in:
lib/mws/webstore/client.rb

Overview

With the Webstore API section of Amazon MWS, you can get “Email Me When Available” subscription information for items listed on your Amazon Webstore. The Webstore API section can help you plan your inventory replenishment cycle by enabling you to query for items that your customers subscribed to when they clicked the Email Me When Available button on your Webstore. The Webstore API section can also return information about the notifications that were sent to your customers when out-of-stock items came back in stock. This information, when combined with sales information that your Webstore tracks, can help you determine how many notifications were converted into sales.

Instance Attribute Summary

Attributes inherited from Peddler::Client

#auth_token, #body, #merchant_id, #path, #primary_marketplace_id, #version

Instance Method Summary collapse

Methods inherited from Peddler::Client

#aws_endpoint, #defaults, #error_handler, #headers, #initialize, #marketplace, #marketplace_id, #marketplace_id=, on_error, #on_error, #operation, path, #run, version

Constructor Details

This class inherits a constructor from Peddler::Client

Instance Method Details

#get_service_statusPeddler::XMLParser

Gets the service status of the API



83
84
85
86
# File 'lib/mws/webstore/client.rb', line 83

def get_service_status
  operation('GetServiceStatus')
  run
end

#get_subscription_details(seller_sku, subscription_state, date_range_start, opts = { marketplace_id: marketplace_id }) ⇒ Peddler::XMLParser

Gets the number of subscriptions that were created or notifications that were sent for an item within a date range

Parameters:

  • seller_sku (String)
  • subscription_state (String)
  • date_range_start (String, #iso8601)
  • opts (Hash) (defaults to: { marketplace_id: marketplace_id })

Options Hash (opts):

  • :marketplace_id (String)
  • :date_range_end (String, #iso8601)

Returns:

See Also:



67
68
69
70
71
72
73
74
75
76
77
# File 'lib/mws/webstore/client.rb', line 67

def get_subscription_details(seller_sku, subscription_state, date_range_start, opts = {})
  opts[:marketplace_id] ||= primary_marketplace_id
  operation('GetSubscriptionDetails')
    .add(opts.update(
           'SellerSKU' => seller_sku,
           'SubscriptionState' => subscription_state,
           'DateRangeStart' => date_range_start
    ))

  run
end

#list_subscriptions_count(subscription_state, opts = { marketplace_id: primary_marketplace_id }) ⇒ Peddler::XMLParser

Lists subscription counts of subscriptions in a specified state, including the items that are subscribed to

Parameters:

  • subscription_state (String)
  • opts (Hash) (defaults to: { marketplace_id: primary_marketplace_id })

Options Hash (opts):

  • :marketplace_id (String)
  • :date_range_start (String, #iso8601)
  • :date_range_end (String, #iso8601)
  • :seller_sku_list (Array<String>)

Returns:

See Also:



31
32
33
34
35
36
37
38
39
40
41
# File 'lib/mws/webstore/client.rb', line 31

def list_subscriptions_count(subscription_state, opts = {})
  opts[:marketplace_id] ||= primary_marketplace_id
  if opts.key?(:seller_sku_list)
    opts['SellerSKUList'] = opts.delete(:seller_sku_list)
  end
  operation('ListSubscriptionsCount')
    .add(opts.update('SubscriptionState' => subscription_state))
    .structure!('SellerSKUList', 'SellerSKU')

  run
end

#list_subscriptions_count_by_next_token(next_token) ⇒ Peddler::XMLParser

Lists the next page of subscription counts



48
49
50
51
52
53
# File 'lib/mws/webstore/client.rb', line 48

def list_subscriptions_count_by_next_token(next_token)
  operation('ListSubscriptionsCountByNextToken')
    .add('NextToken' => next_token)

  run
end