Class: WhopSDK::Resources::Referrals::Businesses
- Inherits:
-
Object
- Object
- WhopSDK::Resources::Referrals::Businesses
- Defined in:
- lib/whop_sdk/resources/referrals/businesses.rb,
lib/whop_sdk/resources/referrals/businesses/earnings.rb,
sig/whop_sdk/resources/referrals/businesses.rbs,
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.
Defined Under Namespace
Classes: Earnings
Instance Attribute Summary collapse
-
#earnings ⇒ WhopSDK::Resources::Referrals::Businesses::Earnings
readonly
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.
Instance Method Summary collapse
-
#initialize(client:) ⇒ Businesses
constructor
private
A new instance of Businesses.
-
#leaderboard(period: nil, request_options: {}) ⇒ WhopSDK::Models::Referrals::BusinessLeaderboardResponse
Some parameter documentations has been truncated, see Models::Referrals::BusinessLeaderboardParams for more details.
-
#list(after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, has_earnings: nil, last: nil, order: nil, referred_user_id: nil, referred_username: nil, status: nil, tier: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::Referrals::BusinessListResponse>
Some parameter documentations has been truncated, see Models::Referrals::BusinessListParams for more details.
-
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::Referrals::BusinessRetrieveResponse
Retrieves a single referred business and its referral terms.
Constructor Details
#initialize(client:) ⇒ Businesses
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 Businesses.
125 126 127 128 |
# File 'lib/whop_sdk/resources/referrals/businesses.rb', line 125 def initialize(client:) @client = client @earnings = WhopSDK::Resources::Referrals::Businesses::Earnings.new(client: client) end |
Instance Attribute Details
#earnings ⇒ WhopSDK::Resources::Referrals::Businesses::Earnings (readonly)
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.
20 21 22 |
# File 'lib/whop_sdk/resources/referrals/businesses.rb', line 20 def earnings @earnings end |
Instance Method Details
#leaderboard(period: nil, request_options: {}) ⇒ WhopSDK::Models::Referrals::BusinessLeaderboardResponse
Some parameter documentations has been truncated, see Models::Referrals::BusinessLeaderboardParams for more details.
Ranks referrers by business referral earnings — all-time by default, or over the current day, month, year, or trailing 30 days — and includes the caller's own standing.
110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/whop_sdk/resources/referrals/businesses.rb', line 110 def leaderboard(params = {}) parsed, = WhopSDK::Referrals::BusinessLeaderboardParams.dump_request(params) query = WhopSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "partners/leaderboard", query: query, model: WhopSDK::Models::Referrals::BusinessLeaderboardResponse, options: ) end |
#list(after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, has_earnings: nil, last: nil, order: nil, referred_user_id: nil, referred_username: nil, status: nil, tier: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::Referrals::BusinessListResponse>
Some parameter documentations has been truncated, see Models::Referrals::BusinessListParams for more details.
Lists the businesses the authenticated user referred onto Whop, most recent first.
81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/whop_sdk/resources/referrals/businesses.rb', line 81 def list(params = {}) parsed, = WhopSDK::Referrals::BusinessListParams.dump_request(params) query = WhopSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "partners/businesses", query: query, page: WhopSDK::Internal::CursorPage, model: WhopSDK::Models::Referrals::BusinessListResponse, options: ) end |
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::Referrals::BusinessRetrieveResponse
Retrieves a single referred business and its referral terms.
33 34 35 36 37 38 39 40 |
# File 'lib/whop_sdk/resources/referrals/businesses.rb', line 33 def retrieve(id, params = {}) @client.request( method: :get, path: ["partners/businesses/%1$s", id], model: WhopSDK::Models::Referrals::BusinessRetrieveResponse, options: params[:request_options] ) end |