Class: Peddler::APIs::Finances20240619

Inherits:
Peddler::API show all
Defined in:
lib/peddler/apis/finances_2024_06_19.rb,
lib/peddler/apis/finances_2024_06_19/item.rb,
lib/peddler/apis/finances_2024_06_19/error.rb,
lib/peddler/apis/finances_2024_06_19/items.rb,
lib/peddler/apis/finances_2024_06_19/context.rb,
lib/peddler/apis/finances_2024_06_19/contexts.rb,
lib/peddler/apis/finances_2024_06_19/breakdown.rb,
lib/peddler/apis/finances_2024_06_19/breakdowns.rb,
lib/peddler/apis/finances_2024_06_19/error_list.rb,
lib/peddler/apis/finances_2024_06_19/transaction.rb,
lib/peddler/apis/finances_2024_06_19/transactions.rb,
lib/peddler/apis/finances_2024_06_19/product_context.rb,
lib/peddler/apis/finances_2024_06_19/business_context.rb,
lib/peddler/apis/finances_2024_06_19/deferred_context.rb,
lib/peddler/apis/finances_2024_06_19/payments_context.rb,
lib/peddler/apis/finances_2024_06_19/amazon_pay_context.rb,
lib/peddler/apis/finances_2024_06_19/related_identifier.rb,
lib/peddler/apis/finances_2024_06_19/time_range_context.rb,
lib/peddler/apis/finances_2024_06_19/marketplace_details.rb,
lib/peddler/apis/finances_2024_06_19/related_identifiers.rb,
lib/peddler/apis/finances_2024_06_19/transactions_payload.rb,
lib/peddler/apis/finances_2024_06_19/item_related_identifier.rb,
lib/peddler/apis/finances_2024_06_19/item_related_identifiers.rb,
lib/peddler/apis/finances_2024_06_19/selling_partner_metadata.rb,
lib/peddler/apis/finances_2024_06_19/list_transactions_response.rb,
sig/peddler/apis/finances_2024_06_19.rbs

Overview

The Selling Partner API for Finances

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

Defined Under Namespace

Classes: AmazonPayContext, Breakdown, Breakdowns, BusinessContext, Context, Contexts, DeferredContext, Error, ErrorList, Item, ItemRelatedIdentifier, ItemRelatedIdentifiers, Items, ListTransactionsResponse, MarketplaceDetails, PaymentsContext, ProductContext, RelatedIdentifier, RelatedIdentifiers, SellingPartnerMetadata, TimeRangeContext, Transaction, Transactions, TransactionsPayload

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_transactions(posted_after: nil, posted_before: nil, marketplace_id: nil, transaction_status: nil, related_identifier_name: nil, related_identifier_value: nil, next_token: nil, rate_limit: 0.5) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Returns transactions for the given parameters. Financial events might not include orders from the last 48 hours.

Parameters:

  • posted_after (String) (defaults to: nil)

    The response includes financial events posted on or after this date. This date must be in ISO 8601 date-time format. The date-time must be more than two minutes before the time of the request. This field is required if you do not specify a related identifier.

  • posted_before (String) (defaults to: nil)

    The response includes financial events posted before (but not on) this date. This date must be in ISO 8601 date-time format. The date-time must be later than PostedAfter and more than two minutes before the request was submitted. If PostedAfter and PostedBefore are more than 180 days apart, the response is empty. Default: Two minutes before the time of the request.

  • marketplace_id (String) (defaults to: nil)

    The identifier of the marketplace from which you want to retrieve transactions. The marketplace ID is the globally unique identifier of a marketplace. To find the ID for your marketplace, refer to Marketplace IDs.

  • transaction_status (String) (defaults to: nil)

    The status of the transaction. Possible values: * DEFERRED: the transaction is currently deferred. * RELEASED: the transaction is currently released. * DEFERRED_RELEASED: the transaction was deferred in the past, but is now released. The status of a deferred transaction is updated to DEFERRED_RELEASED when the transaction is released.

  • related_identifier_name (String) (defaults to: nil)

    The name of the relatedIdentifier. Possible values: * FINANCIAL_EVENT_GROUP_ID: the financial event group ID associated with the transaction. * ORDER_ID: the order ID associated with the transaction. Note: FINANCIAL_EVENT_GROUP_ID and ORDER_ID are the only relatedIdentifier with filtering capabilities at the moment. While other relatedIdentifier values will be included in the response when available, they cannot be used for filtering purposes.

  • related_identifier_value (String) (defaults to: nil)

    The value of the relatedIdentifier.

  • next_token (String) (defaults to: nil)

    The response includes nextToken when the number of results exceeds the specified pageSize value. To get the next page of results, call the operation with this token and include the same arguments as the call that produced the token. To get a complete list, call this operation until nextToken is null. Note that this operation can return empty pages.

  • rate_limit (Float) (defaults to: 0.5)

    Requests per second

  • posted_after: (String, nil) (defaults to: nil)
  • posted_before: (String, nil) (defaults to: nil)
  • marketplace_id: (String, nil) (defaults to: nil)
  • transaction_status: (String, nil) (defaults to: nil)
  • related_identifier_name: (String, nil) (defaults to: nil)
  • related_identifier_value: (String, nil) (defaults to: nil)
  • next_token: (String, nil) (defaults to: nil)
  • rate_limit: (Float) (defaults to: 0.5)

Returns:



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/peddler/apis/finances_2024_06_19.rb', line 45

def list_transactions(posted_after: nil, posted_before: nil, marketplace_id: nil, transaction_status: nil,
  related_identifier_name: nil, related_identifier_value: nil, next_token: nil, rate_limit: 0.5)
  path = "/finances/2024-06-19/transactions"
  params = {
    "postedAfter" => posted_after,
    "postedBefore" => posted_before,
    "marketplaceId" => marketplace_id,
    "transactionStatus" => transaction_status,
    "relatedIdentifierName" => related_identifier_name,
    "relatedIdentifierValue" => related_identifier_value,
    "nextToken" => next_token,
  }.compact
  parser = -> { ListTransactionsResponse }
  get(path, params:, rate_limit:, parser:)
end