@whop/sdk 0.0.15 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/client.d.mts +7 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +7 -4
- package/client.d.ts.map +1 -1
- package/client.js +3 -0
- package/client.js.map +1 -1
- package/client.mjs +3 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/courses.d.mts +33 -0
- package/resources/courses.d.mts.map +1 -1
- package/resources/courses.d.ts +33 -0
- package/resources/courses.d.ts.map +1 -1
- package/resources/index.d.mts +3 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/payment-methods.d.mts +202 -54
- package/resources/payment-methods.d.mts.map +1 -1
- package/resources/payment-methods.d.ts +202 -54
- package/resources/payment-methods.d.ts.map +1 -1
- package/resources/payments.d.mts +55 -1
- package/resources/payments.d.mts.map +1 -1
- package/resources/payments.d.ts +55 -1
- package/resources/payments.d.ts.map +1 -1
- package/resources/payments.js +23 -0
- package/resources/payments.js.map +1 -1
- package/resources/payments.mjs +23 -0
- package/resources/payments.mjs.map +1 -1
- package/resources/payout-methods.d.mts +78 -0
- package/resources/payout-methods.d.mts.map +1 -0
- package/resources/payout-methods.d.ts +78 -0
- package/resources/payout-methods.d.ts.map +1 -0
- package/resources/payout-methods.js +23 -0
- package/resources/payout-methods.js.map +1 -0
- package/resources/payout-methods.mjs +19 -0
- package/resources/payout-methods.mjs.map +1 -0
- package/resources/shared.d.mts +30 -0
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +30 -0
- package/resources/shared.d.ts.map +1 -1
- package/resources/withdrawals.d.mts +170 -1
- package/resources/withdrawals.d.mts.map +1 -1
- package/resources/withdrawals.d.ts +170 -1
- package/resources/withdrawals.d.ts.map +1 -1
- package/resources/withdrawals.js +38 -0
- package/resources/withdrawals.js.map +1 -1
- package/resources/withdrawals.mjs +38 -0
- package/resources/withdrawals.mjs.map +1 -1
- package/src/client.ts +25 -0
- package/src/resources/courses.ts +38 -0
- package/src/resources/index.ts +11 -0
- package/src/resources/payment-methods.ts +236 -54
- package/src/resources/payments.ts +105 -0
- package/src/resources/payout-methods.ts +105 -0
- package/src/resources/shared.ts +34 -0
- package/src/resources/withdrawals.ts +247 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -4,12 +4,38 @@ import { APIPromise } from "../core/api-promise.js";
|
|
|
4
4
|
import { CursorPage, type CursorPageParams, PagePromise } from "../core/pagination.js";
|
|
5
5
|
import { RequestOptions } from "../internal/request-options.js";
|
|
6
6
|
export declare class Withdrawals extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Creates a withdrawal request for a ledger account
|
|
9
|
+
*
|
|
10
|
+
* Required permissions:
|
|
11
|
+
*
|
|
12
|
+
* - `payout:withdraw_funds`
|
|
13
|
+
* - `payout:destination:read`
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const withdrawal = await client.withdrawals.create({
|
|
18
|
+
* amount: 6.9,
|
|
19
|
+
* company_id: 'biz_xxxxxxxxxxxxxx',
|
|
20
|
+
* currency: 'usd',
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
create(body: WithdrawalCreateParams, options?: RequestOptions): APIPromise<WithdrawalCreateResponse>;
|
|
7
25
|
/**
|
|
8
26
|
* Retrieves a withdrawal by ID
|
|
9
27
|
*
|
|
10
28
|
* Required permissions:
|
|
11
29
|
*
|
|
12
30
|
* - `payout:withdrawal:read`
|
|
31
|
+
* - `payout:destination:read`
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* const withdrawal = await client.withdrawals.retrieve(
|
|
36
|
+
* 'wdrl_xxxxxxxxxxxxx',
|
|
37
|
+
* );
|
|
38
|
+
* ```
|
|
13
39
|
*/
|
|
14
40
|
retrieve(id: string, options?: RequestOptions): APIPromise<WithdrawalRetrieveResponse>;
|
|
15
41
|
/**
|
|
@@ -18,6 +44,16 @@ export declare class Withdrawals extends APIResource {
|
|
|
18
44
|
* Required permissions:
|
|
19
45
|
*
|
|
20
46
|
* - `payout:withdrawal:read`
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* // Automatically fetches more pages as needed.
|
|
51
|
+
* for await (const withdrawalListResponse of client.withdrawals.list(
|
|
52
|
+
* { company_id: 'biz_xxxxxxxxxxxxxx' },
|
|
53
|
+
* )) {
|
|
54
|
+
* // ...
|
|
55
|
+
* }
|
|
56
|
+
* ```
|
|
21
57
|
*/
|
|
22
58
|
list(query: WithdrawalListParams, options?: RequestOptions): PagePromise<WithdrawalListResponsesCursorPage, WithdrawalListResponse>;
|
|
23
59
|
}
|
|
@@ -38,6 +74,121 @@ export type WithdrawalStatus = 'requested' | 'awaiting_payment' | 'in_transit' |
|
|
|
38
74
|
* The types of withdrawals
|
|
39
75
|
*/
|
|
40
76
|
export type WithdrawalTypes = 'regular' | 'clawback';
|
|
77
|
+
/**
|
|
78
|
+
* A withdrawal request.
|
|
79
|
+
*/
|
|
80
|
+
export interface WithdrawalCreateResponse {
|
|
81
|
+
/**
|
|
82
|
+
* Internal ID of the withdrawal request.
|
|
83
|
+
*/
|
|
84
|
+
id: string;
|
|
85
|
+
/**
|
|
86
|
+
* How much money was attempted to be withdrawn, in a float type.
|
|
87
|
+
*/
|
|
88
|
+
amount: number;
|
|
89
|
+
/**
|
|
90
|
+
* When the withdrawal request was created.
|
|
91
|
+
*/
|
|
92
|
+
created_at: string;
|
|
93
|
+
/**
|
|
94
|
+
* The currency of the withdrawal request.
|
|
95
|
+
*/
|
|
96
|
+
currency: Shared.Currency;
|
|
97
|
+
/**
|
|
98
|
+
* The different error codes a payout can be in.
|
|
99
|
+
*/
|
|
100
|
+
error_code: 'account_closed' | 'account_does_not_exist' | 'account_information_invalid' | 'account_number_invalid_region' | 'account_frozen' | 'account_lookup_failed' | 'account_not_found' | 'amount_out_of_bounds' | 'attributes_not_validated' | 'b2b_payments_prohibited' | 'bank_statement_required' | 'compliance_review' | 'currency_not_supported' | 'deposit_canceled' | 'deposit_failed' | 'deposit_rejected' | 'destination_unavailable' | 'exceeded_account_limit' | 'expired_quote' | 'generic_payout_error' | 'technical_problem' | 'identification_number_invalid' | 'invalid_account_number' | 'invalid_bank_code' | 'invalid_beneficiary' | 'invalid_branch_number' | 'invalid_branch_code' | 'invalid_phone_number' | 'invalid_routing_number' | 'invalid_swift_code' | 'invalid_company_details' | 'manual_cancelation' | 'misc_error' | 'missing_city_and_country' | 'missing_phone_number' | 'missing_remittance_info' | 'payee_name_invalid' | 'receiving_account_locked' | 'rejected_by_compliance' | 'rtp_not_supported' | 'non_transaction_account' | 'source_token_insufficient_funds' | 'ssn_invalid' | 'wallet_screenshot_required' | 'unsupported_region' | null;
|
|
101
|
+
/**
|
|
102
|
+
* The error message for the withdrawal, if any.
|
|
103
|
+
*/
|
|
104
|
+
error_message: string | null;
|
|
105
|
+
/**
|
|
106
|
+
* The estimated availability date for the withdrawal, if any.
|
|
107
|
+
*/
|
|
108
|
+
estimated_availability: string | null;
|
|
109
|
+
/**
|
|
110
|
+
* The fee amount that was charged for the withdrawal. This is in the same currency
|
|
111
|
+
* as the withdrawal amount.
|
|
112
|
+
*/
|
|
113
|
+
fee_amount: number;
|
|
114
|
+
/**
|
|
115
|
+
* The different fee types for a withdrawal.
|
|
116
|
+
*/
|
|
117
|
+
fee_type: WithdrawalFeeTypes | null;
|
|
118
|
+
/**
|
|
119
|
+
* The ledger account associated with the withdrawal.
|
|
120
|
+
*/
|
|
121
|
+
ledger_account: WithdrawalCreateResponse.LedgerAccount;
|
|
122
|
+
/**
|
|
123
|
+
* The markup fee that was charged for the withdrawal. This is in the same currency
|
|
124
|
+
* as the withdrawal amount. This only applies to platform accounts using Whop
|
|
125
|
+
* Rails.
|
|
126
|
+
*/
|
|
127
|
+
markup_fee: number;
|
|
128
|
+
/**
|
|
129
|
+
* The payout token used for the withdrawal, if applicable.
|
|
130
|
+
*/
|
|
131
|
+
payout_token: WithdrawalCreateResponse.PayoutToken | null;
|
|
132
|
+
/**
|
|
133
|
+
* The speed of the withdrawal.
|
|
134
|
+
*/
|
|
135
|
+
speed: WithdrawalSpeeds;
|
|
136
|
+
/**
|
|
137
|
+
* Status of the withdrawal.
|
|
138
|
+
*/
|
|
139
|
+
status: WithdrawalStatus;
|
|
140
|
+
/**
|
|
141
|
+
* The trace code for the payout, if applicable. Provided on ACH transactions when
|
|
142
|
+
* available.
|
|
143
|
+
*/
|
|
144
|
+
trace_code: string | null;
|
|
145
|
+
/**
|
|
146
|
+
* The type of withdrawal.
|
|
147
|
+
*/
|
|
148
|
+
withdrawal_type: WithdrawalTypes;
|
|
149
|
+
}
|
|
150
|
+
export declare namespace WithdrawalCreateResponse {
|
|
151
|
+
/**
|
|
152
|
+
* The ledger account associated with the withdrawal.
|
|
153
|
+
*/
|
|
154
|
+
interface LedgerAccount {
|
|
155
|
+
/**
|
|
156
|
+
* The ID of the LedgerAccount.
|
|
157
|
+
*/
|
|
158
|
+
id: string;
|
|
159
|
+
/**
|
|
160
|
+
* The ID of the company associated with this ledger account.
|
|
161
|
+
*/
|
|
162
|
+
company_id: string | null;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* The payout token used for the withdrawal, if applicable.
|
|
166
|
+
*/
|
|
167
|
+
interface PayoutToken {
|
|
168
|
+
/**
|
|
169
|
+
* The ID of the payout token
|
|
170
|
+
*/
|
|
171
|
+
id: string;
|
|
172
|
+
/**
|
|
173
|
+
* The date and time the payout token was created
|
|
174
|
+
*/
|
|
175
|
+
created_at: string;
|
|
176
|
+
/**
|
|
177
|
+
* The currency code of the payout destination. This is the currency that payouts
|
|
178
|
+
* will be made in for this token.
|
|
179
|
+
*/
|
|
180
|
+
destination_currency_code: string;
|
|
181
|
+
/**
|
|
182
|
+
* An optional nickname for the payout token to help the user identify it. This is
|
|
183
|
+
* not used by the provider and is only for the user's reference.
|
|
184
|
+
*/
|
|
185
|
+
nickname: string | null;
|
|
186
|
+
/**
|
|
187
|
+
* The name of the payer associated with the payout token.
|
|
188
|
+
*/
|
|
189
|
+
payer_name: string | null;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
41
192
|
/**
|
|
42
193
|
* A withdrawal request.
|
|
43
194
|
*/
|
|
@@ -201,6 +352,24 @@ export interface WithdrawalListResponse {
|
|
|
201
352
|
*/
|
|
202
353
|
withdrawal_type: WithdrawalTypes;
|
|
203
354
|
}
|
|
355
|
+
export interface WithdrawalCreateParams {
|
|
356
|
+
/**
|
|
357
|
+
* The amount to withdraw in the specified currency
|
|
358
|
+
*/
|
|
359
|
+
amount: number;
|
|
360
|
+
/**
|
|
361
|
+
* The ID of the company to withdraw from.
|
|
362
|
+
*/
|
|
363
|
+
company_id: string;
|
|
364
|
+
/**
|
|
365
|
+
* The currency that is being withdrawn.
|
|
366
|
+
*/
|
|
367
|
+
currency: Shared.Currency;
|
|
368
|
+
/**
|
|
369
|
+
* The ID of the payout method to use for the withdrawal.
|
|
370
|
+
*/
|
|
371
|
+
payout_method_id?: string | null;
|
|
372
|
+
}
|
|
204
373
|
export interface WithdrawalListParams extends CursorPageParams {
|
|
205
374
|
/**
|
|
206
375
|
* The ID of the company to list withdrawals for
|
|
@@ -232,6 +401,6 @@ export interface WithdrawalListParams extends CursorPageParams {
|
|
|
232
401
|
last?: number | null;
|
|
233
402
|
}
|
|
234
403
|
export declare namespace Withdrawals {
|
|
235
|
-
export { type WithdrawalFeeTypes as WithdrawalFeeTypes, type WithdrawalSpeeds as WithdrawalSpeeds, type WithdrawalStatus as WithdrawalStatus, type WithdrawalTypes as WithdrawalTypes, type WithdrawalRetrieveResponse as WithdrawalRetrieveResponse, type WithdrawalListResponse as WithdrawalListResponse, type WithdrawalListResponsesCursorPage as WithdrawalListResponsesCursorPage, type WithdrawalListParams as WithdrawalListParams, };
|
|
404
|
+
export { type WithdrawalFeeTypes as WithdrawalFeeTypes, type WithdrawalSpeeds as WithdrawalSpeeds, type WithdrawalStatus as WithdrawalStatus, type WithdrawalTypes as WithdrawalTypes, type WithdrawalCreateResponse as WithdrawalCreateResponse, type WithdrawalRetrieveResponse as WithdrawalRetrieveResponse, type WithdrawalListResponse as WithdrawalListResponse, type WithdrawalListResponsesCursorPage as WithdrawalListResponsesCursorPage, type WithdrawalCreateParams as WithdrawalCreateParams, type WithdrawalListParams as WithdrawalListParams, };
|
|
236
405
|
}
|
|
237
406
|
//# sourceMappingURL=withdrawals.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withdrawals.d.ts","sourceRoot":"","sources":["../src/resources/withdrawals.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;OACd,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE;OAClD,EAAE,cAAc,EAAE;AAGzB,qBAAa,WAAY,SAAQ,WAAW;IAC1C
|
|
1
|
+
{"version":3,"file":"withdrawals.d.ts","sourceRoot":"","sources":["../src/resources/withdrawals.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;OACd,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE;OAClD,EAAE,cAAc,EAAE;AAGzB,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;IAIpG;;;;;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,IAAI,oBAAoB,GAClD,CAAC;CACH"}
|
package/resources/withdrawals.js
CHANGED
|
@@ -6,12 +6,40 @@ const resource_1 = require("../core/resource.js");
|
|
|
6
6
|
const pagination_1 = require("../core/pagination.js");
|
|
7
7
|
const path_1 = require("../internal/utils/path.js");
|
|
8
8
|
class Withdrawals extends resource_1.APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Creates a withdrawal request for a ledger account
|
|
11
|
+
*
|
|
12
|
+
* Required permissions:
|
|
13
|
+
*
|
|
14
|
+
* - `payout:withdraw_funds`
|
|
15
|
+
* - `payout:destination:read`
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const withdrawal = await client.withdrawals.create({
|
|
20
|
+
* amount: 6.9,
|
|
21
|
+
* company_id: 'biz_xxxxxxxxxxxxxx',
|
|
22
|
+
* currency: 'usd',
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
create(body, options) {
|
|
27
|
+
return this._client.post('/withdrawals', { body, ...options });
|
|
28
|
+
}
|
|
9
29
|
/**
|
|
10
30
|
* Retrieves a withdrawal by ID
|
|
11
31
|
*
|
|
12
32
|
* Required permissions:
|
|
13
33
|
*
|
|
14
34
|
* - `payout:withdrawal:read`
|
|
35
|
+
* - `payout:destination:read`
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* const withdrawal = await client.withdrawals.retrieve(
|
|
40
|
+
* 'wdrl_xxxxxxxxxxxxx',
|
|
41
|
+
* );
|
|
42
|
+
* ```
|
|
15
43
|
*/
|
|
16
44
|
retrieve(id, options) {
|
|
17
45
|
return this._client.get((0, path_1.path) `/withdrawals/${id}`, options);
|
|
@@ -22,6 +50,16 @@ class Withdrawals extends resource_1.APIResource {
|
|
|
22
50
|
* Required permissions:
|
|
23
51
|
*
|
|
24
52
|
* - `payout:withdrawal:read`
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* // Automatically fetches more pages as needed.
|
|
57
|
+
* for await (const withdrawalListResponse of client.withdrawals.list(
|
|
58
|
+
* { company_id: 'biz_xxxxxxxxxxxxxx' },
|
|
59
|
+
* )) {
|
|
60
|
+
* // ...
|
|
61
|
+
* }
|
|
62
|
+
* ```
|
|
25
63
|
*/
|
|
26
64
|
list(query, options) {
|
|
27
65
|
return this._client.getAPIList('/withdrawals', (pagination_1.CursorPage), { query, ...options });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withdrawals.js","sourceRoot":"","sources":["../src/resources/withdrawals.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,sDAAoF;AAEpF,oDAA8C;AAE9C,MAAa,WAAY,SAAQ,sBAAW;IAC1C
|
|
1
|
+
{"version":3,"file":"withdrawals.js","sourceRoot":"","sources":["../src/resources/withdrawals.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,sDAAoF;AAEpF,oDAA8C;AAE9C,MAAa,WAAY,SAAQ,sBAAW;IAC1C;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,IAA4B,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,gBAAgB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,IAAI,CACF,KAA2B,EAC3B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,EAAE,CAAA,uBAAkC,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5G,CAAC;CACF;AAhED,kCAgEC"}
|
|
@@ -3,12 +3,40 @@ import { APIResource } from "../core/resource.mjs";
|
|
|
3
3
|
import { CursorPage } from "../core/pagination.mjs";
|
|
4
4
|
import { path } from "../internal/utils/path.mjs";
|
|
5
5
|
export class Withdrawals extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Creates a withdrawal request for a ledger account
|
|
8
|
+
*
|
|
9
|
+
* Required permissions:
|
|
10
|
+
*
|
|
11
|
+
* - `payout:withdraw_funds`
|
|
12
|
+
* - `payout:destination:read`
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const withdrawal = await client.withdrawals.create({
|
|
17
|
+
* amount: 6.9,
|
|
18
|
+
* company_id: 'biz_xxxxxxxxxxxxxx',
|
|
19
|
+
* currency: 'usd',
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
create(body, options) {
|
|
24
|
+
return this._client.post('/withdrawals', { body, ...options });
|
|
25
|
+
}
|
|
6
26
|
/**
|
|
7
27
|
* Retrieves a withdrawal by ID
|
|
8
28
|
*
|
|
9
29
|
* Required permissions:
|
|
10
30
|
*
|
|
11
31
|
* - `payout:withdrawal:read`
|
|
32
|
+
* - `payout:destination:read`
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* const withdrawal = await client.withdrawals.retrieve(
|
|
37
|
+
* 'wdrl_xxxxxxxxxxxxx',
|
|
38
|
+
* );
|
|
39
|
+
* ```
|
|
12
40
|
*/
|
|
13
41
|
retrieve(id, options) {
|
|
14
42
|
return this._client.get(path `/withdrawals/${id}`, options);
|
|
@@ -19,6 +47,16 @@ export class Withdrawals extends APIResource {
|
|
|
19
47
|
* Required permissions:
|
|
20
48
|
*
|
|
21
49
|
* - `payout:withdrawal:read`
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* // Automatically fetches more pages as needed.
|
|
54
|
+
* for await (const withdrawalListResponse of client.withdrawals.list(
|
|
55
|
+
* { company_id: 'biz_xxxxxxxxxxxxxx' },
|
|
56
|
+
* )) {
|
|
57
|
+
* // ...
|
|
58
|
+
* }
|
|
59
|
+
* ```
|
|
22
60
|
*/
|
|
23
61
|
list(query, options) {
|
|
24
62
|
return this._client.getAPIList('/withdrawals', (CursorPage), { query, ...options });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withdrawals.mjs","sourceRoot":"","sources":["../src/resources/withdrawals.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,UAAU,EAAsC;OAElD,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C
|
|
1
|
+
{"version":3,"file":"withdrawals.mjs","sourceRoot":"","sources":["../src/resources/withdrawals.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,UAAU,EAAsC;OAElD,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,IAA4B,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,gBAAgB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,IAAI,CACF,KAA2B,EAC3B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,EAAE,CAAA,UAAkC,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5G,CAAC;CACF"}
|
package/src/client.ts
CHANGED
|
@@ -215,6 +215,9 @@ import {
|
|
|
215
215
|
BillingReasons,
|
|
216
216
|
CardBrands,
|
|
217
217
|
PaymentCreateParams,
|
|
218
|
+
PaymentListFeesParams,
|
|
219
|
+
PaymentListFeesResponse,
|
|
220
|
+
PaymentListFeesResponsesCursorPage,
|
|
218
221
|
PaymentListParams,
|
|
219
222
|
PaymentListResponse,
|
|
220
223
|
PaymentListResponsesCursorPage,
|
|
@@ -222,6 +225,12 @@ import {
|
|
|
222
225
|
PaymentRefundParams,
|
|
223
226
|
Payments,
|
|
224
227
|
} from './resources/payments';
|
|
228
|
+
import {
|
|
229
|
+
PayoutMethodListParams,
|
|
230
|
+
PayoutMethodListResponse,
|
|
231
|
+
PayoutMethodListResponsesCursorPage,
|
|
232
|
+
PayoutMethods,
|
|
233
|
+
} from './resources/payout-methods';
|
|
225
234
|
import {
|
|
226
235
|
PlanCreateParams,
|
|
227
236
|
PlanDeleteResponse,
|
|
@@ -338,6 +347,8 @@ import {
|
|
|
338
347
|
WithdrawalUpdatedWebhookEvent,
|
|
339
348
|
} from './resources/webhooks';
|
|
340
349
|
import {
|
|
350
|
+
WithdrawalCreateParams,
|
|
351
|
+
WithdrawalCreateResponse,
|
|
341
352
|
WithdrawalFeeTypes,
|
|
342
353
|
WithdrawalListParams,
|
|
343
354
|
WithdrawalListResponse,
|
|
@@ -1114,6 +1125,7 @@ export class Whop {
|
|
|
1114
1125
|
setupIntents: API.SetupIntents = new API.SetupIntents(this);
|
|
1115
1126
|
paymentMethods: API.PaymentMethods = new API.PaymentMethods(this);
|
|
1116
1127
|
feeMarkups: API.FeeMarkups = new API.FeeMarkups(this);
|
|
1128
|
+
payoutMethods: API.PayoutMethods = new API.PayoutMethods(this);
|
|
1117
1129
|
}
|
|
1118
1130
|
|
|
1119
1131
|
Whop.Apps = Apps;
|
|
@@ -1156,6 +1168,7 @@ Whop.AccountLinks = AccountLinks;
|
|
|
1156
1168
|
Whop.SetupIntents = SetupIntents;
|
|
1157
1169
|
Whop.PaymentMethods = PaymentMethods;
|
|
1158
1170
|
Whop.FeeMarkups = FeeMarkups;
|
|
1171
|
+
Whop.PayoutMethods = PayoutMethods;
|
|
1159
1172
|
|
|
1160
1173
|
export declare namespace Whop {
|
|
1161
1174
|
export type RequestOptions = Opts.RequestOptions;
|
|
@@ -1344,9 +1357,12 @@ export declare namespace Whop {
|
|
|
1344
1357
|
type CardBrands as CardBrands,
|
|
1345
1358
|
type PaymentMethodTypes as PaymentMethodTypes,
|
|
1346
1359
|
type PaymentListResponse as PaymentListResponse,
|
|
1360
|
+
type PaymentListFeesResponse as PaymentListFeesResponse,
|
|
1347
1361
|
type PaymentListResponsesCursorPage as PaymentListResponsesCursorPage,
|
|
1362
|
+
type PaymentListFeesResponsesCursorPage as PaymentListFeesResponsesCursorPage,
|
|
1348
1363
|
type PaymentCreateParams as PaymentCreateParams,
|
|
1349
1364
|
type PaymentListParams as PaymentListParams,
|
|
1365
|
+
type PaymentListFeesParams as PaymentListFeesParams,
|
|
1350
1366
|
type PaymentRefundParams as PaymentRefundParams,
|
|
1351
1367
|
};
|
|
1352
1368
|
|
|
@@ -1507,9 +1523,11 @@ export declare namespace Whop {
|
|
|
1507
1523
|
type WithdrawalSpeeds as WithdrawalSpeeds,
|
|
1508
1524
|
type WithdrawalStatus as WithdrawalStatus,
|
|
1509
1525
|
type WithdrawalTypes as WithdrawalTypes,
|
|
1526
|
+
type WithdrawalCreateResponse as WithdrawalCreateResponse,
|
|
1510
1527
|
type WithdrawalRetrieveResponse as WithdrawalRetrieveResponse,
|
|
1511
1528
|
type WithdrawalListResponse as WithdrawalListResponse,
|
|
1512
1529
|
type WithdrawalListResponsesCursorPage as WithdrawalListResponsesCursorPage,
|
|
1530
|
+
type WithdrawalCreateParams as WithdrawalCreateParams,
|
|
1513
1531
|
type WithdrawalListParams as WithdrawalListParams,
|
|
1514
1532
|
};
|
|
1515
1533
|
|
|
@@ -1548,6 +1566,13 @@ export declare namespace Whop {
|
|
|
1548
1566
|
type FeeMarkupListParams as FeeMarkupListParams,
|
|
1549
1567
|
};
|
|
1550
1568
|
|
|
1569
|
+
export {
|
|
1570
|
+
PayoutMethods as PayoutMethods,
|
|
1571
|
+
type PayoutMethodListResponse as PayoutMethodListResponse,
|
|
1572
|
+
type PayoutMethodListResponsesCursorPage as PayoutMethodListResponsesCursorPage,
|
|
1573
|
+
type PayoutMethodListParams as PayoutMethodListParams,
|
|
1574
|
+
};
|
|
1575
|
+
|
|
1551
1576
|
export type AccessLevel = API.AccessLevel;
|
|
1552
1577
|
export type AccessPassType = API.AccessPassType;
|
|
1553
1578
|
export type App = API.App;
|
package/src/resources/courses.ts
CHANGED
|
@@ -235,10 +235,48 @@ export namespace Course {
|
|
|
235
235
|
*/
|
|
236
236
|
order: number;
|
|
237
237
|
|
|
238
|
+
/**
|
|
239
|
+
* The thumbnail for the lesson
|
|
240
|
+
*/
|
|
241
|
+
thumbnail: Lesson.Thumbnail | null;
|
|
242
|
+
|
|
238
243
|
/**
|
|
239
244
|
* The title of the lesson
|
|
240
245
|
*/
|
|
241
246
|
title: string;
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* The associated Mux asset for video lessons
|
|
250
|
+
*/
|
|
251
|
+
video_asset: Lesson.VideoAsset | null;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export namespace Lesson {
|
|
255
|
+
/**
|
|
256
|
+
* The thumbnail for the lesson
|
|
257
|
+
*/
|
|
258
|
+
export interface Thumbnail {
|
|
259
|
+
/**
|
|
260
|
+
* This is the URL you use to render optimized attachments on the client. This
|
|
261
|
+
* should be used for apps.
|
|
262
|
+
*/
|
|
263
|
+
url: string | null;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* The associated Mux asset for video lessons
|
|
268
|
+
*/
|
|
269
|
+
export interface VideoAsset {
|
|
270
|
+
/**
|
|
271
|
+
* The duration of the video in seconds
|
|
272
|
+
*/
|
|
273
|
+
duration_seconds: number | null;
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* The signed thumbnail playback token of the Mux asset
|
|
277
|
+
*/
|
|
278
|
+
signed_thumbnail_playback_token: string | null;
|
|
279
|
+
}
|
|
242
280
|
}
|
|
243
281
|
}
|
|
244
282
|
|
package/src/resources/index.ts
CHANGED
|
@@ -204,11 +204,20 @@ export {
|
|
|
204
204
|
type CardBrands,
|
|
205
205
|
type PaymentMethodTypes,
|
|
206
206
|
type PaymentListResponse,
|
|
207
|
+
type PaymentListFeesResponse,
|
|
207
208
|
type PaymentCreateParams,
|
|
208
209
|
type PaymentListParams,
|
|
210
|
+
type PaymentListFeesParams,
|
|
209
211
|
type PaymentRefundParams,
|
|
210
212
|
type PaymentListResponsesCursorPage,
|
|
213
|
+
type PaymentListFeesResponsesCursorPage,
|
|
211
214
|
} from './payments';
|
|
215
|
+
export {
|
|
216
|
+
PayoutMethods,
|
|
217
|
+
type PayoutMethodListResponse,
|
|
218
|
+
type PayoutMethodListParams,
|
|
219
|
+
type PayoutMethodListResponsesCursorPage,
|
|
220
|
+
} from './payout-methods';
|
|
212
221
|
export {
|
|
213
222
|
Plans,
|
|
214
223
|
type PlanListResponse,
|
|
@@ -330,8 +339,10 @@ export {
|
|
|
330
339
|
type WithdrawalSpeeds,
|
|
331
340
|
type WithdrawalStatus,
|
|
332
341
|
type WithdrawalTypes,
|
|
342
|
+
type WithdrawalCreateResponse,
|
|
333
343
|
type WithdrawalRetrieveResponse,
|
|
334
344
|
type WithdrawalListResponse,
|
|
345
|
+
type WithdrawalCreateParams,
|
|
335
346
|
type WithdrawalListParams,
|
|
336
347
|
type WithdrawalListResponsesCursorPage,
|
|
337
348
|
} from './withdrawals';
|