peddler 2.4.5 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +402 -140
- data/lib/peddler/api/amazon_warehousing_and_distribution_2024_05_09.rb +92 -0
- data/lib/peddler/api/aplus_content_2020_11_01.rb +246 -0
- data/lib/peddler/api/application_integrations_2024_04_01.rb +56 -0
- data/lib/peddler/api/application_management_2023_11_30.rb +35 -0
- data/lib/peddler/api/catalog_items_2020_12_01.rb +81 -0
- data/lib/peddler/api/catalog_items_2022_04_01.rb +93 -0
- data/lib/peddler/api/catalog_items_v0.rb +103 -0
- data/lib/peddler/api/data_kiosk_2023_11_15.rb +108 -0
- data/lib/peddler/api/easy_ship_2022_03_23.rb +127 -0
- data/lib/peddler/api/fba_inbound_eligibility_v1.rb +44 -0
- data/lib/peddler/api/fba_inventory_v1.rb +122 -0
- data/lib/peddler/api/feeds_2021_06_30.rb +122 -0
- data/lib/peddler/api/finances_2024_06_19.rb +50 -0
- data/lib/peddler/api/finances_v0.rb +148 -0
- data/lib/peddler/api/fulfillment_inbound_2024_03_20.rb +759 -0
- data/lib/peddler/api/fulfillment_inbound_v0.rb +352 -0
- data/lib/peddler/api/fulfillment_outbound_2020_07_01.rb +259 -0
- data/lib/peddler/api/invoices_2024_06_19.rb +180 -0
- data/lib/peddler/api/listings_items_2020_09_01.rb +95 -0
- data/lib/peddler/api/listings_items_2021_08_01.rb +170 -0
- data/lib/peddler/api/listings_restrictions_2021_08_01.rb +47 -0
- data/lib/peddler/api/merchant_fulfillment_v0.rb +80 -0
- data/lib/peddler/api/messaging_v1.rb +273 -0
- data/lib/peddler/api/notifications_v1.rb +145 -0
- data/lib/peddler/api/orders_v0.rb +279 -0
- data/lib/peddler/api/product_fees_v0.rb +77 -0
- data/lib/peddler/api/product_pricing_2022_05_01.rb +54 -0
- data/lib/peddler/api/product_pricing_v0.rb +162 -0
- data/lib/peddler/api/product_type_definitions_2020_09_01.rb +86 -0
- data/lib/peddler/api/replenishment_2022_11_07.rb +57 -0
- data/lib/peddler/api/reports_2021_06_30.rb +163 -0
- data/lib/peddler/api/sales_v1.rb +77 -0
- data/lib/peddler/api/sellers_v1.rb +45 -0
- data/lib/peddler/api/services_v1.rb +348 -0
- data/lib/peddler/api/shipment_invoicing_v0.rb +59 -0
- data/lib/peddler/api/shipping_v1.rb +132 -0
- data/lib/peddler/api/shipping_v2.rb +319 -0
- data/lib/peddler/api/solicitations_v1.rb +63 -0
- data/lib/peddler/api/supply_sources_2020_07_01.rb +100 -0
- data/lib/peddler/api/tokens_2021_03_01.rb +38 -0
- data/lib/peddler/api/uploads_2020_11_01.rb +50 -0
- data/lib/peddler/api/vendor_direct_fulfillment_inventory_v1.rb +32 -0
- data/lib/peddler/api/vendor_direct_fulfillment_orders_2021_12_28.rb +84 -0
- data/lib/peddler/api/vendor_direct_fulfillment_orders_v1.rb +84 -0
- data/lib/peddler/api/vendor_direct_fulfillment_payments_v1.rb +31 -0
- data/lib/peddler/api/vendor_direct_fulfillment_sandbox_test_data_2021_10_28.rb +45 -0
- data/lib/peddler/api/vendor_direct_fulfillment_shipping_2021_12_28.rb +203 -0
- data/lib/peddler/api/vendor_direct_fulfillment_shipping_v1.rb +189 -0
- data/lib/peddler/api/vendor_direct_fulfillment_transactions_2021_12_28.rb +32 -0
- data/lib/peddler/api/vendor_direct_fulfillment_transactions_v1.rb +32 -0
- data/lib/peddler/api/vendor_invoices_v1.rb +30 -0
- data/lib/peddler/api/vendor_orders_v1.rb +159 -0
- data/lib/peddler/api/vendor_shipments_v1.rb +132 -0
- data/lib/peddler/api/vendor_transaction_status_v1.rb +33 -0
- data/lib/peddler/api.rb +138 -0
- data/lib/peddler/endpoint.rb +51 -0
- data/lib/peddler/error.rb +31 -0
- data/lib/peddler/marketplace.rb +38 -68
- data/lib/peddler/token.rb +70 -0
- data/lib/peddler/version.rb +1 -1
- data/lib/peddler.rb +56 -1
- metadata +74 -80
- data/lib/mws/easy_ship/client.rb +0 -93
- data/lib/mws/easy_ship.rb +0 -3
- data/lib/mws/feeds/client.rb +0 -122
- data/lib/mws/feeds.rb +0 -3
- data/lib/mws/finances/client.rb +0 -82
- data/lib/mws/finances.rb +0 -3
- data/lib/mws/fulfillment_inbound_shipment/client.rb +0 -388
- data/lib/mws/fulfillment_inbound_shipment.rb +0 -3
- data/lib/mws/fulfillment_inventory/client.rb +0 -57
- data/lib/mws/fulfillment_inventory.rb +0 -3
- data/lib/mws/fulfillment_outbound_shipment/client.rb +0 -211
- data/lib/mws/fulfillment_outbound_shipment.rb +0 -3
- data/lib/mws/merchant_fulfillment/client.rb +0 -87
- data/lib/mws/merchant_fulfillment.rb +0 -3
- data/lib/mws/off_amazon_payments.rb +0 -3
- data/lib/mws/orders/client.rb +0 -120
- data/lib/mws/orders.rb +0 -3
- data/lib/mws/products/client.rb +0 -268
- data/lib/mws/products.rb +0 -3
- data/lib/mws/recommendations/client.rb +0 -72
- data/lib/mws/recommendations.rb +0 -3
- data/lib/mws/reports/client.rb +0 -236
- data/lib/mws/reports.rb +0 -3
- data/lib/mws/sellers/client.rb +0 -44
- data/lib/mws/sellers.rb +0 -3
- data/lib/mws/shipment_invoicing/client.rb +0 -74
- data/lib/mws/shipment_invoicing.rb +0 -3
- data/lib/mws/subscriptions/client.rb +0 -179
- data/lib/mws/subscriptions.rb +0 -3
- data/lib/mws.rb +0 -29
- data/lib/peddler/client.rb +0 -159
- data/lib/peddler/errors/builder.rb +0 -64
- data/lib/peddler/errors/class_generator.rb +0 -40
- data/lib/peddler/errors/error.rb +0 -45
- data/lib/peddler/errors/parser.rb +0 -28
- data/lib/peddler/flat_file_parser.rb +0 -56
- data/lib/peddler/headers.rb +0 -102
- data/lib/peddler/operation.rb +0 -78
- data/lib/peddler/parser.rb +0 -33
- data/lib/peddler/structured_list.rb +0 -23
- data/lib/peddler/vcr_matcher.rb +0 -97
- data/lib/peddler/xml_parser.rb +0 -38
- data/lib/peddler/xml_response_parser.rb +0 -25
data/lib/peddler/marketplace.rb
CHANGED
@@ -1,79 +1,49 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "peddler/endpoint"
|
4
|
+
|
3
5
|
module Peddler
|
4
|
-
#
|
5
|
-
|
6
|
-
|
6
|
+
# @see https://developer-docs.amazon.com/sp-api/docs/marketplace-ids
|
7
|
+
MARKETPLACE_IDS = {
|
8
|
+
"CA" => { id: "A2EUQ1WTGCTBG2", country_name: "Canada", selling_region: "North America" },
|
9
|
+
"US" => { id: "ATVPDKIKX0DER", country_name: "United States", selling_region: "North America" },
|
10
|
+
"MX" => { id: "A1AM78C64UM0Y8", country_name: "Mexico", selling_region: "North America" },
|
11
|
+
"BR" => { id: "A2Q3Y263D00KWC", country_name: "Brazil", selling_region: "North America" },
|
12
|
+
"ES" => { id: "A1RKKUPIHCS9HS", country_name: "Spain", selling_region: "Europe" },
|
13
|
+
"UK" => { id: "A1F83G8C2ARO7P", country_name: "United Kingdom", selling_region: "Europe" },
|
14
|
+
"FR" => { id: "A13V1IB3VIYZZH", country_name: "France", selling_region: "Europe" },
|
15
|
+
"BE" => { id: "AMEN7PMS3EDWL", country_name: "Belgium", selling_region: "Europe" },
|
16
|
+
"NL" => { id: "A1805IZSGTT6HS", country_name: "Netherlands", selling_region: "Europe" },
|
17
|
+
"DE" => { id: "A1PA6795UKMFR9", country_name: "Germany", selling_region: "Europe" },
|
18
|
+
"IT" => { id: "APJ6JRA9NG5V4", country_name: "Italy", selling_region: "Europe" },
|
19
|
+
"SE" => { id: "A2NODRKZP88ZB9", country_name: "Sweden", selling_region: "Europe" },
|
20
|
+
"ZA" => { id: "AE08WJ6YKNBMC", country_name: "South Africa", selling_region: "Europe" },
|
21
|
+
"PL" => { id: "A1C3SOZRARQ6R3", country_name: "Poland", selling_region: "Europe" },
|
22
|
+
"EG" => { id: "ARBP9OOSHTCHU", country_name: "Egypt", selling_region: "Europe" },
|
23
|
+
"TR" => { id: "A33AVAJ2PDY3EV", country_name: "Turkey", selling_region: "Europe" },
|
24
|
+
"SA" => { id: "A17E79C6D8DWNP", country_name: "Saudi Arabia", selling_region: "Europe" },
|
25
|
+
"AE" => { id: "A2VIGQ35RCS4UG", country_name: "United Arab Emirates", selling_region: "Europe" },
|
26
|
+
"IN" => { id: "A21TJRUUN4KGV", country_name: "India", selling_region: "Europe" },
|
27
|
+
"SG" => { id: "A19VAU5U5O7RUS", country_name: "Singapore", selling_region: "Far East" },
|
28
|
+
"AU" => { id: "A39IBJ37TRP1C6", country_name: "Australia", selling_region: "Far East" },
|
29
|
+
"JP" => { id: "A1VC38T7YXB528", country_name: "Japan", selling_region: "Far East" },
|
30
|
+
}
|
31
|
+
|
32
|
+
Marketplace = Data.define(:id, :country_code, :country_name, :selling_region) do
|
7
33
|
class << self
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
marketplace || not_found!(key)
|
15
|
-
end
|
16
|
-
|
17
|
-
private
|
18
|
-
|
19
|
-
def find_by_country(code)
|
20
|
-
code = 'GB' if code == 'UK'
|
21
|
-
all.find { |marketplace| marketplace.country_code == code }
|
22
|
-
end
|
23
|
-
|
24
|
-
def find_by_id(id)
|
25
|
-
all.find { |marketplace| marketplace.id == id }
|
26
|
-
end
|
27
|
-
|
28
|
-
def missing_key!
|
29
|
-
raise ArgumentError, 'missing marketplace'
|
30
|
-
end
|
31
|
-
|
32
|
-
def not_found!(country_code)
|
33
|
-
raise ArgumentError, %("#{country_code}" is not a valid marketplace)
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
attr_reader :id, :country_code, :host
|
38
|
-
|
39
|
-
def initialize(id, country_code, host)
|
40
|
-
@id = id
|
41
|
-
@country_code = country_code
|
42
|
-
@host = host
|
43
|
-
end
|
34
|
+
# @param [String] country_code
|
35
|
+
def find(country_code)
|
36
|
+
values = MARKETPLACE_IDS.fetch(country_code) do
|
37
|
+
raise ArgumentError, "#{country_code} not found"
|
38
|
+
end
|
44
39
|
|
45
|
-
|
46
|
-
case country_code
|
47
|
-
when 'JP'
|
48
|
-
'Windows-31J'
|
49
|
-
else
|
50
|
-
'CP1252'
|
40
|
+
new(**values.merge(country_code: country_code))
|
51
41
|
end
|
52
42
|
end
|
53
43
|
|
54
|
-
@
|
55
|
-
|
56
|
-
|
57
|
-
['A1AM78C64UM0Y8', 'MX', 'mws.amazonservices.com'],
|
58
|
-
['ATVPDKIKX0DER', 'US', 'mws.amazonservices.com'],
|
59
|
-
['A2VIGQ35RCS4UG', 'AE', 'mws.amazonservices.ae'],
|
60
|
-
['A1PA6795UKMFR9', 'DE', 'mws-eu.amazonservices.com'],
|
61
|
-
['ARBP9OOSHTCHU', 'EG', 'mws-eu.amazonservices.com'],
|
62
|
-
['A1RKKUPIHCS9HS', 'ES', 'mws-eu.amazonservices.com'],
|
63
|
-
['A13V1IB3VIYZZH', 'FR', 'mws-eu.amazonservices.com'],
|
64
|
-
['A1F83G8C2ARO7P', 'GB', 'mws-eu.amazonservices.com'],
|
65
|
-
['A21TJRUUN4KGV', 'IN', 'mws.amazonservices.in'],
|
66
|
-
['APJ6JRA9NG5V4', 'IT', 'mws-eu.amazonservices.com'],
|
67
|
-
['A1805IZSGTT6HS', 'NL', 'mws-eu.amazonservices.com'],
|
68
|
-
['A17E79C6D8DWNP', 'SA', 'mws-eu.amazonservices.com'],
|
69
|
-
['A33AVAJ2PDY3EV', 'TR', 'mws-eu.amazonservices.com'],
|
70
|
-
['A2NODRKZP88ZB9', 'SE', 'mws-eu.amazonservices.com'],
|
71
|
-
['A19VAU5U5O7RUS', 'SG', 'mws-fe.amazonservices.com'],
|
72
|
-
['A39IBJ37TRP1C6', 'AU', 'mws.amazonservices.com.au'],
|
73
|
-
['A1VC38T7YXB528', 'JP', 'mws.amazonservices.jp'],
|
74
|
-
['A1C3SOZRARQ6R3', 'PL', 'mws-eu.amazonservices.com']
|
75
|
-
].map do |values|
|
76
|
-
new(*values)
|
44
|
+
# @return [Peddler::Endpoint]
|
45
|
+
def endpoint
|
46
|
+
Endpoint.find_by_selling_region(selling_region)
|
77
47
|
end
|
78
48
|
end
|
79
49
|
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "http"
|
4
|
+
|
5
|
+
module Peddler
|
6
|
+
# Requests refresh and access tokens that authorize your application to take actions on behalf of a selling partner.
|
7
|
+
#
|
8
|
+
# The refresh token allows you to generate access tokens. Access tokens expire one hour after they are issued.
|
9
|
+
#
|
10
|
+
# @see https://developer-docs.amazon.com/sp-api/docs/connecting-to-the-selling-partner-api
|
11
|
+
class Token
|
12
|
+
class Error < StandardError
|
13
|
+
attr_reader :cause
|
14
|
+
|
15
|
+
def initialize(msg = nil, cause = nil)
|
16
|
+
@cause = cause
|
17
|
+
super(msg)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
URL = "https://api.amazon.com/auth/o2/token"
|
22
|
+
|
23
|
+
attr_reader :client_id, :client_secret, :options
|
24
|
+
|
25
|
+
class << self
|
26
|
+
def request(...)
|
27
|
+
new(...).request
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def initialize(client_id: ENV["LWA_CLIENT_ID"], client_secret: ENV["LWA_CLIENT_SECRET"], **options)
|
32
|
+
@client_id = client_id
|
33
|
+
@client_secret = client_secret
|
34
|
+
@options = options
|
35
|
+
end
|
36
|
+
|
37
|
+
def request
|
38
|
+
response = HTTP.post(URL, form: params)
|
39
|
+
|
40
|
+
unless response.status.success?
|
41
|
+
message = response.parse["error_description"]
|
42
|
+
raise Error.new(message, response)
|
43
|
+
end
|
44
|
+
|
45
|
+
response
|
46
|
+
end
|
47
|
+
|
48
|
+
private
|
49
|
+
|
50
|
+
def params
|
51
|
+
{
|
52
|
+
grant_type: grant_type,
|
53
|
+
client_id: client_id,
|
54
|
+
client_secret: client_secret,
|
55
|
+
}.compact.merge(options)
|
56
|
+
end
|
57
|
+
|
58
|
+
def grant_type
|
59
|
+
return if options.key?(:grant_type)
|
60
|
+
|
61
|
+
if options.key?(:refresh_token)
|
62
|
+
"refresh_token"
|
63
|
+
elsif options.key?(:scope)
|
64
|
+
"client_credentials"
|
65
|
+
elsif options.key?(:code)
|
66
|
+
"authorization_code"
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
data/lib/peddler/version.rb
CHANGED
data/lib/peddler.rb
CHANGED
@@ -1,3 +1,58 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "peddler/api/amazon_warehousing_and_distribution_2024_05_09"
|
4
|
+
require "peddler/api/aplus_content_2020_11_01"
|
5
|
+
require "peddler/api/application_integrations_2024_04_01"
|
6
|
+
require "peddler/api/application_management_2023_11_30"
|
7
|
+
require "peddler/api/catalog_items_2020_12_01"
|
8
|
+
require "peddler/api/catalog_items_2022_04_01"
|
9
|
+
require "peddler/api/catalog_items_v0"
|
10
|
+
require "peddler/api/data_kiosk_2023_11_15"
|
11
|
+
require "peddler/api/easy_ship_2022_03_23"
|
12
|
+
require "peddler/api/fba_inbound_eligibility_v1"
|
13
|
+
require "peddler/api/fba_inventory_v1"
|
14
|
+
require "peddler/api/feeds_2021_06_30"
|
15
|
+
require "peddler/api/finances_2024_06_19"
|
16
|
+
require "peddler/api/finances_v0"
|
17
|
+
require "peddler/api/fulfillment_inbound_2024_03_20"
|
18
|
+
require "peddler/api/fulfillment_inbound_v0"
|
19
|
+
require "peddler/api/fulfillment_outbound_2020_07_01"
|
20
|
+
require "peddler/api/invoices_2024_06_19"
|
21
|
+
require "peddler/api/listings_items_2020_09_01"
|
22
|
+
require "peddler/api/listings_items_2021_08_01"
|
23
|
+
require "peddler/api/listings_restrictions_2021_08_01"
|
24
|
+
require "peddler/api/merchant_fulfillment_v0"
|
25
|
+
require "peddler/api/messaging_v1"
|
26
|
+
require "peddler/api/notifications_v1"
|
27
|
+
require "peddler/api/orders_v0"
|
28
|
+
require "peddler/api/product_fees_v0"
|
29
|
+
require "peddler/api/product_pricing_2022_05_01"
|
30
|
+
require "peddler/api/product_pricing_v0"
|
31
|
+
require "peddler/api/product_type_definitions_2020_09_01"
|
32
|
+
require "peddler/api/replenishment_2022_11_07"
|
33
|
+
require "peddler/api/reports_2021_06_30"
|
34
|
+
require "peddler/api/sales_v1"
|
35
|
+
require "peddler/api/sellers_v1"
|
36
|
+
require "peddler/api/services_v1"
|
37
|
+
require "peddler/api/shipment_invoicing_v0"
|
38
|
+
require "peddler/api/shipping_v1"
|
39
|
+
require "peddler/api/shipping_v2"
|
40
|
+
require "peddler/api/solicitations_v1"
|
41
|
+
require "peddler/api/supply_sources_2020_07_01"
|
42
|
+
require "peddler/api/tokens_2021_03_01"
|
43
|
+
require "peddler/api/uploads_2020_11_01"
|
44
|
+
require "peddler/api/vendor_direct_fulfillment_inventory_v1"
|
45
|
+
require "peddler/api/vendor_direct_fulfillment_orders_2021_12_28"
|
46
|
+
require "peddler/api/vendor_direct_fulfillment_orders_v1"
|
47
|
+
require "peddler/api/vendor_direct_fulfillment_payments_v1"
|
48
|
+
require "peddler/api/vendor_direct_fulfillment_sandbox_test_data_2021_10_28"
|
49
|
+
require "peddler/api/vendor_direct_fulfillment_shipping_2021_12_28"
|
50
|
+
require "peddler/api/vendor_direct_fulfillment_shipping_v1"
|
51
|
+
require "peddler/api/vendor_direct_fulfillment_transactions_2021_12_28"
|
52
|
+
require "peddler/api/vendor_direct_fulfillment_transactions_v1"
|
53
|
+
require "peddler/api/vendor_invoices_v1"
|
54
|
+
require "peddler/api/vendor_orders_v1"
|
55
|
+
require "peddler/api/vendor_shipments_v1"
|
56
|
+
require "peddler/api/vendor_transaction_status_v1"
|
57
|
+
require "peddler/marketplace"
|
58
|
+
require "peddler/token"
|
metadata
CHANGED
@@ -1,116 +1,110 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: peddler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hakan Ensari
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: http
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
20
|
-
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 0.50.0
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: jeff
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
19
|
+
version: '5.0'
|
20
|
+
- - "<"
|
32
21
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
22
|
+
version: '7.0'
|
34
23
|
type: :runtime
|
35
24
|
prerelease: false
|
36
25
|
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '2.0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: multi_xml
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
26
|
requirements:
|
45
27
|
- - ">="
|
46
28
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
48
|
-
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
29
|
+
version: '5.0'
|
30
|
+
- - "<"
|
53
31
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
32
|
+
version: '7.0'
|
55
33
|
description:
|
56
34
|
email:
|
57
|
-
-
|
35
|
+
- hakanensari@gmail.com
|
58
36
|
executables: []
|
59
37
|
extensions: []
|
60
38
|
extra_rdoc_files: []
|
61
39
|
files:
|
62
40
|
- LICENSE
|
63
41
|
- README.md
|
64
|
-
- lib/mws.rb
|
65
|
-
- lib/mws/easy_ship.rb
|
66
|
-
- lib/mws/easy_ship/client.rb
|
67
|
-
- lib/mws/feeds.rb
|
68
|
-
- lib/mws/feeds/client.rb
|
69
|
-
- lib/mws/finances.rb
|
70
|
-
- lib/mws/finances/client.rb
|
71
|
-
- lib/mws/fulfillment_inbound_shipment.rb
|
72
|
-
- lib/mws/fulfillment_inbound_shipment/client.rb
|
73
|
-
- lib/mws/fulfillment_inventory.rb
|
74
|
-
- lib/mws/fulfillment_inventory/client.rb
|
75
|
-
- lib/mws/fulfillment_outbound_shipment.rb
|
76
|
-
- lib/mws/fulfillment_outbound_shipment/client.rb
|
77
|
-
- lib/mws/merchant_fulfillment.rb
|
78
|
-
- lib/mws/merchant_fulfillment/client.rb
|
79
|
-
- lib/mws/off_amazon_payments.rb
|
80
|
-
- lib/mws/orders.rb
|
81
|
-
- lib/mws/orders/client.rb
|
82
|
-
- lib/mws/products.rb
|
83
|
-
- lib/mws/products/client.rb
|
84
|
-
- lib/mws/recommendations.rb
|
85
|
-
- lib/mws/recommendations/client.rb
|
86
|
-
- lib/mws/reports.rb
|
87
|
-
- lib/mws/reports/client.rb
|
88
|
-
- lib/mws/sellers.rb
|
89
|
-
- lib/mws/sellers/client.rb
|
90
|
-
- lib/mws/shipment_invoicing.rb
|
91
|
-
- lib/mws/shipment_invoicing/client.rb
|
92
|
-
- lib/mws/subscriptions.rb
|
93
|
-
- lib/mws/subscriptions/client.rb
|
94
42
|
- lib/peddler.rb
|
95
|
-
- lib/peddler/
|
96
|
-
- lib/peddler/
|
97
|
-
- lib/peddler/
|
98
|
-
- lib/peddler/
|
99
|
-
- lib/peddler/
|
100
|
-
- lib/peddler/
|
101
|
-
- lib/peddler/
|
43
|
+
- lib/peddler/api.rb
|
44
|
+
- lib/peddler/api/amazon_warehousing_and_distribution_2024_05_09.rb
|
45
|
+
- lib/peddler/api/aplus_content_2020_11_01.rb
|
46
|
+
- lib/peddler/api/application_integrations_2024_04_01.rb
|
47
|
+
- lib/peddler/api/application_management_2023_11_30.rb
|
48
|
+
- lib/peddler/api/catalog_items_2020_12_01.rb
|
49
|
+
- lib/peddler/api/catalog_items_2022_04_01.rb
|
50
|
+
- lib/peddler/api/catalog_items_v0.rb
|
51
|
+
- lib/peddler/api/data_kiosk_2023_11_15.rb
|
52
|
+
- lib/peddler/api/easy_ship_2022_03_23.rb
|
53
|
+
- lib/peddler/api/fba_inbound_eligibility_v1.rb
|
54
|
+
- lib/peddler/api/fba_inventory_v1.rb
|
55
|
+
- lib/peddler/api/feeds_2021_06_30.rb
|
56
|
+
- lib/peddler/api/finances_2024_06_19.rb
|
57
|
+
- lib/peddler/api/finances_v0.rb
|
58
|
+
- lib/peddler/api/fulfillment_inbound_2024_03_20.rb
|
59
|
+
- lib/peddler/api/fulfillment_inbound_v0.rb
|
60
|
+
- lib/peddler/api/fulfillment_outbound_2020_07_01.rb
|
61
|
+
- lib/peddler/api/invoices_2024_06_19.rb
|
62
|
+
- lib/peddler/api/listings_items_2020_09_01.rb
|
63
|
+
- lib/peddler/api/listings_items_2021_08_01.rb
|
64
|
+
- lib/peddler/api/listings_restrictions_2021_08_01.rb
|
65
|
+
- lib/peddler/api/merchant_fulfillment_v0.rb
|
66
|
+
- lib/peddler/api/messaging_v1.rb
|
67
|
+
- lib/peddler/api/notifications_v1.rb
|
68
|
+
- lib/peddler/api/orders_v0.rb
|
69
|
+
- lib/peddler/api/product_fees_v0.rb
|
70
|
+
- lib/peddler/api/product_pricing_2022_05_01.rb
|
71
|
+
- lib/peddler/api/product_pricing_v0.rb
|
72
|
+
- lib/peddler/api/product_type_definitions_2020_09_01.rb
|
73
|
+
- lib/peddler/api/replenishment_2022_11_07.rb
|
74
|
+
- lib/peddler/api/reports_2021_06_30.rb
|
75
|
+
- lib/peddler/api/sales_v1.rb
|
76
|
+
- lib/peddler/api/sellers_v1.rb
|
77
|
+
- lib/peddler/api/services_v1.rb
|
78
|
+
- lib/peddler/api/shipment_invoicing_v0.rb
|
79
|
+
- lib/peddler/api/shipping_v1.rb
|
80
|
+
- lib/peddler/api/shipping_v2.rb
|
81
|
+
- lib/peddler/api/solicitations_v1.rb
|
82
|
+
- lib/peddler/api/supply_sources_2020_07_01.rb
|
83
|
+
- lib/peddler/api/tokens_2021_03_01.rb
|
84
|
+
- lib/peddler/api/uploads_2020_11_01.rb
|
85
|
+
- lib/peddler/api/vendor_direct_fulfillment_inventory_v1.rb
|
86
|
+
- lib/peddler/api/vendor_direct_fulfillment_orders_2021_12_28.rb
|
87
|
+
- lib/peddler/api/vendor_direct_fulfillment_orders_v1.rb
|
88
|
+
- lib/peddler/api/vendor_direct_fulfillment_payments_v1.rb
|
89
|
+
- lib/peddler/api/vendor_direct_fulfillment_sandbox_test_data_2021_10_28.rb
|
90
|
+
- lib/peddler/api/vendor_direct_fulfillment_shipping_2021_12_28.rb
|
91
|
+
- lib/peddler/api/vendor_direct_fulfillment_shipping_v1.rb
|
92
|
+
- lib/peddler/api/vendor_direct_fulfillment_transactions_2021_12_28.rb
|
93
|
+
- lib/peddler/api/vendor_direct_fulfillment_transactions_v1.rb
|
94
|
+
- lib/peddler/api/vendor_invoices_v1.rb
|
95
|
+
- lib/peddler/api/vendor_orders_v1.rb
|
96
|
+
- lib/peddler/api/vendor_shipments_v1.rb
|
97
|
+
- lib/peddler/api/vendor_transaction_status_v1.rb
|
98
|
+
- lib/peddler/endpoint.rb
|
99
|
+
- lib/peddler/error.rb
|
102
100
|
- lib/peddler/marketplace.rb
|
103
|
-
- lib/peddler/
|
104
|
-
- lib/peddler/parser.rb
|
105
|
-
- lib/peddler/structured_list.rb
|
106
|
-
- lib/peddler/vcr_matcher.rb
|
101
|
+
- lib/peddler/token.rb
|
107
102
|
- lib/peddler/version.rb
|
108
|
-
|
109
|
-
- lib/peddler/xml_response_parser.rb
|
110
|
-
homepage: https://github.com/hakanensari/peddler
|
103
|
+
homepage: https://github.com/lineofflight/peddler
|
111
104
|
licenses:
|
112
105
|
- MIT
|
113
|
-
metadata:
|
106
|
+
metadata:
|
107
|
+
rubygems_mfa_required: 'true'
|
114
108
|
post_install_message:
|
115
109
|
rdoc_options: []
|
116
110
|
require_paths:
|
@@ -119,15 +113,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
119
113
|
requirements:
|
120
114
|
- - ">="
|
121
115
|
- !ruby/object:Gem::Version
|
122
|
-
version: '2
|
116
|
+
version: '3.2'
|
123
117
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
124
118
|
requirements:
|
125
119
|
- - ">="
|
126
120
|
- !ruby/object:Gem::Version
|
127
121
|
version: '0'
|
128
122
|
requirements: []
|
129
|
-
rubygems_version: 3.
|
123
|
+
rubygems_version: 3.5.16
|
130
124
|
signing_key:
|
131
125
|
specification_version: 4
|
132
|
-
summary:
|
126
|
+
summary: Amazon Selling Partner API (SP-API) in Ruby
|
133
127
|
test_files: []
|
data/lib/mws/easy_ship/client.rb
DELETED
@@ -1,93 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'peddler/client'
|
4
|
-
|
5
|
-
module MWS
|
6
|
-
module EasyShip
|
7
|
-
# With the Easy Ship API section, you can build applications that help
|
8
|
-
# sellers in India manage and ship their Amazon Easy Ship orders.
|
9
|
-
#
|
10
|
-
# @note This functionality is available only in the India marketplace.
|
11
|
-
class Client < ::Peddler::Client
|
12
|
-
self.version = '2018-09-01'
|
13
|
-
self.path = "/EasyShip/#{version}"
|
14
|
-
|
15
|
-
# Returns time slots for Amazon Easy Ship package pickup
|
16
|
-
#
|
17
|
-
# @see https://docs.developer.amazonservices.com/en_US/easy_ship/EasyShip_ListPickupSlots.html
|
18
|
-
# @param [String] marketplace_id
|
19
|
-
# @param [String] amazon_order_id
|
20
|
-
# @param [Struct, Hash] package_dimensions
|
21
|
-
# @param [Struct, Hash] package_weight
|
22
|
-
# @return [Peddler::XMLParser]
|
23
|
-
def list_pickup_slots(marketplace_id, amazon_order_id, package_dimensions,
|
24
|
-
package_weight)
|
25
|
-
operation('ListPickupSlots')
|
26
|
-
.add('MarketplaceId' => marketplace_id,
|
27
|
-
'AmazonOrderId' => amazon_order_id,
|
28
|
-
'PackageDimensions' => package_dimensions,
|
29
|
-
'PackageWeight' => package_weight)
|
30
|
-
|
31
|
-
run
|
32
|
-
end
|
33
|
-
|
34
|
-
# Schedules an Amazon Easy Ship pickup slot
|
35
|
-
#
|
36
|
-
# @see https://docs.developer.amazonservices.com/en_US/easy_ship/EasyShip_CreateScheduledPackage.html
|
37
|
-
# @param [String] marketplace_id
|
38
|
-
# @param [String] amazon_order_id
|
39
|
-
# @param [Struct, Hash] package_request_details
|
40
|
-
# @return [Peddler::XMLParser]
|
41
|
-
def create_scheduled_package(marketplace_id, amazon_order_id,
|
42
|
-
package_request_details)
|
43
|
-
operation('CreateScheduledPackage')
|
44
|
-
.add('MarketplaceId' => marketplace_id,
|
45
|
-
'AmazonOrderId' => amazon_order_id,
|
46
|
-
'PackageRequestDetails' => package_request_details)
|
47
|
-
|
48
|
-
run
|
49
|
-
end
|
50
|
-
|
51
|
-
# Updates an Amazon Easy Ship pickup slot
|
52
|
-
#
|
53
|
-
# @see https://docs.developer.amazonservices.com/en_US/easy_ship/EasyShip_UpdateScheduledPackages.html
|
54
|
-
# @param [String] marketplace_id
|
55
|
-
# @param [Array<Struct, Hash>] scheduled_package_update_details_list
|
56
|
-
# @return [Peddler::XMLParser]
|
57
|
-
def update_scheduled_packages(marketplace_id,
|
58
|
-
scheduled_package_update_details_list)
|
59
|
-
operation('UpdateScheduledPackages')
|
60
|
-
.add('MarketplaceId' => marketplace_id,
|
61
|
-
'ScheduledPackageUpdateDetailsList' =>
|
62
|
-
scheduled_package_update_details_list)
|
63
|
-
.structure!('ScheduledPackageUpdateDetailsList',
|
64
|
-
'PackageUpdateDetails')
|
65
|
-
|
66
|
-
run
|
67
|
-
end
|
68
|
-
|
69
|
-
# Returns information about a scheduled package
|
70
|
-
#
|
71
|
-
# @see https://docs.developer.amazonservices.com/en_US/easy_ship/EasyShip_GetScheduledPackage.html
|
72
|
-
# @param [String] marketplace_id
|
73
|
-
# @param [Struct, Hash] scheduled_package_id
|
74
|
-
# @return [Peddler::XMLParser]
|
75
|
-
def get_scheduled_package(marketplace_id, scheduled_package_id)
|
76
|
-
operation('GetScheduledPackage')
|
77
|
-
.add('MarketplaceId' => marketplace_id,
|
78
|
-
'ScheduledPackageId' => scheduled_package_id)
|
79
|
-
|
80
|
-
run
|
81
|
-
end
|
82
|
-
|
83
|
-
# Returns the operational status of the API
|
84
|
-
#
|
85
|
-
# @see https://docs.developer.amazonservices.com/en_US/shipment_invoicing/ShipmentInvoicing_GetServiceStatus.html
|
86
|
-
# @return [Peddler::XMLParser]
|
87
|
-
def get_service_status
|
88
|
-
operation('GetServiceStatus')
|
89
|
-
run
|
90
|
-
end
|
91
|
-
end
|
92
|
-
end
|
93
|
-
end
|
data/lib/mws/easy_ship.rb
DELETED