peddler 3.0.0.beta1 → 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 +96 -106
- data/lib/peddler/api/amazon_warehousing_and_distribution_2024_05_09.rb +34 -22
- data/lib/peddler/api/aplus_content_2020_11_01.rb +86 -48
- data/lib/peddler/api/application_integrations_2024_04_01.rb +56 -0
- data/lib/peddler/api/application_management_2023_11_30.rb +12 -2
- data/lib/peddler/api/catalog_items_2020_12_01.rb +31 -20
- data/lib/peddler/api/catalog_items_2022_04_01.rb +35 -25
- data/lib/peddler/api/catalog_items_v0.rb +39 -26
- data/lib/peddler/api/data_kiosk_2023_11_15.rb +41 -25
- data/lib/peddler/api/easy_ship_2022_03_23.rb +62 -43
- data/lib/peddler/api/fba_inbound_eligibility_v1.rb +13 -5
- data/lib/peddler/api/fba_inventory_v1.rb +40 -24
- data/lib/peddler/api/feeds_2021_06_30.rb +43 -25
- data/lib/peddler/api/finances_2024_06_19.rb +50 -0
- data/lib/peddler/api/finances_v0.rb +86 -59
- data/lib/peddler/api/fulfillment_inbound_2024_03_20.rb +304 -205
- data/lib/peddler/api/fulfillment_inbound_v0.rb +112 -74
- data/lib/peddler/api/fulfillment_outbound_2020_07_01.rb +90 -53
- data/lib/peddler/api/invoices_2024_06_19.rb +180 -0
- data/lib/peddler/api/listings_items_2020_09_01.rb +44 -33
- data/lib/peddler/api/listings_items_2021_08_01.rb +76 -60
- data/lib/peddler/api/listings_restrictions_2021_08_01.rb +19 -9
- data/lib/peddler/api/merchant_fulfillment_v0.rb +31 -15
- data/lib/peddler/api/messaging_v1.rb +93 -61
- data/lib/peddler/api/notifications_v1.rb +54 -23
- data/lib/peddler/api/orders_v0.rb +87 -72
- data/lib/peddler/api/product_fees_v0.rb +39 -31
- data/lib/peddler/api/product_pricing_2022_05_01.rb +17 -6
- data/lib/peddler/api/product_pricing_v0.rb +63 -45
- data/lib/peddler/api/product_type_definitions_2020_09_01.rb +29 -18
- data/lib/peddler/api/replenishment_2022_11_07.rb +21 -9
- data/lib/peddler/api/reports_2021_06_30.rb +60 -36
- data/lib/peddler/api/sales_v1.rb +20 -12
- data/lib/peddler/api/sellers_v1.rb +16 -4
- data/lib/peddler/api/services_v1.rb +138 -98
- data/lib/peddler/api/shipment_invoicing_v0.rb +25 -12
- data/lib/peddler/api/shipping_v1.rb +54 -29
- data/lib/peddler/api/shipping_v2.rb +132 -80
- data/lib/peddler/api/solicitations_v1.rb +18 -8
- data/lib/peddler/api/supply_sources_2020_07_01.rb +33 -15
- data/lib/peddler/api/tokens_2021_03_01.rb +13 -5
- data/lib/peddler/api/uploads_2020_11_01.rb +16 -6
- data/lib/peddler/api/vendor_direct_fulfillment_inventory_v1.rb +12 -4
- data/lib/peddler/api/vendor_direct_fulfillment_orders_2021_12_28.rb +29 -17
- data/lib/peddler/api/vendor_direct_fulfillment_orders_v1.rb +29 -17
- data/lib/peddler/api/vendor_direct_fulfillment_payments_v1.rb +11 -3
- data/lib/peddler/api/vendor_direct_fulfillment_sandbox_test_data_2021_10_28.rb +14 -4
- data/lib/peddler/api/vendor_direct_fulfillment_shipping_2021_12_28.rb +74 -48
- data/lib/peddler/api/vendor_direct_fulfillment_shipping_v1.rb +74 -50
- data/lib/peddler/api/vendor_direct_fulfillment_transactions_2021_12_28.rb +11 -3
- data/lib/peddler/api/vendor_direct_fulfillment_transactions_v1.rb +11 -3
- data/lib/peddler/api/vendor_invoices_v1.rb +11 -3
- data/lib/peddler/api/vendor_orders_v1.rb +54 -43
- data/lib/peddler/api/vendor_shipments_v1.rb +63 -51
- data/lib/peddler/api/vendor_transaction_status_v1.rb +12 -3
- data/lib/peddler/api.rb +41 -18
- data/lib/peddler/endpoint.rb +51 -0
- data/lib/peddler/error.rb +1 -0
- data/lib/peddler/marketplace.rb +49 -0
- data/lib/peddler/token.rb +70 -0
- data/lib/peddler/version.rb +1 -1
- data/lib/peddler.rb +56 -52
- metadata +10 -6
- data/lib/peddler/access_token.rb +0 -76
- data/lib/peddler/region.rb +0 -30
@@ -3,6 +3,12 @@
|
|
3
3
|
require "peddler/api"
|
4
4
|
|
5
5
|
module Peddler
|
6
|
+
class << self
|
7
|
+
def supply_sources_2020_07_01(...)
|
8
|
+
API::SupplySources20200701.new(...)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
6
12
|
class API
|
7
13
|
# Selling Partner API for Supply Sources
|
8
14
|
#
|
@@ -10,10 +16,12 @@ module Peddler
|
|
10
16
|
class SupplySources20200701 < API
|
11
17
|
# The path to retrieve paginated supply sources.
|
12
18
|
#
|
13
|
-
# @
|
14
|
-
# @param [
|
19
|
+
# @note This operation can make a static sandbox call.
|
20
|
+
# @param next_page_token [String] The pagination token to retrieve a specific page of results.
|
21
|
+
# @param page_size [Number] The number of supply sources to return per paginated request.
|
22
|
+
# @param rate_limit [Float] Requests per second
|
15
23
|
# @return [Hash] The API response
|
16
|
-
def get_supply_sources(next_page_token: nil, page_size: nil)
|
24
|
+
def get_supply_sources(next_page_token: nil, page_size: 10, rate_limit: nil)
|
17
25
|
path = "/supplySources/2020-07-01/supplySources"
|
18
26
|
params = {
|
19
27
|
"nextPageToken" => next_page_token,
|
@@ -25,9 +33,11 @@ module Peddler
|
|
25
33
|
|
26
34
|
# Create a new supply source.
|
27
35
|
#
|
28
|
-
# @
|
36
|
+
# @note This operation can make a static sandbox call.
|
37
|
+
# @param payload [Hash] A request to create a supply source.
|
38
|
+
# @param rate_limit [Float] Requests per second
|
29
39
|
# @return [Hash] The API response
|
30
|
-
def create_supply_source(payload)
|
40
|
+
def create_supply_source(payload, rate_limit: nil)
|
31
41
|
path = "/supplySources/2020-07-01/supplySources"
|
32
42
|
body = payload
|
33
43
|
|
@@ -36,9 +46,11 @@ module Peddler
|
|
36
46
|
|
37
47
|
# Retrieve a supply source.
|
38
48
|
#
|
39
|
-
# @
|
49
|
+
# @note This operation can make a static sandbox call.
|
50
|
+
# @param supply_source_id [String] The unique identifier of a supply source.
|
51
|
+
# @param rate_limit [Float] Requests per second
|
40
52
|
# @return [Hash] The API response
|
41
|
-
def get_supply_source(supply_source_id)
|
53
|
+
def get_supply_source(supply_source_id, rate_limit: nil)
|
42
54
|
path = "/supplySources/2020-07-01/supplySources/#{supply_source_id}"
|
43
55
|
|
44
56
|
get(path)
|
@@ -46,10 +58,12 @@ module Peddler
|
|
46
58
|
|
47
59
|
# Update the configuration and capabilities of a supply source.
|
48
60
|
#
|
49
|
-
# @
|
50
|
-
# @param [
|
61
|
+
# @note This operation can make a static sandbox call.
|
62
|
+
# @param supply_source_id [String] The unique identitier of a supply source.
|
63
|
+
# @param payload [Hash]
|
64
|
+
# @param rate_limit [Float] Requests per second
|
51
65
|
# @return [Hash] The API response
|
52
|
-
def update_supply_source(supply_source_id, payload: nil)
|
66
|
+
def update_supply_source(supply_source_id, payload: nil, rate_limit: nil)
|
53
67
|
path = "/supplySources/2020-07-01/supplySources/#{supply_source_id}"
|
54
68
|
body = payload
|
55
69
|
|
@@ -58,9 +72,11 @@ module Peddler
|
|
58
72
|
|
59
73
|
# Archive a supply source, making it inactive. Cannot be undone.
|
60
74
|
#
|
61
|
-
# @
|
75
|
+
# @note This operation can make a static sandbox call.
|
76
|
+
# @param supply_source_id [String] The unique identifier of a supply source.
|
77
|
+
# @param rate_limit [Float] Requests per second
|
62
78
|
# @return [Hash] The API response
|
63
|
-
def archive_supply_source(supply_source_id)
|
79
|
+
def archive_supply_source(supply_source_id, rate_limit: nil)
|
64
80
|
path = "/supplySources/2020-07-01/supplySources/#{supply_source_id}"
|
65
81
|
|
66
82
|
delete(path)
|
@@ -68,10 +84,12 @@ module Peddler
|
|
68
84
|
|
69
85
|
# Update the status of a supply source.
|
70
86
|
#
|
71
|
-
# @
|
72
|
-
# @param [
|
87
|
+
# @note This operation can make a static sandbox call.
|
88
|
+
# @param supply_source_id [String] The unique identifier of a supply source.
|
89
|
+
# @param payload [Hash]
|
90
|
+
# @param rate_limit [Float] Requests per second
|
73
91
|
# @return [Hash] The API response
|
74
|
-
def update_supply_source_status(supply_source_id, payload: nil)
|
92
|
+
def update_supply_source_status(supply_source_id, payload: nil, rate_limit: nil)
|
75
93
|
path = "/supplySources/2020-07-01/supplySources/#{supply_source_id}/status"
|
76
94
|
body = payload
|
77
95
|
|
@@ -3,14 +3,20 @@
|
|
3
3
|
require "peddler/api"
|
4
4
|
|
5
5
|
module Peddler
|
6
|
+
class << self
|
7
|
+
def tokens_2021_03_01(...)
|
8
|
+
API::Tokens20210301.new(...)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
6
12
|
class API
|
7
13
|
# Selling Partner API for Tokens
|
8
14
|
#
|
9
15
|
# The Selling Partner API for Tokens provides a secure way to access a customer's PII (Personally Identifiable
|
10
16
|
# Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted
|
11
17
|
# resources that you specify. The RDT authorizes subsequent calls to restricted operations that correspond to the
|
12
|
-
# restricted resources that you specified. For more information, see the
|
13
|
-
#
|
18
|
+
# restricted resources that you specified. For more information, see the
|
19
|
+
# {https://developer-docs.amazon.com/sp-api/docs/tokens-api-use-case-guide Tokens API Use Case Guide}.
|
14
20
|
class Tokens20210301 < API
|
15
21
|
# Returns a Restricted Data Token (RDT) for one or more restricted resources that you specify. A restricted
|
16
22
|
# resource is the HTTP method and path from a restricted operation that returns Personally Identifiable
|
@@ -18,12 +24,14 @@ module Peddler
|
|
18
24
|
# Case Guide for a list of restricted operations. Use the RDT returned here as the access token in subsequent
|
19
25
|
# calls to the corresponding restricted operations.
|
20
26
|
#
|
21
|
-
# @
|
27
|
+
# @note This operation can make a static sandbox call.
|
28
|
+
# @param body [Hash] The restricted data token request details.
|
29
|
+
# @param rate_limit [Float] Requests per second
|
22
30
|
# @return [Hash] The API response
|
23
|
-
def create_restricted_data_token(body)
|
31
|
+
def create_restricted_data_token(body, rate_limit: 1.0)
|
24
32
|
path = "/tokens/2021-03-01/restrictedDataToken"
|
25
33
|
|
26
|
-
rate_limit
|
34
|
+
meter(rate_limit).post(path, body:)
|
27
35
|
end
|
28
36
|
end
|
29
37
|
end
|
@@ -3,6 +3,12 @@
|
|
3
3
|
require "peddler/api"
|
4
4
|
|
5
5
|
module Peddler
|
6
|
+
class << self
|
7
|
+
def uploads_2020_11_01(...)
|
8
|
+
API::Uploads20201101.new(...)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
6
12
|
class API
|
7
13
|
# Selling Partner API for Uploads
|
8
14
|
#
|
@@ -12,20 +18,24 @@ module Peddler
|
|
12
18
|
# Creates an upload destination, returning the information required to upload a file to the destination and to
|
13
19
|
# programmatically access the file.
|
14
20
|
#
|
15
|
-
# @param [Array<String>]
|
21
|
+
# @param marketplace_ids [Array<String>] A list of marketplace identifiers. This specifies the marketplaces where
|
16
22
|
# the upload will be available. Only one marketplace can be specified.
|
17
|
-
# @param [String]
|
23
|
+
# @param content_md5 [String] An MD5 hash of the content to be submitted to the upload destination. This value is
|
18
24
|
# used to determine if the data has been corrupted or tampered with during transit.
|
19
|
-
# @param [String]
|
25
|
+
# @param resource [String] The resource for the upload destination that you are creating. For example, if you are
|
20
26
|
# creating an upload destination for the createLegalDisclosure operation of the Messaging API, the `{resource}`
|
21
27
|
# would be `/messaging/v1/orders/{amazonOrderId}/messages/legalDisclosure`, and the entire path would be
|
22
28
|
# `/uploads/2020-11-01/uploadDestinations/messaging/v1/orders/{amazonOrderId}/messages/legalDisclosure`. If you
|
23
29
|
# are creating an upload destination for an Aplus content document, the `{resource}` would be
|
24
30
|
# `aplus/2020-11-01/contentDocuments` and the path would be
|
25
31
|
# `/uploads/v1/uploadDestinations/aplus/2020-11-01/contentDocuments`.
|
26
|
-
# @param [String]
|
32
|
+
# @param content_type [String] The content type of the file to be uploaded.
|
33
|
+
# @param rate_limit [Float] Requests per second
|
27
34
|
# @return [Hash] The API response
|
28
|
-
def create_upload_destination_for_resource(marketplace_ids, content_md5, resource, content_type: nil
|
35
|
+
def create_upload_destination_for_resource(marketplace_ids, content_md5, resource, content_type: nil,
|
36
|
+
rate_limit: 10.0)
|
37
|
+
cannot_sandbox!
|
38
|
+
|
29
39
|
path = "/uploads/2020-11-01/uploadDestinations/#{resource}"
|
30
40
|
params = {
|
31
41
|
"marketplaceIds" => marketplace_ids,
|
@@ -33,7 +43,7 @@ module Peddler
|
|
33
43
|
"contentType" => content_type,
|
34
44
|
}.compact
|
35
45
|
|
36
|
-
rate_limit
|
46
|
+
meter(rate_limit).post(path, params:)
|
37
47
|
end
|
38
48
|
end
|
39
49
|
end
|
@@ -3,6 +3,12 @@
|
|
3
3
|
require "peddler/api"
|
4
4
|
|
5
5
|
module Peddler
|
6
|
+
class << self
|
7
|
+
def vendor_direct_fulfillment_inventory_v1(...)
|
8
|
+
API::VendorDirectFulfillmentInventoryV1.new(...)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
6
12
|
class API
|
7
13
|
# Selling Partner API for Direct Fulfillment Inventory Updates
|
8
14
|
#
|
@@ -11,13 +17,15 @@ module Peddler
|
|
11
17
|
class VendorDirectFulfillmentInventoryV1 < API
|
12
18
|
# Submits inventory updates for the specified warehouse for either a partial or full feed of inventory items.
|
13
19
|
#
|
14
|
-
# @
|
15
|
-
# @param [
|
20
|
+
# @note This operation can make a static sandbox call.
|
21
|
+
# @param body [Hash] The request body that contains the inventory update data to submit.
|
22
|
+
# @param warehouse_id [String] Identifier for the warehouse for which to update inventory.
|
23
|
+
# @param rate_limit [Float] Requests per second
|
16
24
|
# @return [Hash] The API response
|
17
|
-
def submit_inventory_update(body, warehouse_id)
|
25
|
+
def submit_inventory_update(body, warehouse_id, rate_limit: 10.0)
|
18
26
|
path = "/vendor/directFulfillment/inventory/v1/warehouses/#{warehouse_id}/items"
|
19
27
|
|
20
|
-
rate_limit
|
28
|
+
meter(rate_limit).post(path, body:)
|
21
29
|
end
|
22
30
|
end
|
23
31
|
end
|
@@ -3,6 +3,12 @@
|
|
3
3
|
require "peddler/api"
|
4
4
|
|
5
5
|
module Peddler
|
6
|
+
class << self
|
7
|
+
def vendor_direct_fulfillment_orders_2021_12_28(...)
|
8
|
+
API::VendorDirectFulfillmentOrders20211228.new(...)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
6
12
|
class API
|
7
13
|
# Selling Partner API for Direct Fulfillment Orders
|
8
14
|
#
|
@@ -15,23 +21,25 @@ module Peddler
|
|
15
21
|
# a list of purchase order numbers. You can then call the getOrder operation to return the details of a specific
|
16
22
|
# order.
|
17
23
|
#
|
18
|
-
# @
|
24
|
+
# @note This operation can make a dynamic sandbox call.
|
25
|
+
# @param ship_from_party_id [String] The vendor warehouse identifier for the fulfillment warehouse. If not
|
19
26
|
# specified, the result will contain orders for all warehouses.
|
20
|
-
# @param [String]
|
27
|
+
# @param status [String] Returns only the purchase orders that match the specified status. If not specified, the
|
21
28
|
# result will contain orders that match any status.
|
22
|
-
# @param [Integer]
|
23
|
-
# @param [String]
|
29
|
+
# @param limit [Integer] The limit to the number of purchase orders returned.
|
30
|
+
# @param created_after [String] Purchase orders that became available after this date and time will be included in
|
24
31
|
# the result. Must be in ISO-8601 date/time format.
|
25
|
-
# @param [String]
|
32
|
+
# @param created_before [String] Purchase orders that became available before this date and time will be included
|
26
33
|
# in the result. Must be in ISO-8601 date/time format.
|
27
|
-
# @param [String]
|
28
|
-
# @param [String]
|
34
|
+
# @param sort_order [String] Sort the list in ascending or descending order by order creation date.
|
35
|
+
# @param next_token [String] Used for pagination when there are more orders than the specified result size limit.
|
29
36
|
# The token value is returned in the previous API call.
|
30
|
-
# @param [String]
|
37
|
+
# @param include_details [String] When true, returns the complete purchase order details. Otherwise, only purchase
|
31
38
|
# order numbers are returned.
|
39
|
+
# @param rate_limit [Float] Requests per second
|
32
40
|
# @return [Hash] The API response
|
33
|
-
def get_orders(created_after, created_before, ship_from_party_id: nil, status: nil, limit: nil,
|
34
|
-
|
41
|
+
def get_orders(created_after, created_before, ship_from_party_id: nil, status: nil, limit: nil, sort_order: nil,
|
42
|
+
next_token: nil, include_details: "true", rate_limit: 10.0)
|
35
43
|
path = "/vendor/directFulfillment/orders/2021-12-28/purchaseOrders"
|
36
44
|
params = {
|
37
45
|
"shipFromPartyId" => ship_from_party_id,
|
@@ -44,28 +52,32 @@ module Peddler
|
|
44
52
|
"includeDetails" => include_details,
|
45
53
|
}.compact
|
46
54
|
|
47
|
-
rate_limit
|
55
|
+
meter(rate_limit).get(path, params:)
|
48
56
|
end
|
49
57
|
|
50
58
|
# Returns purchase order information for the purchaseOrderNumber that you specify.
|
51
59
|
#
|
52
|
-
# @
|
60
|
+
# @note This operation can make a dynamic sandbox call.
|
61
|
+
# @param purchase_order_number [String] The order identifier for the purchase order that you want. Formatting
|
53
62
|
# Notes: alpha-numeric code.
|
63
|
+
# @param rate_limit [Float] Requests per second
|
54
64
|
# @return [Hash] The API response
|
55
|
-
def get_order(purchase_order_number)
|
65
|
+
def get_order(purchase_order_number, rate_limit: 10.0)
|
56
66
|
path = "/vendor/directFulfillment/orders/2021-12-28/purchaseOrders/#{purchase_order_number}"
|
57
67
|
|
58
|
-
rate_limit
|
68
|
+
meter(rate_limit).get(path)
|
59
69
|
end
|
60
70
|
|
61
71
|
# Submits acknowledgements for one or more purchase orders.
|
62
72
|
#
|
63
|
-
# @
|
73
|
+
# @note This operation can make a dynamic sandbox call.
|
74
|
+
# @param body [Hash] The request body containing the acknowledgement to an order
|
75
|
+
# @param rate_limit [Float] Requests per second
|
64
76
|
# @return [Hash] The API response
|
65
|
-
def submit_acknowledgement(body)
|
77
|
+
def submit_acknowledgement(body, rate_limit: 10.0)
|
66
78
|
path = "/vendor/directFulfillment/orders/2021-12-28/acknowledgements"
|
67
79
|
|
68
|
-
rate_limit
|
80
|
+
meter(rate_limit).post(path, body:)
|
69
81
|
end
|
70
82
|
end
|
71
83
|
end
|
@@ -3,6 +3,12 @@
|
|
3
3
|
require "peddler/api"
|
4
4
|
|
5
5
|
module Peddler
|
6
|
+
class << self
|
7
|
+
def vendor_direct_fulfillment_orders_v1(...)
|
8
|
+
API::VendorDirectFulfillmentOrdersV1.new(...)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
6
12
|
class API
|
7
13
|
# Selling Partner API for Direct Fulfillment Orders
|
8
14
|
#
|
@@ -15,23 +21,25 @@ module Peddler
|
|
15
21
|
# a list of purchase order numbers. You can then call the getOrder operation to return the details of a specific
|
16
22
|
# order.
|
17
23
|
#
|
18
|
-
# @
|
24
|
+
# @note This operation can make a static sandbox call.
|
25
|
+
# @param ship_from_party_id [String] The vendor warehouse identifier for the fulfillment warehouse. If not
|
19
26
|
# specified, the result will contain orders for all warehouses.
|
20
|
-
# @param [String]
|
27
|
+
# @param status [String] Returns only the purchase orders that match the specified status. If not specified, the
|
21
28
|
# result will contain orders that match any status.
|
22
|
-
# @param [Integer]
|
23
|
-
# @param [String]
|
29
|
+
# @param limit [Integer] The limit to the number of purchase orders returned.
|
30
|
+
# @param created_after [String] Purchase orders that became available after this date and time will be included in
|
24
31
|
# the result. Must be in ISO-8601 date/time format.
|
25
|
-
# @param [String]
|
32
|
+
# @param created_before [String] Purchase orders that became available before this date and time will be included
|
26
33
|
# in the result. Must be in ISO-8601 date/time format.
|
27
|
-
# @param [String]
|
28
|
-
# @param [String]
|
34
|
+
# @param sort_order [String] Sort the list in ascending or descending order by order creation date.
|
35
|
+
# @param next_token [String] Used for pagination when there are more orders than the specified result size limit.
|
29
36
|
# The token value is returned in the previous API call.
|
30
|
-
# @param [String]
|
37
|
+
# @param include_details [String] When true, returns the complete purchase order details. Otherwise, only purchase
|
31
38
|
# order numbers are returned.
|
39
|
+
# @param rate_limit [Float] Requests per second
|
32
40
|
# @return [Hash] The API response
|
33
|
-
def get_orders(created_after, created_before, ship_from_party_id: nil, status: nil, limit: nil,
|
34
|
-
|
41
|
+
def get_orders(created_after, created_before, ship_from_party_id: nil, status: nil, limit: nil, sort_order: nil,
|
42
|
+
next_token: nil, include_details: "true", rate_limit: 10.0)
|
35
43
|
path = "/vendor/directFulfillment/orders/v1/purchaseOrders"
|
36
44
|
params = {
|
37
45
|
"shipFromPartyId" => ship_from_party_id,
|
@@ -44,28 +52,32 @@ module Peddler
|
|
44
52
|
"includeDetails" => include_details,
|
45
53
|
}.compact
|
46
54
|
|
47
|
-
rate_limit
|
55
|
+
meter(rate_limit).get(path, params:)
|
48
56
|
end
|
49
57
|
|
50
58
|
# Returns purchase order information for the purchaseOrderNumber that you specify.
|
51
59
|
#
|
52
|
-
# @
|
60
|
+
# @note This operation can make a static sandbox call.
|
61
|
+
# @param purchase_order_number [String] The order identifier for the purchase order that you want. Formatting
|
53
62
|
# Notes: alpha-numeric code.
|
63
|
+
# @param rate_limit [Float] Requests per second
|
54
64
|
# @return [Hash] The API response
|
55
|
-
def get_order(purchase_order_number)
|
65
|
+
def get_order(purchase_order_number, rate_limit: 10.0)
|
56
66
|
path = "/vendor/directFulfillment/orders/v1/purchaseOrders/#{purchase_order_number}"
|
57
67
|
|
58
|
-
rate_limit
|
68
|
+
meter(rate_limit).get(path)
|
59
69
|
end
|
60
70
|
|
61
71
|
# Submits acknowledgements for one or more purchase orders.
|
62
72
|
#
|
63
|
-
# @
|
73
|
+
# @note This operation can make a static sandbox call.
|
74
|
+
# @param body [Hash] The request body that contains the order acknowledgement.
|
75
|
+
# @param rate_limit [Float] Requests per second
|
64
76
|
# @return [Hash] The API response
|
65
|
-
def submit_acknowledgement(body)
|
77
|
+
def submit_acknowledgement(body, rate_limit: 10.0)
|
66
78
|
path = "/vendor/directFulfillment/orders/v1/acknowledgements"
|
67
79
|
|
68
|
-
rate_limit
|
80
|
+
meter(rate_limit).post(path, body:)
|
69
81
|
end
|
70
82
|
end
|
71
83
|
end
|
@@ -3,6 +3,12 @@
|
|
3
3
|
require "peddler/api"
|
4
4
|
|
5
5
|
module Peddler
|
6
|
+
class << self
|
7
|
+
def vendor_direct_fulfillment_payments_v1(...)
|
8
|
+
API::VendorDirectFulfillmentPaymentsV1.new(...)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
6
12
|
class API
|
7
13
|
# Selling Partner API for Direct Fulfillment Payments
|
8
14
|
#
|
@@ -11,12 +17,14 @@ module Peddler
|
|
11
17
|
class VendorDirectFulfillmentPaymentsV1 < API
|
12
18
|
# Submits one or more invoices for a vendor's direct fulfillment orders.
|
13
19
|
#
|
14
|
-
# @
|
20
|
+
# @note This operation can make a static sandbox call.
|
21
|
+
# @param body [Hash] The request body that contains one or more invoices for vendor orders.
|
22
|
+
# @param rate_limit [Float] Requests per second
|
15
23
|
# @return [Hash] The API response
|
16
|
-
def submit_invoice(body)
|
24
|
+
def submit_invoice(body, rate_limit: 10.0)
|
17
25
|
path = "/vendor/directFulfillment/payments/v1/invoices"
|
18
26
|
|
19
|
-
rate_limit
|
27
|
+
meter(rate_limit).post(path, body:)
|
20
28
|
end
|
21
29
|
end
|
22
30
|
end
|
@@ -3,6 +3,12 @@
|
|
3
3
|
require "peddler/api"
|
4
4
|
|
5
5
|
module Peddler
|
6
|
+
class << self
|
7
|
+
def vendor_direct_fulfillment_sandbox_test_data_2021_10_28(...)
|
8
|
+
API::VendorDirectFulfillmentSandboxTestData20211028.new(...)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
6
12
|
class API
|
7
13
|
# Selling Partner API for Vendor Direct Fulfillment Sandbox Test Data
|
8
14
|
#
|
@@ -11,9 +17,11 @@ module Peddler
|
|
11
17
|
class VendorDirectFulfillmentSandboxTestData20211028 < API
|
12
18
|
# Submits a request to generate test order data for Vendor Direct Fulfillment API entities.
|
13
19
|
#
|
14
|
-
# @
|
20
|
+
# @note This operation can make a dynamic sandbox call.
|
21
|
+
# @param body [Hash] The request payload that contain parameters to generate test order data scenarios.
|
22
|
+
# @param rate_limit [Float] Requests per second
|
15
23
|
# @return [Hash] The API response
|
16
|
-
def generate_order_scenarios(body)
|
24
|
+
def generate_order_scenarios(body, rate_limit: nil)
|
17
25
|
path = "/vendor/directFulfillment/sandbox/2021-10-28/orders"
|
18
26
|
|
19
27
|
post(path, body:)
|
@@ -22,10 +30,12 @@ module Peddler
|
|
22
30
|
# Retrieves the transaction status identified by the specified `transactionId`, and returns the requested test
|
23
31
|
# order data if the transaction is successful.
|
24
32
|
#
|
25
|
-
# @
|
33
|
+
# @note This operation can make a dynamic sandbox call.
|
34
|
+
# @param transaction_id [String] The transaction identifier returned in the response for the
|
26
35
|
# `generateOrderScenarios` operation.
|
36
|
+
# @param rate_limit [Float] Requests per second
|
27
37
|
# @return [Hash] The API response
|
28
|
-
def get_order_scenarios(transaction_id)
|
38
|
+
def get_order_scenarios(transaction_id, rate_limit: nil)
|
29
39
|
path = "/vendor/directFulfillment/sandbox/2021-10-28/transactions/#{transaction_id}"
|
30
40
|
|
31
41
|
get(path)
|