Class: WhopSDK::Resources::Withdrawals
- Inherits:
-
Object
- Object
- WhopSDK::Resources::Withdrawals
- Defined in:
- lib/whop_sdk/resources/withdrawals.rb
Overview
Withdrawals
Instance Method Summary collapse
-
#create(amount:, company_id:, currency:, payout_method_id: nil, platform_covers_fees: nil, statement_descriptor: nil, request_options: {}) ⇒ WhopSDK::Models::Withdrawal
Some parameter documentations has been truncated, see Models::WithdrawalCreateParams for more details.
-
#initialize(client:) ⇒ Withdrawals
constructor
private
A new instance of Withdrawals.
-
#list(company_id:, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::WithdrawalListResponse>
Returns a paginated list of withdrawals for a company, with optional sorting and date filtering.
-
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::Withdrawal
Retrieves the details of an existing withdrawal.
Constructor Details
#initialize(client:) ⇒ Withdrawals
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 Withdrawals.
118 119 120 |
# File 'lib/whop_sdk/resources/withdrawals.rb', line 118 def initialize(client:) @client = client end |
Instance Method Details
#create(amount:, company_id:, currency:, payout_method_id: nil, platform_covers_fees: nil, statement_descriptor: nil, request_options: {}) ⇒ WhopSDK::Models::Withdrawal
Some parameter documentations has been truncated, see Models::WithdrawalCreateParams for more details.
Creates a withdrawal request for a ledger account
Required permissions:
-
‘payout:withdraw_funds`
-
‘payout:destination:read`
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/whop_sdk/resources/withdrawals.rb', line 36 def create(params) parsed, = WhopSDK::WithdrawalCreateParams.dump_request(params) @client.request( method: :post, path: "withdrawals", body: parsed, model: WhopSDK::Withdrawal, options: ) end |
#list(company_id:, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::WithdrawalListResponse>
Returns a paginated list of withdrawals for a company, with optional sorting and date filtering.
Required permissions:
-
‘payout:withdrawal:read`
102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/whop_sdk/resources/withdrawals.rb', line 102 def list(params) parsed, = WhopSDK::WithdrawalListParams.dump_request(params) query = WhopSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "withdrawals", query: query, page: WhopSDK::Internal::CursorPage, model: WhopSDK::Models::WithdrawalListResponse, options: ) end |
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::Withdrawal
Retrieves the details of an existing withdrawal.
Required permissions:
-
‘payout:withdrawal:read`
-
‘payout:destination:read`
63 64 65 66 67 68 69 70 |
# File 'lib/whop_sdk/resources/withdrawals.rb', line 63 def retrieve(id, params = {}) @client.request( method: :get, path: ["withdrawals/%1$s", id], model: WhopSDK::Withdrawal, options: params[:request_options] ) end |