peddler 5.0.0 → 5.1.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 +6 -6
- data/lib/peddler/acronyms.rb +1 -0
- data/lib/peddler/api.rb +35 -62
- data/lib/peddler/apis/amazon_warehousing_and_distribution_2024_05_09.rb +11 -11
- data/lib/peddler/apis/aplus_content_2020_11_01.rb +10 -10
- data/lib/peddler/apis/application_integrations_2024_04_01.rb +3 -3
- data/lib/peddler/apis/application_management_2023_11_30.rb +1 -1
- data/lib/peddler/apis/catalog_items_2020_12_01.rb +2 -2
- data/lib/peddler/apis/catalog_items_2022_04_01.rb +2 -2
- data/lib/peddler/apis/catalog_items_v0.rb +1 -1
- data/lib/peddler/apis/data_kiosk_2023_11_15.rb +5 -5
- data/lib/peddler/apis/delivery_by_amazon_2022_07_01/error.rb +23 -0
- data/lib/peddler/apis/delivery_by_amazon_2022_07_01/error_list.rb +18 -0
- data/lib/peddler/apis/delivery_by_amazon_2022_07_01/get_invoice_status_response.rb +26 -0
- data/lib/peddler/apis/delivery_by_amazon_2022_07_01/submit_invoice_request.rb +31 -0
- data/lib/peddler/apis/delivery_by_amazon_2022_07_01/submit_invoice_response.rb +17 -0
- data/lib/peddler/apis/delivery_by_amazon_2022_07_01.rb +59 -0
- data/lib/peddler/apis/easy_ship_2022_03_23.rb +5 -5
- data/lib/peddler/apis/external_fulfillment_shipments_2024_09_11/shipment.rb +3 -0
- data/lib/peddler/apis/fba_inbound_eligibility_v1.rb +1 -1
- data/lib/peddler/apis/fba_inventory_v1.rb +1 -1
- data/lib/peddler/apis/feeds_2021_06_30.rb +6 -6
- data/lib/peddler/apis/finances_2024_06_19/amazon_pay_context.rb +2 -2
- data/lib/peddler/apis/finances_2024_06_19/breakdown.rb +3 -4
- data/lib/peddler/apis/finances_2024_06_19/context.rb +11 -11
- data/lib/peddler/apis/finances_2024_06_19/contexts.rb +1 -1
- data/lib/peddler/apis/finances_2024_06_19/deferred_context.rb +1 -1
- data/lib/peddler/apis/finances_2024_06_19/error.rb +1 -1
- data/lib/peddler/apis/finances_2024_06_19/error_list.rb +1 -1
- data/lib/peddler/apis/finances_2024_06_19/item.rb +3 -3
- data/lib/peddler/apis/finances_2024_06_19/item_related_identifier.rb +1 -1
- data/lib/peddler/apis/finances_2024_06_19/item_related_identifiers.rb +1 -1
- data/lib/peddler/apis/finances_2024_06_19/items.rb +1 -1
- data/lib/peddler/apis/finances_2024_06_19/marketplace_details.rb +2 -3
- data/lib/peddler/apis/finances_2024_06_19/payments_context.rb +5 -5
- data/lib/peddler/apis/finances_2024_06_19/product_context.rb +4 -4
- data/lib/peddler/apis/finances_2024_06_19/related_identifier.rb +2 -2
- data/lib/peddler/apis/finances_2024_06_19/selling_partner_metadata.rb +3 -3
- data/lib/peddler/apis/finances_2024_06_19/time_range_context.rb +3 -3
- data/lib/peddler/apis/finances_2024_06_19/transaction.rb +8 -10
- data/lib/peddler/apis/finances_2024_06_19/transactions.rb +1 -1
- data/lib/peddler/apis/finances_2024_06_19/transactions_payload.rb +4 -2
- data/lib/peddler/apis/finances_2024_06_19.rb +24 -13
- data/lib/peddler/apis/finances_v0/adhoc_disbursement_event.rb +1 -3
- data/lib/peddler/apis/finances_v0/adjustment_event.rb +11 -18
- data/lib/peddler/apis/finances_v0/adjustment_item.rb +3 -3
- data/lib/peddler/apis/finances_v0/affordability_expense_event.rb +6 -7
- data/lib/peddler/apis/finances_v0/capacity_reservation_billing_event.rb +1 -1
- data/lib/peddler/apis/finances_v0/charge_component.rb +37 -35
- data/lib/peddler/apis/finances_v0/charge_refund_event.rb +2 -6
- data/lib/peddler/apis/finances_v0/coupon_payment_event.rb +1 -1
- data/lib/peddler/apis/finances_v0/debt_recovery_event.rb +1 -5
- data/lib/peddler/apis/finances_v0/debt_recovery_item.rb +4 -4
- data/lib/peddler/apis/finances_v0/direct_payment.rb +7 -7
- data/lib/peddler/apis/finances_v0/ebt_refund_reimbursement_only_event.rb +23 -0
- data/lib/peddler/apis/finances_v0/ebt_refund_reimbursement_only_event_list.rb +18 -0
- data/lib/peddler/apis/finances_v0/failed_adhoc_disbursement_event.rb +3 -9
- data/lib/peddler/apis/finances_v0/failed_adhoc_disbursement_event_list.rb +1 -1
- data/lib/peddler/apis/finances_v0/fba_liquidation_event.rb +1 -1
- data/lib/peddler/apis/finances_v0/financial_event_group.rb +5 -7
- data/lib/peddler/apis/finances_v0/financial_events.rb +4 -1
- data/lib/peddler/apis/finances_v0/list_financial_event_groups_payload.rb +1 -1
- data/lib/peddler/apis/finances_v0/list_financial_event_groups_response.rb +3 -3
- data/lib/peddler/apis/finances_v0/list_financial_events_payload.rb +1 -1
- data/lib/peddler/apis/finances_v0/list_financial_events_response.rb +3 -3
- data/lib/peddler/apis/finances_v0/loan_servicing_event.rb +3 -3
- data/lib/peddler/apis/finances_v0/network_commingling_transaction_event.rb +3 -3
- data/lib/peddler/apis/finances_v0/pay_with_amazon_event.rb +5 -5
- data/lib/peddler/apis/finances_v0/product_ads_payment_event.rb +4 -4
- data/lib/peddler/apis/finances_v0/removal_shipment_adjustment_event.rb +2 -2
- data/lib/peddler/apis/finances_v0/removal_shipment_adjustment_event_list.rb +1 -1
- data/lib/peddler/apis/finances_v0/removal_shipment_event.rb +2 -2
- data/lib/peddler/apis/finances_v0/removal_shipment_item.rb +5 -6
- data/lib/peddler/apis/finances_v0/removal_shipment_item_adjustment.rb +8 -9
- data/lib/peddler/apis/finances_v0/removal_shipment_item_list.rb +1 -1
- data/lib/peddler/apis/finances_v0/rental_transaction_event.rb +17 -16
- data/lib/peddler/apis/finances_v0/retrocharge_event.rb +2 -2
- data/lib/peddler/apis/finances_v0/retrocharge_event_list.rb +1 -1
- data/lib/peddler/apis/finances_v0/safet_reimbursement_event_list.rb +1 -1
- data/lib/peddler/apis/finances_v0/safet_reimbursement_item_list.rb +1 -1
- data/lib/peddler/apis/finances_v0/seller_deal_payment_event.rb +2 -2
- data/lib/peddler/apis/finances_v0/seller_review_enrollment_payment_event.rb +1 -1
- data/lib/peddler/apis/finances_v0/solution_provider_credit_event.rb +1 -1
- data/lib/peddler/apis/finances_v0/solution_provider_credit_event_list.rb +1 -1
- data/lib/peddler/apis/finances_v0/tax_withheld_component.rb +2 -3
- data/lib/peddler/apis/finances_v0/tax_withholding_event.rb +1 -1
- data/lib/peddler/apis/finances_v0/tax_withholding_event_list.rb +1 -1
- data/lib/peddler/apis/finances_v0/tax_withholding_period.rb +1 -1
- data/lib/peddler/apis/finances_v0/value_added_service_charge_event.rb +1 -3
- data/lib/peddler/apis/finances_v0.rb +60 -47
- data/lib/peddler/apis/fulfillment_inbound_2024_03_20/delivery_window_option.rb +2 -1
- data/lib/peddler/apis/fulfillment_inbound_2024_03_20/selected_delivery_window.rb +2 -1
- data/lib/peddler/apis/fulfillment_inbound_2024_03_20.rb +90 -142
- data/lib/peddler/apis/fulfillment_inbound_v0.rb +6 -6
- data/lib/peddler/apis/fulfillment_outbound_2020_07_01.rb +14 -17
- data/lib/peddler/apis/invoices_2024_06_19.rb +7 -7
- data/lib/peddler/apis/listings_items_2020_09_01.rb +3 -3
- data/lib/peddler/apis/listings_items_2021_08_01.rb +5 -5
- data/lib/peddler/apis/listings_restrictions_2021_08_01.rb +1 -1
- data/lib/peddler/apis/merchant_fulfillment_v0.rb +5 -5
- data/lib/peddler/apis/messaging_v1.rb +11 -11
- data/lib/peddler/apis/notifications_v1.rb +8 -8
- data/lib/peddler/apis/orders_v0/buyer_info.rb +0 -3
- data/lib/peddler/apis/orders_v0/order_buyer_info.rb +0 -3
- data/lib/peddler/apis/orders_v0.rb +12 -15
- data/lib/peddler/apis/product_fees_v0.rb +3 -3
- data/lib/peddler/apis/product_pricing_2022_05_01.rb +2 -2
- data/lib/peddler/apis/product_pricing_v0.rb +6 -6
- data/lib/peddler/apis/product_type_definitions_2020_09_01.rb +2 -2
- data/lib/peddler/apis/replenishment_2022_11_07/get_selling_partner_metrics_response_metric.rb +66 -22
- data/lib/peddler/apis/replenishment_2022_11_07/list_offer_metrics_response_offer.rb +13 -13
- data/lib/peddler/apis/replenishment_2022_11_07.rb +3 -3
- data/lib/peddler/apis/reports_2021_06_30.rb +9 -9
- data/lib/peddler/apis/sales_v1.rb +1 -1
- data/lib/peddler/apis/seller_wallet_2024_03_01/bank_account.rb +23 -18
- data/lib/peddler/apis/seller_wallet_2024_03_01/payee_contact_information.rb +54 -0
- data/lib/peddler/apis/seller_wallet_2024_03_01/transaction.rb +7 -3
- data/lib/peddler/apis/seller_wallet_2024_03_01/transaction_initiation_request.rb +3 -3
- data/lib/peddler/apis/seller_wallet_2024_03_01.rb +7 -2
- data/lib/peddler/apis/sellers_v1.rb +2 -2
- data/lib/peddler/apis/services_v1.rb +17 -17
- data/lib/peddler/apis/shipment_invoicing_v0.rb +3 -3
- data/lib/peddler/apis/shipping_v1.rb +9 -9
- data/lib/peddler/apis/shipping_v2.rb +19 -19
- data/lib/peddler/apis/solicitations_v1.rb +2 -2
- data/lib/peddler/apis/tokens_2021_03_01.rb +1 -1
- data/lib/peddler/apis/transfers_2024_06_01.rb +2 -2
- data/lib/peddler/apis/uploads_2020_11_01.rb +1 -1
- data/lib/peddler/apis/vendor_direct_fulfillment_inventory_v1.rb +1 -1
- data/lib/peddler/apis/vendor_direct_fulfillment_orders_2021_12_28.rb +3 -3
- data/lib/peddler/apis/vendor_direct_fulfillment_orders_v1.rb +3 -3
- data/lib/peddler/apis/vendor_direct_fulfillment_payments_v1.rb +1 -1
- data/lib/peddler/apis/vendor_direct_fulfillment_shipping_2021_12_28.rb +11 -11
- data/lib/peddler/apis/vendor_direct_fulfillment_shipping_v1.rb +9 -9
- data/lib/peddler/apis/vendor_direct_fulfillment_transactions_2021_12_28.rb +1 -1
- data/lib/peddler/apis/vendor_direct_fulfillment_transactions_v1.rb +1 -1
- data/lib/peddler/apis/vendor_invoices_v1.rb +1 -1
- data/lib/peddler/apis/vendor_orders_v1.rb +4 -4
- data/lib/peddler/apis/vendor_shipments_v1/package_item_details.rb +16 -0
- data/lib/peddler/apis/vendor_shipments_v1/regulation_references.rb +32 -0
- data/lib/peddler/apis/vendor_shipments_v1.rb +5 -5
- data/lib/peddler/apis/vendor_transaction_status_v1.rb +1 -1
- data/lib/peddler/data_kiosk/economics20240315/analytics_economics20240315.rb +5 -0
- data/lib/peddler/data_kiosk/economics20240315.json +340 -7
- data/lib/peddler/data_kiosk/vendor_analytics20240930/traffic.rb +5 -0
- data/lib/peddler/data_kiosk/vendor_analytics20240930.json +12 -0
- data/lib/peddler/response.rb +1 -1
- data/lib/peddler/version.rb +1 -1
- data/lib/peddler.rb +2 -0
- data/sig/peddler/api.rbs +13 -23
- data/sig/peddler/apis/delivery_by_amazon_2022_07_01.rbs +85 -0
- data/sig/peddler/apis/external_fulfillment_shipments_2024_09_11.rbs +8 -7
- data/sig/peddler/apis/finances_2024_06_19.rbs +1 -1
- data/sig/peddler/apis/finances_v0.rbs +30 -7
- data/sig/peddler/apis/fulfillment_inbound_2024_03_20.rbs +45 -45
- data/sig/peddler/apis/fulfillment_outbound_2020_07_01.rbs +1 -1
- data/sig/peddler/apis/orders_v0.rbs +15 -17
- data/sig/peddler/apis/replenishment_2022_11_07.rbs +18 -7
- data/sig/peddler/apis/seller_wallet_2024_03_01.rbs +49 -42
- data/sig/peddler/apis/vendor_shipments_v1.rbs +30 -41
- data/sig/peddler/data_kiosk/economics20240315.rbs +8 -7
- data/sig/peddler/data_kiosk/vendor_analytics20240930.rbs +8 -7
- data/sig/peddler.rbs +4 -0
- metadata +13 -5
- data/lib/peddler/apis/seller_wallet_2024_03_01/account_holder_address.rb +0 -36
- data/lib/peddler/apis/vendor_shipments_v1/packed_quantity.rb +0 -25
- data/lib/peddler/apis/vendor_shipments_v1/purchase_order_item_details.rb +0 -18
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is generated. Do not edit.
|
|
4
|
+
|
|
5
|
+
module Peddler
|
|
6
|
+
module APIs
|
|
7
|
+
# Selling Partner API for Delivery Shipment Invoicing
|
|
8
|
+
#
|
|
9
|
+
# The Selling Partner API for Delivery Shipment Invoicing helps you programmatically retrieve shipment invoice
|
|
10
|
+
# information in the Brazil marketplace for a selling partner’s orders.
|
|
11
|
+
#
|
|
12
|
+
# @see https://github.com/amzn/selling-partner-api-models/blob/main/models/delivery-by-amazon/deliveryShipmentInvoiceV2022-07-01.json
|
|
13
|
+
class DeliveryByAmazon20220701 < API
|
|
14
|
+
# Submits a shipment invoice for a given order or shipment. You must specify either an `orderId` or `shipmentId`
|
|
15
|
+
# as query parameter. If both parameters are supplied, `orderId` takes precedence over `shipmentId`.
|
|
16
|
+
#
|
|
17
|
+
# @note This operation can make a static sandbox call.
|
|
18
|
+
# @param order_id [String] The identifier for the order.
|
|
19
|
+
# @param shipment_id [String] The identifier for the shipment.
|
|
20
|
+
# @param body [Hash] The request body that specifies invoice, program and marketplace values.
|
|
21
|
+
# @param rate_limit [Float] Requests per second
|
|
22
|
+
# @return [Peddler::Response] The API response
|
|
23
|
+
def submit_invoice(body, order_id: nil, shipment_id: nil, rate_limit: 1.133)
|
|
24
|
+
path = "/delivery/2022-07-01/invoice"
|
|
25
|
+
params = {
|
|
26
|
+
"orderId" => order_id,
|
|
27
|
+
"shipmentId" => shipment_id,
|
|
28
|
+
}.compact
|
|
29
|
+
parser = -> { SubmitInvoiceResponse }
|
|
30
|
+
post(path, body:, params:, rate_limit:, parser:)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Returns the invoice status for the order or shipment you specify. You must specify either an `orderId` or
|
|
34
|
+
# `shipmentId` as query parameter. If both parameters are supplied, `orderId` takes precedence over `shipmentId`.
|
|
35
|
+
#
|
|
36
|
+
# @note This operation can make a static sandbox call.
|
|
37
|
+
# @param order_id [String] The order identifier.
|
|
38
|
+
# @param shipment_id [String] The shipment identifier.
|
|
39
|
+
# @param marketplace_id [String] The marketplace identifier.
|
|
40
|
+
# @param invoice_type [String] The invoice's type.
|
|
41
|
+
# @param program_type [String] The Amazon program that seller is currently enrolled.
|
|
42
|
+
# @param rate_limit [Float] Requests per second
|
|
43
|
+
# @return [Peddler::Response] The API response
|
|
44
|
+
def get_invoice_status(marketplace_id, invoice_type, program_type, order_id: nil, shipment_id: nil,
|
|
45
|
+
rate_limit: 1.133)
|
|
46
|
+
path = "/delivery/2022-07-01/invoice/status"
|
|
47
|
+
params = {
|
|
48
|
+
"orderId" => order_id,
|
|
49
|
+
"shipmentId" => shipment_id,
|
|
50
|
+
"marketplaceId" => marketplace_id,
|
|
51
|
+
"invoiceType" => invoice_type,
|
|
52
|
+
"programType" => program_type,
|
|
53
|
+
}.compact
|
|
54
|
+
parser = -> { GetInvoiceStatusResponse }
|
|
55
|
+
get(path, params:, rate_limit:, parser:)
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
@@ -35,7 +35,7 @@ module Peddler
|
|
|
35
35
|
path = "/easyShip/2022-03-23/timeSlot"
|
|
36
36
|
body = list_handover_slots_request
|
|
37
37
|
parser = -> { ListHandoverSlotsResponse }
|
|
38
|
-
|
|
38
|
+
post(path, body:, rate_limit:, parser:)
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
# Returns information about a package, including dimensions, weight, time slot information for handover, invoice
|
|
@@ -54,7 +54,7 @@ module Peddler
|
|
|
54
54
|
"marketplaceId" => marketplace_id,
|
|
55
55
|
}.compact
|
|
56
56
|
parser = -> { Package }
|
|
57
|
-
|
|
57
|
+
get(path, params:, rate_limit:, parser:)
|
|
58
58
|
end
|
|
59
59
|
|
|
60
60
|
# Schedules an Easy Ship order and returns the scheduled package information.
|
|
@@ -85,7 +85,7 @@ module Peddler
|
|
|
85
85
|
path = "/easyShip/2022-03-23/package"
|
|
86
86
|
body = create_scheduled_package_request
|
|
87
87
|
parser = -> { Package }
|
|
88
|
-
|
|
88
|
+
post(path, body:, rate_limit:, parser:)
|
|
89
89
|
end
|
|
90
90
|
|
|
91
91
|
# Updates the time slot for handing over the package indicated by the specified `scheduledPackageId`. You can get
|
|
@@ -104,7 +104,7 @@ module Peddler
|
|
|
104
104
|
path = "/easyShip/2022-03-23/package"
|
|
105
105
|
body = update_scheduled_packages_request
|
|
106
106
|
parser = -> { Packages }
|
|
107
|
-
|
|
107
|
+
patch(path, body:, rate_limit:, parser:)
|
|
108
108
|
end
|
|
109
109
|
|
|
110
110
|
# This operation automatically schedules a time slot for all the `amazonOrderId`s given as input, generating the
|
|
@@ -137,7 +137,7 @@ module Peddler
|
|
|
137
137
|
path = "/easyShip/2022-03-23/packages/bulk"
|
|
138
138
|
body = create_scheduled_packages_request
|
|
139
139
|
parser = -> { CreateScheduledPackagesResponse }
|
|
140
|
-
|
|
140
|
+
post(path, body:, rate_limit:, parser:)
|
|
141
141
|
end
|
|
142
142
|
end
|
|
143
143
|
end
|
|
@@ -58,6 +58,9 @@ module Peddler
|
|
|
58
58
|
# seller. Applicable for direct-fulfillment sellers.
|
|
59
59
|
attribute?(:party_info_list, [PartyIdentificationInfo], from: "partyInfoList")
|
|
60
60
|
|
|
61
|
+
# @return [String] The reason for the sub-status.
|
|
62
|
+
attribute?(:reason, String)
|
|
63
|
+
|
|
61
64
|
# @return [String] The sub status of the shipment.
|
|
62
65
|
attribute?(:sub_status, String, from: "subStatus")
|
|
63
66
|
end
|
|
@@ -61,7 +61,7 @@ module Peddler
|
|
|
61
61
|
"marketplaceIds" => stringify_array(marketplace_ids),
|
|
62
62
|
}.compact
|
|
63
63
|
parser = -> { GetInventorySummariesResponse }
|
|
64
|
-
|
|
64
|
+
get(path, params:, rate_limit:, parser:)
|
|
65
65
|
end
|
|
66
66
|
|
|
67
67
|
# Requests that Amazon create product-details in the Sandbox Inventory in the sandbox environment. This is a
|
|
@@ -45,7 +45,7 @@ module Peddler
|
|
|
45
45
|
"nextToken" => next_token,
|
|
46
46
|
}.compact
|
|
47
47
|
parser = -> { GetFeedsResponse }
|
|
48
|
-
|
|
48
|
+
get(path, params:, rate_limit:, parser:)
|
|
49
49
|
end
|
|
50
50
|
|
|
51
51
|
# Creates a feed. Upload the contents of the feed document before calling this operation.
|
|
@@ -57,7 +57,7 @@ module Peddler
|
|
|
57
57
|
def create_feed(body, rate_limit: 0.0083)
|
|
58
58
|
path = "/feeds/2021-06-30/feeds"
|
|
59
59
|
parser = -> { CreateFeedResponse }
|
|
60
|
-
|
|
60
|
+
post(path, body:, rate_limit:, parser:)
|
|
61
61
|
end
|
|
62
62
|
|
|
63
63
|
# Cancels the feed that you specify. Only feeds with `processingStatus=IN_QUEUE` can be cancelled. Cancelled feeds
|
|
@@ -71,7 +71,7 @@ module Peddler
|
|
|
71
71
|
# @return [Peddler::Response] The API response
|
|
72
72
|
def cancel_feed(feed_id, rate_limit: 2.0)
|
|
73
73
|
path = "/feeds/2021-06-30/feeds/#{percent_encode(feed_id)}"
|
|
74
|
-
|
|
74
|
+
delete(path, rate_limit:)
|
|
75
75
|
end
|
|
76
76
|
|
|
77
77
|
# Returns feed details (including the `resultDocumentId`, if available) for the feed that you specify.
|
|
@@ -84,7 +84,7 @@ module Peddler
|
|
|
84
84
|
def get_feed(feed_id, rate_limit: 2.0)
|
|
85
85
|
path = "/feeds/2021-06-30/feeds/#{percent_encode(feed_id)}"
|
|
86
86
|
parser = -> { Feed }
|
|
87
|
-
|
|
87
|
+
get(path, rate_limit:, parser:)
|
|
88
88
|
end
|
|
89
89
|
|
|
90
90
|
# Creates a feed document for the feed type that you specify. This operation returns a presigned URL for uploading
|
|
@@ -98,7 +98,7 @@ module Peddler
|
|
|
98
98
|
def create_feed_document(body, rate_limit: 0.5)
|
|
99
99
|
path = "/feeds/2021-06-30/documents"
|
|
100
100
|
parser = -> { CreateFeedDocumentResponse }
|
|
101
|
-
|
|
101
|
+
post(path, body:, rate_limit:, parser:)
|
|
102
102
|
end
|
|
103
103
|
|
|
104
104
|
# Returns the information required for retrieving a feed document's contents.
|
|
@@ -110,7 +110,7 @@ module Peddler
|
|
|
110
110
|
def get_feed_document(feed_document_id, rate_limit: 0.0222)
|
|
111
111
|
path = "/feeds/2021-06-30/documents/#{percent_encode(feed_document_id)}"
|
|
112
112
|
parser = -> { FeedDocument }
|
|
113
|
-
|
|
113
|
+
get(path, rate_limit:, parser:)
|
|
114
114
|
end
|
|
115
115
|
end
|
|
116
116
|
end
|
|
@@ -12,10 +12,10 @@ module Peddler
|
|
|
12
12
|
# @return [String] Channel details of related transaction.
|
|
13
13
|
attribute?(:channel, String)
|
|
14
14
|
|
|
15
|
-
# @return [String]
|
|
15
|
+
# @return [String] The transaction's order type.
|
|
16
16
|
attribute?(:order_type, String, from: "orderType")
|
|
17
17
|
|
|
18
|
-
# @return [String]
|
|
18
|
+
# @return [String] The name of the store that is related to the transaction.
|
|
19
19
|
attribute?(:store_name, String, from: "storeName")
|
|
20
20
|
end
|
|
21
21
|
end
|
|
@@ -7,11 +7,10 @@ require "structure"
|
|
|
7
7
|
module Peddler
|
|
8
8
|
module APIs
|
|
9
9
|
class Finances20240619
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
# structure.
|
|
10
|
+
# Details about the movement of money in the financial transaction. Breakdowns are further categorized into
|
|
11
|
+
# breakdown types, breakdown amounts, and further breakdowns.
|
|
13
12
|
Breakdown = Structure.new do
|
|
14
|
-
# @return [Money] The amount of the charge.
|
|
13
|
+
# @return [Money] The monetary amount of the charge.
|
|
15
14
|
attribute?(:breakdown_amount, Money, from: "breakdownAmount")
|
|
16
15
|
|
|
17
16
|
# @return [String] The type of charge.
|
|
@@ -12,7 +12,7 @@ module Peddler
|
|
|
12
12
|
# @return [String]
|
|
13
13
|
attribute(:context_type, String, from: "contextType")
|
|
14
14
|
|
|
15
|
-
# @return [String] Amazon Standard Identification Number (ASIN) of the item.
|
|
15
|
+
# @return [String] The Amazon Standard Identification Number (ASIN) of the item.
|
|
16
16
|
attribute?(:asin, String)
|
|
17
17
|
|
|
18
18
|
# @return [String] Channel details of related transaction.
|
|
@@ -23,37 +23,37 @@ module Peddler
|
|
|
23
23
|
# **Examples:** `B2B` (invoiced orders), `DD7` (delivery date policy)
|
|
24
24
|
attribute?(:deferral_reason, String, from: "deferralReason")
|
|
25
25
|
|
|
26
|
-
# @return [String]
|
|
26
|
+
# @return [String] The end time of the transaction.
|
|
27
27
|
attribute?(:end_time, String, from: "endTime")
|
|
28
28
|
|
|
29
|
-
# @return [String]
|
|
29
|
+
# @return [String] The fulfillment network of the item.
|
|
30
30
|
attribute?(:fulfillment_network, String, from: "fulfillmentNetwork")
|
|
31
31
|
|
|
32
32
|
# @return [String] The release date of the transaction.
|
|
33
33
|
attribute?(:maturity_date, String, from: "maturityDate")
|
|
34
34
|
|
|
35
|
-
# @return [String]
|
|
35
|
+
# @return [String] The transaction's order type.
|
|
36
36
|
attribute?(:order_type, String, from: "orderType")
|
|
37
37
|
|
|
38
|
-
# @return [String]
|
|
38
|
+
# @return [String] The date of the payment.
|
|
39
39
|
attribute?(:payment_date, String, from: "paymentDate")
|
|
40
40
|
|
|
41
|
-
# @return [String]
|
|
41
|
+
# @return [String] The method of payment.
|
|
42
42
|
attribute?(:payment_method, String, from: "paymentMethod")
|
|
43
43
|
|
|
44
|
-
# @return [String]
|
|
44
|
+
# @return [String] The reference number of the payment.
|
|
45
45
|
attribute?(:payment_reference, String, from: "paymentReference")
|
|
46
46
|
|
|
47
|
-
# @return [String]
|
|
47
|
+
# @return [String] The type of payment.
|
|
48
48
|
attribute?(:payment_type, String, from: "paymentType")
|
|
49
49
|
|
|
50
|
-
# @return [Integer]
|
|
50
|
+
# @return [Integer] The quantity of the item shipped.
|
|
51
51
|
attribute?(:quantity_shipped, Integer, from: "quantityShipped")
|
|
52
52
|
|
|
53
|
-
# @return [String] Stock
|
|
53
|
+
# @return [String] The Stock Keeping Unit (SKU) of the item.
|
|
54
54
|
attribute?(:sku, String)
|
|
55
55
|
|
|
56
|
-
# @return [String]
|
|
56
|
+
# @return [String] The start time of the transaction.
|
|
57
57
|
attribute?(:start_time, String, from: "startTime")
|
|
58
58
|
|
|
59
59
|
# @return [String] The store name associated with the transaction.
|
|
@@ -7,7 +7,7 @@ require "structure"
|
|
|
7
7
|
module Peddler
|
|
8
8
|
module APIs
|
|
9
9
|
class Finances20240619
|
|
10
|
-
# Additional information related to
|
|
10
|
+
# Additional information related to deferred transactions.
|
|
11
11
|
DeferredContext = Structure.new do
|
|
12
12
|
# @return [String] The deferral policy applied to the transaction.
|
|
13
13
|
#
|
|
@@ -7,7 +7,7 @@ require "structure"
|
|
|
7
7
|
module Peddler
|
|
8
8
|
module APIs
|
|
9
9
|
class Finances20240619
|
|
10
|
-
#
|
|
10
|
+
# An error response returned when the request is unsuccessful.
|
|
11
11
|
Error = Structure.new do
|
|
12
12
|
# @return [String] An error code that identifies the type of error that occurred.
|
|
13
13
|
attribute(:code, String)
|
|
@@ -9,7 +9,7 @@ module Peddler
|
|
|
9
9
|
class Finances20240619
|
|
10
10
|
# A list of error responses returned when a request is unsuccessful.
|
|
11
11
|
ErrorList = Structure.new do
|
|
12
|
-
# @return [Array<Error>]
|
|
12
|
+
# @return [Array<Error>] The error responses that are returned when the request is unsuccessful.
|
|
13
13
|
attribute(:errors, [Error])
|
|
14
14
|
end
|
|
15
15
|
end
|
|
@@ -7,7 +7,7 @@ require "structure"
|
|
|
7
7
|
module Peddler
|
|
8
8
|
module APIs
|
|
9
9
|
class Finances20240619
|
|
10
|
-
# Additional information about the items in
|
|
10
|
+
# Additional information about the items in a transaction.
|
|
11
11
|
Item = Structure.new do
|
|
12
12
|
# @return [Array<Breakdown>] A list of breakdowns that detail how the total amount is calculated for the
|
|
13
13
|
# transaction.
|
|
@@ -16,13 +16,13 @@ module Peddler
|
|
|
16
16
|
# @return [Array<Context>] Additional Information about the item.
|
|
17
17
|
attribute?(:contexts, [Context])
|
|
18
18
|
|
|
19
|
-
# @return [String]
|
|
19
|
+
# @return [String] A description of the items in a transaction.
|
|
20
20
|
attribute?(:description, String)
|
|
21
21
|
|
|
22
22
|
# @return [Array<ItemRelatedIdentifier>] Related business identifiers of the item.
|
|
23
23
|
attribute?(:related_identifiers, [ItemRelatedIdentifier], from: "relatedIdentifiers")
|
|
24
24
|
|
|
25
|
-
# @return [Money] The total amount of the item.
|
|
25
|
+
# @return [Money] The total monetary amount of the item.
|
|
26
26
|
attribute?(:total_amount, Money, from: "totalAmount")
|
|
27
27
|
end
|
|
28
28
|
end
|
|
@@ -12,7 +12,7 @@ module Peddler
|
|
|
12
12
|
# @return [String] Enumerated set of related item identifier names for the item.
|
|
13
13
|
attribute?(:item_related_identifier_name, String, from: "itemRelatedIdentifierName")
|
|
14
14
|
|
|
15
|
-
# @return [String] Corresponding value
|
|
15
|
+
# @return [String] Corresponding value to `ItemRelatedIdentifierName`.
|
|
16
16
|
attribute?(:item_related_identifier_value, String, from: "itemRelatedIdentifierValue")
|
|
17
17
|
end
|
|
18
18
|
end
|
|
@@ -14,9 +14,8 @@ module Peddler
|
|
|
14
14
|
# IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
|
|
15
15
|
attribute?(:marketplace_id, String, from: "marketplaceId")
|
|
16
16
|
|
|
17
|
-
# @return [String] The name of the marketplace where the transaction occurred.
|
|
18
|
-
#
|
|
19
|
-
# Example: 'Amazon.com','Amazon.in'
|
|
17
|
+
# @return [String] The name of the marketplace where the transaction occurred. For example:
|
|
18
|
+
# `Amazon.com`,`Amazon.in`
|
|
20
19
|
attribute?(:marketplace_name, String, from: "marketplaceName")
|
|
21
20
|
end
|
|
22
21
|
end
|
|
@@ -7,18 +7,18 @@ require "structure"
|
|
|
7
7
|
module Peddler
|
|
8
8
|
module APIs
|
|
9
9
|
class Finances20240619
|
|
10
|
-
# Additional information related to
|
|
10
|
+
# Additional information related to payments-related transactions.
|
|
11
11
|
PaymentsContext = Structure.new do
|
|
12
|
-
# @return [String]
|
|
12
|
+
# @return [String] The date of the payment.
|
|
13
13
|
attribute?(:payment_date, String, from: "paymentDate")
|
|
14
14
|
|
|
15
|
-
# @return [String]
|
|
15
|
+
# @return [String] The method of payment.
|
|
16
16
|
attribute?(:payment_method, String, from: "paymentMethod")
|
|
17
17
|
|
|
18
|
-
# @return [String]
|
|
18
|
+
# @return [String] The reference number of the payment.
|
|
19
19
|
attribute?(:payment_reference, String, from: "paymentReference")
|
|
20
20
|
|
|
21
|
-
# @return [String]
|
|
21
|
+
# @return [String] The type of payment.
|
|
22
22
|
attribute?(:payment_type, String, from: "paymentType")
|
|
23
23
|
end
|
|
24
24
|
end
|
|
@@ -9,16 +9,16 @@ module Peddler
|
|
|
9
9
|
class Finances20240619
|
|
10
10
|
# Additional information related to the product.
|
|
11
11
|
ProductContext = Structure.new do
|
|
12
|
-
# @return [String] Amazon Standard Identification Number (ASIN) of the item.
|
|
12
|
+
# @return [String] The Amazon Standard Identification Number (ASIN) of the item.
|
|
13
13
|
attribute?(:asin, String)
|
|
14
14
|
|
|
15
|
-
# @return [String]
|
|
15
|
+
# @return [String] The fulfillment network of the item.
|
|
16
16
|
attribute?(:fulfillment_network, String, from: "fulfillmentNetwork")
|
|
17
17
|
|
|
18
|
-
# @return [Integer]
|
|
18
|
+
# @return [Integer] The quantity of the item shipped.
|
|
19
19
|
attribute?(:quantity_shipped, Integer, from: "quantityShipped")
|
|
20
20
|
|
|
21
|
-
# @return [String] Stock
|
|
21
|
+
# @return [String] The Stock Keeping Unit (SKU) of the item.
|
|
22
22
|
attribute?(:sku, String)
|
|
23
23
|
end
|
|
24
24
|
end
|
|
@@ -9,10 +9,10 @@ module Peddler
|
|
|
9
9
|
class Finances20240619
|
|
10
10
|
# Related business identifier of the transaction.
|
|
11
11
|
RelatedIdentifier = Structure.new do
|
|
12
|
-
# @return [String]
|
|
12
|
+
# @return [String] An enumerated set of related business identifier names.
|
|
13
13
|
attribute?(:related_identifier_name, String, from: "relatedIdentifierName")
|
|
14
14
|
|
|
15
|
-
# @return [String] Corresponding value of RelatedIdentifierName
|
|
15
|
+
# @return [String] Corresponding value of `RelatedIdentifierName`.
|
|
16
16
|
attribute?(:related_identifier_value, String, from: "relatedIdentifierValue")
|
|
17
17
|
end
|
|
18
18
|
end
|
|
@@ -7,9 +7,9 @@ require "structure"
|
|
|
7
7
|
module Peddler
|
|
8
8
|
module APIs
|
|
9
9
|
class Finances20240619
|
|
10
|
-
# Metadata
|
|
10
|
+
# Metadata that describes the seller.
|
|
11
11
|
SellingPartnerMetadata = Structure.new do
|
|
12
|
-
# @return [String]
|
|
12
|
+
# @return [String] The type of account in the transaction.
|
|
13
13
|
attribute?(:account_type, String, from: "accountType")
|
|
14
14
|
|
|
15
15
|
# @return [String] The identifier of the marketplace where the transaction occurred. The marketplace ID is the
|
|
@@ -17,7 +17,7 @@ module Peddler
|
|
|
17
17
|
# IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
|
|
18
18
|
attribute?(:marketplace_id, String, from: "marketplaceId")
|
|
19
19
|
|
|
20
|
-
# @return [String]
|
|
20
|
+
# @return [String] A unique seller identifier.
|
|
21
21
|
attribute?(:selling_partner_id, String, from: "sellingPartnerId")
|
|
22
22
|
end
|
|
23
23
|
end
|
|
@@ -7,12 +7,12 @@ require "structure"
|
|
|
7
7
|
module Peddler
|
|
8
8
|
module APIs
|
|
9
9
|
class Finances20240619
|
|
10
|
-
# Additional information related to time range
|
|
10
|
+
# Additional information that is related to the time range of the transaction.
|
|
11
11
|
TimeRangeContext = Structure.new do
|
|
12
|
-
# @return [String]
|
|
12
|
+
# @return [String] The end time of the transaction.
|
|
13
13
|
attribute?(:end_time, String, from: "endTime")
|
|
14
14
|
|
|
15
|
-
# @return [String]
|
|
15
|
+
# @return [String] The start time of the transaction.
|
|
16
16
|
attribute?(:start_time, String, from: "startTime")
|
|
17
17
|
end
|
|
18
18
|
end
|
|
@@ -7,7 +7,7 @@ require "structure"
|
|
|
7
7
|
module Peddler
|
|
8
8
|
module APIs
|
|
9
9
|
class Finances20240619
|
|
10
|
-
#
|
|
10
|
+
# All the information related to a transaction.
|
|
11
11
|
Transaction = Structure.new do
|
|
12
12
|
# @return [Array<Breakdown>] A list of breakdowns that detail how the total amount is calculated for the
|
|
13
13
|
# transaction.
|
|
@@ -18,10 +18,10 @@ module Peddler
|
|
|
18
18
|
|
|
19
19
|
# @return [String] Describes the reasons for the transaction.
|
|
20
20
|
#
|
|
21
|
-
# Example
|
|
21
|
+
# **Example:** 'Order Payment', 'Refund Order'
|
|
22
22
|
attribute?(:description, String)
|
|
23
23
|
|
|
24
|
-
# @return [Array<Item>] Additional information about the items in
|
|
24
|
+
# @return [Array<Item>] Additional information about the items in the transaction.
|
|
25
25
|
attribute?(:items, [Item])
|
|
26
26
|
|
|
27
27
|
# @return [MarketplaceDetails] Information about the marketplace where the transaction occurred.
|
|
@@ -30,16 +30,16 @@ module Peddler
|
|
|
30
30
|
# @return [String] The date and time when the transaction was posted.
|
|
31
31
|
attribute?(:posted_date, String, from: "postedDate")
|
|
32
32
|
|
|
33
|
-
# @return [Array<RelatedIdentifier>]
|
|
33
|
+
# @return [Array<RelatedIdentifier>] Identifiers related to the transaction, such as order and shipment IDs.
|
|
34
34
|
attribute?(:related_identifiers, [RelatedIdentifier], from: "relatedIdentifiers")
|
|
35
35
|
|
|
36
|
-
# @return [SellingPartnerMetadata] Metadata
|
|
36
|
+
# @return [SellingPartnerMetadata] Metadata that describes the seller.
|
|
37
37
|
attribute?(:selling_partner_metadata, SellingPartnerMetadata, from: "sellingPartnerMetadata")
|
|
38
38
|
|
|
39
|
-
# @return [Money]
|
|
39
|
+
# @return [Money] The total amount of money in the transaction.
|
|
40
40
|
attribute?(:total_amount, Money, from: "totalAmount")
|
|
41
41
|
|
|
42
|
-
# @return [String] The unique identifier
|
|
42
|
+
# @return [String] The unique identifier of the transaction.
|
|
43
43
|
attribute?(:transaction_id, String, from: "transactionId")
|
|
44
44
|
|
|
45
45
|
# @return [String] The status of the transaction.
|
|
@@ -54,9 +54,7 @@ module Peddler
|
|
|
54
54
|
|
|
55
55
|
# @return [String] The type of transaction.
|
|
56
56
|
#
|
|
57
|
-
# Possible
|
|
58
|
-
#
|
|
59
|
-
# * Shipment
|
|
57
|
+
# **Possible value:** `Shipment`
|
|
60
58
|
attribute?(:transaction_type, String, from: "transactionType")
|
|
61
59
|
end
|
|
62
60
|
end
|
|
@@ -9,8 +9,10 @@ module Peddler
|
|
|
9
9
|
class Finances20240619
|
|
10
10
|
# The payload for the `listTransactions` operation.
|
|
11
11
|
TransactionsPayload = Structure.new do
|
|
12
|
-
# @return [String]
|
|
13
|
-
#
|
|
12
|
+
# @return [String] The response includes `nextToken` when the number of results exceeds the specified `pageSize`
|
|
13
|
+
# value. To get the next page of results, call the operation with this token and include the same arguments as
|
|
14
|
+
# the call that produced the token. To get a complete list, call this operation until `nextToken` is null.
|
|
15
|
+
# Note that this operation can return empty pages.
|
|
14
16
|
attribute?(:next_token, String, from: "nextToken")
|
|
15
17
|
|
|
16
18
|
# @return [Array<Transaction>]
|
|
@@ -6,9 +6,8 @@ module Peddler
|
|
|
6
6
|
module APIs
|
|
7
7
|
# The Selling Partner API for Finances
|
|
8
8
|
#
|
|
9
|
-
# The Selling Partner API for Finances
|
|
10
|
-
#
|
|
11
|
-
# closes.
|
|
9
|
+
# The Selling Partner API for Finances provides financial information relevant to a seller's business. You can
|
|
10
|
+
# obtain financial events for a given order or date range without having to wait until a statement period closes.
|
|
12
11
|
#
|
|
13
12
|
# @see https://github.com/amzn/selling-partner-api-models/blob/main/models/finances-api-model/finances_2024-06-19.json
|
|
14
13
|
class Finances20240619 < API
|
|
@@ -17,12 +16,13 @@ module Peddler
|
|
|
17
16
|
# @note This operation can make a static sandbox call.
|
|
18
17
|
# @param posted_after [String] The response includes financial events posted on or after this date. This date must
|
|
19
18
|
# be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The date-time must
|
|
20
|
-
# be more than two minutes before the time of the request.
|
|
21
|
-
#
|
|
22
|
-
#
|
|
23
|
-
#
|
|
24
|
-
#
|
|
25
|
-
#
|
|
19
|
+
# be more than two minutes before the time of the request. This field is required if you do not specify a
|
|
20
|
+
# related identifier.
|
|
21
|
+
# @param posted_before [String] The response includes financial events posted before (but not on) this date. This
|
|
22
|
+
# date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The
|
|
23
|
+
# date-time must be later than `PostedAfter` and more than two minutes before the request was submitted. If
|
|
24
|
+
# `PostedAfter` and `PostedBefore` are more than 180 days apart, the response is empty. **Default:** Two minutes
|
|
25
|
+
# before the time of the request.
|
|
26
26
|
# @param marketplace_id [String] The identifier of the marketplace from which you want to retrieve transactions.
|
|
27
27
|
# The marketplace ID is the globally unique identifier of a marketplace. To find the ID for your marketplace,
|
|
28
28
|
# refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
|
|
@@ -30,21 +30,32 @@ module Peddler
|
|
|
30
30
|
# transaction is currently deferred. * `RELEASED`: the transaction is currently released. * `DEFERRED_RELEASED`:
|
|
31
31
|
# the transaction was deferred in the past, but is now released. The status of a deferred transaction is updated
|
|
32
32
|
# to `DEFERRED_RELEASED` when the transaction is released.
|
|
33
|
-
# @param
|
|
33
|
+
# @param related_identifier_name [String] The name of the `relatedIdentifier`. **Possible values:** *
|
|
34
|
+
# `FINANCIAL_EVENT_GROUP_ID`: the financial event group ID associated with the transaction. **Note:**
|
|
35
|
+
# FINANCIAL_EVENT_GROUP_ID is the only `relatedIdentifier` with filtering capabilities at the moment. While
|
|
36
|
+
# other `relatedIdentifier` values will be included in the response when available, they cannot be used for
|
|
37
|
+
# filtering purposes.
|
|
38
|
+
# @param related_identifier_value [String] The value of the `relatedIdentifier`.
|
|
39
|
+
# @param next_token [String] The response includes `nextToken` when the number of results exceeds the specified
|
|
40
|
+
# `pageSize` value. To get the next page of results, call the operation with this token and include the same
|
|
41
|
+
# arguments as the call that produced the token. To get a complete list, call this operation until `nextToken`
|
|
42
|
+
# is null. Note that this operation can return empty pages.
|
|
34
43
|
# @param rate_limit [Float] Requests per second
|
|
35
44
|
# @return [Peddler::Response] The API response
|
|
36
|
-
def list_transactions(posted_after, posted_before: nil, marketplace_id: nil, transaction_status: nil,
|
|
37
|
-
next_token: nil, rate_limit: 0.5)
|
|
45
|
+
def list_transactions(posted_after: nil, posted_before: nil, marketplace_id: nil, transaction_status: nil,
|
|
46
|
+
related_identifier_name: nil, related_identifier_value: nil, next_token: nil, rate_limit: 0.5)
|
|
38
47
|
path = "/finances/2024-06-19/transactions"
|
|
39
48
|
params = {
|
|
40
49
|
"postedAfter" => posted_after,
|
|
41
50
|
"postedBefore" => posted_before,
|
|
42
51
|
"marketplaceId" => marketplace_id,
|
|
43
52
|
"transactionStatus" => transaction_status,
|
|
53
|
+
"relatedIdentifierName" => related_identifier_name,
|
|
54
|
+
"relatedIdentifierValue" => related_identifier_value,
|
|
44
55
|
"nextToken" => next_token,
|
|
45
56
|
}.compact
|
|
46
57
|
parser = -> { ListTransactionsResponse }
|
|
47
|
-
|
|
58
|
+
get(path, params:, rate_limit:, parser:)
|
|
48
59
|
end
|
|
49
60
|
end
|
|
50
61
|
end
|