Class: WhopSDK::Resources::Referrals::Businesses::Earnings
- Inherits:
-
Object
- Object
- WhopSDK::Resources::Referrals::Businesses::Earnings
- 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
-
#initialize(client:) ⇒ Earnings
constructor
private
A new instance of Earnings.
-
#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.
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.
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.
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, = 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: ) end |