Class: Onlyfans::Resources::Analytics::Financial::Transactions

Inherits:
Object
  • Object
show all
Defined in:
lib/onlyfans/resources/analytics/financial/transactions.rb

Overview

APIs for retrieving financial analytics data

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Transactions

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Transactions.

Parameters:



66
67
68
# File 'lib/onlyfans/resources/analytics/financial/transactions.rb', line 66

def initialize(client:)
  @client = client
end

Instance Method Details

#get_by_type(account_ids:, end_date:, start_date:, request_options: {}) ⇒ Array<Onlyfans::Models::Analytics::Financial::TransactionGetByTypeResponseItem>

Get transaction totals grouped by transaction type (subscriptions, tips, messages, etc.).

Parameters:

  • account_ids (Array<String>)

    Array of account prefixed IDs

  • end_date (String)

    The end date (ISO 8601 format)

  • start_date (String)

    The start date (ISO 8601 format)

  • request_options (Onlyfans::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



25
26
27
28
29
30
31
32
33
34
# File 'lib/onlyfans/resources/analytics/financial/transactions.rb', line 25

def get_by_type(params)
  parsed, options = Onlyfans::Analytics::Financial::TransactionGetByTypeParams.dump_request(params)
  @client.request(
    method: :post,
    path: "api/analytics/financial/transactions/by-type",
    body: parsed,
    model: Onlyfans::Internal::Type::ArrayOf[Onlyfans::Models::Analytics::Financial::TransactionGetByTypeResponseItem],
    options: options
  )
end

#get_summary(account_ids:, end_date:, start_date:, request_options: {}) ⇒ Onlyfans::Models::Analytics::Financial::TransactionGetSummaryResponse

Get transaction summary including counts for succeeded, refunded, and disputed transactions, plus gross, net, and fee totals.

Parameters:

  • account_ids (Array<String>)

    Array of account prefixed IDs

  • end_date (String)

    The end date (ISO 8601 format)

  • start_date (String)

    The start date (ISO 8601 format)

  • request_options (Onlyfans::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



52
53
54
55
56
57
58
59
60
61
# File 'lib/onlyfans/resources/analytics/financial/transactions.rb', line 52

def get_summary(params)
  parsed, options = Onlyfans::Analytics::Financial::TransactionGetSummaryParams.dump_request(params)
  @client.request(
    method: :post,
    path: "api/analytics/financial/transactions/summary",
    body: parsed,
    model: Onlyfans::Models::Analytics::Financial::TransactionGetSummaryResponse,
    options: options
  )
end