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.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +108 -110
  3. data/lib/peddler/api.rb +56 -18
  4. data/lib/peddler/{api → apis}/amazon_warehousing_and_distribution_2024_05_09.rb +38 -26
  5. data/lib/peddler/{api → apis}/aplus_content_2020_11_01.rb +97 -59
  6. data/lib/peddler/apis/application_integrations_2024_04_01.rb +56 -0
  7. data/lib/peddler/{api → apis}/application_management_2023_11_30.rb +14 -4
  8. data/lib/peddler/{api → apis}/catalog_items_2020_12_01.rb +34 -23
  9. data/lib/peddler/{api → apis}/catalog_items_2022_04_01.rb +39 -29
  10. data/lib/peddler/{api → apis}/catalog_items_v0.rb +43 -30
  11. data/lib/peddler/{api → apis}/data_kiosk_2023_11_15.rb +47 -31
  12. data/lib/peddler/apis/easy_ship_2022_03_23.rb +126 -0
  13. data/lib/peddler/{api → apis}/fba_inbound_eligibility_v1.rb +15 -7
  14. data/lib/peddler/{api → apis}/fba_inventory_v1.rb +45 -29
  15. data/lib/peddler/{api → apis}/feeds_2021_06_30.rb +54 -33
  16. data/lib/peddler/apis/finances_2024_06_19.rb +50 -0
  17. data/lib/peddler/{api → apis}/finances_v0.rb +50 -36
  18. data/lib/peddler/{api → apis}/fulfillment_inbound_2024_03_20.rb +384 -255
  19. data/lib/peddler/{api → apis}/fulfillment_inbound_v0.rb +138 -93
  20. data/lib/peddler/{api → apis}/fulfillment_outbound_2020_07_01.rb +105 -68
  21. data/lib/peddler/apis/invoices_2024_06_19.rb +180 -0
  22. data/lib/peddler/apis/listings_items_2020_09_01.rb +95 -0
  23. data/lib/peddler/apis/listings_items_2021_08_01.rb +136 -0
  24. data/lib/peddler/{api → apis}/listings_restrictions_2021_08_01.rb +21 -11
  25. data/lib/peddler/apis/merchant_fulfillment_v0.rb +80 -0
  26. data/lib/peddler/{api → apis}/messaging_v1.rb +107 -75
  27. data/lib/peddler/{api → apis}/notifications_v1.rb +63 -32
  28. data/lib/peddler/{api → apis}/orders_v0.rb +99 -84
  29. data/lib/peddler/apis/product_fees_v0.rb +77 -0
  30. data/lib/peddler/{api → apis}/product_pricing_2022_05_01.rb +24 -13
  31. data/lib/peddler/{api → apis}/product_pricing_v0.rb +70 -52
  32. data/lib/peddler/{api → apis}/product_type_definitions_2020_09_01.rb +32 -21
  33. data/lib/peddler/{api → apis}/replenishment_2022_11_07.rb +25 -13
  34. data/lib/peddler/{api → apis}/reports_2021_06_30.rb +71 -47
  35. data/lib/peddler/{api → apis}/sales_v1.rb +22 -14
  36. data/lib/peddler/{api → apis}/sellers_v1.rb +19 -7
  37. data/lib/peddler/{api → apis}/services_v1.rb +156 -116
  38. data/lib/peddler/apis/shipment_invoicing_v0.rb +59 -0
  39. data/lib/peddler/apis/shipping_v1.rb +132 -0
  40. data/lib/peddler/{api → apis}/shipping_v2.rb +150 -98
  41. data/lib/peddler/{api → apis}/solicitations_v1.rb +21 -11
  42. data/lib/peddler/apis/supply_sources_2020_07_01.rb +100 -0
  43. data/lib/peddler/{api → apis}/tokens_2021_03_01.rb +15 -7
  44. data/lib/peddler/{api → apis}/uploads_2020_11_01.rb +18 -8
  45. data/lib/peddler/{api → apis}/vendor_direct_fulfillment_inventory_v1.rb +14 -6
  46. data/lib/peddler/{api → apis}/vendor_direct_fulfillment_orders_2021_12_28.rb +33 -21
  47. data/lib/peddler/{api → apis}/vendor_direct_fulfillment_orders_v1.rb +33 -21
  48. data/lib/peddler/{api → apis}/vendor_direct_fulfillment_payments_v1.rb +13 -5
  49. data/lib/peddler/apis/vendor_direct_fulfillment_sandbox_test_data_2021_10_28.rb +45 -0
  50. data/lib/peddler/{api → apis}/vendor_direct_fulfillment_shipping_2021_12_28.rb +86 -60
  51. data/lib/peddler/apis/vendor_direct_fulfillment_shipping_v1.rb +189 -0
  52. data/lib/peddler/{api → apis}/vendor_direct_fulfillment_transactions_2021_12_28.rb +14 -6
  53. data/lib/peddler/{api → apis}/vendor_direct_fulfillment_transactions_v1.rb +14 -6
  54. data/lib/peddler/apis/vendor_invoices_v1.rb +30 -0
  55. data/lib/peddler/{api → apis}/vendor_orders_v1.rb +59 -48
  56. data/lib/peddler/apis/vendor_shipments_v1.rb +132 -0
  57. data/lib/peddler/{api → apis}/vendor_transaction_status_v1.rb +14 -5
  58. data/lib/peddler/endpoint.rb +51 -0
  59. data/lib/peddler/error.rb +21 -11
  60. data/lib/peddler/helpers/feeds_2021_06_30.rb +26 -0
  61. data/lib/peddler/json_feed_document.rb +31 -0
  62. data/lib/peddler/marketplace.rb +93 -0
  63. data/lib/peddler/response.rb +46 -0
  64. data/lib/peddler/token.rb +70 -0
  65. data/lib/peddler/version.rb +1 -1
  66. data/lib/peddler.rb +55 -52
  67. metadata +64 -57
  68. data/lib/peddler/access_token.rb +0 -76
  69. data/lib/peddler/api/easy_ship_2022_03_23.rb +0 -108
  70. data/lib/peddler/api/listings_items_2020_09_01.rb +0 -84
  71. data/lib/peddler/api/listings_items_2021_08_01.rb +0 -154
  72. data/lib/peddler/api/merchant_fulfillment_v0.rb +0 -64
  73. data/lib/peddler/api/product_fees_v0.rb +0 -69
  74. data/lib/peddler/api/shipment_invoicing_v0.rb +0 -46
  75. data/lib/peddler/api/shipping_v1.rb +0 -107
  76. data/lib/peddler/api/supply_sources_2020_07_01.rb +0 -82
  77. data/lib/peddler/api/vendor_direct_fulfillment_sandbox_test_data_2021_10_28.rb +0 -35
  78. data/lib/peddler/api/vendor_direct_fulfillment_shipping_v1.rb +0 -165
  79. data/lib/peddler/api/vendor_invoices_v1.rb +0 -22
  80. data/lib/peddler/api/vendor_shipments_v1.rb +0 -120
  81. data/lib/peddler/region.rb +0 -30
@@ -1,76 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "http"
4
-
5
- module Peddler
6
- # Requests a Login with Amazon (LWA) access token that authorizes your application to take actions on behalf of a
7
- # selling partner. An LWA access token expires one hour after it is issued.
8
- #
9
- # @see https://developer-docs.amazon.com/sp-api/docs/connecting-to-the-selling-partner-api
10
- class AccessToken
11
- URL = "https://api.amazon.com/auth/o2/token"
12
-
13
- attr_reader :client_id, :client_secret, :refresh_token, :scope
14
-
15
- class << self
16
- # Requests an access token
17
- #
18
- # @param client_id [String]
19
- # @param client_secret [String]
20
- # @param refresh_token [String]
21
- # @param scope [String]
22
- def request(client_id: ENV["LWA_CLIENT_ID"], client_secret: ENV["LWA_CLIENT_SECRET"], refresh_token: nil,
23
- scope: nil)
24
- new(client_id: client_id, client_secret: client_secret, refresh_token: refresh_token, scope: scope).request
25
- end
26
- end
27
-
28
- # @param client_id [String]
29
- # @param client_secret [String]
30
- # @param refresh_token [String]
31
- # @param scope [String]
32
- def initialize(client_id: ENV["LWA_CLIENT_ID"], client_secret: ENV["LWA_CLIENT_SECRET"], refresh_token: nil,
33
- scope: nil)
34
- @client_id = client_id
35
- @client_secret = client_secret
36
- @refresh_token = refresh_token
37
- @scope = scope
38
-
39
- validate_lwa_credentials!
40
- validate_exclusive_token_or_scope!
41
- end
42
-
43
- def request
44
- response = HTTP.post(URL, form: params)
45
- response.parse.fetch("access_token")
46
- end
47
-
48
- private
49
-
50
- def validate_lwa_credentials!
51
- if client_id.nil? || client_secret.nil?
52
- raise ArgumentError, "Provide client_id and client_secret."
53
- end
54
- end
55
-
56
- def validate_exclusive_token_or_scope!
57
- if @refresh_token.nil? == @scope.nil?
58
- raise ArgumentError, "Provide either refresh_token or scope, not both."
59
- end
60
- end
61
-
62
- def params
63
- {
64
- grant_type: grant_type,
65
- refresh_token: refresh_token,
66
- scope: scope,
67
- client_id: client_id,
68
- client_secret: client_secret,
69
- }.compact
70
- end
71
-
72
- def grant_type
73
- scope ? "client_credentials" : "refresh_token"
74
- end
75
- end
76
- end
@@ -1,108 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "peddler/api"
4
-
5
- module Peddler
6
- class API
7
- # Selling Partner API for Easy Ship
8
- #
9
- # The Selling Partner API for Easy Ship helps you build applications that help sellers manage and ship Amazon Easy
10
- # Ship orders. Your Easy Ship applications can: * Get available time slots for packages to be scheduled for
11
- # delivery. * Schedule, reschedule, and cancel Easy Ship orders. * Print labels, invoices, and warranties. See the
12
- # [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) for the
13
- # differences in Easy Ship operations by marketplace.
14
- class EasyShip20220323 < API
15
- # Returns time slots available for Easy Ship orders to be scheduled based on the package weight and dimensions
16
- # that the seller specifies. This operation is available for scheduled and unscheduled orders based on marketplace
17
- # support. See **Get Time Slots** in the [Marketplace Support
18
- # Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table). This operation can return time
19
- # slots that have either pickup or drop-off handover methods - see **Supported Handover Methods** in the
20
- # [Marketplace Support Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table).
21
- #
22
- # @param [Hash] list_handover_slots_request The request schema for the `listHandoverSlots` operation.
23
- # @return [Hash] The API response
24
- def list_handover_slots(list_handover_slots_request: nil)
25
- path = "/easyShip/2022-03-23/timeSlot"
26
- body = list_handover_slots_request
27
-
28
- rate_limit(1.0).post(path, body:)
29
- end
30
-
31
- # Returns information about a package, including dimensions, weight, time slot information for handover, invoice
32
- # and item information, and status.
33
- #
34
- # @param [String] amazon_order_id An Amazon-defined order identifier. Identifies the order that the seller wants
35
- # to deliver using Amazon Easy Ship.
36
- # @param [String] marketplace_id An identifier for the marketplace in which the seller is selling.
37
- # @return [Hash] The API response
38
- def get_scheduled_package(amazon_order_id, marketplace_id)
39
- path = "/easyShip/2022-03-23/package"
40
- params = {
41
- "amazonOrderId" => amazon_order_id,
42
- "marketplaceId" => marketplace_id,
43
- }.compact
44
-
45
- rate_limit(1.0).get(path, params:)
46
- end
47
-
48
- # Schedules an Easy Ship order and returns the scheduled package information. This operation does the following: *
49
- # Specifies the time slot and handover method for the order to be scheduled for delivery. * Updates the Easy Ship
50
- # order status. * Generates a shipping label and an invoice. Calling `createScheduledPackage` also generates a
51
- # warranty document if you specify a `SerialNumber` value. To get these documents, see [How to get invoice,
52
- # shipping label, and warranty documents](doc:easyship-api-v2022-03-23-use-case-guide). * Shows the status of Easy
53
- # Ship orders when you call the `getOrders` operation of the Selling Partner API for Orders and examine the
54
- # `EasyShipShipmentStatus` property in the response body. See the **Shipping Label**, **Invoice**, and
55
- # **Warranty** columns in the [Marketplace Support
56
- # Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which documents are
57
- # supported in each marketplace.
58
- #
59
- # @param [Hash] create_scheduled_package_request The request schema for the `createScheduledPackage` operation.
60
- # @return [Hash] The API response
61
- def create_scheduled_package(create_scheduled_package_request)
62
- path = "/easyShip/2022-03-23/package"
63
- body = create_scheduled_package_request
64
-
65
- rate_limit(1.0).post(path, body:)
66
- end
67
-
68
- # Updates the time slot for handing over the package indicated by the specified `scheduledPackageId`. You can get
69
- # the new `slotId` value for the time slot by calling the `listHandoverSlots` operation before making another
70
- # `patch` call. See the **Update Package** column in the [Marketplace Support
71
- # Table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which marketplaces this
72
- # operation is supported in.
73
- #
74
- # @param [Hash] update_scheduled_packages_request The request schema for the `updateScheduledPackages` operation.
75
- # @return [Hash] The API response
76
- def update_scheduled_packages(update_scheduled_packages_request: nil)
77
- path = "/easyShip/2022-03-23/package"
78
- body = update_scheduled_packages_request
79
-
80
- rate_limit(1.0).patch(path, body:)
81
- end
82
-
83
- # This operation automatically schedules a time slot for all the `amazonOrderId`s given as input, generating the
84
- # associated shipping labels, along with other compliance documents according to the marketplace (refer to the
85
- # [marketplace document support table](doc:easyship-api-v2022-03-23-use-case-guide#marketplace-support-table)).
86
- # Developers calling this operation may optionally assign a `packageDetails` object, allowing them to input a
87
- # preferred time slot for each order in ther request. In this case, Amazon will try to schedule the respective
88
- # packages using their optional settings. On the other hand, *i.e.*, if the time slot is not provided, Amazon will
89
- # then pick the earliest time slot possible. Regarding the shipping label's file format, external developers are
90
- # able to choose between PDF or ZPL, and Amazon will create the label accordingly. This operation returns an array
91
- # composed of the scheduled packages, and a short-lived URL pointing to a zip file containing the generated
92
- # shipping labels and the other documents enabled for your marketplace. If at least an order couldn't be
93
- # scheduled, then Amazon adds the `rejectedOrders` list into the response, which contains an entry for each order
94
- # we couldn't process. Each entry is composed of an error message describing the reason of the failure, so that
95
- # sellers can take action. The table below displays the supported request and burst maximum rates:
96
- #
97
- # @param [Hash] create_scheduled_packages_request The request schema for the `createScheduledPackageBulk`
98
- # operation.
99
- # @return [Hash] The API response
100
- def create_scheduled_package_bulk(create_scheduled_packages_request)
101
- path = "/easyShip/2022-03-23/packages/bulk"
102
- body = create_scheduled_packages_request
103
-
104
- rate_limit(1.0).post(path, body:)
105
- end
106
- end
107
- end
108
- end
@@ -1,84 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "peddler/api"
4
-
5
- module Peddler
6
- class API
7
- # Selling Partner API for Listings Items
8
- #
9
- # The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner
10
- # listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which
11
- # you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more
12
- # information, see the [Listing Items API Use Case Guide](doc:listings-items-api-v2020-09-01-use-case-guide).
13
- class ListingsItems20200901 < API
14
- # Delete a listings item for a selling partner.
15
- # @note The parameters associated with this operation may contain special characters that must be encoded to
16
- # successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL
17
- # Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding).
18
- #
19
- # @param [String] seller_id A selling partner identifier, such as a merchant account or vendor code.
20
- # @param [String] sku A selling partner provided identifier for an Amazon listing.
21
- # @param [Array<String>] marketplace_ids A comma-delimited list of Amazon marketplace identifiers for the request.
22
- # @param [String] issue_locale A locale for localization of issues. When not provided, the default language code
23
- # of the first marketplace is used. Examples: "en_US", "fr_CA", "fr_FR". Localized messages default to "en_US"
24
- # when a localization is not available in the specified locale.
25
- # @return [Hash] The API response
26
- def delete_listings_item(seller_id, sku, marketplace_ids, issue_locale: nil)
27
- path = "/listings/2020-09-01/items/#{seller_id}/#{sku}"
28
- params = {
29
- "marketplaceIds" => marketplace_ids,
30
- "issueLocale" => issue_locale,
31
- }.compact
32
-
33
- rate_limit(5.0).delete(path, params:)
34
- end
35
-
36
- # Partially update (patch) a listings item for a selling partner. Only top-level listings item attributes can be
37
- # patched. Patching nested attributes is not supported.
38
- # @note The parameters associated with this operation may contain special characters that must be encoded to
39
- # successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL
40
- # Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding).
41
- #
42
- # @param [String] seller_id A selling partner identifier, such as a merchant account or vendor code.
43
- # @param [String] sku A selling partner provided identifier for an Amazon listing.
44
- # @param [Array<String>] marketplace_ids A comma-delimited list of Amazon marketplace identifiers for the request.
45
- # @param [String] issue_locale A locale for localization of issues. When not provided, the default language code
46
- # of the first marketplace is used. Examples: "en_US", "fr_CA", "fr_FR". Localized messages default to "en_US"
47
- # when a localization is not available in the specified locale.
48
- # @param [Hash] body The request body schema for the patchListingsItem operation.
49
- # @return [Hash] The API response
50
- def patch_listings_item(seller_id, sku, marketplace_ids, body, issue_locale: nil)
51
- path = "/listings/2020-09-01/items/#{seller_id}/#{sku}"
52
- params = {
53
- "marketplaceIds" => marketplace_ids,
54
- "issueLocale" => issue_locale,
55
- }.compact
56
-
57
- rate_limit(5.0).patch(path, body:, params:)
58
- end
59
-
60
- # Creates a new or fully-updates an existing listings item for a selling partner.
61
- # @note The parameters associated with this operation may contain special characters that must be encoded to
62
- # successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL
63
- # Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding).
64
- #
65
- # @param [String] seller_id A selling partner identifier, such as a merchant account or vendor code.
66
- # @param [String] sku A selling partner provided identifier for an Amazon listing.
67
- # @param [Array<String>] marketplace_ids A comma-delimited list of Amazon marketplace identifiers for the request.
68
- # @param [String] issue_locale A locale for localization of issues. When not provided, the default language code
69
- # of the first marketplace is used. Examples: "en_US", "fr_CA", "fr_FR". Localized messages default to "en_US"
70
- # when a localization is not available in the specified locale.
71
- # @param [Hash] body The request body schema for the putListingsItem operation.
72
- # @return [Hash] The API response
73
- def put_listings_item(seller_id, sku, marketplace_ids, body, issue_locale: nil)
74
- path = "/listings/2020-09-01/items/#{seller_id}/#{sku}"
75
- params = {
76
- "marketplaceIds" => marketplace_ids,
77
- "issueLocale" => issue_locale,
78
- }.compact
79
-
80
- rate_limit(5.0).put(path, body:, params:)
81
- end
82
- end
83
- end
84
- end
@@ -1,154 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "peddler/api"
4
-
5
- module Peddler
6
- class API
7
- # Selling Partner API for Listings Items
8
- #
9
- # The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner
10
- # listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which
11
- # you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more
12
- # information, see the [Listings Items API Use Case
13
- # Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide).
14
- class ListingsItems20210801 < API
15
- # Delete a listings item for a selling partner.
16
- # @note The parameters associated with this operation may contain special characters that must be encoded to
17
- # successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL
18
- # Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding).
19
- #
20
- # @param [String] seller_id A selling partner identifier, such as a merchant account or vendor code.
21
- # @param [String] sku A selling partner provided identifier for an Amazon listing.
22
- # @param [Array<String>] marketplace_ids A comma-delimited list of Amazon marketplace identifiers for the request.
23
- # @param [String] issue_locale A locale for localization of issues. When not provided, the default language code
24
- # of the first marketplace is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US`
25
- # when a localization is not available in the specified locale.
26
- # @return [Hash] The API response
27
- def delete_listings_item(seller_id, sku, marketplace_ids, issue_locale: nil)
28
- path = "/listings/2021-08-01/items/#{seller_id}/#{sku}"
29
- params = {
30
- "marketplaceIds" => marketplace_ids,
31
- "issueLocale" => issue_locale,
32
- }.compact
33
-
34
- rate_limit(5.0).delete(path, params:)
35
- end
36
-
37
- # Returns details about a listings item for a selling partner.
38
- # @note The parameters associated with this operation may contain special characters that must be encoded to
39
- # successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL
40
- # Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding).
41
- #
42
- # @param [String] seller_id A selling partner identifier, such as a merchant account or vendor code.
43
- # @param [String] sku A selling partner provided identifier for an Amazon listing.
44
- # @param [Array<String>] marketplace_ids A comma-delimited list of Amazon marketplace identifiers for the request.
45
- # @param [String] issue_locale A locale for localization of issues. When not provided, the default language code
46
- # of the first marketplace is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US`
47
- # when a localization is not available in the specified locale.
48
- # @param [Array<String>] included_data A comma-delimited list of data sets to include in the response. Default:
49
- # `summaries`.
50
- # @return [Hash] The API response
51
- def get_listings_item(seller_id, sku, marketplace_ids, issue_locale: nil, included_data: nil)
52
- path = "/listings/2021-08-01/items/#{seller_id}/#{sku}"
53
- params = {
54
- "marketplaceIds" => marketplace_ids,
55
- "issueLocale" => issue_locale,
56
- "includedData" => included_data,
57
- }.compact
58
-
59
- rate_limit(5.0).get(path, params:)
60
- end
61
-
62
- # Partially update (patch) a listings item for a selling partner. Only top-level listings item attributes can be
63
- # patched. Patching nested attributes is not supported.
64
- # @note This operation has a throttling rate of one request per second when `mode` is `VALIDATION_PREVIEW`.
65
- # @note The parameters associated with this operation may contain special characters that must be encoded to
66
- # successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL
67
- # Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding).
68
- #
69
- # @param [String] seller_id A selling partner identifier, such as a merchant account or vendor code.
70
- # @param [String] sku A selling partner provided identifier for an Amazon listing.
71
- # @param [Array<String>] marketplace_ids A comma-delimited list of Amazon marketplace identifiers for the request.
72
- # @param [Array<String>] included_data A comma-delimited list of data sets to include in the response. Default:
73
- # `issues`.
74
- # @param [String] mode The mode of operation for the request.
75
- # @param [String] issue_locale A locale for localization of issues. When not provided, the default language code
76
- # of the first marketplace is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US`
77
- # when a localization is not available in the specified locale.
78
- # @param [Hash] body The request body schema for the `patchListingsItem` operation.
79
- # @return [Hash] The API response
80
- def patch_listings_item(seller_id, sku, marketplace_ids, body, included_data: nil, mode: nil, issue_locale: nil)
81
- path = "/listings/2021-08-01/items/#{seller_id}/#{sku}"
82
- params = {
83
- "marketplaceIds" => marketplace_ids,
84
- "includedData" => included_data,
85
- "mode" => mode,
86
- "issueLocale" => issue_locale,
87
- }.compact
88
-
89
- rate_limit(5.0).patch(path, body:, params:)
90
- end
91
-
92
- # Creates or fully updates an existing listings item for a selling partner.
93
- # @note This operation has a throttling rate of one request per second when `mode` is `VALIDATION_PREVIEW`.
94
- # @note The parameters associated with this operation may contain special characters that must be encoded to
95
- # successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL
96
- # Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding).
97
- #
98
- # @param [String] seller_id A selling partner identifier, such as a merchant account or vendor code.
99
- # @param [String] sku A selling partner provided identifier for an Amazon listing.
100
- # @param [Array<String>] marketplace_ids A comma-delimited list of Amazon marketplace identifiers for the request.
101
- # @param [Array<String>] included_data A comma-delimited list of data sets to include in the response. Default:
102
- # `issues`.
103
- # @param [String] mode The mode of operation for the request.
104
- # @param [String] issue_locale A locale for localization of issues. When not provided, the default language code
105
- # of the first marketplace is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US`
106
- # when a localization is not available in the specified locale.
107
- # @param [Hash] body The request body schema for the `putListingsItem` operation.
108
- # @return [Hash] The API response
109
- def put_listings_item(seller_id, sku, marketplace_ids, body, included_data: nil, mode: nil, issue_locale: nil)
110
- path = "/listings/2021-08-01/items/#{seller_id}/#{sku}"
111
- params = {
112
- "marketplaceIds" => marketplace_ids,
113
- "includedData" => included_data,
114
- "mode" => mode,
115
- "issueLocale" => issue_locale,
116
- }.compact
117
-
118
- rate_limit(5.0).put(path, body:, params:)
119
- end
120
-
121
- # Search for and return list of listings items and respective details for a selling partner.
122
- #
123
- # @param [String] seller_id A selling partner identifier, such as a merchant account or vendor code.
124
- # @param [Array<String>] marketplace_ids A comma-delimited list of Amazon marketplace identifiers for the request.
125
- # @param [Array<String>] identifiers A comma-delimited list of product identifiers to search for listings items
126
- # by. **Note**: 1. Required when `identifiersType` is provided.
127
- # @param [String] identifiers_type Type of product identifiers to search for listings items by. **Note**: 1.
128
- # Required when `identifiers` is provided.
129
- # @param [Integer] page_size Number of results to be returned per page.
130
- # @param [String] page_token A token to fetch a certain page when there are multiple pages worth of results.
131
- # @param [Array<String>] included_data A comma-delimited list of data sets to include in the response. Default:
132
- # summaries.
133
- # @param [String] issue_locale A locale for localization of issues. When not provided, the default language code
134
- # of the first marketplace is used. Examples: "en_US", "fr_CA", "fr_FR". Localized messages default to "en_US"
135
- # when a localization is not available in the specified locale.
136
- # @return [Hash] The API response
137
- def search_listings_items(seller_id, marketplace_ids, identifiers: nil, identifiers_type: nil, page_size: nil,
138
- page_token: nil, included_data: nil, issue_locale: nil)
139
- path = "/listings/2021-08-01/items/#{seller_id}"
140
- params = {
141
- "marketplaceIds" => marketplace_ids,
142
- "identifiers" => identifiers,
143
- "identifiersType" => identifiers_type,
144
- "pageSize" => page_size,
145
- "pageToken" => page_token,
146
- "includedData" => included_data,
147
- "issueLocale" => issue_locale,
148
- }.compact
149
-
150
- rate_limit(5.0).get(path, params:)
151
- end
152
- end
153
- end
154
- end
@@ -1,64 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "peddler/api"
4
-
5
- module Peddler
6
- class API
7
- # Selling Partner API for Merchant Fulfillment
8
- #
9
- # The Selling Partner API for Merchant Fulfillment helps you build applications that let sellers purchase shipping
10
- # for non-Prime and Prime orders using Amazon’s Buy Shipping Services.
11
- class MerchantFulfillmentV0 < API
12
- # Returns a list of shipping service offers that satisfy the specified shipment request details.
13
- #
14
- # @param [Hash] body Request schema for GetEligibleShipmentServices operation.
15
- # @return [Hash] The API response
16
- def get_eligible_shipment_services(body)
17
- path = "/mfn/v0/eligibleShippingServices"
18
-
19
- rate_limit(5.0).post(path, body:)
20
- end
21
-
22
- # Returns the shipment information for an existing shipment.
23
- #
24
- # @param [String] shipment_id The Amazon-defined shipment identifier for the shipment.
25
- # @return [Hash] The API response
26
- def get_shipment(shipment_id)
27
- path = "/mfn/v0/shipments/#{shipment_id}"
28
-
29
- rate_limit(1.0).get(path)
30
- end
31
-
32
- # Cancel the shipment indicated by the specified shipment identifier.
33
- #
34
- # @param [String] shipment_id The Amazon-defined shipment identifier for the shipment to cancel.
35
- # @return [Hash] The API response
36
- def cancel_shipment(shipment_id)
37
- path = "/mfn/v0/shipments/#{shipment_id}"
38
-
39
- rate_limit(1.0).delete(path)
40
- end
41
-
42
- # Create a shipment with the information provided.
43
- #
44
- # @param [Hash] body Request schema for CreateShipment operation.
45
- # @return [Hash] The API response
46
- def create_shipment(body)
47
- path = "/mfn/v0/shipments"
48
-
49
- rate_limit(1.0).post(path, body:)
50
- end
51
-
52
- # Gets a list of additional seller inputs required for a ship method. This is generally used for international
53
- # shipping.
54
- #
55
- # @param [Hash] body Request schema for GetAdditionalSellerInputs operation.
56
- # @return [Hash] The API response
57
- def get_additional_seller_inputs(body)
58
- path = "/mfn/v0/additionalSellerInputs"
59
-
60
- rate_limit(1.0).post(path, body:)
61
- end
62
- end
63
- end
64
- end
@@ -1,69 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "peddler/api"
4
-
5
- module Peddler
6
- class API
7
- # Selling Partner API for Product Fees
8
- #
9
- # The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can
10
- # then account for those fees in your pricing.
11
- class ProductFeesV0 < API
12
- # Returns the estimated fees for the item indicated by the specified seller SKU in the marketplace specified in
13
- # the request body.
14
- # @note The parameters associated with this operation may contain special characters that require URL encoding to
15
- # call the API. To avoid errors with SKUs when encoding URLs, refer to [URL
16
- # Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). You can call `getMyFeesEstimateForSKU`
17
- # for an item on behalf of a selling partner before the selling partner sets the item's price. The selling
18
- # partner can then take any estimated fees into account. Each fees estimate request must include an original
19
- # identifier. This identifier is included in the fees estimate so that you can correlate a fees estimate with
20
- # the original request.
21
- # @note This identifier value is used to identify an estimate. Actual costs may vary. Search "fees" in [Seller
22
- # Central](https://sellercentral.amazon.com/) and consult the store-specific fee schedule for the most
23
- # up-to-date information.
24
- # @note When sellers use the `getMyFeesEstimateForSKU` operation with their `SellerSKU`, they get accurate fees
25
- # based on real item measurements, but only after they've sent their items to Amazon.
26
- #
27
- # @param [Hash] body
28
- # @param [String] seller_sku Used to identify an item in the given marketplace. SellerSKU is qualified by the
29
- # seller's SellerId, which is included with every operation that you submit.
30
- # @return [Hash] The API response
31
- def get_my_fees_estimate_for_sku(body, seller_sku)
32
- path = "/products/fees/v0/listings/#{seller_sku}/feesEstimate"
33
-
34
- rate_limit(1.0).post(path, body:)
35
- end
36
-
37
- # Returns the estimated fees for the item indicated by the specified ASIN in the marketplace specified in the
38
- # request body. You can call `getMyFeesEstimateForASIN` for an item on behalf of a selling partner before the
39
- # selling partner sets the item's price. The selling partner can then take estimated fees into account. Each fees
40
- # request must include an original identifier. This identifier is included in the fees estimate so you can
41
- # correlate a fees estimate with the original request.
42
- # @note This identifier value is used to identify an estimate. Actual costs may vary. Search "fees" in [Seller
43
- # Central](https://sellercentral.amazon.com/) and consult the store-specific fee schedule for the most
44
- # up-to-date information.
45
- # @note When using the `getMyFeesEstimateForASIN` operation with an ASIN, the fee estimates might be different.
46
- # This is because these estimates use the item's catalog size, which might not always match the actual size of
47
- # the item sent to Amazon.
48
- #
49
- # @param [Hash] body
50
- # @param [String] asin The Amazon Standard Identification Number (ASIN) of the item.
51
- # @return [Hash] The API response
52
- def get_my_fees_estimate_for_asin(body, asin)
53
- path = "/products/fees/v0/items/#{asin}/feesEstimate"
54
-
55
- rate_limit(1.0).post(path, body:)
56
- end
57
-
58
- # Returns the estimated fees for a list of products.
59
- #
60
- # @param [Hash] body
61
- # @return [Hash] The API response
62
- def get_my_fees_estimates(body)
63
- path = "/products/fees/v0/feesEstimate"
64
-
65
- rate_limit(0.5).post(path, body:)
66
- end
67
- end
68
- end
69
- end
@@ -1,46 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "peddler/api"
4
-
5
- module Peddler
6
- class API
7
- # Selling Partner API for Shipment Invoicing
8
- #
9
- # The Selling Partner API for Shipment Invoicing helps you programmatically retrieve shipment invoice information in
10
- # the Brazil marketplace for a selling partner’s Fulfillment by Amazon (FBA) orders.
11
- class ShipmentInvoicingV0 < API
12
- # Returns the shipment details required to issue an invoice for the specified shipment.
13
- #
14
- # @param [String] shipment_id The identifier for the shipment. Get this value from the FBAOutboundShipmentStatus
15
- # notification. For information about subscribing to notifications, see the [Notifications API Use Case
16
- # Guide](doc:notifications-api-v1-use-case-guide).
17
- # @return [Hash] The API response
18
- def get_shipment_details(shipment_id)
19
- path = "/fba/outbound/brazil/v0/shipments/#{shipment_id}"
20
-
21
- rate_limit(1.133).get(path)
22
- end
23
-
24
- # Submits a shipment invoice document for a given shipment.
25
- #
26
- # @param [String] shipment_id The identifier for the shipment.
27
- # @param [Hash] body
28
- # @return [Hash] The API response
29
- def submit_invoice(shipment_id, body)
30
- path = "/fba/outbound/brazil/v0/shipments/#{shipment_id}/invoice"
31
-
32
- rate_limit(1.133).post(path, body:)
33
- end
34
-
35
- # Returns the invoice status for the shipment you specify.
36
- #
37
- # @param [String] shipment_id The shipment identifier for the shipment.
38
- # @return [Hash] The API response
39
- def get_invoice_status(shipment_id)
40
- path = "/fba/outbound/brazil/v0/shipments/#{shipment_id}/invoice/status"
41
-
42
- rate_limit(1.133).get(path)
43
- end
44
- end
45
- end
46
- end