Class: WhopSDK::Resources::FeeMarkups

Inherits:
Object
  • Object
show all
Defined in:
lib/whop_sdk/resources/fee_markups.rb

Overview

Fee markups

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ FeeMarkups

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

Parameters:



115
116
117
# File 'lib/whop_sdk/resources/fee_markups.rb', line 115

def initialize(client:)
  @client = client
end

Instance Method Details

#create(company_id:, fee_type:, fixed_fee_usd: nil, metadata: nil, notes: nil, percentage_fee: nil, request_options: {}) ⇒ WhopSDK::Models::FeeMarkupCreateResponse

Some parameter documentations has been truncated, see Models::FeeMarkupCreateParams for more details.

Create or update a fee markup for a company. If a markup for the specified fee type already exists, it will be updated with the new values.

Required permissions:

  • ‘company:update_child_fees`

Parameters:

  • company_id (String)

    The unique identifier of the company to create or update the fee markup for.

  • fee_type (Symbol, WhopSDK::Models::FeeMarkupType)

    The type of fee this markup applies to, such as processing or platform fees.

  • fixed_fee_usd (Float, nil)

    The fixed fee amount in USD to charge per transaction. Must be between 0 and 50.

  • metadata (Hash{Symbol=>Object}, nil)

    Custom key-value metadata to attach to this fee markup.

  • notes (String, nil)

    Internal notes about this fee markup for record-keeping purposes.

  • percentage_fee (Float, nil)

    The percentage fee to charge per transaction. Must be between 0 and 25.

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

Returns:

See Also:



36
37
38
39
40
41
42
43
44
45
# File 'lib/whop_sdk/resources/fee_markups.rb', line 36

def create(params)
  parsed, options = WhopSDK::FeeMarkupCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "fee_markups",
    body: parsed,
    model: WhopSDK::Models::FeeMarkupCreateResponse,
    options: options
  )
end

#delete(id, request_options: {}) ⇒ Boolean

Delete a fee markup configuration for a company. This removes the custom fee override and reverts to the parent company’s default fees.

Required permissions:

  • ‘company:update_child_fees`

Parameters:

  • id (String)

    The unique identifier of the fee markup to delete.

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

Returns:

  • (Boolean)

See Also:



103
104
105
106
107
108
109
110
# File 'lib/whop_sdk/resources/fee_markups.rb', line 103

def delete(id, params = {})
  @client.request(
    method: :delete,
    path: ["fee_markups/%1$s", id],
    model: WhopSDK::Internal::Type::Boolean,
    options: params[:request_options]
  )
end

#list(company_id:, after: nil, before: nil, first: nil, last: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::FeeMarkupListResponse>

Some parameter documentations has been truncated, see Models::FeeMarkupListParams for more details.

Returns a paginated list of fee markups configured for a company. If the company is a platform account, returns the platform default markups.

Required permissions:

  • ‘company:update_child_fees`

Parameters:

  • company_id (String)

    The unique identifier of the company to list fee markups for. Pass a platform ac

  • after (String, nil)

    Returns the elements in the list that come after the specified cursor.

  • before (String, nil)

    Returns the elements in the list that come before the specified cursor.

  • first (Integer, nil)

    Returns the first n elements from the list.

  • last (Integer, nil)

    Returns the last n elements from the list.

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

Returns:

See Also:



74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/whop_sdk/resources/fee_markups.rb', line 74

def list(params)
  parsed, options = WhopSDK::FeeMarkupListParams.dump_request(params)
  query = WhopSDK::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "fee_markups",
    query: query,
    page: WhopSDK::Internal::CursorPage,
    model: WhopSDK::Models::FeeMarkupListResponse,
    options: options
  )
end