Class: WhopSDK::Resources::Referrals::Businesses::Earnings

Inherits:
Object
  • Object
show all
Defined in:
lib/whop_sdk/resources/referrals/businesses/earnings.rb,
sig/whop_sdk/resources/referrals/businesses/earnings.rbs

Overview

The Referrals API covers your Whop partner activity: the users you referred onto Whop, the businesses you referred and the earnings generated from their processing volume, and the partner leaderboard.

Use it to enroll as a Whop partner, list the users you referred, list your referred businesses and review their earnings, and see the partner leaderboard.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Earnings

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

Parameters:



60
61
62
# File 'lib/whop_sdk/resources/referrals/businesses/earnings.rb', line 60

def initialize(client:)
  @client = client
end

Instance Method Details

#list(id, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, order: nil, status: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::Referrals::Businesses::EarningListResponse>

Lists the earnings Whop pays out for one referred business's activity, most recent first.

Parameters:

Returns:

See Also:



44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/whop_sdk/resources/referrals/businesses/earnings.rb', line 44

def list(id, params = {})
  parsed, options = WhopSDK::Referrals::Businesses::EarningListParams.dump_request(params)
  query = WhopSDK::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["partners/businesses/%1$s/earnings", id],
    query: query,
    page: WhopSDK::Internal::CursorPage,
    model: WhopSDK::Models::Referrals::Businesses::EarningListResponse,
    options: options
  )
end