Class: WhopSDK::Resources::Payouts
- Inherits:
-
Object
- Object
- WhopSDK::Resources::Payouts
- Defined in:
- lib/whop_sdk/resources/payouts.rb,
lib/whop_sdk/resources/payouts/methods.rb,
sig/whop_sdk/resources/payouts.rbs,
sig/whop_sdk/resources/payouts/methods.rbs
Overview
Payouts represent money sent from an account or user balance to an external destination, such as a bank account, wallet, or other saved payout method.
Use the Payouts API to create payouts from stablecoin accounts, list payout history for accounts or users, monitor payout statuses, and show expected arrival details for funds leaving Whop.
Defined Under Namespace
Classes: Methods
Instance Attribute Summary collapse
-
#methods_ ⇒ WhopSDK::Resources::Payouts::Methods
readonly
Payouts represent money sent from an account or user balance to an external destination, such as a bank account, wallet, or other saved payout method.
Instance Method Summary collapse
-
#create(account_id:, amount:, payout_method_id:, currency: nil, idempotency_key: nil, request_options: {}) ⇒ WhopSDK::Models::PayoutCreateResponse
Some parameter documentations has been truncated, see Models::PayoutCreateParams for more details.
-
#initialize(client:) ⇒ Payouts
constructor
private
A new instance of Payouts.
-
#list(account_id: nil, after: nil, before: nil, currency: nil, first: nil, last: nil, user_id: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::PayoutListResponse>
Lists payouts (withdrawal requests) for an account or user, most recent first.
Constructor Details
#initialize(client:) ⇒ Payouts
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 Payouts.
101 102 103 104 |
# File 'lib/whop_sdk/resources/payouts.rb', line 101 def initialize(client:) @client = client @methods_ = WhopSDK::Resources::Payouts::Methods.new(client: client) end |
Instance Attribute Details
#methods_ ⇒ WhopSDK::Resources::Payouts::Methods (readonly)
Payouts represent money sent from an account or user balance to an external destination, such as a bank account, wallet, or other saved payout method.
Use the Payouts API to create payouts from stablecoin accounts, list payout history for accounts or users, monitor payout statuses, and show expected arrival details for funds leaving Whop.
19 20 21 |
# File 'lib/whop_sdk/resources/payouts.rb', line 19 def methods_ @methods_ end |
Instance Method Details
#create(account_id:, amount:, payout_method_id:, currency: nil, idempotency_key: nil, request_options: {}) ⇒ WhopSDK::Models::PayoutCreateResponse
Some parameter documentations has been truncated, see Models::PayoutCreateParams for more details.
Creates a payout from a stablecoin account to a saved payout method. The account's funds move from its stablecoin balance to an external bank account, wallet, or crypto address. Accounts that pay out from a fiat balance use POST /withdrawals. Requires the payouts API to be enabled for the account; contact support to enable it. The payout settles asynchronously; poll GET /payouts for the entry whose payout_request_id matches this payout's id.
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/whop_sdk/resources/payouts.rb', line 48 def create(params) parsed, = WhopSDK::PayoutCreateParams.dump_request(params) @client.request( method: :post, path: "payouts", body: parsed, model: WhopSDK::Models::PayoutCreateResponse, options: ) end |
#list(account_id: nil, after: nil, before: nil, currency: nil, first: nil, last: nil, user_id: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::PayoutListResponse>
Lists payouts (withdrawal requests) for an account or user, most recent first. Pass exactly one of accountid (a biz identifier) or userid (a user identifier). The saved payout method on each payout additionally requires the payout:destination:read scope and is null without it.
85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/whop_sdk/resources/payouts.rb', line 85 def list(params = {}) parsed, = WhopSDK::PayoutListParams.dump_request(params) query = WhopSDK::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "payouts", query: query, page: WhopSDK::Internal::CursorPage, model: WhopSDK::Models::PayoutListResponse, options: ) end |