peddler 5.3.1 → 5.4.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 +55 -11
- data/lib/peddler/api.rb +3 -3
- data/lib/peddler/apis/external_fulfillment_shipments_2024_09_11/address.rb +4 -1
- data/lib/peddler/apis/external_fulfillment_shipments_2024_09_11/distance.rb +20 -0
- data/lib/peddler/apis/external_fulfillment_shipments_2024_09_11/geocodes.rb +23 -0
- data/lib/peddler/apis/external_fulfillment_shipments_2024_09_11/handover_location.rb +23 -0
- data/lib/peddler/apis/external_fulfillment_shipments_2024_09_11/ship_label_metadata.rb +4 -0
- data/lib/peddler/apis/external_fulfillment_shipments_2024_09_11/shipment_info.rb +3 -0
- data/lib/peddler/apis/external_fulfillment_shipments_2024_09_11/shipping_options.rb +4 -0
- data/lib/peddler/apis/external_fulfillment_shipments_2024_09_11.rb +1 -1
- data/lib/peddler/apis/feeds_2021_06_30.rb +8 -2
- data/lib/peddler/apis/fulfillment_outbound_2020_07_01/amount.rb +2 -2
- data/lib/peddler/apis/fulfillment_outbound_2020_07_01/delivery_document.rb +2 -2
- data/lib/peddler/apis/fulfillment_outbound_2020_07_01/delivery_information.rb +2 -1
- data/lib/peddler/apis/fulfillment_outbound_2020_07_01/delivery_preferences.rb +1 -1
- data/lib/peddler/apis/fulfillment_outbound_2020_07_01/delivery_window.rb +3 -4
- data/lib/peddler/apis/fulfillment_outbound_2020_07_01/drop_off_location.rb +9 -7
- data/lib/peddler/apis/fulfillment_outbound_2020_07_01/feature_settings.rb +5 -1
- data/lib/peddler/apis/fulfillment_outbound_2020_07_01/feature_sku.rb +1 -1
- data/lib/peddler/apis/fulfillment_outbound_2020_07_01/fulfillment_order.rb +2 -2
- data/lib/peddler/apis/fulfillment_outbound_2020_07_01/fulfillment_preview_shipment.rb +6 -6
- data/lib/peddler/apis/fulfillment_outbound_2020_07_01/fulfillment_shipment_package.rb +3 -4
- data/lib/peddler/apis/fulfillment_outbound_2020_07_01/get_feature_inventory_response.rb +1 -1
- data/lib/peddler/apis/fulfillment_outbound_2020_07_01/get_feature_sku_result.rb +12 -3
- data/lib/peddler/apis/fulfillment_outbound_2020_07_01/origin.rb +2 -1
- data/lib/peddler/apis/fulfillment_outbound_2020_07_01/tracking_event.rb +1 -2
- data/lib/peddler/apis/orders_2026_01_01/associated_order_item.rb +27 -0
- data/lib/peddler/apis/orders_2026_01_01/item_packing.rb +3 -0
- data/lib/peddler/apis/orders_2026_01_01/item_picking.rb +1 -1
- data/lib/peddler/apis/orders_2026_01_01/item_proceeds_detailed_breakdown.rb +1 -1
- data/lib/peddler/apis/orders_2026_01_01/item_tax.rb +20 -0
- data/lib/peddler/apis/orders_2026_01_01/item_tax_calculation_breakdown.rb +21 -0
- data/lib/peddler/apis/orders_2026_01_01/item_tax_collection.rb +24 -0
- data/lib/peddler/apis/orders_2026_01_01/order.rb +8 -1
- data/lib/peddler/apis/orders_2026_01_01/order_item.rb +7 -0
- data/lib/peddler/apis/orders_2026_01_01/order_payment.rb +17 -0
- data/lib/peddler/apis/orders_2026_01_01/order_tax.rb +20 -0
- data/lib/peddler/apis/orders_2026_01_01/order_tax_invoicing.rb +34 -0
- data/lib/peddler/apis/orders_2026_01_01/order_tax_registration.rb +39 -0
- data/lib/peddler/apis/orders_2026_01_01/package_status.rb +4 -3
- data/lib/peddler/apis/orders_2026_01_01/pagination.rb +5 -5
- data/lib/peddler/apis/orders_2026_01_01/payment_execution.rb +39 -0
- data/lib/peddler/apis/orders_2026_01_01/search_orders_response.rb +10 -11
- data/lib/peddler/apis/orders_2026_01_01/serial_number_requirement.rb +19 -0
- data/lib/peddler/apis/orders_2026_01_01/tax_registration_attribute.rb +22 -0
- data/lib/peddler/apis/orders_2026_01_01.rb +15 -13
- data/lib/peddler/apis/orders_v0/address.rb +3 -3
- data/lib/peddler/apis/orders_v0/address_extended_fields.rb +9 -2
- data/lib/peddler/apis/orders_v0/buyer_info.rb +3 -0
- data/lib/peddler/apis/orders_v0/geo_coordinates.rb +20 -0
- data/lib/peddler/apis/orders_v0/order_buyer_info.rb +3 -0
- data/lib/peddler/apis/orders_v0.rb +6 -2
- data/lib/peddler/apis/product_pricing_2022_05_01/competitive_summary_response_body.rb +3 -0
- data/lib/peddler/apis/product_pricing_2022_05_01/item.rb +17 -0
- data/lib/peddler/apis/product_pricing_2022_05_01/points.rb +1 -1
- data/lib/peddler/apis/product_pricing_2022_05_01/similar_items.rb +17 -0
- data/lib/peddler/apis/replenishment_2022_11_07/deliveries_condition.rb +22 -0
- data/lib/peddler/apis/replenishment_2022_11_07/forecast_deliveries.rb +26 -0
- data/lib/peddler/apis/replenishment_2022_11_07/get_selling_partner_metrics_request.rb +3 -3
- data/lib/peddler/apis/replenishment_2022_11_07/get_selling_partner_metrics_response_metric.rb +5 -1
- data/lib/peddler/apis/replenishment_2022_11_07/list_offer_metrics_request_filters.rb +1 -1
- data/lib/peddler/apis/replenishment_2022_11_07/list_offer_metrics_response_offer.rb +30 -23
- data/lib/peddler/apis/replenishment_2022_11_07/list_offers_request_filters.rb +7 -3
- data/lib/peddler/apis/replenishment_2022_11_07/list_offers_response_offer.rb +27 -1
- data/lib/peddler/apis/replenishment_2022_11_07/offer_program_configuration.rb +1 -1
- data/lib/peddler/apis/replenishment_2022_11_07/time_interval.rb +1 -1
- data/lib/peddler/apis/reports_2021_06_30.rb +8 -2
- data/lib/peddler/apis/seller_wallet_2024_03_01/balance.rb +6 -6
- data/lib/peddler/apis/seller_wallet_2024_03_01/balance_listing.rb +2 -2
- data/lib/peddler/apis/seller_wallet_2024_03_01/bank_account.rb +5 -5
- data/lib/peddler/apis/seller_wallet_2024_03_01/bank_account_listing.rb +2 -2
- data/lib/peddler/apis/seller_wallet_2024_03_01/delete_transfer_schedule.rb +3 -2
- data/lib/peddler/apis/seller_wallet_2024_03_01/fee.rb +4 -7
- data/lib/peddler/apis/seller_wallet_2024_03_01/fx_rate_details.rb +6 -6
- data/lib/peddler/apis/seller_wallet_2024_03_01/payee_contact_information.rb +5 -5
- data/lib/peddler/apis/seller_wallet_2024_03_01/payment_preference.rb +2 -3
- data/lib/peddler/apis/seller_wallet_2024_03_01/schedule_expression.rb +4 -5
- data/lib/peddler/apis/seller_wallet_2024_03_01/transaction.rb +13 -14
- data/lib/peddler/apis/seller_wallet_2024_03_01/transaction_account.rb +8 -8
- data/lib/peddler/apis/seller_wallet_2024_03_01/transaction_initiation_request.rb +8 -7
- data/lib/peddler/apis/seller_wallet_2024_03_01/transaction_instrument_details.rb +6 -7
- data/lib/peddler/apis/seller_wallet_2024_03_01/transaction_listing.rb +6 -5
- data/lib/peddler/apis/seller_wallet_2024_03_01/transfer_rate_preview.rb +4 -3
- data/lib/peddler/apis/seller_wallet_2024_03_01/transfer_schedule.rb +11 -12
- data/lib/peddler/apis/seller_wallet_2024_03_01/transfer_schedule_failures.rb +3 -3
- data/lib/peddler/apis/seller_wallet_2024_03_01/transfer_schedule_information.rb +5 -6
- data/lib/peddler/apis/seller_wallet_2024_03_01/transfer_schedule_listing.rb +6 -5
- data/lib/peddler/apis/seller_wallet_2024_03_01/transfer_schedule_request.rb +11 -13
- data/lib/peddler/apis/seller_wallet_2024_03_01.rb +30 -28
- data/lib/peddler/apis/services_v1/money_amount.rb +20 -0
- data/lib/peddler/apis/services_v1/payment.rb +20 -0
- data/lib/peddler/apis/services_v1/service_job.rb +3 -0
- data/lib/peddler/apis/services_v1.rb +1 -1
- data/lib/peddler/apis/shipment_invoicing_v0/payment_information.rb +6 -6
- data/lib/peddler/apis/shipment_invoicing_v0/payment_information_list.rb +1 -1
- data/lib/peddler/data_kiosk/economics20240315.json +6 -6
- data/lib/peddler/data_kiosk/sales_and_traffic20231115.json +6 -6
- data/lib/peddler/data_kiosk/sales_and_traffic20240424.json +6 -6
- data/lib/peddler/data_kiosk/vendor_analytics20240930.json +6 -6
- data/lib/peddler/errors.rb +1 -0
- data/lib/peddler/version.rb +1 -1
- data/sig/peddler/api.rbs +1 -1
- data/sig/peddler/apis/external_fulfillment_shipments_2024_09_11.rbs +85 -28
- data/sig/peddler/apis/feeds_2021_06_30.rbs +1 -1
- data/sig/peddler/apis/fulfillment_outbound_2020_07_01.rbs +11 -8
- data/sig/peddler/apis/orders_2026_01_01.rbs +220 -23
- data/sig/peddler/apis/orders_v0.rbs +42 -22
- data/sig/peddler/apis/product_pricing_2022_05_01.rbs +40 -7
- data/sig/peddler/apis/replenishment_2022_11_07.rbs +76 -28
- data/sig/peddler/apis/reports_2021_06_30.rbs +1 -1
- data/sig/peddler/apis/services_v1.rbs +42 -7
- data/sig/peddler/errors.rbs +3 -0
- metadata +32 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ea43bac8eb39d36256c21f7fa3f2b1db30878a89d1e9d3545dcd637ec420c503
|
|
4
|
+
data.tar.gz: 4fc3347ad7d0ce503f9551f781285ec8ad0558a27e17f0cfdf6bf69e63f0642a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 86af994dfeaf305576af803e1e885cdc3f8e39b7ed70734e80aa89a4fcae5c63c351299bdd25af6096383d17263b54dcc40d90cfea3e8a625e6eb002ccd51c16
|
|
7
|
+
data.tar.gz: 8c977d54bba2653f97f7508bbfa397a1c2f8dbe2be8d0d4d371163e9b17d1b73e1d040b75d652271631f56fa20f4ed775e68ad8b4120fa30a2047d70a0f142d6
|
data/README.md
CHANGED
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
# Peddler
|
|
2
2
|
|
|
3
|
-
[][build]
|
|
4
|
-
|
|
5
3
|
Peddler is a Ruby interface to the [Amazon Selling Partner API (SP-API)][api-docs]. The SP-API enables Amazon sellers and vendors to programmatically access their data on orders, shipments, payments, and more.
|
|
6
4
|
|
|
7
|
-
Peddler is automatically generated from the latest Open API models provided by Amazon.
|
|
5
|
+
Peddler is automatically generated from the latest Open API models provided by Amazon. A nightly job tracks Amazon's spec changes, so new endpoints and fields land shortly after Amazon publishes them. Model changes are not considered breaking and don't trigger a major version bump.
|
|
8
6
|
|
|
9
7
|
Peddler covers all SP-API endpoints, reports, notifications, and feeds. It's also lightweight: thanks to Zeitwerk, only the code you use gets loaded.
|
|
10
8
|
|
|
11
|
-
To begin using the Amazon SP-API, you must [register as a developer][register-as-developer] and [register your application][register-application]. Once registered, [obtain your Login with Amazon (LWA) credentials][view-credentials] to access your own or other selling partners' data.
|
|
12
|
-
|
|
13
|
-
- [API docs][api-docs]
|
|
14
|
-
- [OpenAPI models][openapi-models]
|
|
15
|
-
- [API samples][api-samples]
|
|
16
|
-
|
|
17
9
|
<img src="https://github.com/hakanensari/peddler/blob/main/images/peddler.jpg?raw=true" alt="Peddler" style="max-width: 830px" />
|
|
18
10
|
|
|
19
11
|
## Installation
|
|
20
12
|
|
|
21
13
|
Add to your Gemfile.
|
|
22
14
|
|
|
15
|
+
### Agent skill
|
|
16
|
+
|
|
17
|
+
If you use a coding agent, install the peddler skill for SP-API spec research and Ruby usage help:
|
|
18
|
+
|
|
19
|
+
```shell
|
|
20
|
+
npx skills add lineofflight/peddler
|
|
21
|
+
```
|
|
22
|
+
|
|
23
23
|
## Usage
|
|
24
24
|
|
|
25
25
|
### Authorization
|
|
26
26
|
|
|
27
|
+
Before using Peddler, you must [register as a developer][register-as-developer], [register your application][register-application], and [obtain your Login with Amazon (LWA) credentials][view-credentials]; Amazon's [official SP-API code samples][api-samples] can help you get started.
|
|
28
|
+
|
|
27
29
|
Set your LWA credentials in your environment.
|
|
28
30
|
|
|
29
31
|
```shell
|
|
@@ -85,6 +87,48 @@ class Seller
|
|
|
85
87
|
end
|
|
86
88
|
```
|
|
87
89
|
|
|
90
|
+
### Restricted Data Tokens (RDT) and PII
|
|
91
|
+
|
|
92
|
+
Some operations are restricted because they return Personally Identifiable Information (PII), such as a buyer's name and shipping address. To call one, exchange your access token for a Restricted Data Token (RDT) scoped to the specific resources you need, then pass the RDT in place of the access token.
|
|
93
|
+
|
|
94
|
+
```ruby
|
|
95
|
+
api = Peddler.tokens.new(aws_region, access_token)
|
|
96
|
+
response = api.create_restricted_data_token({
|
|
97
|
+
"restrictedResources" => [
|
|
98
|
+
{
|
|
99
|
+
"method" => "GET",
|
|
100
|
+
"path" => "/orders/v0/orders/123-1234567-1234567/address",
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
})
|
|
104
|
+
restricted_data_token = response.parse.restricted_data_token
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Use the RDT exactly where you would normally pass the access token.
|
|
108
|
+
|
|
109
|
+
```ruby
|
|
110
|
+
api = Peddler.orders.new(aws_region, restricted_data_token)
|
|
111
|
+
address = api.get_order_address("123-1234567-1234567").parse.payload.shipping_address
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
For the Orders API, also specify which `dataElements` you need (`buyerInfo`, `shippingAddress`, or `buyerTaxInformation`).
|
|
115
|
+
|
|
116
|
+
```ruby
|
|
117
|
+
api = Peddler.tokens.new(aws_region, access_token)
|
|
118
|
+
response = api.create_restricted_data_token({
|
|
119
|
+
"restrictedResources" => [
|
|
120
|
+
{
|
|
121
|
+
"method" => "GET",
|
|
122
|
+
"path" => "/orders/v0/orders",
|
|
123
|
+
"dataElements" => ["buyerInfo", "shippingAddress"],
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
})
|
|
127
|
+
restricted_data_token = response.parse.restricted_data_token
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
An RDT is valid for one hour. Like access tokens, cache and reuse it across calls. See the [Tokens API Use Case Guide][tokens-guide] for the full list of restricted operations.
|
|
131
|
+
|
|
88
132
|
### Rate limiting
|
|
89
133
|
|
|
90
134
|
Amazon's SP-API imposes [rate limits][rate-limits] on operations. Override the default value by passing a `:rate_limit` parameter when calling an operation.
|
|
@@ -309,8 +353,7 @@ bundle exec rake generate
|
|
|
309
353
|
# Type check with Steep
|
|
310
354
|
bundle exec steep check --severity-level=hint
|
|
311
355
|
```
|
|
312
|
-
[
|
|
313
|
-
[api-docs]: https://developer.amazonservices.com/sp-api-docs/overview
|
|
356
|
+
[api-docs]: https://developer-docs.amazon.com/sp-api/docs/welcome
|
|
314
357
|
[register-as-developer]: https://developer-docs.amazon.com/sp-api/docs/registering-as-a-developer
|
|
315
358
|
[register-application]: https://developer-docs.amazon.com/sp-api/docs/registering-your-application
|
|
316
359
|
[openapi-models]: https://github.com/amzn/selling-partner-api-models
|
|
@@ -318,4 +361,5 @@ bundle exec steep check --severity-level=hint
|
|
|
318
361
|
[view-credentials]: https://developer-docs.amazon.com/sp-api/docs/viewing-your-application-information-and-credentials
|
|
319
362
|
[authorization]: https://developer-docs.amazon.com/sp-api/docs/authorizing-selling-partner-api-applications
|
|
320
363
|
[rate-limits]: https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits
|
|
364
|
+
[tokens-guide]: https://developer-docs.amazon.com/sp-api/docs/tokens-api-use-case-guide
|
|
321
365
|
[httprb]: https://github.com/httprb/http
|
data/lib/peddler/api.rb
CHANGED
|
@@ -24,7 +24,7 @@ module Peddler
|
|
|
24
24
|
# @param [String] access_token The access token for authentication
|
|
25
25
|
# @param [Integer] retries The number of retries if throttled (default: 0)
|
|
26
26
|
# @param [HTTP::Client] http HTTP client
|
|
27
|
-
def initialize(aws_region, access_token, retries: 0, http: HTTP)
|
|
27
|
+
def initialize(aws_region, access_token, retries: 0, http: HTTP::Client.new)
|
|
28
28
|
@endpoint = Endpoint.find(aws_region)
|
|
29
29
|
@access_token = access_token
|
|
30
30
|
@retries = retries
|
|
@@ -53,7 +53,7 @@ module Peddler
|
|
|
53
53
|
|
|
54
54
|
# @see https://developer-docs.amazon.com/sp-api/docs/include-a-user-agent-header-in-all-requests
|
|
55
55
|
# @see https://developer-docs.amazon.com/amazon-shipping/docs/connecting-to-the-selling-partner-api#step-3-add-headers-to-the-uri
|
|
56
|
-
# @return [HTTP::
|
|
56
|
+
# @return [HTTP::Session]
|
|
57
57
|
def http(rate_limit: nil)
|
|
58
58
|
client = @http.headers(
|
|
59
59
|
"Host" => endpoint_uri.host,
|
|
@@ -65,7 +65,7 @@ module Peddler
|
|
|
65
65
|
return client if retries.zero? || rate_limit.nil?
|
|
66
66
|
|
|
67
67
|
delay = sandbox? ? 0.2 : 1.0 / rate_limit
|
|
68
|
-
client.retriable(delay:, tries: retries + 1, retry_statuses: [429])
|
|
68
|
+
client.retriable(delay:, tries: retries + 1, retry_statuses: [429])
|
|
69
69
|
end
|
|
70
70
|
|
|
71
71
|
private
|
|
@@ -40,7 +40,10 @@ module Peddler
|
|
|
40
40
|
# @return [String] The email address of the contact associated with the address.
|
|
41
41
|
attribute?(:email, String)
|
|
42
42
|
|
|
43
|
-
# @return [
|
|
43
|
+
# @return [Geocodes] The geographic coordinates of the address.
|
|
44
|
+
attribute?(:geocodes, Geocodes)
|
|
45
|
+
|
|
46
|
+
# @return [String] The municipality where the person, business, or institution is located.
|
|
44
47
|
attribute?(:municipality, String)
|
|
45
48
|
|
|
46
49
|
# @return [String] The name of the person, business or institution at that address.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is generated. Do not edit.
|
|
4
|
+
|
|
5
|
+
require "structure"
|
|
6
|
+
|
|
7
|
+
module Peddler
|
|
8
|
+
module APIs
|
|
9
|
+
class ExternalFulfillmentShipments20240911
|
|
10
|
+
# A distance measurement.
|
|
11
|
+
Distance = Structure.new do
|
|
12
|
+
# @return [String] The unit of measurement of the distance.
|
|
13
|
+
attribute(:distance_unit, String, null: false, from: "distanceUnit")
|
|
14
|
+
|
|
15
|
+
# @return [String] The numerical value of the distance.
|
|
16
|
+
attribute(:value, String, null: false)
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is generated. Do not edit.
|
|
4
|
+
|
|
5
|
+
require "structure"
|
|
6
|
+
|
|
7
|
+
module Peddler
|
|
8
|
+
module APIs
|
|
9
|
+
class ExternalFulfillmentShipments20240911
|
|
10
|
+
# Geographic coordinates.
|
|
11
|
+
Geocodes = Structure.new do
|
|
12
|
+
# @return [String] The latitude coordinate.
|
|
13
|
+
attribute(:latitude, String, null: false)
|
|
14
|
+
|
|
15
|
+
# @return [String] The longitude coordinate.
|
|
16
|
+
attribute(:longitude, String, null: false)
|
|
17
|
+
|
|
18
|
+
# @return [String] The elevation in meters.
|
|
19
|
+
attribute?(:elevation, String)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is generated. Do not edit.
|
|
4
|
+
|
|
5
|
+
require "structure"
|
|
6
|
+
|
|
7
|
+
module Peddler
|
|
8
|
+
module APIs
|
|
9
|
+
class ExternalFulfillmentShipments20240911
|
|
10
|
+
# The drop-off location details for package handover.
|
|
11
|
+
HandoverLocation = Structure.new do
|
|
12
|
+
# @return [Address] The address of the drop-off location.
|
|
13
|
+
attribute?(:address, Address)
|
|
14
|
+
|
|
15
|
+
# @return [Distance] The distance from the seller's location to the drop-off point.
|
|
16
|
+
attribute?(:distance, Distance)
|
|
17
|
+
|
|
18
|
+
# @return [String] URL to the map that shows the drop-off location.
|
|
19
|
+
attribute?(:map_url, String, from: "mapUrl")
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -16,6 +16,10 @@ module Peddler
|
|
|
16
16
|
# @return [String] The tracking number of the package.
|
|
17
17
|
attribute(:tracking_id, String, null: false, from: "trackingId")
|
|
18
18
|
|
|
19
|
+
# @return [HandoverLocation] The drop-off location details. This value is populated when `handoverMethod` is
|
|
20
|
+
# `DROPOFF`.
|
|
21
|
+
attribute?(:handover_location, HandoverLocation, from: "handoverLocation")
|
|
22
|
+
|
|
19
23
|
# @return [TimeWindow] The time window during which the package was picked up.
|
|
20
24
|
attribute?(:pickup_window, TimeWindow, from: "pickupWindow")
|
|
21
25
|
|
|
@@ -33,6 +33,9 @@ module Peddler
|
|
|
33
33
|
# either `REPLACEMENT` or `EXCHANGE`.
|
|
34
34
|
attribute?(:original_shipment_info, ReplacedShipmentInfo, from: "originalShipmentInfo")
|
|
35
35
|
|
|
36
|
+
# @return [String] The payment method for the shipment.
|
|
37
|
+
attribute?(:payment_method, String, from: "paymentMethod")
|
|
38
|
+
|
|
36
39
|
# @return [String] The source of the order operation.
|
|
37
40
|
attribute?(:processing_source, String, from: "processingSource")
|
|
38
41
|
end
|
|
@@ -19,6 +19,10 @@ module Peddler
|
|
|
19
19
|
# @return [String] The carrier name for the offering.
|
|
20
20
|
attribute?(:carrier_name, String, from: "carrierName")
|
|
21
21
|
|
|
22
|
+
# @return [HandoverLocation] The drop-off location details. This value is populated when `handoverMethod` is
|
|
23
|
+
# `DROPOFF`.
|
|
24
|
+
attribute?(:handover_location, HandoverLocation, from: "handoverLocation")
|
|
25
|
+
|
|
22
26
|
# @return [TimeWindow] The time window during which the package will be picked up.
|
|
23
27
|
attribute?(:pickup_window, TimeWindow, from: "pickupWindow")
|
|
24
28
|
|
|
@@ -21,7 +21,7 @@ module Peddler
|
|
|
21
21
|
# marketplace, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
|
|
22
22
|
# @param channel_name [String] The channel name associated with the location.
|
|
23
23
|
# @param status [String] The status of shipment you want to include in the response. To retrieve all new
|
|
24
|
-
# shipments, set this value to `ACCEPTED`.
|
|
24
|
+
# shipments, set this value to `CREATED` or `ACCEPTED`.
|
|
25
25
|
# @param last_updated_after [String] The response includes shipments whose latest update is after the specified
|
|
26
26
|
# time. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format.
|
|
27
27
|
# @param last_updated_before [String] The response includes shipments whose latest update is before the specified
|
|
@@ -105,12 +105,18 @@ module Peddler
|
|
|
105
105
|
#
|
|
106
106
|
# @note This operation can make a static sandbox call.
|
|
107
107
|
# @param feed_document_id [String] The identifier of the feed document.
|
|
108
|
+
# @param enable_content_encoding_url_header [Boolean] When `true`, the Content-Encoding header on the returned URL
|
|
109
|
+
# is set to `gzip` instead of the default `identity` when `compressionAlgorithm` is `GZIP`. This allows
|
|
110
|
+
# automatic decompression by HTTP clients.
|
|
108
111
|
# @param rate_limit [Float] Requests per second
|
|
109
112
|
# @return [Peddler::Response] The API response
|
|
110
|
-
def get_feed_document(feed_document_id, rate_limit: 0.0222)
|
|
113
|
+
def get_feed_document(feed_document_id, enable_content_encoding_url_header: nil, rate_limit: 0.0222)
|
|
111
114
|
path = "/feeds/2021-06-30/documents/#{percent_encode(feed_document_id)}"
|
|
115
|
+
params = {
|
|
116
|
+
"enableContentEncodingUrlHeader" => enable_content_encoding_url_header,
|
|
117
|
+
}.compact
|
|
112
118
|
parser = -> { FeedDocument }
|
|
113
|
-
get(path, rate_limit:, parser:)
|
|
119
|
+
get(path, params:, rate_limit:, parser:)
|
|
114
120
|
end
|
|
115
121
|
end
|
|
116
122
|
end
|
|
@@ -7,12 +7,12 @@ require "structure"
|
|
|
7
7
|
module Peddler
|
|
8
8
|
module APIs
|
|
9
9
|
class FulfillmentOutbound20200701
|
|
10
|
-
# A quantity based on unit of
|
|
10
|
+
# A quantity based on the specified unit of measurement.
|
|
11
11
|
Amount = Structure.new do
|
|
12
12
|
# @return [String] The unit of measure for the amount.
|
|
13
13
|
attribute(:unit_of_measure, String, null: false, from: "unitOfMeasure")
|
|
14
14
|
|
|
15
|
-
# @return [String] The amount of a product in the associated unit of
|
|
15
|
+
# @return [String] The amount of a product in the associated unit of measurement.
|
|
16
16
|
attribute(:value, String, null: false)
|
|
17
17
|
end
|
|
18
18
|
end
|
|
@@ -12,8 +12,8 @@ module Peddler
|
|
|
12
12
|
# @return [String] The delivery document type. The only possible value is `DELIVERY_IMAGE`.
|
|
13
13
|
attribute(:document_type, String, null: false, from: "documentType")
|
|
14
14
|
|
|
15
|
-
# @return [String] A URL that
|
|
16
|
-
#
|
|
15
|
+
# @return [String] A URL that is valid for one hour to download the document. In case of URL expiry, call the
|
|
16
|
+
# API again to get a new url. The URL will have a Content-Type header.
|
|
17
17
|
attribute?(:url, String)
|
|
18
18
|
end
|
|
19
19
|
end
|
|
@@ -7,7 +7,8 @@ require "structure"
|
|
|
7
7
|
module Peddler
|
|
8
8
|
module APIs
|
|
9
9
|
class FulfillmentOutbound20200701
|
|
10
|
-
# The delivery information
|
|
10
|
+
# The delivery information of the package, this information is only available post package delivery to its
|
|
11
|
+
# intended destination.
|
|
11
12
|
DeliveryInformation = Structure.new do
|
|
12
13
|
# @return [Array<DeliveryDocument>] All of the delivery documents for a package.
|
|
13
14
|
attribute?(:delivery_document_list, [DeliveryDocument], from: "deliveryDocumentList")
|
|
@@ -14,7 +14,7 @@ module Peddler
|
|
|
14
14
|
# door, unless you specify otherwise.
|
|
15
15
|
DeliveryPreferences = Structure.new do
|
|
16
16
|
# @return [String] Additional delivery instructions. For example, this could be instructions on how to enter a
|
|
17
|
-
# building, nearby landmark or navigation instructions,
|
|
17
|
+
# building, nearby landmark or navigation instructions, or `Beware of dogs`.
|
|
18
18
|
attribute?(:delivery_instructions, String, from: "deliveryInstructions")
|
|
19
19
|
|
|
20
20
|
# @return [DropOffLocation] The preferred location to leave packages at the destination address.
|
|
@@ -10,12 +10,11 @@ module Peddler
|
|
|
10
10
|
# The time range within which a Scheduled Delivery fulfillment order should be delivered. This is only available
|
|
11
11
|
# in the JP marketplace.
|
|
12
12
|
DeliveryWindow = Structure.new do
|
|
13
|
-
# @return [String] The date and time of the end of the Scheduled Delivery window
|
|
14
|
-
# {https://developer-docs.amazon.com/sp-api/docs/iso-8601 ISO 8601} format.
|
|
13
|
+
# @return [String] The date and time of the end of the Scheduled Delivery window, in ISO 8601 date time format.
|
|
15
14
|
attribute(:end_date, String, null: false, from: "endDate")
|
|
16
15
|
|
|
17
|
-
# @return [String] The date and time of the start of the Scheduled Delivery window
|
|
18
|
-
#
|
|
16
|
+
# @return [String] The date and time of the start of the Scheduled Delivery window, in ISO 8601 date time
|
|
17
|
+
# format.
|
|
19
18
|
attribute(:start_date, String, null: false, from: "startDate")
|
|
20
19
|
end
|
|
21
20
|
end
|
|
@@ -7,17 +7,19 @@ require "structure"
|
|
|
7
7
|
module Peddler
|
|
8
8
|
module APIs
|
|
9
9
|
class FulfillmentOutbound20200701
|
|
10
|
-
# The
|
|
10
|
+
# The drop-off location at the destination address.
|
|
11
11
|
DropOffLocation = Structure.new do
|
|
12
|
-
# @return [String]
|
|
12
|
+
# @return [String] The drop-off location type at the destination address.
|
|
13
13
|
attribute(:type, String, null: false)
|
|
14
14
|
|
|
15
|
-
# @return [Hash] Additional information about the drop-off location
|
|
16
|
-
# drop-off location specified in the `type` field.
|
|
17
|
-
#
|
|
15
|
+
# @return [Hash] Additional information about the drop-off location. This information can vary depending on the
|
|
16
|
+
# type of drop-off location specified in the `type` field.
|
|
17
|
+
#
|
|
18
|
+
# If the `type` is set to `FALLBACK_NEIGHBOR_DELIVERY`, the `attributes` object must include the keys
|
|
18
19
|
# `neighborName` and `houseNumber` to provide the name and house number of the designated neighbor.
|
|
19
|
-
#
|
|
20
|
-
#
|
|
20
|
+
#
|
|
21
|
+
# For `RECEPTIONIST` type, the `attributes` object may include a `recipientName` field that contains the name of
|
|
22
|
+
# the person who received or will receive the package.
|
|
21
23
|
attribute?(:attributes, Hash)
|
|
22
24
|
end
|
|
23
25
|
end
|
|
@@ -13,7 +13,9 @@ module Peddler
|
|
|
13
13
|
# orders and increase the risk of some of your orders being unfulfilled or delivered late if there are no
|
|
14
14
|
# alternative carriers available. Using `BLOCK_AMZL` in an order request will take precedence over your Seller
|
|
15
15
|
# Central account setting. To ship in non-Amazon branded packaging (blank boxes), set `featureName` to
|
|
16
|
-
# `BLANK_BOX`. To require
|
|
16
|
+
# `BLANK_BOX`. To require items to be shipped in an overbox rather than in their original product packaging, set
|
|
17
|
+
# `featureName` to `OVERBOX`. To require a packing slip to be included with the order, set `featureName` to
|
|
18
|
+
# `PACKING_SLIP`. To require a signature from the recipient upon delivery, set `featureName` to
|
|
17
19
|
# `SIGNATURE_CONFIRMATION`. Note that using signature confirmation features will incur additional fees on MCF
|
|
18
20
|
# orders and are currently supported only in the US marketplace. To ensure all items in an order are delivered
|
|
19
21
|
# together, set `featureName` to `DELIVER_TOGETHER`.
|
|
@@ -28,6 +30,8 @@ module Peddler
|
|
|
28
30
|
# unfulfilled or delayed deliveries if alternative carriers are unavailable. Using `BLOCK_AMZL` in an order
|
|
29
31
|
# request will take precedence over your Seller Central account setting.
|
|
30
32
|
# - `BLANK_BOX`: Ships orders in non-Amazon branded packaging (blank boxes).
|
|
33
|
+
# - `OVERBOX`: Requires items to be shipped in an overbox rather than in their original product packaging.
|
|
34
|
+
# - `PACKING_SLIP`: Requires a packing slip to be included with the order.
|
|
31
35
|
# - `SIGNATURE_CONFIRMATION`: Requires a signature from the recipient upon delivery.
|
|
32
36
|
# - Note: Using signature confirmation features will incur additional fees on MCF orders and are currently
|
|
33
37
|
# supported only in the US marketplace.
|
|
@@ -19,7 +19,7 @@ module Peddler
|
|
|
19
19
|
# @return [Array<String>] Other seller SKUs that are shared across the same inventory.
|
|
20
20
|
attribute?(:overlapping_skus, [String], from: "overlappingSkus")
|
|
21
21
|
|
|
22
|
-
# @return [String] Used to identify an item in the given marketplace.
|
|
22
|
+
# @return [String] Used to identify an item in the given marketplace. SellerSKU is qualified by the seller's
|
|
23
23
|
# SellerId, which is included with every operation that you submit.
|
|
24
24
|
attribute?(:seller_sku, String, from: "sellerSku")
|
|
25
25
|
|
|
@@ -39,8 +39,8 @@ module Peddler
|
|
|
39
39
|
# @return [String]
|
|
40
40
|
attribute(:shipping_speed_category, String, null: false, from: "shippingSpeedCategory")
|
|
41
41
|
|
|
42
|
-
# @return [String] The date and time that the status of the fulfillment order last changed
|
|
43
|
-
#
|
|
42
|
+
# @return [String] The date and time that the status of the fulfillment order last changed, in ISO 8601 date
|
|
43
|
+
# time format.
|
|
44
44
|
attribute(:status_updated_date, String, null: false, from: "statusUpdatedDate")
|
|
45
45
|
|
|
46
46
|
# @return [CODSettings]
|
|
@@ -15,16 +15,16 @@ module Peddler
|
|
|
15
15
|
# @return [String] The earliest date that the shipment is expected to arrive at its destination.
|
|
16
16
|
attribute?(:earliest_arrival_date, String, from: "earliestArrivalDate")
|
|
17
17
|
|
|
18
|
-
# @return [String] The earliest date that the shipment is expected to be sent from the fulfillment center
|
|
19
|
-
#
|
|
18
|
+
# @return [String] The earliest date that the shipment is expected to be sent from the fulfillment center, in
|
|
19
|
+
# ISO 8601 date time format.
|
|
20
20
|
attribute?(:earliest_ship_date, String, from: "earliestShipDate")
|
|
21
21
|
|
|
22
|
-
# @return [String] The latest date that the shipment is expected to arrive at its destination
|
|
23
|
-
#
|
|
22
|
+
# @return [String] The latest date that the shipment is expected to arrive at its destination, in ISO 8601 date
|
|
23
|
+
# time format.
|
|
24
24
|
attribute?(:latest_arrival_date, String, from: "latestArrivalDate")
|
|
25
25
|
|
|
26
|
-
# @return [String] The latest date that the shipment is expected to be sent from the fulfillment center
|
|
27
|
-
#
|
|
26
|
+
# @return [String] The latest date that the shipment is expected to be sent from the fulfillment center, in ISO
|
|
27
|
+
# 8601 date time format.
|
|
28
28
|
attribute?(:latest_ship_date, String, from: "latestShipDate")
|
|
29
29
|
|
|
30
30
|
# @return [Array<String>] Provides additional insight into the shipment timeline when exact delivery dates are
|
|
@@ -19,12 +19,11 @@ module Peddler
|
|
|
19
19
|
# delivery information.
|
|
20
20
|
attribute?(:amazon_fulfillment_tracking_number, String, from: "amazonFulfillmentTrackingNumber")
|
|
21
21
|
|
|
22
|
-
# @return [DeliveryInformation] The delivery information
|
|
23
|
-
#
|
|
22
|
+
# @return [DeliveryInformation] The delivery information of the package, this information is only available post
|
|
23
|
+
# package delivery to its intended destination.
|
|
24
24
|
attribute?(:delivery_information, DeliveryInformation, from: "deliveryInformation")
|
|
25
25
|
|
|
26
|
-
# @return [String] The estimated arrival date and time of the package
|
|
27
|
-
# {https://developer-docs.amazon.com/sp-api/docs/iso-8601 ISO 8601} format.
|
|
26
|
+
# @return [String] The estimated arrival date and time of the package, in ISO 8601 date time format.
|
|
28
27
|
attribute?(:estimated_arrival_date, String, from: "estimatedArrivalDate")
|
|
29
28
|
|
|
30
29
|
# @return [LockerDetails] The locker details, if provided can be used to access locker delivery box.
|
|
@@ -9,7 +9,7 @@ module Peddler
|
|
|
9
9
|
class FulfillmentOutbound20200701
|
|
10
10
|
# The breakdown of eligibility inventory by feature.
|
|
11
11
|
GetFeatureInventoryResponse = Structure.new do
|
|
12
|
-
# @return [Array<Error>] One or more unexpected errors occurred during the
|
|
12
|
+
# @return [Array<Error>] One or more unexpected errors occurred during the getFeatureInventory operation.
|
|
13
13
|
attribute?(:errors, [Error])
|
|
14
14
|
|
|
15
15
|
# @return [GetFeatureInventoryResult]
|
|
@@ -18,6 +18,12 @@ module Peddler
|
|
|
18
18
|
# @return [String] The requested marketplace.
|
|
19
19
|
attribute(:marketplace_id, String, null: false, from: "marketplaceId")
|
|
20
20
|
|
|
21
|
+
# @return [String] The Amazon Standard Identification Number (ASIN) of the item.
|
|
22
|
+
attribute?(:asin, String)
|
|
23
|
+
|
|
24
|
+
# @return [String] The unique SKU used by Amazon's fulfillment network.
|
|
25
|
+
attribute?(:fn_sku, String, from: "fnSku")
|
|
26
|
+
|
|
21
27
|
# @return [Array<String>] A list of one or more reasons that the seller SKU is ineligible for the feature.
|
|
22
28
|
#
|
|
23
29
|
# Possible values:
|
|
@@ -26,9 +32,12 @@ module Peddler
|
|
|
26
32
|
# * `INVALID_SKU`: There is an issue with the SKU provided.
|
|
27
33
|
attribute?(:ineligible_reasons, [String], from: "ineligibleReasons")
|
|
28
34
|
|
|
29
|
-
# @return [
|
|
30
|
-
#
|
|
31
|
-
attribute?(:
|
|
35
|
+
# @return [String] Used to identify an item in the given marketplace. SellerSKU is qualified by the seller's
|
|
36
|
+
# SellerId, which is included with every operation that you submit.
|
|
37
|
+
attribute?(:seller_sku, String, from: "sellerSku")
|
|
38
|
+
|
|
39
|
+
# @return [Float] The number of SKUs available for this service.
|
|
40
|
+
attribute?(:sku_count, Float, from: "skuCount")
|
|
32
41
|
end
|
|
33
42
|
end
|
|
34
43
|
end
|
|
@@ -9,7 +9,8 @@ module Peddler
|
|
|
9
9
|
class FulfillmentOutbound20200701
|
|
10
10
|
# The origin for the delivery offer.
|
|
11
11
|
Origin = Structure.new do
|
|
12
|
-
# @return [String] The two
|
|
12
|
+
# @return [String] The two-digit country code (in ISO 3166-1 alpha-2 format) for the country where the items
|
|
13
|
+
# will ship from.
|
|
13
14
|
attribute(:country_code, String, null: false, from: "countryCode")
|
|
14
15
|
end
|
|
15
16
|
end
|
|
@@ -15,8 +15,7 @@ module Peddler
|
|
|
15
15
|
# @return [String] The event code for the delivery event.
|
|
16
16
|
attribute(:event_code, String, null: false, from: "eventCode")
|
|
17
17
|
|
|
18
|
-
# @return [String] The date and time that the delivery event took place
|
|
19
|
-
# {https://developer-docs.amazon.com/sp-api/docs/iso-8601 ISO 8601} format.
|
|
18
|
+
# @return [String] The date and time that the delivery event took place, in ISO 8601 date time format.
|
|
20
19
|
attribute(:event_date, String, null: false, from: "eventDate")
|
|
21
20
|
|
|
22
21
|
# @return [String] A description for the corresponding event code.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is generated. Do not edit.
|
|
4
|
+
|
|
5
|
+
require "structure"
|
|
6
|
+
|
|
7
|
+
module Peddler
|
|
8
|
+
module APIs
|
|
9
|
+
class Orders20260101
|
|
10
|
+
# An associated order item that a customer has purchased with the product. For example, a tire installation
|
|
11
|
+
# service purchased with tires.
|
|
12
|
+
AssociatedOrderItem = Structure.new do
|
|
13
|
+
# @return [String] The type of association between the order items.
|
|
14
|
+
#
|
|
15
|
+
# **Possible values**:
|
|
16
|
+
# - `VALUE_ADD_SERVICE` (The associated item is a service order)
|
|
17
|
+
attribute?(:association_type, String, from: "associationType")
|
|
18
|
+
|
|
19
|
+
# @return [String] The order identifier of the associated order item.
|
|
20
|
+
attribute?(:order_id, String, from: "orderId")
|
|
21
|
+
|
|
22
|
+
# @return [String] The order item identifier of the associated order item.
|
|
23
|
+
attribute?(:order_item_id, String, from: "orderItemId")
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -11,6 +11,9 @@ module Peddler
|
|
|
11
11
|
ItemPacking = Structure.new do
|
|
12
12
|
# @return [GiftOption] Gift wrapping and messaging specified for this item.
|
|
13
13
|
attribute?(:gift_option, GiftOption, from: "giftOption")
|
|
14
|
+
|
|
15
|
+
# @return [SerialNumberRequirement] Whether serial numbers must be provided for this line item.
|
|
16
|
+
attribute?(:serial_number_requirement, SerialNumberRequirement, from: "serialNumberRequirement")
|
|
14
17
|
end
|
|
15
18
|
end
|
|
16
19
|
end
|
|
@@ -10,7 +10,7 @@ module Peddler
|
|
|
10
10
|
# Information related to the warehouse picking process for an order item.
|
|
11
11
|
ItemPicking = Structure.new do
|
|
12
12
|
# @return [ItemSubstitutionPreference] Substitution preference for an order item when it becomes unavailable
|
|
13
|
-
# during fulfillment
|
|
13
|
+
# during fulfillment.
|
|
14
14
|
attribute?(:substitution_preference, ItemSubstitutionPreference, from: "substitutionPreference")
|
|
15
15
|
end
|
|
16
16
|
end
|
|
@@ -8,7 +8,7 @@ module Peddler
|
|
|
8
8
|
module APIs
|
|
9
9
|
class Orders20260101
|
|
10
10
|
# Further granular breakdown of the subtotal of the proceeds breakdown, only available for TAX and DISCOUNT
|
|
11
|
-
# proceeds
|
|
11
|
+
# proceeds types.
|
|
12
12
|
ItemProceedsDetailedBreakdown = Structure.new do
|
|
13
13
|
# @return [String] Specific classification of the further granular breakdown.
|
|
14
14
|
#
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is generated. Do not edit.
|
|
4
|
+
|
|
5
|
+
require "structure"
|
|
6
|
+
|
|
7
|
+
module Peddler
|
|
8
|
+
module APIs
|
|
9
|
+
class Orders20260101
|
|
10
|
+
# Tax information for an order item.
|
|
11
|
+
ItemTax = Structure.new do
|
|
12
|
+
# @return [Array<ItemTaxCalculationBreakdown>] A list of tax calculation breakdowns for the order item.
|
|
13
|
+
attribute?(:tax_calculation_breakdowns, [ItemTaxCalculationBreakdown], from: "taxCalculationBreakdowns")
|
|
14
|
+
|
|
15
|
+
# @return [Array<ItemTaxCollection>] A list of tax collections for the order item.
|
|
16
|
+
attribute?(:tax_collections, [ItemTaxCollection], from: "taxCollections")
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|