@whop/sdk 0.0.14 → 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.
Files changed (86) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/client.d.mts +10 -4
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +10 -4
  5. package/client.d.ts.map +1 -1
  6. package/client.js +6 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +6 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/checkout-configurations.d.mts +16 -0
  12. package/resources/checkout-configurations.d.mts.map +1 -1
  13. package/resources/checkout-configurations.d.ts +16 -0
  14. package/resources/checkout-configurations.d.ts.map +1 -1
  15. package/resources/courses.d.mts +33 -0
  16. package/resources/courses.d.mts.map +1 -1
  17. package/resources/courses.d.ts +33 -0
  18. package/resources/courses.d.ts.map +1 -1
  19. package/resources/experiences.d.mts +12 -0
  20. package/resources/experiences.d.mts.map +1 -1
  21. package/resources/experiences.d.ts +12 -0
  22. package/resources/experiences.d.ts.map +1 -1
  23. package/resources/fee-markups.d.mts +179 -0
  24. package/resources/fee-markups.d.mts.map +1 -0
  25. package/resources/fee-markups.d.ts +179 -0
  26. package/resources/fee-markups.d.ts.map +1 -0
  27. package/resources/fee-markups.js +64 -0
  28. package/resources/fee-markups.js.map +1 -0
  29. package/resources/fee-markups.mjs +60 -0
  30. package/resources/fee-markups.mjs.map +1 -0
  31. package/resources/index.d.mts +4 -2
  32. package/resources/index.d.mts.map +1 -1
  33. package/resources/index.d.ts +4 -2
  34. package/resources/index.d.ts.map +1 -1
  35. package/resources/index.js +5 -1
  36. package/resources/index.js.map +1 -1
  37. package/resources/index.mjs +2 -0
  38. package/resources/index.mjs.map +1 -1
  39. package/resources/payment-methods.d.mts +202 -54
  40. package/resources/payment-methods.d.mts.map +1 -1
  41. package/resources/payment-methods.d.ts +202 -54
  42. package/resources/payment-methods.d.ts.map +1 -1
  43. package/resources/payments.d.mts +55 -1
  44. package/resources/payments.d.mts.map +1 -1
  45. package/resources/payments.d.ts +55 -1
  46. package/resources/payments.d.ts.map +1 -1
  47. package/resources/payments.js +23 -0
  48. package/resources/payments.js.map +1 -1
  49. package/resources/payments.mjs +23 -0
  50. package/resources/payments.mjs.map +1 -1
  51. package/resources/payout-methods.d.mts +78 -0
  52. package/resources/payout-methods.d.mts.map +1 -0
  53. package/resources/payout-methods.d.ts +78 -0
  54. package/resources/payout-methods.d.ts.map +1 -0
  55. package/resources/payout-methods.js +23 -0
  56. package/resources/payout-methods.js.map +1 -0
  57. package/resources/payout-methods.mjs +19 -0
  58. package/resources/payout-methods.mjs.map +1 -0
  59. package/resources/shared.d.mts +38 -0
  60. package/resources/shared.d.mts.map +1 -1
  61. package/resources/shared.d.ts +38 -0
  62. package/resources/shared.d.ts.map +1 -1
  63. package/resources/withdrawals.d.mts +170 -1
  64. package/resources/withdrawals.d.mts.map +1 -1
  65. package/resources/withdrawals.d.ts +170 -1
  66. package/resources/withdrawals.d.ts.map +1 -1
  67. package/resources/withdrawals.js +38 -0
  68. package/resources/withdrawals.js.map +1 -1
  69. package/resources/withdrawals.mjs +38 -0
  70. package/resources/withdrawals.mjs.map +1 -1
  71. package/src/client.ts +48 -0
  72. package/src/resources/checkout-configurations.ts +20 -0
  73. package/src/resources/courses.ts +38 -0
  74. package/src/resources/experiences.ts +15 -0
  75. package/src/resources/fee-markups.ts +232 -0
  76. package/src/resources/index.ts +21 -0
  77. package/src/resources/payment-methods.ts +236 -54
  78. package/src/resources/payments.ts +105 -0
  79. package/src/resources/payout-methods.ts +105 -0
  80. package/src/resources/shared.ts +44 -0
  81. package/src/resources/withdrawals.ts +247 -0
  82. package/src/version.ts +1 -1
  83. package/version.d.mts +1 -1
  84. package/version.d.ts +1 -1
  85. package/version.js +1 -1
  86. package/version.mjs +1 -1
@@ -0,0 +1,232 @@
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 { CursorPage, type CursorPageParams, PagePromise } from '../core/pagination';
6
+ import { RequestOptions } from '../internal/request-options';
7
+ import { path } from '../internal/utils/path';
8
+
9
+ export class FeeMarkups extends APIResource {
10
+ /**
11
+ * Creates or updates a fee markup for a company.
12
+ *
13
+ * Required permissions:
14
+ *
15
+ * - `company:update_child_fees`
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * const feeMarkup = await client.feeMarkups.create({
20
+ * company_id: 'biz_xxxxxxxxxxxxxx',
21
+ * fee_type: 'crypto_withdrawal_markup',
22
+ * });
23
+ * ```
24
+ */
25
+ create(body: FeeMarkupCreateParams, options?: RequestOptions): APIPromise<FeeMarkupCreateResponse> {
26
+ return this._client.post('/fee_markups', { body, ...options });
27
+ }
28
+
29
+ /**
30
+ * Lists fee markups for a company.
31
+ *
32
+ * Required permissions:
33
+ *
34
+ * - `company:update_child_fees`
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * // Automatically fetches more pages as needed.
39
+ * for await (const feeMarkupListResponse of client.feeMarkups.list(
40
+ * { company_id: 'biz_xxxxxxxxxxxxxx' },
41
+ * )) {
42
+ * // ...
43
+ * }
44
+ * ```
45
+ */
46
+ list(
47
+ query: FeeMarkupListParams,
48
+ options?: RequestOptions,
49
+ ): PagePromise<FeeMarkupListResponsesCursorPage, FeeMarkupListResponse> {
50
+ return this._client.getAPIList('/fee_markups', CursorPage<FeeMarkupListResponse>, { query, ...options });
51
+ }
52
+
53
+ /**
54
+ * Deletes a fee markup for a company.
55
+ *
56
+ * Required permissions:
57
+ *
58
+ * - `company:update_child_fees`
59
+ *
60
+ * @example
61
+ * ```ts
62
+ * const feeMarkup = await client.feeMarkups.delete('id');
63
+ * ```
64
+ */
65
+ delete(id: string, options?: RequestOptions): APIPromise<FeeMarkupDeleteResponse> {
66
+ return this._client.delete(path`/fee_markups/${id}`, options);
67
+ }
68
+ }
69
+
70
+ export type FeeMarkupListResponsesCursorPage = CursorPage<FeeMarkupListResponse>;
71
+
72
+ /**
73
+ * The types of fee markups that can be configured
74
+ */
75
+ export type FeeMarkupType =
76
+ | 'crypto_withdrawal_markup'
77
+ | 'rtp_withdrawal_markup'
78
+ | 'next_day_bank_withdrawal_markup'
79
+ | 'bank_wire_withdrawal_markup'
80
+ | 'digital_wallet_withdrawal_markup';
81
+
82
+ /**
83
+ * Represents a fee markup configuration for a company
84
+ */
85
+ export interface FeeMarkupCreateResponse {
86
+ /**
87
+ * The unique identifier of the fee markup.
88
+ */
89
+ id: string;
90
+
91
+ /**
92
+ * When this fee markup was created.
93
+ */
94
+ created_at: string;
95
+
96
+ /**
97
+ * The type of fee this markup applies to.
98
+ */
99
+ fee_type: FeeMarkupType;
100
+
101
+ /**
102
+ * The fixed fee in USD to charge (0-50).
103
+ */
104
+ fixed_fee_usd: number | null;
105
+
106
+ /**
107
+ * Internal notes about this fee markup.
108
+ */
109
+ notes: string | null;
110
+
111
+ /**
112
+ * The percentage fee to charge (0-25).
113
+ */
114
+ percentage_fee: number | null;
115
+
116
+ /**
117
+ * When this fee markup was last updated.
118
+ */
119
+ updated_at: string;
120
+ }
121
+
122
+ /**
123
+ * Represents a fee markup configuration for a company
124
+ */
125
+ export interface FeeMarkupListResponse {
126
+ /**
127
+ * The unique identifier of the fee markup.
128
+ */
129
+ id: string;
130
+
131
+ /**
132
+ * When this fee markup was created.
133
+ */
134
+ created_at: string;
135
+
136
+ /**
137
+ * The type of fee this markup applies to.
138
+ */
139
+ fee_type: FeeMarkupType;
140
+
141
+ /**
142
+ * The fixed fee in USD to charge (0-50).
143
+ */
144
+ fixed_fee_usd: number | null;
145
+
146
+ /**
147
+ * Internal notes about this fee markup.
148
+ */
149
+ notes: string | null;
150
+
151
+ /**
152
+ * The percentage fee to charge (0-25).
153
+ */
154
+ percentage_fee: number | null;
155
+
156
+ /**
157
+ * When this fee markup was last updated.
158
+ */
159
+ updated_at: string;
160
+ }
161
+
162
+ /**
163
+ * Represents `true` or `false` values.
164
+ */
165
+ export type FeeMarkupDeleteResponse = boolean;
166
+
167
+ export interface FeeMarkupCreateParams {
168
+ /**
169
+ * The ID (tag) of the company you want to update the fee markup for.
170
+ */
171
+ company_id: string;
172
+
173
+ /**
174
+ * The type of fee this markup applies to.
175
+ */
176
+ fee_type: FeeMarkupType;
177
+
178
+ /**
179
+ * The fixed fee in USD to charge (0-50).
180
+ */
181
+ fixed_fee_usd?: number | null;
182
+
183
+ /**
184
+ * Custom metadata to attach to this fee markup.
185
+ */
186
+ metadata?: { [key: string]: unknown } | null;
187
+
188
+ /**
189
+ * Internal notes about this fee markup.
190
+ */
191
+ notes?: string | null;
192
+
193
+ /**
194
+ * The percentage fee to charge (0-25).
195
+ */
196
+ percentage_fee?: number | null;
197
+ }
198
+
199
+ export interface FeeMarkupListParams extends CursorPageParams {
200
+ /**
201
+ * The ID (tag) of the company you want to list the fee markups for. If you pass
202
+ * your platform account, you will get the platform default markups.
203
+ */
204
+ company_id: string;
205
+
206
+ /**
207
+ * Returns the elements in the list that come before the specified cursor.
208
+ */
209
+ before?: string | null;
210
+
211
+ /**
212
+ * Returns the first _n_ elements from the list.
213
+ */
214
+ first?: number | null;
215
+
216
+ /**
217
+ * Returns the last _n_ elements from the list.
218
+ */
219
+ last?: number | null;
220
+ }
221
+
222
+ export declare namespace FeeMarkups {
223
+ export {
224
+ type FeeMarkupType as FeeMarkupType,
225
+ type FeeMarkupCreateResponse as FeeMarkupCreateResponse,
226
+ type FeeMarkupListResponse as FeeMarkupListResponse,
227
+ type FeeMarkupDeleteResponse as FeeMarkupDeleteResponse,
228
+ type FeeMarkupListResponsesCursorPage as FeeMarkupListResponsesCursorPage,
229
+ type FeeMarkupCreateParams as FeeMarkupCreateParams,
230
+ type FeeMarkupListParams as FeeMarkupListParams,
231
+ };
232
+ }
@@ -128,6 +128,16 @@ export {
128
128
  type ExperienceDuplicateParams,
129
129
  type ExperienceListResponsesCursorPage,
130
130
  } from './experiences';
131
+ export {
132
+ FeeMarkups,
133
+ type FeeMarkupType,
134
+ type FeeMarkupCreateResponse,
135
+ type FeeMarkupListResponse,
136
+ type FeeMarkupDeleteResponse,
137
+ type FeeMarkupCreateParams,
138
+ type FeeMarkupListParams,
139
+ type FeeMarkupListResponsesCursorPage,
140
+ } from './fee-markups';
131
141
  export {
132
142
  ForumPosts,
133
143
  type ForumPostVisibilityType,
@@ -194,11 +204,20 @@ export {
194
204
  type CardBrands,
195
205
  type PaymentMethodTypes,
196
206
  type PaymentListResponse,
207
+ type PaymentListFeesResponse,
197
208
  type PaymentCreateParams,
198
209
  type PaymentListParams,
210
+ type PaymentListFeesParams,
199
211
  type PaymentRefundParams,
200
212
  type PaymentListResponsesCursorPage,
213
+ type PaymentListFeesResponsesCursorPage,
201
214
  } from './payments';
215
+ export {
216
+ PayoutMethods,
217
+ type PayoutMethodListResponse,
218
+ type PayoutMethodListParams,
219
+ type PayoutMethodListResponsesCursorPage,
220
+ } from './payout-methods';
202
221
  export {
203
222
  Plans,
204
223
  type PlanListResponse,
@@ -320,8 +339,10 @@ export {
320
339
  type WithdrawalSpeeds,
321
340
  type WithdrawalStatus,
322
341
  type WithdrawalTypes,
342
+ type WithdrawalCreateResponse,
323
343
  type WithdrawalRetrieveResponse,
324
344
  type WithdrawalListResponse,
345
+ type WithdrawalCreateParams,
325
346
  type WithdrawalListParams,
326
347
  type WithdrawalListResponsesCursorPage,
327
348
  } from './withdrawals';
@@ -53,108 +53,290 @@ export class PaymentMethods extends APIResource {
53
53
  export type PaymentMethodListResponsesCursorPage = CursorPage<PaymentMethodListResponse>;
54
54
 
55
55
  /**
56
- * A stored payment method used to process payments. This could be a credit/debit
57
- * card, bank account, PayPal wallet, etc.
56
+ * A payment method with no additional properties
58
57
  */
59
- export interface PaymentMethodRetrieveResponse {
60
- /**
61
- * The ID of the payment method
62
- */
63
- id: string;
58
+ export type PaymentMethodRetrieveResponse =
59
+ | PaymentMethodRetrieveResponse.BasePaymentMethod
60
+ | PaymentMethodRetrieveResponse.CardPaymentMethod
61
+ | PaymentMethodRetrieveResponse.UsBankAccountPaymentMethod;
64
62
 
63
+ export namespace PaymentMethodRetrieveResponse {
65
64
  /**
66
- * The card data associated with the payment method, if its a debit or credit card.
65
+ * A payment method with no additional properties
67
66
  */
68
- card: PaymentMethodRetrieveResponse.Card | null;
67
+ export interface BasePaymentMethod {
68
+ /**
69
+ * The ID of the payment method
70
+ */
71
+ id: string;
69
72
 
70
- /**
71
- * The date and time the payment method was created
72
- */
73
- created_at: string;
73
+ /**
74
+ * When the payment method was created
75
+ */
76
+ created_at: string;
77
+
78
+ /**
79
+ * The type of the payment method
80
+ */
81
+ payment_method_type: PaymentsAPI.PaymentMethodTypes;
82
+
83
+ /**
84
+ * The typename of this object
85
+ */
86
+ typename: 'BasePaymentMethod';
87
+ }
74
88
 
75
89
  /**
76
- * The payment method type of the payment method
90
+ * The card for the payment method
77
91
  */
78
- payment_method_type: PaymentsAPI.PaymentMethodTypes;
79
- }
92
+ export interface CardPaymentMethod {
93
+ /**
94
+ * The ID of the payment method
95
+ */
96
+ id: string;
97
+
98
+ /**
99
+ * The card details associated with this payment method
100
+ */
101
+ card: CardPaymentMethod.Card;
102
+
103
+ /**
104
+ * When the payment method was created
105
+ */
106
+ created_at: string;
107
+
108
+ /**
109
+ * The type of the payment method
110
+ */
111
+ payment_method_type: PaymentsAPI.PaymentMethodTypes;
112
+
113
+ /**
114
+ * The typename of this object
115
+ */
116
+ typename: 'CardPaymentMethod';
117
+ }
118
+
119
+ export namespace CardPaymentMethod {
120
+ /**
121
+ * The card details associated with this payment method
122
+ */
123
+ export interface Card {
124
+ /**
125
+ * Possible card brands that a payment token can have
126
+ */
127
+ brand: PaymentsAPI.CardBrands | null;
128
+
129
+ /**
130
+ * Card expiration month, like 03 for March.
131
+ */
132
+ exp_month: number | null;
133
+
134
+ /**
135
+ * Card expiration year, like 27 for 2027.
136
+ */
137
+ exp_year: number | null;
138
+
139
+ /**
140
+ * Last four digits of the card.
141
+ */
142
+ last4: string | null;
143
+ }
144
+ }
80
145
 
81
- export namespace PaymentMethodRetrieveResponse {
82
146
  /**
83
- * The card data associated with the payment method, if its a debit or credit card.
147
+ * The bank account for the payment method
84
148
  */
85
- export interface Card {
149
+ export interface UsBankAccountPaymentMethod {
150
+ /**
151
+ * The ID of the payment method
152
+ */
153
+ id: string;
154
+
86
155
  /**
87
- * Possible card brands that a payment token can have
156
+ * When the payment method was created
88
157
  */
89
- brand: PaymentsAPI.CardBrands | null;
158
+ created_at: string;
90
159
 
91
160
  /**
92
- * Card expiration month, like 03 for March.
161
+ * The type of the payment method
93
162
  */
94
- exp_month: number | null;
163
+ payment_method_type: PaymentsAPI.PaymentMethodTypes;
95
164
 
96
165
  /**
97
- * Card expiration year, like 27 for 2027.
166
+ * The typename of this object
98
167
  */
99
- exp_year: number | null;
168
+ typename: 'UsBankAccountPaymentMethod';
100
169
 
101
170
  /**
102
- * Last four digits of the card.
171
+ * The bank details associated with this payment method
103
172
  */
104
- last4: string | null;
173
+ us_bank_account: UsBankAccountPaymentMethod.UsBankAccount;
174
+ }
175
+
176
+ export namespace UsBankAccountPaymentMethod {
177
+ /**
178
+ * The bank details associated with this payment method
179
+ */
180
+ export interface UsBankAccount {
181
+ /**
182
+ * The type of account
183
+ */
184
+ account_type: string;
185
+
186
+ /**
187
+ * The name of the bank
188
+ */
189
+ bank_name: string;
190
+
191
+ /**
192
+ * The last 4 digits of the account number
193
+ */
194
+ last4: string;
195
+ }
105
196
  }
106
197
  }
107
198
 
108
199
  /**
109
- * A stored payment method used to process payments. This could be a credit/debit
110
- * card, bank account, PayPal wallet, etc.
200
+ * A payment method with no additional properties
111
201
  */
112
- export interface PaymentMethodListResponse {
113
- /**
114
- * The ID of the payment method
115
- */
116
- id: string;
202
+ export type PaymentMethodListResponse =
203
+ | PaymentMethodListResponse.BasePaymentMethod
204
+ | PaymentMethodListResponse.CardPaymentMethod
205
+ | PaymentMethodListResponse.UsBankAccountPaymentMethod;
117
206
 
207
+ export namespace PaymentMethodListResponse {
118
208
  /**
119
- * The card data associated with the payment method, if its a debit or credit card.
209
+ * A payment method with no additional properties
120
210
  */
121
- card: PaymentMethodListResponse.Card | null;
211
+ export interface BasePaymentMethod {
212
+ /**
213
+ * The ID of the payment method
214
+ */
215
+ id: string;
122
216
 
123
- /**
124
- * The date and time the payment method was created
125
- */
126
- created_at: string;
217
+ /**
218
+ * When the payment method was created
219
+ */
220
+ created_at: string;
221
+
222
+ /**
223
+ * The type of the payment method
224
+ */
225
+ payment_method_type: PaymentsAPI.PaymentMethodTypes;
226
+
227
+ /**
228
+ * The typename of this object
229
+ */
230
+ typename: 'BasePaymentMethod';
231
+ }
127
232
 
128
233
  /**
129
- * The payment method type of the payment method
234
+ * The card for the payment method
130
235
  */
131
- payment_method_type: PaymentsAPI.PaymentMethodTypes;
132
- }
236
+ export interface CardPaymentMethod {
237
+ /**
238
+ * The ID of the payment method
239
+ */
240
+ id: string;
241
+
242
+ /**
243
+ * The card details associated with this payment method
244
+ */
245
+ card: CardPaymentMethod.Card;
246
+
247
+ /**
248
+ * When the payment method was created
249
+ */
250
+ created_at: string;
251
+
252
+ /**
253
+ * The type of the payment method
254
+ */
255
+ payment_method_type: PaymentsAPI.PaymentMethodTypes;
256
+
257
+ /**
258
+ * The typename of this object
259
+ */
260
+ typename: 'CardPaymentMethod';
261
+ }
262
+
263
+ export namespace CardPaymentMethod {
264
+ /**
265
+ * The card details associated with this payment method
266
+ */
267
+ export interface Card {
268
+ /**
269
+ * Possible card brands that a payment token can have
270
+ */
271
+ brand: PaymentsAPI.CardBrands | null;
272
+
273
+ /**
274
+ * Card expiration month, like 03 for March.
275
+ */
276
+ exp_month: number | null;
277
+
278
+ /**
279
+ * Card expiration year, like 27 for 2027.
280
+ */
281
+ exp_year: number | null;
282
+
283
+ /**
284
+ * Last four digits of the card.
285
+ */
286
+ last4: string | null;
287
+ }
288
+ }
133
289
 
134
- export namespace PaymentMethodListResponse {
135
290
  /**
136
- * The card data associated with the payment method, if its a debit or credit card.
291
+ * The bank account for the payment method
137
292
  */
138
- export interface Card {
293
+ export interface UsBankAccountPaymentMethod {
294
+ /**
295
+ * The ID of the payment method
296
+ */
297
+ id: string;
298
+
139
299
  /**
140
- * Possible card brands that a payment token can have
300
+ * When the payment method was created
141
301
  */
142
- brand: PaymentsAPI.CardBrands | null;
302
+ created_at: string;
143
303
 
144
304
  /**
145
- * Card expiration month, like 03 for March.
305
+ * The type of the payment method
146
306
  */
147
- exp_month: number | null;
307
+ payment_method_type: PaymentsAPI.PaymentMethodTypes;
148
308
 
149
309
  /**
150
- * Card expiration year, like 27 for 2027.
310
+ * The typename of this object
151
311
  */
152
- exp_year: number | null;
312
+ typename: 'UsBankAccountPaymentMethod';
153
313
 
154
314
  /**
155
- * Last four digits of the card.
315
+ * The bank details associated with this payment method
156
316
  */
157
- last4: string | null;
317
+ us_bank_account: UsBankAccountPaymentMethod.UsBankAccount;
318
+ }
319
+
320
+ export namespace UsBankAccountPaymentMethod {
321
+ /**
322
+ * The bank details associated with this payment method
323
+ */
324
+ export interface UsBankAccount {
325
+ /**
326
+ * The type of account
327
+ */
328
+ account_type: string;
329
+
330
+ /**
331
+ * The name of the bank
332
+ */
333
+ bank_name: string;
334
+
335
+ /**
336
+ * The last 4 digits of the account number
337
+ */
338
+ last4: string;
339
+ }
158
340
  }
159
341
  }
160
342