peddler 3.0.0.beta1 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +108 -110
- data/lib/peddler/api.rb +56 -18
- data/lib/peddler/{api → apis}/amazon_warehousing_and_distribution_2024_05_09.rb +38 -26
- data/lib/peddler/{api → apis}/aplus_content_2020_11_01.rb +97 -59
- data/lib/peddler/apis/application_integrations_2024_04_01.rb +56 -0
- data/lib/peddler/{api → apis}/application_management_2023_11_30.rb +14 -4
- data/lib/peddler/{api → apis}/catalog_items_2020_12_01.rb +34 -23
- data/lib/peddler/{api → apis}/catalog_items_2022_04_01.rb +39 -29
- data/lib/peddler/{api → apis}/catalog_items_v0.rb +43 -30
- data/lib/peddler/{api → apis}/data_kiosk_2023_11_15.rb +47 -31
- data/lib/peddler/apis/easy_ship_2022_03_23.rb +126 -0
- data/lib/peddler/{api → apis}/fba_inbound_eligibility_v1.rb +15 -7
- data/lib/peddler/{api → apis}/fba_inventory_v1.rb +45 -29
- data/lib/peddler/{api → apis}/feeds_2021_06_30.rb +54 -33
- data/lib/peddler/apis/finances_2024_06_19.rb +50 -0
- data/lib/peddler/{api → apis}/finances_v0.rb +50 -36
- data/lib/peddler/{api → apis}/fulfillment_inbound_2024_03_20.rb +384 -255
- data/lib/peddler/{api → apis}/fulfillment_inbound_v0.rb +138 -93
- data/lib/peddler/{api → apis}/fulfillment_outbound_2020_07_01.rb +105 -68
- data/lib/peddler/apis/invoices_2024_06_19.rb +180 -0
- data/lib/peddler/apis/listings_items_2020_09_01.rb +95 -0
- data/lib/peddler/apis/listings_items_2021_08_01.rb +136 -0
- data/lib/peddler/{api → apis}/listings_restrictions_2021_08_01.rb +21 -11
- data/lib/peddler/apis/merchant_fulfillment_v0.rb +80 -0
- data/lib/peddler/{api → apis}/messaging_v1.rb +107 -75
- data/lib/peddler/{api → apis}/notifications_v1.rb +63 -32
- data/lib/peddler/{api → apis}/orders_v0.rb +99 -84
- data/lib/peddler/apis/product_fees_v0.rb +77 -0
- data/lib/peddler/{api → apis}/product_pricing_2022_05_01.rb +24 -13
- data/lib/peddler/{api → apis}/product_pricing_v0.rb +70 -52
- data/lib/peddler/{api → apis}/product_type_definitions_2020_09_01.rb +32 -21
- data/lib/peddler/{api → apis}/replenishment_2022_11_07.rb +25 -13
- data/lib/peddler/{api → apis}/reports_2021_06_30.rb +71 -47
- data/lib/peddler/{api → apis}/sales_v1.rb +22 -14
- data/lib/peddler/{api → apis}/sellers_v1.rb +19 -7
- data/lib/peddler/{api → apis}/services_v1.rb +156 -116
- data/lib/peddler/apis/shipment_invoicing_v0.rb +59 -0
- data/lib/peddler/apis/shipping_v1.rb +132 -0
- data/lib/peddler/{api → apis}/shipping_v2.rb +150 -98
- data/lib/peddler/{api → apis}/solicitations_v1.rb +21 -11
- data/lib/peddler/apis/supply_sources_2020_07_01.rb +100 -0
- data/lib/peddler/{api → apis}/tokens_2021_03_01.rb +15 -7
- data/lib/peddler/{api → apis}/uploads_2020_11_01.rb +18 -8
- data/lib/peddler/{api → apis}/vendor_direct_fulfillment_inventory_v1.rb +14 -6
- data/lib/peddler/{api → apis}/vendor_direct_fulfillment_orders_2021_12_28.rb +33 -21
- data/lib/peddler/{api → apis}/vendor_direct_fulfillment_orders_v1.rb +33 -21
- data/lib/peddler/{api → apis}/vendor_direct_fulfillment_payments_v1.rb +13 -5
- data/lib/peddler/apis/vendor_direct_fulfillment_sandbox_test_data_2021_10_28.rb +45 -0
- data/lib/peddler/{api → apis}/vendor_direct_fulfillment_shipping_2021_12_28.rb +86 -60
- data/lib/peddler/apis/vendor_direct_fulfillment_shipping_v1.rb +189 -0
- data/lib/peddler/{api → apis}/vendor_direct_fulfillment_transactions_2021_12_28.rb +14 -6
- data/lib/peddler/{api → apis}/vendor_direct_fulfillment_transactions_v1.rb +14 -6
- data/lib/peddler/apis/vendor_invoices_v1.rb +30 -0
- data/lib/peddler/{api → apis}/vendor_orders_v1.rb +59 -48
- data/lib/peddler/apis/vendor_shipments_v1.rb +132 -0
- data/lib/peddler/{api → apis}/vendor_transaction_status_v1.rb +14 -5
- data/lib/peddler/endpoint.rb +51 -0
- data/lib/peddler/error.rb +21 -11
- data/lib/peddler/helpers/feeds_2021_06_30.rb +26 -0
- data/lib/peddler/json_feed_document.rb +31 -0
- data/lib/peddler/marketplace.rb +93 -0
- data/lib/peddler/response.rb +46 -0
- data/lib/peddler/token.rb +70 -0
- data/lib/peddler/version.rb +1 -1
- data/lib/peddler.rb +55 -52
- metadata +64 -57
- data/lib/peddler/access_token.rb +0 -76
- data/lib/peddler/api/easy_ship_2022_03_23.rb +0 -108
- data/lib/peddler/api/listings_items_2020_09_01.rb +0 -84
- data/lib/peddler/api/listings_items_2021_08_01.rb +0 -154
- data/lib/peddler/api/merchant_fulfillment_v0.rb +0 -64
- data/lib/peddler/api/product_fees_v0.rb +0 -69
- data/lib/peddler/api/shipment_invoicing_v0.rb +0 -46
- data/lib/peddler/api/shipping_v1.rb +0 -107
- data/lib/peddler/api/supply_sources_2020_07_01.rb +0 -82
- data/lib/peddler/api/vendor_direct_fulfillment_sandbox_test_data_2021_10_28.rb +0 -35
- data/lib/peddler/api/vendor_direct_fulfillment_shipping_v1.rb +0 -165
- data/lib/peddler/api/vendor_invoices_v1.rb +0 -22
- data/lib/peddler/api/vendor_shipments_v1.rb +0 -120
- data/lib/peddler/region.rb +0 -30
@@ -1,107 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "peddler/api"
|
4
|
-
|
5
|
-
module Peddler
|
6
|
-
class API
|
7
|
-
# Selling Partner API for Shipping
|
8
|
-
#
|
9
|
-
# Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer
|
10
|
-
# to the latest version of <a
|
11
|
-
# href="https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference">Amazon Shipping API
|
12
|
-
# (v2)</a> on the <a href="https://developer-docs.amazon.com/amazon-shipping/">Amazon Shipping Developer
|
13
|
-
# Documentation</a> site.
|
14
|
-
class ShippingV1 < API
|
15
|
-
# Create a new shipment.
|
16
|
-
#
|
17
|
-
# @param [Hash] body
|
18
|
-
# @return [Hash] The API response
|
19
|
-
def create_shipment(body)
|
20
|
-
path = "/shipping/v1/shipments"
|
21
|
-
|
22
|
-
rate_limit(5.0).post(path, body:)
|
23
|
-
end
|
24
|
-
|
25
|
-
# Return the entire shipment object for the shipmentId.
|
26
|
-
#
|
27
|
-
# @param [String] shipment_id
|
28
|
-
# @return [Hash] The API response
|
29
|
-
def get_shipment(shipment_id)
|
30
|
-
path = "/shipping/v1/shipments/#{shipment_id}"
|
31
|
-
|
32
|
-
rate_limit(5.0).get(path)
|
33
|
-
end
|
34
|
-
|
35
|
-
# Cancel a shipment by the given shipmentId.
|
36
|
-
#
|
37
|
-
# @param [String] shipment_id
|
38
|
-
# @return [Hash] The API response
|
39
|
-
def cancel_shipment(shipment_id)
|
40
|
-
path = "/shipping/v1/shipments/#{shipment_id}/cancel"
|
41
|
-
|
42
|
-
rate_limit(5.0).post(path)
|
43
|
-
end
|
44
|
-
|
45
|
-
# Purchase shipping labels based on a given rate.
|
46
|
-
#
|
47
|
-
# @param [String] shipment_id
|
48
|
-
# @param [Hash] body
|
49
|
-
# @return [Hash] The API response
|
50
|
-
def purchase_labels(shipment_id, body)
|
51
|
-
path = "/shipping/v1/shipments/#{shipment_id}/purchaseLabels"
|
52
|
-
|
53
|
-
rate_limit(5.0).post(path, body:)
|
54
|
-
end
|
55
|
-
|
56
|
-
# Retrieve shipping label based on the shipment id and tracking id.
|
57
|
-
#
|
58
|
-
# @param [String] shipment_id
|
59
|
-
# @param [String] tracking_id
|
60
|
-
# @param [Hash] body
|
61
|
-
# @return [Hash] The API response
|
62
|
-
def retrieve_shipping_label(shipment_id, tracking_id, body)
|
63
|
-
path = "/shipping/v1/shipments/#{shipment_id}/containers/#{tracking_id}/label"
|
64
|
-
|
65
|
-
rate_limit(5.0).post(path, body:)
|
66
|
-
end
|
67
|
-
|
68
|
-
# Purchase shipping labels.
|
69
|
-
#
|
70
|
-
# @param [Hash] body
|
71
|
-
# @return [Hash] The API response
|
72
|
-
def purchase_shipment(body)
|
73
|
-
path = "/shipping/v1/purchaseShipment"
|
74
|
-
|
75
|
-
rate_limit(5.0).post(path, body:)
|
76
|
-
end
|
77
|
-
|
78
|
-
# Get service rates.
|
79
|
-
#
|
80
|
-
# @param [Hash] body
|
81
|
-
# @return [Hash] The API response
|
82
|
-
def get_rates(body)
|
83
|
-
path = "/shipping/v1/rates"
|
84
|
-
|
85
|
-
rate_limit(5.0).post(path, body:)
|
86
|
-
end
|
87
|
-
|
88
|
-
# Verify if the current account is valid.
|
89
|
-
# @return [Hash] The API response
|
90
|
-
def get_account
|
91
|
-
path = "/shipping/v1/account"
|
92
|
-
|
93
|
-
rate_limit(5.0).get(path)
|
94
|
-
end
|
95
|
-
|
96
|
-
# Return the tracking information of a shipment.
|
97
|
-
#
|
98
|
-
# @param [String] tracking_id
|
99
|
-
# @return [Hash] The API response
|
100
|
-
def get_tracking_information(tracking_id)
|
101
|
-
path = "/shipping/v1/tracking/#{tracking_id}"
|
102
|
-
|
103
|
-
rate_limit(1.0).get(path)
|
104
|
-
end
|
105
|
-
end
|
106
|
-
end
|
107
|
-
end
|
@@ -1,82 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "peddler/api"
|
4
|
-
|
5
|
-
module Peddler
|
6
|
-
class API
|
7
|
-
# Selling Partner API for Supply Sources
|
8
|
-
#
|
9
|
-
# Manage configurations and capabilities of seller supply sources.
|
10
|
-
class SupplySources20200701 < API
|
11
|
-
# The path to retrieve paginated supply sources.
|
12
|
-
#
|
13
|
-
# @param [String] next_page_token The pagination token to retrieve a specific page of results.
|
14
|
-
# @param [Number] page_size The number of supply sources to return per paginated request.
|
15
|
-
# @return [Hash] The API response
|
16
|
-
def get_supply_sources(next_page_token: nil, page_size: nil)
|
17
|
-
path = "/supplySources/2020-07-01/supplySources"
|
18
|
-
params = {
|
19
|
-
"nextPageToken" => next_page_token,
|
20
|
-
"pageSize" => page_size,
|
21
|
-
}.compact
|
22
|
-
|
23
|
-
get(path, params:)
|
24
|
-
end
|
25
|
-
|
26
|
-
# Create a new supply source.
|
27
|
-
#
|
28
|
-
# @param [Hash] payload A request to create a supply source.
|
29
|
-
# @return [Hash] The API response
|
30
|
-
def create_supply_source(payload)
|
31
|
-
path = "/supplySources/2020-07-01/supplySources"
|
32
|
-
body = payload
|
33
|
-
|
34
|
-
post(path, body:)
|
35
|
-
end
|
36
|
-
|
37
|
-
# Retrieve a supply source.
|
38
|
-
#
|
39
|
-
# @param [String] supply_source_id The unique identifier of a supply source.
|
40
|
-
# @return [Hash] The API response
|
41
|
-
def get_supply_source(supply_source_id)
|
42
|
-
path = "/supplySources/2020-07-01/supplySources/#{supply_source_id}"
|
43
|
-
|
44
|
-
get(path)
|
45
|
-
end
|
46
|
-
|
47
|
-
# Update the configuration and capabilities of a supply source.
|
48
|
-
#
|
49
|
-
# @param [String] supply_source_id The unique identitier of a supply source.
|
50
|
-
# @param [Hash] payload
|
51
|
-
# @return [Hash] The API response
|
52
|
-
def update_supply_source(supply_source_id, payload: nil)
|
53
|
-
path = "/supplySources/2020-07-01/supplySources/#{supply_source_id}"
|
54
|
-
body = payload
|
55
|
-
|
56
|
-
put(path, body:)
|
57
|
-
end
|
58
|
-
|
59
|
-
# Archive a supply source, making it inactive. Cannot be undone.
|
60
|
-
#
|
61
|
-
# @param [String] supply_source_id The unique identifier of a supply source.
|
62
|
-
# @return [Hash] The API response
|
63
|
-
def archive_supply_source(supply_source_id)
|
64
|
-
path = "/supplySources/2020-07-01/supplySources/#{supply_source_id}"
|
65
|
-
|
66
|
-
delete(path)
|
67
|
-
end
|
68
|
-
|
69
|
-
# Update the status of a supply source.
|
70
|
-
#
|
71
|
-
# @param [String] supply_source_id The unique identifier of a supply source.
|
72
|
-
# @param [Hash] payload
|
73
|
-
# @return [Hash] The API response
|
74
|
-
def update_supply_source_status(supply_source_id, payload: nil)
|
75
|
-
path = "/supplySources/2020-07-01/supplySources/#{supply_source_id}/status"
|
76
|
-
body = payload
|
77
|
-
|
78
|
-
put(path, body:)
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "peddler/api"
|
4
|
-
|
5
|
-
module Peddler
|
6
|
-
class API
|
7
|
-
# Selling Partner API for Vendor Direct Fulfillment Sandbox Test Data
|
8
|
-
#
|
9
|
-
# The Selling Partner API for Vendor Direct Fulfillment Sandbox Test Data provides programmatic access to vendor
|
10
|
-
# direct fulfillment sandbox test data.
|
11
|
-
class VendorDirectFulfillmentSandboxTestData20211028 < API
|
12
|
-
# Submits a request to generate test order data for Vendor Direct Fulfillment API entities.
|
13
|
-
#
|
14
|
-
# @param [Hash] body The request payload that contain parameters to generate test order data scenarios.
|
15
|
-
# @return [Hash] The API response
|
16
|
-
def generate_order_scenarios(body)
|
17
|
-
path = "/vendor/directFulfillment/sandbox/2021-10-28/orders"
|
18
|
-
|
19
|
-
post(path, body:)
|
20
|
-
end
|
21
|
-
|
22
|
-
# Retrieves the transaction status identified by the specified `transactionId`, and returns the requested test
|
23
|
-
# order data if the transaction is successful.
|
24
|
-
#
|
25
|
-
# @param [String] transaction_id The transaction identifier returned in the response for the
|
26
|
-
# `generateOrderScenarios` operation.
|
27
|
-
# @return [Hash] The API response
|
28
|
-
def get_order_scenarios(transaction_id)
|
29
|
-
path = "/vendor/directFulfillment/sandbox/2021-10-28/transactions/#{transaction_id}"
|
30
|
-
|
31
|
-
get(path)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,165 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "peddler/api"
|
4
|
-
|
5
|
-
module Peddler
|
6
|
-
class API
|
7
|
-
# Selling Partner API for Direct Fulfillment Shipping
|
8
|
-
#
|
9
|
-
# The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment
|
10
|
-
# vendor's shipping data.
|
11
|
-
class VendorDirectFulfillmentShippingV1 < API
|
12
|
-
# Returns a list of shipping labels created during the time frame that you specify. You define that time frame
|
13
|
-
# using the `createdAfter` and `createdBefore` parameters. You must use both of these parameters. The date range
|
14
|
-
# to search must not be more than 7 days.
|
15
|
-
#
|
16
|
-
# @param [String] ship_from_party_id The vendor `warehouseId` for order fulfillment. If not specified, the result
|
17
|
-
# will contain orders for all warehouses.
|
18
|
-
# @param [Integer] limit The limit to the number of records returned.
|
19
|
-
# @param [String] created_after Shipping labels that became available after this date and time will be included in
|
20
|
-
# the result. Must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date/time format.
|
21
|
-
# @param [String] created_before Shipping labels that became available before this date and time will be included
|
22
|
-
# in the result. Must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date/time format.
|
23
|
-
# @param [String] sort_order Sort ASC or DESC by order creation date.
|
24
|
-
# @param [String] next_token Used for pagination when there are more ship labels than the specified result size
|
25
|
-
# limit. The token value is returned in the previous API call.
|
26
|
-
# @return [Hash] The API response
|
27
|
-
def get_shipping_labels(created_after, created_before, ship_from_party_id: nil, limit: nil, sort_order: nil,
|
28
|
-
next_token: nil)
|
29
|
-
path = "/vendor/directFulfillment/shipping/v1/shippingLabels"
|
30
|
-
params = {
|
31
|
-
"shipFromPartyId" => ship_from_party_id,
|
32
|
-
"limit" => limit,
|
33
|
-
"createdAfter" => created_after,
|
34
|
-
"createdBefore" => created_before,
|
35
|
-
"sortOrder" => sort_order,
|
36
|
-
"nextToken" => next_token,
|
37
|
-
}.compact
|
38
|
-
|
39
|
-
rate_limit(10.0).get(path, params:)
|
40
|
-
end
|
41
|
-
|
42
|
-
# Creates a shipping label for a purchase order and returns a `transactionId` for reference.
|
43
|
-
#
|
44
|
-
# @param [Hash] body Request body containing one or more shipping labels data.
|
45
|
-
# @return [Hash] The API response
|
46
|
-
def submit_shipping_label_request(body)
|
47
|
-
path = "/vendor/directFulfillment/shipping/v1/shippingLabels"
|
48
|
-
|
49
|
-
rate_limit(10.0).post(path, body:)
|
50
|
-
end
|
51
|
-
|
52
|
-
# Returns a shipping label for the `purchaseOrderNumber` that you specify.
|
53
|
-
#
|
54
|
-
# @param [String] purchase_order_number The purchase order number for which you want to return the shipping label.
|
55
|
-
# It should be the same `purchaseOrderNumber` as received in the order.
|
56
|
-
# @return [Hash] The API response
|
57
|
-
def get_shipping_label(purchase_order_number)
|
58
|
-
path = "/vendor/directFulfillment/shipping/v1/shippingLabels/#{purchase_order_number}"
|
59
|
-
|
60
|
-
rate_limit(10.0).get(path)
|
61
|
-
end
|
62
|
-
|
63
|
-
# Submits one or more shipment confirmations for vendor orders.
|
64
|
-
#
|
65
|
-
# @param [Hash] body Request body containing the shipment confirmations data.
|
66
|
-
# @return [Hash] The API response
|
67
|
-
def submit_shipment_confirmations(body)
|
68
|
-
path = "/vendor/directFulfillment/shipping/v1/shipmentConfirmations"
|
69
|
-
|
70
|
-
rate_limit(10.0).post(path, body:)
|
71
|
-
end
|
72
|
-
|
73
|
-
# This API call is only to be used by Vendor-Own-Carrier (VOC) vendors. Calling this API will submit a shipment
|
74
|
-
# status update for the package that a vendor has shipped. It will provide the Amazon customer visibility on their
|
75
|
-
# order, when the package is outside of Amazon Network visibility.
|
76
|
-
#
|
77
|
-
# @param [Hash] body Request body containing the shipment status update data.
|
78
|
-
# @return [Hash] The API response
|
79
|
-
def submit_shipment_status_updates(body)
|
80
|
-
path = "/vendor/directFulfillment/shipping/v1/shipmentStatusUpdates"
|
81
|
-
|
82
|
-
rate_limit(10.0).post(path, body:)
|
83
|
-
end
|
84
|
-
|
85
|
-
# Returns a list of customer invoices created during a time frame that you specify. You define the time frame
|
86
|
-
# using the `createdAfter` and `createdBefore` parameters. You must use both of these parameters. The date range
|
87
|
-
# to search must be no more than 7 days.
|
88
|
-
#
|
89
|
-
# @param [String] ship_from_party_id The vendor `warehouseId` for order fulfillment. If not specified, the result
|
90
|
-
# will contain orders for all warehouses.
|
91
|
-
# @param [Integer] limit The limit to the number of records returned
|
92
|
-
# @param [String] created_after Orders that became available after this date and time will be included in the
|
93
|
-
# result. Must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date/time format.
|
94
|
-
# @param [String] created_before Orders that became available before this date and time will be included in the
|
95
|
-
# result. Must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date/time format.
|
96
|
-
# @param [String] sort_order Sort ASC or DESC by order creation date.
|
97
|
-
# @param [String] next_token Used for pagination when there are more orders than the specified result size limit.
|
98
|
-
# The token value is returned in the previous API call.
|
99
|
-
# @return [Hash] The API response
|
100
|
-
def get_customer_invoices(created_after, created_before, ship_from_party_id: nil, limit: nil, sort_order: nil,
|
101
|
-
next_token: nil)
|
102
|
-
path = "/vendor/directFulfillment/shipping/v1/customerInvoices"
|
103
|
-
params = {
|
104
|
-
"shipFromPartyId" => ship_from_party_id,
|
105
|
-
"limit" => limit,
|
106
|
-
"createdAfter" => created_after,
|
107
|
-
"createdBefore" => created_before,
|
108
|
-
"sortOrder" => sort_order,
|
109
|
-
"nextToken" => next_token,
|
110
|
-
}.compact
|
111
|
-
|
112
|
-
rate_limit(10.0).get(path, params:)
|
113
|
-
end
|
114
|
-
|
115
|
-
# Returns a customer invoice based on the `purchaseOrderNumber` that you specify.
|
116
|
-
#
|
117
|
-
# @param [String] purchase_order_number Purchase order number of the shipment for which to return the invoice.
|
118
|
-
# @return [Hash] The API response
|
119
|
-
def get_customer_invoice(purchase_order_number)
|
120
|
-
path = "/vendor/directFulfillment/shipping/v1/customerInvoices/#{purchase_order_number}"
|
121
|
-
|
122
|
-
rate_limit(10.0).get(path)
|
123
|
-
end
|
124
|
-
|
125
|
-
# Returns a list of packing slips for the purchase orders that match the criteria specified. Date range to search
|
126
|
-
# must not be more than 7 days.
|
127
|
-
#
|
128
|
-
# @param [String] ship_from_party_id The vendor `warehouseId` for order fulfillment. If not specified the result
|
129
|
-
# will contain orders for all warehouses.
|
130
|
-
# @param [Integer] limit The limit to the number of records returned
|
131
|
-
# @param [String] created_after Packing slips that became available after this date and time will be included in
|
132
|
-
# the result. Must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date/time format.
|
133
|
-
# @param [String] created_before Packing slips that became available before this date and time will be included in
|
134
|
-
# the result. Must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date/time format.
|
135
|
-
# @param [String] sort_order Sort ASC or DESC by packing slip creation date.
|
136
|
-
# @param [String] next_token Used for pagination when there are more packing slips than the specified result size
|
137
|
-
# limit. The token value is returned in the previous API call.
|
138
|
-
# @return [Hash] The API response
|
139
|
-
def get_packing_slips(created_after, created_before, ship_from_party_id: nil, limit: nil, sort_order: nil,
|
140
|
-
next_token: nil)
|
141
|
-
path = "/vendor/directFulfillment/shipping/v1/packingSlips"
|
142
|
-
params = {
|
143
|
-
"shipFromPartyId" => ship_from_party_id,
|
144
|
-
"limit" => limit,
|
145
|
-
"createdAfter" => created_after,
|
146
|
-
"createdBefore" => created_before,
|
147
|
-
"sortOrder" => sort_order,
|
148
|
-
"nextToken" => next_token,
|
149
|
-
}.compact
|
150
|
-
|
151
|
-
rate_limit(10.0).get(path, params:)
|
152
|
-
end
|
153
|
-
|
154
|
-
# Returns a packing slip based on the `purchaseOrderNumber` that you specify.
|
155
|
-
#
|
156
|
-
# @param [String] purchase_order_number The `purchaseOrderNumber` for the packing slip you want.
|
157
|
-
# @return [Hash] The API response
|
158
|
-
def get_packing_slip(purchase_order_number)
|
159
|
-
path = "/vendor/directFulfillment/shipping/v1/packingSlips/#{purchase_order_number}"
|
160
|
-
|
161
|
-
rate_limit(10.0).get(path)
|
162
|
-
end
|
163
|
-
end
|
164
|
-
end
|
165
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "peddler/api"
|
4
|
-
|
5
|
-
module Peddler
|
6
|
-
class API
|
7
|
-
# Selling Partner API for Retail Procurement Payments
|
8
|
-
#
|
9
|
-
# The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data.
|
10
|
-
class VendorInvoicesV1 < API
|
11
|
-
# Submit new invoices to Amazon.
|
12
|
-
#
|
13
|
-
# @param [Hash] body The request body containing the invoice data to submit.
|
14
|
-
# @return [Hash] The API response
|
15
|
-
def submit_invoices(body)
|
16
|
-
path = "/vendor/payments/v1/invoices"
|
17
|
-
|
18
|
-
rate_limit(10.0).post(path, body:)
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
@@ -1,120 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "peddler/api"
|
4
|
-
|
5
|
-
module Peddler
|
6
|
-
class API
|
7
|
-
# Selling Partner API for Retail Procurement Shipments
|
8
|
-
#
|
9
|
-
# The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for
|
10
|
-
# vendors.
|
11
|
-
class VendorShipmentsV1 < API
|
12
|
-
# Submits one or more shipment confirmations for vendor orders.
|
13
|
-
#
|
14
|
-
# @param [Hash] body A request to submit shipment confirmation.
|
15
|
-
# @return [Hash] The API response
|
16
|
-
def submit_shipment_confirmations(body)
|
17
|
-
path = "/vendor/shipping/v1/shipmentConfirmations"
|
18
|
-
|
19
|
-
rate_limit(10.0).post(path, body:)
|
20
|
-
end
|
21
|
-
|
22
|
-
# Submits one or more shipment request for vendor Orders.
|
23
|
-
#
|
24
|
-
# @param [Hash] body A request to submit shipment request.
|
25
|
-
# @return [Hash] The API response
|
26
|
-
def submit_shipments(body)
|
27
|
-
path = "/vendor/shipping/v1/shipments"
|
28
|
-
|
29
|
-
rate_limit(10.0).post(path, body:)
|
30
|
-
end
|
31
|
-
|
32
|
-
# Returns the Details about Shipment, Carrier Details, status of the shipment, container details and other details
|
33
|
-
# related to shipment based on the filter parameters value that you specify.
|
34
|
-
#
|
35
|
-
# @param [Integer] limit The limit to the number of records returned. Default value is 50 records.
|
36
|
-
# @param [String] sort_order Sort in ascending or descending order by purchase order creation date.
|
37
|
-
# @param [String] next_token Used for pagination when there are more shipments than the specified result size
|
38
|
-
# limit.
|
39
|
-
# @param [String] created_after Get Shipment Details that became available after this timestamp will be included
|
40
|
-
# in the result. Must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format.
|
41
|
-
# @param [String] created_before Get Shipment Details that became available before this timestamp will be included
|
42
|
-
# in the result. Must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format.
|
43
|
-
# @param [String] shipment_confirmed_before Get Shipment Details by passing Shipment confirmed create Date Before.
|
44
|
-
# Must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format.
|
45
|
-
# @param [String] shipment_confirmed_after Get Shipment Details by passing Shipment confirmed create Date After.
|
46
|
-
# Must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format.
|
47
|
-
# @param [String] package_label_created_before Get Shipment Details by passing Package label create Date by buyer.
|
48
|
-
# Must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format.
|
49
|
-
# @param [String] package_label_created_after Get Shipment Details by passing Package label create Date After by
|
50
|
-
# buyer. Must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format.
|
51
|
-
# @param [String] shipped_before Get Shipment Details by passing Shipped Date Before. Must be in [ISO
|
52
|
-
# 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format.
|
53
|
-
# @param [String] shipped_after Get Shipment Details by passing Shipped Date After. Must be in [ISO
|
54
|
-
# 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format.
|
55
|
-
# @param [String] estimated_delivery_before Get Shipment Details by passing Estimated Delivery Date Before. Must
|
56
|
-
# be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format.
|
57
|
-
# @param [String] estimated_delivery_after Get Shipment Details by passing Estimated Delivery Date Before. Must be
|
58
|
-
# in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format.
|
59
|
-
# @param [String] shipment_delivery_before Get Shipment Details by passing Shipment Delivery Date Before. Must be
|
60
|
-
# in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format.
|
61
|
-
# @param [String] shipment_delivery_after Get Shipment Details by passing Shipment Delivery Date After. Must be in
|
62
|
-
# [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format.
|
63
|
-
# @param [String] requested_pick_up_before Get Shipment Details by passing Before Requested pickup date. Must be
|
64
|
-
# in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format.
|
65
|
-
# @param [String] requested_pick_up_after Get Shipment Details by passing After Requested pickup date. Must be in
|
66
|
-
# [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format.
|
67
|
-
# @param [String] scheduled_pick_up_before Get Shipment Details by passing Before scheduled pickup date. Must be
|
68
|
-
# in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format.
|
69
|
-
# @param [String] scheduled_pick_up_after Get Shipment Details by passing After Scheduled pickup date. Must be in
|
70
|
-
# [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format.
|
71
|
-
# @param [String] current_shipment_status Get Shipment Details by passing Current shipment status.
|
72
|
-
# @param [String] vendor_shipment_identifier Get Shipment Details by passing Vendor Shipment ID
|
73
|
-
# @param [String] buyer_reference_number Get Shipment Details by passing buyer Reference ID
|
74
|
-
# @param [String] buyer_warehouse_code Get Shipping Details based on buyer warehouse code. This value should be
|
75
|
-
# same as 'shipToParty.partyId' in the Shipment.
|
76
|
-
# @param [String] seller_warehouse_code Get Shipping Details based on vendor warehouse code. This value should be
|
77
|
-
# same as 'sellingParty.partyId' in the Shipment.
|
78
|
-
# @return [Hash] The API response
|
79
|
-
def get_shipment_details(
|
80
|
-
limit: nil, sort_order: nil, next_token: nil, created_after: nil, created_before: nil,
|
81
|
-
shipment_confirmed_before: nil, shipment_confirmed_after: nil, package_label_created_before: nil,
|
82
|
-
package_label_created_after: nil, shipped_before: nil, shipped_after: nil, estimated_delivery_before: nil,
|
83
|
-
estimated_delivery_after: nil, shipment_delivery_before: nil, shipment_delivery_after: nil,
|
84
|
-
requested_pick_up_before: nil, requested_pick_up_after: nil, scheduled_pick_up_before: nil,
|
85
|
-
scheduled_pick_up_after: nil, current_shipment_status: nil, vendor_shipment_identifier: nil,
|
86
|
-
buyer_reference_number: nil, buyer_warehouse_code: nil, seller_warehouse_code: nil
|
87
|
-
)
|
88
|
-
path = "/vendor/shipping/v1/shipments"
|
89
|
-
params = {
|
90
|
-
"limit" => limit,
|
91
|
-
"sortOrder" => sort_order,
|
92
|
-
"nextToken" => next_token,
|
93
|
-
"createdAfter" => created_after,
|
94
|
-
"createdBefore" => created_before,
|
95
|
-
"shipmentConfirmedBefore" => shipment_confirmed_before,
|
96
|
-
"shipmentConfirmedAfter" => shipment_confirmed_after,
|
97
|
-
"packageLabelCreatedBefore" => package_label_created_before,
|
98
|
-
"packageLabelCreatedAfter" => package_label_created_after,
|
99
|
-
"shippedBefore" => shipped_before,
|
100
|
-
"shippedAfter" => shipped_after,
|
101
|
-
"estimatedDeliveryBefore" => estimated_delivery_before,
|
102
|
-
"estimatedDeliveryAfter" => estimated_delivery_after,
|
103
|
-
"shipmentDeliveryBefore" => shipment_delivery_before,
|
104
|
-
"shipmentDeliveryAfter" => shipment_delivery_after,
|
105
|
-
"requestedPickUpBefore" => requested_pick_up_before,
|
106
|
-
"requestedPickUpAfter" => requested_pick_up_after,
|
107
|
-
"scheduledPickUpBefore" => scheduled_pick_up_before,
|
108
|
-
"scheduledPickUpAfter" => scheduled_pick_up_after,
|
109
|
-
"currentShipmentStatus" => current_shipment_status,
|
110
|
-
"vendorShipmentIdentifier" => vendor_shipment_identifier,
|
111
|
-
"buyerReferenceNumber" => buyer_reference_number,
|
112
|
-
"buyerWarehouseCode" => buyer_warehouse_code,
|
113
|
-
"sellerWarehouseCode" => seller_warehouse_code,
|
114
|
-
}.compact
|
115
|
-
|
116
|
-
rate_limit(10.0).get(path, params:)
|
117
|
-
end
|
118
|
-
end
|
119
|
-
end
|
120
|
-
end
|
data/lib/peddler/region.rb
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "uri"
|
4
|
-
|
5
|
-
module Peddler
|
6
|
-
class Region
|
7
|
-
class UnknownRegion < ArgumentError; end
|
8
|
-
|
9
|
-
# @see https://developer-docs.amazon.com/sp-api/docs/sp-api-endpoints
|
10
|
-
ENDPOINTS = {
|
11
|
-
"us-east-1" => "https://sellingpartnerapi-na.amazon.com",
|
12
|
-
"us-west-2" => "https://sellingpartnerapi-fe.amazon.com",
|
13
|
-
"eu-west-1" => "https://sellingpartnerapi-eu.amazon.com",
|
14
|
-
}
|
15
|
-
|
16
|
-
attr_reader :name
|
17
|
-
|
18
|
-
# @param [String] name
|
19
|
-
def initialize(name)
|
20
|
-
@name = name
|
21
|
-
end
|
22
|
-
|
23
|
-
# @return [String]
|
24
|
-
def endpoint
|
25
|
-
ENDPOINTS.fetch(name) do
|
26
|
-
raise UnknownRegion, "#{name} not found"
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|