@whop/sdk 0.0.13 → 0.0.15

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 (64) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/client.d.mts +3 -0
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +3 -0
  5. package/client.d.ts.map +1 -1
  6. package/client.js +3 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +3 -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/companies.d.mts +18 -0
  16. package/resources/companies.d.mts.map +1 -1
  17. package/resources/companies.d.ts +18 -0
  18. package/resources/companies.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 +1 -0
  32. package/resources/index.d.mts.map +1 -1
  33. package/resources/index.d.ts +1 -0
  34. package/resources/index.d.ts.map +1 -1
  35. package/resources/index.js +3 -1
  36. package/resources/index.js.map +1 -1
  37. package/resources/index.mjs +1 -0
  38. package/resources/index.mjs.map +1 -1
  39. package/resources/shared.d.mts +12 -0
  40. package/resources/shared.d.mts.map +1 -1
  41. package/resources/shared.d.ts +12 -0
  42. package/resources/shared.d.ts.map +1 -1
  43. package/resources/webhooks.d.mts +12 -0
  44. package/resources/webhooks.d.mts.map +1 -1
  45. package/resources/webhooks.d.ts +12 -0
  46. package/resources/webhooks.d.ts.map +1 -1
  47. package/resources/withdrawals.d.mts +12 -0
  48. package/resources/withdrawals.d.mts.map +1 -1
  49. package/resources/withdrawals.d.ts +12 -0
  50. package/resources/withdrawals.d.ts.map +1 -1
  51. package/src/client.ts +23 -0
  52. package/src/resources/checkout-configurations.ts +20 -0
  53. package/src/resources/companies.ts +21 -0
  54. package/src/resources/experiences.ts +15 -0
  55. package/src/resources/fee-markups.ts +232 -0
  56. package/src/resources/index.ts +10 -0
  57. package/src/resources/shared.ts +15 -0
  58. package/src/resources/webhooks.ts +14 -0
  59. package/src/resources/withdrawals.ts +14 -0
  60. package/src/version.ts +1 -1
  61. package/version.d.mts +1 -1
  62. package/version.d.ts +1 -1
  63. package/version.js +1 -1
  64. 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,
@@ -442,6 +442,11 @@ export interface CheckoutConfiguration {
442
442
  */
443
443
  company_id: string;
444
444
 
445
+ /**
446
+ * The available currencies on the platform
447
+ */
448
+ currency: Currency | null;
449
+
445
450
  /**
446
451
  * The metadata to use for the checkout configuration
447
452
  */
@@ -626,6 +631,11 @@ export interface Company {
626
631
  */
627
632
  route: string;
628
633
 
634
+ /**
635
+ * Whether Whop sends transactional emails to customers on behalf of this company.
636
+ */
637
+ send_customer_emails: boolean;
638
+
629
639
  /**
630
640
  * The social media accounts of the company
631
641
  */
@@ -1149,6 +1159,11 @@ export interface Experience {
1149
1159
  */
1150
1160
  image: Experience.Image | null;
1151
1161
 
1162
+ /**
1163
+ * Whether the experience is visible to the public
1164
+ */
1165
+ is_public: boolean;
1166
+
1152
1167
  /**
1153
1168
  * The written name of the description.
1154
1169
  */
@@ -509,6 +509,13 @@ export namespace WithdrawalCreatedWebhookEvent {
509
509
  */
510
510
  ledger_account: Data.LedgerAccount;
511
511
 
512
+ /**
513
+ * The markup fee that was charged for the withdrawal. This is in the same currency
514
+ * as the withdrawal amount. This only applies to platform accounts using Whop
515
+ * Rails.
516
+ */
517
+ markup_fee: number;
518
+
512
519
  /**
513
520
  * The payout token used for the withdrawal, if applicable.
514
521
  */
@@ -715,6 +722,13 @@ export namespace WithdrawalUpdatedWebhookEvent {
715
722
  */
716
723
  ledger_account: Data.LedgerAccount;
717
724
 
725
+ /**
726
+ * The markup fee that was charged for the withdrawal. This is in the same currency
727
+ * as the withdrawal amount. This only applies to platform accounts using Whop
728
+ * Rails.
729
+ */
730
+ markup_fee: number;
731
+
718
732
  /**
719
733
  * The payout token used for the withdrawal, if applicable.
720
734
  */
@@ -164,6 +164,13 @@ export interface WithdrawalRetrieveResponse {
164
164
  */
165
165
  ledger_account: WithdrawalRetrieveResponse.LedgerAccount;
166
166
 
167
+ /**
168
+ * The markup fee that was charged for the withdrawal. This is in the same currency
169
+ * as the withdrawal amount. This only applies to platform accounts using Whop
170
+ * Rails.
171
+ */
172
+ markup_fee: number;
173
+
167
174
  /**
168
175
  * The payout token used for the withdrawal, if applicable.
169
176
  */
@@ -275,6 +282,13 @@ export interface WithdrawalListResponse {
275
282
  */
276
283
  fee_type: WithdrawalFeeTypes | null;
277
284
 
285
+ /**
286
+ * The markup fee that was charged for the withdrawal. This is in the same currency
287
+ * as the withdrawal amount. This only applies to platform accounts using Whop
288
+ * Rails.
289
+ */
290
+ markup_fee: number;
291
+
278
292
  /**
279
293
  * The speed of the withdrawal.
280
294
  */
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.0.13'; // x-release-please-version
1
+ export const VERSION = '0.0.15'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.0.13";
1
+ export declare const VERSION = "0.0.15";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.0.13";
1
+ export declare const VERSION = "0.0.15";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.0.13'; // x-release-please-version
4
+ exports.VERSION = '0.0.15'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.0.13'; // x-release-please-version
1
+ export const VERSION = '0.0.15'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map