Class: Peddler::APIs::Finances20240619

Inherits:
Peddler::API show all
Defined in:
lib/peddler/apis/finances_2024_06_19.rb

Overview

The Selling Partner API for Finances

The Selling Partner API for Finances helps you obtain 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.

Instance Attribute Summary

Attributes inherited from Peddler::API

#access_token, #endpoint, #parser, #retries

Instance Method Summary collapse

Methods inherited from Peddler::API

#endpoint_uri, #http, #initialize, #meter, #retriable, #sandbox, #sandbox?, #use, #via

Constructor Details

This class inherits a constructor from Peddler::API

Instance Method Details

#list_transactions(posted_after, posted_before: nil, marketplace_id: nil, transaction_status: 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)

    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.

  • posted_before (String) (defaults to: nil)

    A date used for selecting transactions posted before (but not at) a specified time. The date-time must be later than PostedAfter and no later than two minutes before the request was submitted, in ISO 8601 date time format. If PostedAfter and PostedBefore are more than 180 days apart, no transactions are returned. You must specify the PostedAfter parameter if you specify the PostedBefore parameter. Default: Now minus two minutes.

  • 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.

  • next_token (String) (defaults to: nil)

    A string token returned in the response of your previous request.

  • rate_limit (Float) (defaults to: 0.5)

    Requests per second

Returns:



40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/peddler/apis/finances_2024_06_19.rb', line 40

def list_transactions(posted_after, posted_before: nil, marketplace_id: nil, transaction_status: 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,
    "nextToken" => next_token,
  }.compact

  meter(rate_limit).get(path, params:)
end