Class: Peddler::APIs::FinancesV0

Inherits:
Peddler::API show all
Defined in:
lib/peddler/apis/finances_v0.rb,
lib/peddler/apis/finances_v0/error.rb,
lib/peddler/apis/finances_v0/promotion.rb,
lib/peddler/apis/finances_v0/error_list.rb,
lib/peddler/apis/finances_v0/fee_component.rb,
lib/peddler/apis/finances_v0/shipment_item.rb,
lib/peddler/apis/finances_v0/direct_payment.rb,
lib/peddler/apis/finances_v0/promotion_list.rb,
lib/peddler/apis/finances_v0/shipment_event.rb,
lib/peddler/apis/finances_v0/adjustment_item.rb,
lib/peddler/apis/finances_v0/adjustment_event.rb,
lib/peddler/apis/finances_v0/charge_component.rb,
lib/peddler/apis/finances_v0/financial_events.rb,
lib/peddler/apis/finances_v0/charge_instrument.rb,
lib/peddler/apis/finances_v0/retrocharge_event.rb,
lib/peddler/apis/finances_v0/service_fee_event.rb,
lib/peddler/apis/finances_v0/debt_recovery_item.rb,
lib/peddler/apis/finances_v0/fee_component_list.rb,
lib/peddler/apis/finances_v0/shipment_item_list.rb,
lib/peddler/apis/finances_v0/charge_refund_event.rb,
lib/peddler/apis/finances_v0/debt_recovery_event.rb,
lib/peddler/apis/finances_v0/direct_payment_list.rb,
lib/peddler/apis/finances_v0/shipment_event_list.rb,
lib/peddler/apis/finances_v0/adjustment_item_list.rb,
lib/peddler/apis/finances_v0/coupon_payment_event.rb,
lib/peddler/apis/finances_v0/loan_servicing_event.rb,
lib/peddler/apis/finances_v0/trial_shipment_event.rb,
lib/peddler/apis/finances_v0/adjustment_event_list.rb,
lib/peddler/apis/finances_v0/charge_component_list.rb,
lib/peddler/apis/finances_v0/fba_liquidation_event.rb,
lib/peddler/apis/finances_v0/financial_event_group.rb,
lib/peddler/apis/finances_v0/pay_with_amazon_event.rb,
lib/peddler/apis/finances_v0/removal_shipment_item.rb,
lib/peddler/apis/finances_v0/tax_withholding_event.rb,
lib/peddler/apis/finances_v0/charge_instrument_list.rb,
lib/peddler/apis/finances_v0/removal_shipment_event.rb,
lib/peddler/apis/finances_v0/retrocharge_event_list.rb,
lib/peddler/apis/finances_v0/service_fee_event_list.rb,
lib/peddler/apis/finances_v0/tax_withheld_component.rb,
lib/peddler/apis/finances_v0/tax_withholding_period.rb,
lib/peddler/apis/finances_v0/debt_recovery_item_list.rb,
lib/peddler/apis/finances_v0/tds_reimbursement_event.rb,
lib/peddler/apis/finances_v0/adhoc_disbursement_event.rb,
lib/peddler/apis/finances_v0/charge_refund_event_list.rb,
lib/peddler/apis/finances_v0/debt_recovery_event_list.rb,
lib/peddler/apis/finances_v0/rental_transaction_event.rb,
lib/peddler/apis/finances_v0/safet_reimbursement_item.rb,
lib/peddler/apis/finances_v0/charge_refund_transaction.rb,
lib/peddler/apis/finances_v0/coupon_payment_event_list.rb,
lib/peddler/apis/finances_v0/loan_servicing_event_list.rb,
lib/peddler/apis/finances_v0/product_ads_payment_event.rb,
lib/peddler/apis/finances_v0/safet_reimbursement_event.rb,
lib/peddler/apis/finances_v0/seller_deal_payment_event.rb,
lib/peddler/apis/finances_v0/trial_shipment_event_list.rb,
lib/peddler/apis/finances_v0/charge_refund_transactions.rb,
lib/peddler/apis/finances_v0/fba_liquidation_event_list.rb,
lib/peddler/apis/finances_v0/financial_event_group_list.rb,
lib/peddler/apis/finances_v0/imaging_services_fee_event.rb,
lib/peddler/apis/finances_v0/pay_with_amazon_event_list.rb,
lib/peddler/apis/finances_v0/removal_shipment_item_list.rb,
lib/peddler/apis/finances_v0/shipment_settle_event_list.rb,
lib/peddler/apis/finances_v0/tax_withholding_event_list.rb,
lib/peddler/apis/finances_v0/affordability_expense_event.rb,
lib/peddler/apis/finances_v0/removal_shipment_event_list.rb,
lib/peddler/apis/finances_v0/tax_withheld_component_list.rb,
lib/peddler/apis/finances_v0/tds_reimbursement_event_list.rb,
lib/peddler/apis/finances_v0/adhoc_disbursement_event_list.rb,
lib/peddler/apis/finances_v0/list_financial_events_payload.rb,
lib/peddler/apis/finances_v0/rental_transaction_event_list.rb,
lib/peddler/apis/finances_v0/safet_reimbursement_item_list.rb,
lib/peddler/apis/finances_v0/list_financial_events_response.rb,
lib/peddler/apis/finances_v0/product_ads_payment_event_list.rb,
lib/peddler/apis/finances_v0/safet_reimbursement_event_list.rb,
lib/peddler/apis/finances_v0/seller_deal_payment_event_list.rb,
lib/peddler/apis/finances_v0/solution_provider_credit_event.rb,
lib/peddler/apis/finances_v0/failed_adhoc_disbursement_event.rb,
lib/peddler/apis/finances_v0/imaging_services_fee_event_list.rb,
lib/peddler/apis/finances_v0/affordability_expense_event_list.rb,
lib/peddler/apis/finances_v0/removal_shipment_item_adjustment.rb,
lib/peddler/apis/finances_v0/value_added_service_charge_event.rb,
lib/peddler/apis/finances_v0/removal_shipment_adjustment_event.rb,
lib/peddler/apis/finances_v0/capacity_reservation_billing_event.rb,
lib/peddler/apis/finances_v0/ebt_refund_reimbursement_only_event.rb,
lib/peddler/apis/finances_v0/list_financial_event_groups_payload.rb,
lib/peddler/apis/finances_v0/solution_provider_credit_event_list.rb,
lib/peddler/apis/finances_v0/failed_adhoc_disbursement_event_list.rb,
lib/peddler/apis/finances_v0/list_financial_event_groups_response.rb,
lib/peddler/apis/finances_v0/network_commingling_transaction_event.rb,
lib/peddler/apis/finances_v0/value_added_service_charge_event_list.rb,
lib/peddler/apis/finances_v0/removal_shipment_adjustment_event_list.rb,
lib/peddler/apis/finances_v0/seller_review_enrollment_payment_event.rb,
lib/peddler/apis/finances_v0/capacity_reservation_billing_event_list.rb,
lib/peddler/apis/finances_v0/ebt_refund_reimbursement_only_event_list.rb,
lib/peddler/apis/finances_v0/network_commingling_transaction_event_list.rb,
lib/peddler/apis/finances_v0/seller_review_enrollment_payment_event_list.rb,
sig/peddler/apis/finances_v0.rbs

Overview

Selling Partner API for Finances

The Selling Partner API for Finances provides financial information that is relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range.

Defined Under Namespace

Classes: AdhocDisbursementEvent, AdhocDisbursementEventList, AdjustmentEvent, AdjustmentEventList, AdjustmentItem, AdjustmentItemList, AffordabilityExpenseEvent, AffordabilityExpenseEventList, CapacityReservationBillingEvent, CapacityReservationBillingEventList, ChargeComponent, ChargeComponentList, ChargeInstrument, ChargeInstrumentList, ChargeRefundEvent, ChargeRefundEventList, ChargeRefundTransaction, ChargeRefundTransactions, CouponPaymentEvent, CouponPaymentEventList, DebtRecoveryEvent, DebtRecoveryEventList, DebtRecoveryItem, DebtRecoveryItemList, DirectPayment, DirectPaymentList, EBTRefundReimbursementOnlyEvent, EBTRefundReimbursementOnlyEventList, Error, ErrorList, FBALiquidationEvent, FBALiquidationEventList, FailedAdhocDisbursementEvent, FailedAdhocDisbursementEventList, FeeComponent, FeeComponentList, FinancialEventGroup, FinancialEventGroupList, FinancialEvents, ImagingServicesFeeEvent, ImagingServicesFeeEventList, ListFinancialEventGroupsPayload, ListFinancialEventGroupsResponse, ListFinancialEventsPayload, ListFinancialEventsResponse, LoanServicingEvent, LoanServicingEventList, NetworkComminglingTransactionEvent, NetworkComminglingTransactionEventList, PayWithAmazonEvent, PayWithAmazonEventList, ProductAdsPaymentEvent, ProductAdsPaymentEventList, Promotion, PromotionList, RemovalShipmentAdjustmentEvent, RemovalShipmentAdjustmentEventList, RemovalShipmentEvent, RemovalShipmentEventList, RemovalShipmentItem, RemovalShipmentItemAdjustment, RemovalShipmentItemList, RentalTransactionEvent, RentalTransactionEventList, RetrochargeEvent, RetrochargeEventList, SAFETReimbursementEvent, SAFETReimbursementEventList, SAFETReimbursementItem, SAFETReimbursementItemList, SellerDealPaymentEvent, SellerDealPaymentEventList, SellerReviewEnrollmentPaymentEvent, SellerReviewEnrollmentPaymentEventList, ServiceFeeEvent, ServiceFeeEventList, ShipmentEvent, ShipmentEventList, ShipmentItem, ShipmentItemList, ShipmentSettleEventList, SolutionProviderCreditEvent, SolutionProviderCreditEventList, TDSReimbursementEvent, TDSReimbursementEventList, TaxWithheldComponent, TaxWithheldComponentList, TaxWithholdingEvent, TaxWithholdingEventList, TaxWithholdingPeriod, TrialShipmentEvent, TrialShipmentEventList, ValueAddedServiceChargeEvent, ValueAddedServiceChargeEventList

Constant Summary

Constants inherited from Peddler::API

Peddler::API::TRANSIENT_STATUSES

Instance Attribute Summary

Attributes inherited from Peddler::API

#access_token, #endpoint, #retries

Instance Method Summary collapse

Methods inherited from Peddler::API

#cannot_sandbox!, #delete, #endpoint_uri, #get, #http, #initialize, #must_sandbox!, #patch, #percent_encode, #post, #put, #request, #sandbox, #sandbox?, #stringify_array, #timestamp, #user_agent

Constructor Details

This class inherits a constructor from Peddler::API

Instance Method Details

#list_financial_event_groups(max_results_per_page: 10, financial_event_group_started_before: nil, financial_event_group_started_after: nil, next_token: nil, rate_limit: 0.5) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Returns financial event groups for a given date range. Orders from the last 48 hours might not be included in financial events.



36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/peddler/apis/finances_v0.rb', line 36

def list_financial_event_groups(max_results_per_page: 10, financial_event_group_started_before: nil,
  financial_event_group_started_after: nil, next_token: nil, rate_limit: 0.5)
  path = "/finances/v0/financialEventGroups"
  params = {
    "MaxResultsPerPage" => max_results_per_page,
    "FinancialEventGroupStartedBefore" => financial_event_group_started_before,
    "FinancialEventGroupStartedAfter" => financial_event_group_started_after,
    "NextToken" => next_token,
  }.compact
  parser = -> { ListFinancialEventGroupsResponse }
  get(path, params:, rate_limit:, parser:)
end

#list_financial_events(max_results_per_page: 100, posted_after: nil, posted_before: nil, next_token: nil, rate_limit: 0.5) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Returns financial events for the specified data range. Orders from the last 48 hours might not be included in financial events.

Note: in ListFinancialEvents, deferred events don't show up in responses until they are released.



133
134
135
136
137
138
139
140
141
142
143
144
# File 'lib/peddler/apis/finances_v0.rb', line 133

def list_financial_events(max_results_per_page: 100, posted_after: nil, posted_before: nil, next_token: nil,
  rate_limit: 0.5)
  path = "/finances/v0/financialEvents"
  params = {
    "MaxResultsPerPage" => max_results_per_page,
    "PostedAfter" => posted_after,
    "PostedBefore" => posted_before,
    "NextToken" => next_token,
  }.compact
  parser = -> { ListFinancialEventsResponse }
  get(path, params:, rate_limit:, parser:)
end

#list_financial_events_by_group_id(event_group_id, max_results_per_page: 100, posted_after: nil, posted_before: nil, next_token: nil, rate_limit: 0.5) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Returns all financial events for the specified financial event group. Orders from the last 48 hours might not be included in financial events.

Note: This operation only retrieves a group's data for the past two years. A request for data spanning more than two years produces an empty response.



74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/peddler/apis/finances_v0.rb', line 74

def list_financial_events_by_group_id(event_group_id, max_results_per_page: 100, posted_after: nil,
  posted_before: nil, next_token: nil, rate_limit: 0.5)
  path = "/finances/v0/financialEventGroups/#{percent_encode(event_group_id)}/financialEvents"
  params = {
    "MaxResultsPerPage" => max_results_per_page,
    "PostedAfter" => posted_after,
    "PostedBefore" => posted_before,
    "NextToken" => next_token,
  }.compact
  parser = -> { ListFinancialEventsResponse }
  get(path, params:, rate_limit:, parser:)
end

#list_financial_events_by_order_id(order_id, max_results_per_page: 100, next_token: nil, rate_limit: 0.5) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Returns all financial events for the specified order. Orders from the last 48 hours might not be included in financial events.



100
101
102
103
104
105
106
107
108
# File 'lib/peddler/apis/finances_v0.rb', line 100

def list_financial_events_by_order_id(order_id, max_results_per_page: 100, next_token: nil, rate_limit: 0.5)
  path = "/finances/v0/orders/#{percent_encode(order_id)}/financialEvents"
  params = {
    "MaxResultsPerPage" => max_results_per_page,
    "NextToken" => next_token,
  }.compact
  parser = -> { ListFinancialEventsResponse }
  get(path, params:, rate_limit:, parser:)
end