Class: Peddler::API::Finances20240619

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

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.

Instance Attribute Summary

Attributes inherited from Peddler::API

#access_token, #endpoint

Instance Method Summary collapse

Methods inherited from Peddler::API

#cannot_sandbox!, #endpoint_uri, #http, #initialize, #meter, #must_sandbox!, #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, next_token: nil, rate_limit: 0.5) ⇒ Hash

Note:

This operation can make a static sandbox call.

Returns transactions for the given parameters. Orders from the last 48 hours might not be included in financial events.

Parameters:

  • posted_after (String)

    The response includes financial events posted after (or on) 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)

    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 ID of the marketplace from which you want to retrieve transactions.

  • 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

Returns:

  • (Hash)

    The API response



38
39
40
41
42
43
44
45
46
47
48
# File 'lib/peddler/api/finances_2024_06_19.rb', line 38

def list_transactions(posted_after, posted_before: nil, marketplace_id: nil, next_token: nil, rate_limit: 0.5)
  path = "/finances/2024-06-19/transactions"
  params = {
    "postedAfter" => posted_after,
    "postedBefore" => posted_before,
    "marketplaceId" => marketplace_id,
    "nextToken" => next_token,
  }.compact

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