@whop/sdk 0.0.21 → 0.0.23
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 +24 -0
- package/client.d.mts +16 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +16 -4
- package/client.d.ts.map +1 -1
- package/client.js +12 -0
- package/client.js.map +1 -1
- package/client.mjs +12 -0
- package/client.mjs.map +1 -1
- package/lib/upload-file.d.mts +39 -0
- package/lib/upload-file.d.mts.map +1 -0
- package/lib/upload-file.d.ts +39 -0
- package/lib/upload-file.d.ts.map +1 -0
- package/lib/upload-file.js +68 -0
- package/lib/upload-file.js.map +1 -0
- package/lib/upload-file.mjs +65 -0
- package/lib/upload-file.mjs.map +1 -0
- package/package.json +1 -1
- package/resources/files.d.mts +104 -0
- package/resources/files.d.mts.map +1 -0
- package/resources/files.d.ts +104 -0
- package/resources/files.d.ts.map +1 -0
- package/resources/files.js +35 -0
- package/resources/files.js.map +1 -0
- package/resources/files.mjs +31 -0
- package/resources/files.mjs.map +1 -0
- package/resources/index.d.mts +6 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +6 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +9 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +4 -0
- package/resources/index.mjs.map +1 -1
- package/resources/leads.d.mts +489 -0
- package/resources/leads.d.mts.map +1 -0
- package/resources/leads.d.ts +489 -0
- package/resources/leads.d.ts.map +1 -0
- package/resources/leads.js +94 -0
- package/resources/leads.js.map +1 -0
- package/resources/leads.mjs +90 -0
- package/resources/leads.mjs.map +1 -0
- package/resources/ledger-accounts.d.mts +25 -0
- package/resources/ledger-accounts.d.mts.map +1 -1
- package/resources/ledger-accounts.d.ts +25 -0
- package/resources/ledger-accounts.d.ts.map +1 -1
- package/resources/payments.d.mts +1 -1
- package/resources/payments.d.mts.map +1 -1
- package/resources/payments.d.ts +1 -1
- package/resources/payments.d.ts.map +1 -1
- package/resources/payout-methods.d.mts +69 -1
- package/resources/payout-methods.d.mts.map +1 -1
- package/resources/payout-methods.d.ts +69 -1
- package/resources/payout-methods.d.ts.map +1 -1
- package/resources/payout-methods.js +11 -0
- package/resources/payout-methods.js.map +1 -1
- package/resources/payout-methods.mjs +11 -0
- package/resources/payout-methods.mjs.map +1 -1
- package/resources/plans.d.mts +8 -0
- package/resources/plans.d.mts.map +1 -1
- package/resources/plans.d.ts +8 -0
- package/resources/plans.d.ts.map +1 -1
- package/resources/topups.d.mts +79 -0
- package/resources/topups.d.mts.map +1 -0
- package/resources/topups.d.ts +79 -0
- package/resources/topups.d.ts.map +1 -0
- package/resources/topups.js +29 -0
- package/resources/topups.js.map +1 -0
- package/resources/topups.mjs +25 -0
- package/resources/topups.mjs.map +1 -0
- package/resources/verifications.d.mts +38 -0
- package/resources/verifications.d.mts.map +1 -0
- package/resources/verifications.d.ts +38 -0
- package/resources/verifications.d.ts.map +1 -0
- package/resources/verifications.js +20 -0
- package/resources/verifications.js.map +1 -0
- package/resources/verifications.mjs +16 -0
- package/resources/verifications.mjs.map +1 -0
- package/resources/webhooks.d.mts +431 -1
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +431 -1
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js +90 -0
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +90 -0
- package/resources/webhooks.mjs.map +1 -1
- package/src/client.ts +72 -0
- package/src/lib/upload-file.ts +115 -0
- package/src/resources/files.ts +140 -0
- package/src/resources/index.ts +24 -0
- package/src/resources/leads.ts +583 -0
- package/src/resources/ledger-accounts.ts +63 -0
- package/src/resources/payments.ts +30 -30
- package/src/resources/payout-methods.ts +83 -0
- package/src/resources/plans.ts +10 -0
- package/src/resources/topups.ts +95 -0
- package/src/resources/verifications.ts +81 -0
- package/src/resources/webhooks.ts +793 -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
|
@@ -243,35 +243,34 @@ export type CardBrands =
|
|
|
243
243
|
* The different types of payment methods that can be used.
|
|
244
244
|
*/
|
|
245
245
|
export type PaymentMethodTypes =
|
|
246
|
-
| 'acss_debit'
|
|
247
|
-
| 'affirm'
|
|
248
246
|
| 'afterpay_clearpay'
|
|
249
247
|
| 'alipay'
|
|
250
|
-
| 'alma'
|
|
251
248
|
| 'amazon_pay'
|
|
252
249
|
| 'apple_pay'
|
|
253
|
-
| 'au_becs_debit'
|
|
254
|
-
| 'bacs_debit'
|
|
255
250
|
| 'bancontact'
|
|
256
|
-
| 'billie'
|
|
257
|
-
| 'blik'
|
|
258
|
-
| 'boleto'
|
|
259
251
|
| 'card'
|
|
260
252
|
| 'cashapp'
|
|
261
253
|
| 'crypto'
|
|
262
|
-
| 'eps'
|
|
263
|
-
| 'fpx'
|
|
264
|
-
| 'giropay'
|
|
265
254
|
| 'google_pay'
|
|
266
|
-
| 'grabpay'
|
|
267
255
|
| 'ideal'
|
|
268
|
-
| 'kakao_pay'
|
|
269
256
|
| 'klarna'
|
|
270
|
-
| 'konbini'
|
|
271
|
-
| 'kr_card'
|
|
272
|
-
| 'link'
|
|
273
257
|
| 'mobilepay'
|
|
258
|
+
| 'sepa_debit'
|
|
259
|
+
| 'swish'
|
|
260
|
+
| 'twint'
|
|
261
|
+
| 'us_bank_account'
|
|
262
|
+
| 'zip'
|
|
263
|
+
| 'vipps'
|
|
264
|
+
| 'paypal'
|
|
265
|
+
| 'sezzle'
|
|
266
|
+
| 'coinbase'
|
|
267
|
+
| 'splitit'
|
|
268
|
+
| 'platform_balance'
|
|
269
|
+
| 'apple'
|
|
270
|
+
| 'venmo'
|
|
271
|
+
| 'affirm'
|
|
274
272
|
| 'multibanco'
|
|
273
|
+
| 'wechat_pay'
|
|
275
274
|
| 'naver_pay'
|
|
276
275
|
| 'nz_bank_account'
|
|
277
276
|
| 'oxxo'
|
|
@@ -284,13 +283,22 @@ export type PaymentMethodTypes =
|
|
|
284
283
|
| 'revolut_pay'
|
|
285
284
|
| 'samsung_pay'
|
|
286
285
|
| 'satispay'
|
|
287
|
-
| 'sepa_debit'
|
|
288
286
|
| 'sofort'
|
|
289
|
-
| '
|
|
290
|
-
| '
|
|
291
|
-
| '
|
|
292
|
-
| '
|
|
293
|
-
| '
|
|
287
|
+
| 'konbini'
|
|
288
|
+
| 'kr_card'
|
|
289
|
+
| 'link'
|
|
290
|
+
| 'grabpay'
|
|
291
|
+
| 'kakao_pay'
|
|
292
|
+
| 'billie'
|
|
293
|
+
| 'blik'
|
|
294
|
+
| 'boleto'
|
|
295
|
+
| 'eps'
|
|
296
|
+
| 'fpx'
|
|
297
|
+
| 'giropay'
|
|
298
|
+
| 'acss_debit'
|
|
299
|
+
| 'alma'
|
|
300
|
+
| 'au_becs_debit'
|
|
301
|
+
| 'bacs_debit'
|
|
294
302
|
| 'bizum'
|
|
295
303
|
| 'capchase_pay'
|
|
296
304
|
| 'kriya'
|
|
@@ -299,7 +307,6 @@ export type PaymentMethodTypes =
|
|
|
299
307
|
| 'paypay'
|
|
300
308
|
| 'sequra'
|
|
301
309
|
| 'scalapay'
|
|
302
|
-
| 'vipps'
|
|
303
310
|
| 'custom'
|
|
304
311
|
| 'customer_balance'
|
|
305
312
|
| 'gopay'
|
|
@@ -309,7 +316,6 @@ export type PaymentMethodTypes =
|
|
|
309
316
|
| 'ng_card'
|
|
310
317
|
| 'ng_market'
|
|
311
318
|
| 'ng_ussd'
|
|
312
|
-
| 'paypal'
|
|
313
319
|
| 'payto'
|
|
314
320
|
| 'qris'
|
|
315
321
|
| 'rechnung'
|
|
@@ -322,12 +328,6 @@ export type PaymentMethodTypes =
|
|
|
322
328
|
| 'id_bank_transfer'
|
|
323
329
|
| 'demo_pay'
|
|
324
330
|
| 'shop_pay'
|
|
325
|
-
| 'sezzle'
|
|
326
|
-
| 'coinbase'
|
|
327
|
-
| 'splitit'
|
|
328
|
-
| 'platform_balance'
|
|
329
|
-
| 'apple'
|
|
330
|
-
| 'venmo'
|
|
331
331
|
| 'unknown';
|
|
332
332
|
|
|
333
333
|
/**
|
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
4
5
|
import { CursorPage, type CursorPageParams, PagePromise } from '../core/pagination';
|
|
5
6
|
import { RequestOptions } from '../internal/request-options';
|
|
7
|
+
import { path } from '../internal/utils/path';
|
|
6
8
|
|
|
7
9
|
export class PayoutMethods extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Retrieves a payout method by ID
|
|
12
|
+
*
|
|
13
|
+
* Required permissions:
|
|
14
|
+
*
|
|
15
|
+
* - `payout:destination:read`
|
|
16
|
+
*/
|
|
17
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<PayoutMethodRetrieveResponse> {
|
|
18
|
+
return this._client.get(path`/payout_methods/${id}`, options);
|
|
19
|
+
}
|
|
20
|
+
|
|
8
21
|
/**
|
|
9
22
|
* Lists payout destinations for a company
|
|
10
23
|
*
|
|
@@ -25,6 +38,75 @@ export class PayoutMethods extends APIResource {
|
|
|
25
38
|
|
|
26
39
|
export type PayoutMethodListResponsesCursorPage = CursorPage<PayoutMethodListResponse>;
|
|
27
40
|
|
|
41
|
+
/**
|
|
42
|
+
* An object representing an user's setup payout destination.
|
|
43
|
+
*/
|
|
44
|
+
export interface PayoutMethodRetrieveResponse {
|
|
45
|
+
/**
|
|
46
|
+
* The ID of the payout token
|
|
47
|
+
*/
|
|
48
|
+
id: string;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* The company associated with the payout token
|
|
52
|
+
*/
|
|
53
|
+
company: PayoutMethodRetrieveResponse.Company | null;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The currency code of the payout destination. This is the currency that payouts
|
|
57
|
+
* will be made in for this token.
|
|
58
|
+
*/
|
|
59
|
+
currency: string;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* The payout destination associated with the payout token
|
|
63
|
+
*/
|
|
64
|
+
destination: PayoutMethodRetrieveResponse.Destination | null;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Whether this payout token is the default for the payout account
|
|
68
|
+
*/
|
|
69
|
+
is_default: boolean;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* An optional nickname for the payout token to help the user identify it. This is
|
|
73
|
+
* not used by the provider and is only for the user's reference.
|
|
74
|
+
*/
|
|
75
|
+
nickname: string | null;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export namespace PayoutMethodRetrieveResponse {
|
|
79
|
+
/**
|
|
80
|
+
* The company associated with the payout token
|
|
81
|
+
*/
|
|
82
|
+
export interface Company {
|
|
83
|
+
/**
|
|
84
|
+
* The ID (tag) of the company.
|
|
85
|
+
*/
|
|
86
|
+
id: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* The payout destination associated with the payout token
|
|
91
|
+
*/
|
|
92
|
+
export interface Destination {
|
|
93
|
+
/**
|
|
94
|
+
* The category of the payout destination
|
|
95
|
+
*/
|
|
96
|
+
category: 'crypto' | 'rtp' | 'next_day_bank' | 'bank_wire' | 'digital_wallet' | 'unknown';
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* The country code of the payout destination
|
|
100
|
+
*/
|
|
101
|
+
country_code: string;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* The name of the payer associated with the payout destination
|
|
105
|
+
*/
|
|
106
|
+
name: string;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
28
110
|
/**
|
|
29
111
|
* An object representing an user's setup payout destination.
|
|
30
112
|
*/
|
|
@@ -118,6 +200,7 @@ export interface PayoutMethodListParams extends CursorPageParams {
|
|
|
118
200
|
|
|
119
201
|
export declare namespace PayoutMethods {
|
|
120
202
|
export {
|
|
203
|
+
type PayoutMethodRetrieveResponse as PayoutMethodRetrieveResponse,
|
|
121
204
|
type PayoutMethodListResponse as PayoutMethodListResponse,
|
|
122
205
|
type PayoutMethodListResponsesCursorPage as PayoutMethodListResponsesCursorPage,
|
|
123
206
|
type PayoutMethodListParams as PayoutMethodListParams,
|
package/src/resources/plans.ts
CHANGED
|
@@ -370,6 +370,11 @@ export interface PlanCreateParams {
|
|
|
370
370
|
*/
|
|
371
371
|
internal_notes?: string | null;
|
|
372
372
|
|
|
373
|
+
/**
|
|
374
|
+
* Whether this plan uses legacy payment method controls
|
|
375
|
+
*/
|
|
376
|
+
legacy_payment_method_controls?: boolean | null;
|
|
377
|
+
|
|
373
378
|
/**
|
|
374
379
|
* Whether or not the tax is included in a plan's price (or if it hasn't been set
|
|
375
380
|
* up)
|
|
@@ -555,6 +560,11 @@ export interface PlanUpdateParams {
|
|
|
555
560
|
*/
|
|
556
561
|
internal_notes?: string | null;
|
|
557
562
|
|
|
563
|
+
/**
|
|
564
|
+
* Whether this plan uses legacy payment method controls
|
|
565
|
+
*/
|
|
566
|
+
legacy_payment_method_controls?: boolean | null;
|
|
567
|
+
|
|
558
568
|
/**
|
|
559
569
|
* Whether or not to offer a discount to cancel a subscription.
|
|
560
570
|
*/
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import * as Shared from './shared';
|
|
5
|
+
import { APIPromise } from '../core/api-promise';
|
|
6
|
+
import { RequestOptions } from '../internal/request-options';
|
|
7
|
+
|
|
8
|
+
export class Topups extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Add funds to your platform balance by charging a stored payment method.
|
|
11
|
+
*
|
|
12
|
+
* Required permissions:
|
|
13
|
+
*
|
|
14
|
+
* - `payment:charge`
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const topup = await client.topups.create({
|
|
19
|
+
* amount: 6.9,
|
|
20
|
+
* company_id: 'biz_xxxxxxxxxxxxxx',
|
|
21
|
+
* currency: 'usd',
|
|
22
|
+
* payment_method_id: 'pmt_xxxxxxxxxxxxxx',
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
create(body: TopupCreateParams, options?: RequestOptions): APIPromise<TopupCreateResponse> {
|
|
27
|
+
return this._client.post('/topups', { body, ...options });
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* An object representing a receipt for a membership.
|
|
33
|
+
*/
|
|
34
|
+
export interface TopupCreateResponse {
|
|
35
|
+
/**
|
|
36
|
+
* The payment ID
|
|
37
|
+
*/
|
|
38
|
+
id: string;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The datetime the payment was created
|
|
42
|
+
*/
|
|
43
|
+
created_at: string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The available currencies on the platform
|
|
47
|
+
*/
|
|
48
|
+
currency: Shared.Currency | null;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* If the payment failed, the reason for the failure.
|
|
52
|
+
*/
|
|
53
|
+
failure_message: string | null;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The datetime the payment was paid
|
|
57
|
+
*/
|
|
58
|
+
paid_at: string | null;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The status of a receipt
|
|
62
|
+
*/
|
|
63
|
+
status: Shared.ReceiptStatus | null;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* The total to show to the creator (excluding buyer fees).
|
|
67
|
+
*/
|
|
68
|
+
total: number | null;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface TopupCreateParams {
|
|
72
|
+
/**
|
|
73
|
+
* The amount to add to the balance.
|
|
74
|
+
*/
|
|
75
|
+
amount: number;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* The ID of the company to add funds to.
|
|
79
|
+
*/
|
|
80
|
+
company_id: string;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* The currency of the top-up.
|
|
84
|
+
*/
|
|
85
|
+
currency: Shared.Currency;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* The ID of the payment method to charge for the top-up.
|
|
89
|
+
*/
|
|
90
|
+
payment_method_id: string;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export declare namespace Topups {
|
|
94
|
+
export { type TopupCreateResponse as TopupCreateResponse, type TopupCreateParams as TopupCreateParams };
|
|
95
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../internal/request-options';
|
|
6
|
+
import { path } from '../internal/utils/path';
|
|
7
|
+
|
|
8
|
+
export class Verifications extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Retrieves a verification by ID
|
|
11
|
+
*
|
|
12
|
+
* Required permissions:
|
|
13
|
+
*
|
|
14
|
+
* - `payout:account:read`
|
|
15
|
+
*/
|
|
16
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<VerificationRetrieveResponse> {
|
|
17
|
+
return this._client.get(path`/verifications/${id}`, options);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* An object representing an identity verification session
|
|
23
|
+
*/
|
|
24
|
+
export interface VerificationRetrieveResponse {
|
|
25
|
+
/**
|
|
26
|
+
* A unique identifier for the verification.
|
|
27
|
+
*/
|
|
28
|
+
id: string;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* An error code for a verification attempt.
|
|
32
|
+
*/
|
|
33
|
+
last_error_code:
|
|
34
|
+
| 'abandoned'
|
|
35
|
+
| 'consent_declined'
|
|
36
|
+
| 'country_not_supported'
|
|
37
|
+
| 'device_not_supported'
|
|
38
|
+
| 'document_expired'
|
|
39
|
+
| 'document_type_not_supported'
|
|
40
|
+
| 'document_unverified_other'
|
|
41
|
+
| 'email_unverified_other'
|
|
42
|
+
| 'email_verification_declined'
|
|
43
|
+
| 'id_number_insufficient_document_data'
|
|
44
|
+
| 'id_number_mismatch'
|
|
45
|
+
| 'id_number_unverified_other'
|
|
46
|
+
| 'phone_unverified_other'
|
|
47
|
+
| 'phone_verification_declined'
|
|
48
|
+
| 'selfie_document_missing_photo'
|
|
49
|
+
| 'selfie_face_mismatch'
|
|
50
|
+
| 'selfie_manipulated'
|
|
51
|
+
| 'selfie_unverified_other'
|
|
52
|
+
| 'under_supported_age'
|
|
53
|
+
| null;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The last error reason that occurred during the verification.
|
|
57
|
+
*/
|
|
58
|
+
last_error_reason: string | null;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The status of the verification.
|
|
62
|
+
*/
|
|
63
|
+
status:
|
|
64
|
+
| 'requires_input'
|
|
65
|
+
| 'processing'
|
|
66
|
+
| 'verified'
|
|
67
|
+
| 'canceled'
|
|
68
|
+
| 'created'
|
|
69
|
+
| 'started'
|
|
70
|
+
| 'submitted'
|
|
71
|
+
| 'approved'
|
|
72
|
+
| 'declined'
|
|
73
|
+
| 'resubmission_requested'
|
|
74
|
+
| 'expired'
|
|
75
|
+
| 'abandoned'
|
|
76
|
+
| 'review';
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export declare namespace Verifications {
|
|
80
|
+
export { type VerificationRetrieveResponse as VerificationRetrieveResponse };
|
|
81
|
+
}
|