@whop/sdk 0.0.25 → 0.0.27

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 (271) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/client.d.mts +29 -25
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +29 -25
  5. package/client.d.ts.map +1 -1
  6. package/client.js +14 -3
  7. package/client.js.map +1 -1
  8. package/client.mjs +16 -5
  9. package/client.mjs.map +1 -1
  10. package/internal/parse.d.mts.map +1 -1
  11. package/internal/parse.d.ts.map +1 -1
  12. package/internal/parse.js +5 -0
  13. package/internal/parse.js.map +1 -1
  14. package/internal/parse.mjs +5 -0
  15. package/internal/parse.mjs.map +1 -1
  16. package/package.json +3 -3
  17. package/resources/access-tokens.d.mts +32 -51
  18. package/resources/access-tokens.d.mts.map +1 -1
  19. package/resources/access-tokens.d.ts +32 -51
  20. package/resources/access-tokens.d.ts.map +1 -1
  21. package/resources/access-tokens.js +6 -8
  22. package/resources/access-tokens.js.map +1 -1
  23. package/resources/access-tokens.mjs +6 -8
  24. package/resources/access-tokens.mjs.map +1 -1
  25. package/resources/ai-chats.d.mts +36 -104
  26. package/resources/ai-chats.d.mts.map +1 -1
  27. package/resources/ai-chats.d.ts +36 -104
  28. package/resources/ai-chats.d.ts.map +1 -1
  29. package/resources/ai-chats.js +1 -1
  30. package/resources/ai-chats.js.map +1 -1
  31. package/resources/ai-chats.mjs +1 -1
  32. package/resources/ai-chats.mjs.map +1 -1
  33. package/resources/app-builds.d.mts +2 -2
  34. package/resources/app-builds.d.ts +2 -2
  35. package/resources/apps.d.mts +5 -4
  36. package/resources/apps.d.mts.map +1 -1
  37. package/resources/apps.d.ts +5 -4
  38. package/resources/apps.d.ts.map +1 -1
  39. package/resources/authorized-users.d.mts +43 -9
  40. package/resources/authorized-users.d.mts.map +1 -1
  41. package/resources/authorized-users.d.ts +43 -9
  42. package/resources/authorized-users.d.ts.map +1 -1
  43. package/resources/authorized-users.js +1 -1
  44. package/resources/authorized-users.js.map +1 -1
  45. package/resources/authorized-users.mjs +1 -1
  46. package/resources/authorized-users.mjs.map +1 -1
  47. package/resources/chat-channels.d.mts +1 -1
  48. package/resources/chat-channels.d.ts +1 -1
  49. package/resources/checkout-configurations.d.mts +24 -16
  50. package/resources/checkout-configurations.d.mts.map +1 -1
  51. package/resources/checkout-configurations.d.ts +24 -16
  52. package/resources/checkout-configurations.d.ts.map +1 -1
  53. package/resources/companies.d.mts +38 -25
  54. package/resources/companies.d.mts.map +1 -1
  55. package/resources/companies.d.ts +38 -25
  56. package/resources/companies.d.ts.map +1 -1
  57. package/resources/companies.js +7 -4
  58. package/resources/companies.js.map +1 -1
  59. package/resources/companies.mjs +7 -4
  60. package/resources/companies.mjs.map +1 -1
  61. package/resources/company-token-transactions.d.mts +23 -109
  62. package/resources/company-token-transactions.d.mts.map +1 -1
  63. package/resources/company-token-transactions.d.ts +23 -109
  64. package/resources/company-token-transactions.d.ts.map +1 -1
  65. package/resources/course-chapters.d.mts +3 -3
  66. package/resources/course-chapters.d.ts +3 -3
  67. package/resources/course-lessons.d.mts +15 -15
  68. package/resources/course-lessons.d.ts +15 -15
  69. package/resources/course-students.d.mts +6 -6
  70. package/resources/course-students.d.ts +6 -6
  71. package/resources/courses.d.mts +8 -8
  72. package/resources/courses.d.ts +8 -8
  73. package/resources/disputes.d.mts +20 -18
  74. package/resources/disputes.d.mts.map +1 -1
  75. package/resources/disputes.d.ts +20 -18
  76. package/resources/disputes.d.ts.map +1 -1
  77. package/resources/dm-channels.d.mts +161 -0
  78. package/resources/dm-channels.d.mts.map +1 -0
  79. package/resources/dm-channels.d.ts +161 -0
  80. package/resources/dm-channels.d.ts.map +1 -0
  81. package/resources/dm-channels.js +87 -0
  82. package/resources/dm-channels.js.map +1 -0
  83. package/resources/dm-channels.mjs +83 -0
  84. package/resources/dm-channels.mjs.map +1 -0
  85. package/resources/dm-members.d.mts +14 -66
  86. package/resources/dm-members.d.mts.map +1 -1
  87. package/resources/dm-members.d.ts +14 -66
  88. package/resources/dm-members.d.ts.map +1 -1
  89. package/resources/entries.d.mts +6 -6
  90. package/resources/entries.d.ts +6 -6
  91. package/resources/experiences.d.mts +6 -5
  92. package/resources/experiences.d.mts.map +1 -1
  93. package/resources/experiences.d.ts +6 -5
  94. package/resources/experiences.d.ts.map +1 -1
  95. package/resources/fee-markups.d.mts +6 -6
  96. package/resources/fee-markups.d.ts +6 -6
  97. package/resources/files.d.mts +9 -5
  98. package/resources/files.d.mts.map +1 -1
  99. package/resources/files.d.ts +9 -5
  100. package/resources/files.d.ts.map +1 -1
  101. package/resources/forum-posts.d.mts +8 -4
  102. package/resources/forum-posts.d.mts.map +1 -1
  103. package/resources/forum-posts.d.ts +8 -4
  104. package/resources/forum-posts.d.ts.map +1 -1
  105. package/resources/forums.d.mts +1 -1
  106. package/resources/forums.d.ts +1 -1
  107. package/resources/index.d.mts +12 -11
  108. package/resources/index.d.mts.map +1 -1
  109. package/resources/index.d.ts +12 -11
  110. package/resources/index.d.ts.map +1 -1
  111. package/resources/index.js +3 -1
  112. package/resources/index.js.map +1 -1
  113. package/resources/index.mjs +3 -2
  114. package/resources/index.mjs.map +1 -1
  115. package/resources/invoices.d.mts +28 -20
  116. package/resources/invoices.d.mts.map +1 -1
  117. package/resources/invoices.d.ts +28 -20
  118. package/resources/invoices.d.ts.map +1 -1
  119. package/resources/leads.d.mts +21 -189
  120. package/resources/leads.d.mts.map +1 -1
  121. package/resources/leads.d.ts +21 -189
  122. package/resources/leads.d.ts.map +1 -1
  123. package/resources/ledger-accounts.d.mts +12 -9
  124. package/resources/ledger-accounts.d.mts.map +1 -1
  125. package/resources/ledger-accounts.d.ts +12 -9
  126. package/resources/ledger-accounts.d.ts.map +1 -1
  127. package/resources/ledger-accounts.js.map +1 -1
  128. package/resources/ledger-accounts.mjs.map +1 -1
  129. package/resources/members.d.mts +14 -14
  130. package/resources/members.d.mts.map +1 -1
  131. package/resources/members.d.ts +14 -14
  132. package/resources/members.d.ts.map +1 -1
  133. package/resources/members.js +1 -1
  134. package/resources/members.js.map +1 -1
  135. package/resources/members.mjs +1 -1
  136. package/resources/members.mjs.map +1 -1
  137. package/resources/memberships.d.mts +25 -15
  138. package/resources/memberships.d.mts.map +1 -1
  139. package/resources/memberships.d.ts +25 -15
  140. package/resources/memberships.d.ts.map +1 -1
  141. package/resources/messages.d.mts +7 -3
  142. package/resources/messages.d.mts.map +1 -1
  143. package/resources/messages.d.ts +7 -3
  144. package/resources/messages.d.ts.map +1 -1
  145. package/resources/payments.d.mts +59 -19
  146. package/resources/payments.d.mts.map +1 -1
  147. package/resources/payments.d.ts +59 -19
  148. package/resources/payments.d.ts.map +1 -1
  149. package/resources/payout-methods.d.mts +14 -9
  150. package/resources/payout-methods.d.mts.map +1 -1
  151. package/resources/payout-methods.d.ts +14 -9
  152. package/resources/payout-methods.d.ts.map +1 -1
  153. package/resources/payout-methods.js.map +1 -1
  154. package/resources/payout-methods.mjs.map +1 -1
  155. package/resources/plans.d.mts +34 -24
  156. package/resources/plans.d.mts.map +1 -1
  157. package/resources/plans.d.ts +34 -24
  158. package/resources/plans.d.ts.map +1 -1
  159. package/resources/products.d.mts +4 -2
  160. package/resources/products.d.mts.map +1 -1
  161. package/resources/products.d.ts +4 -2
  162. package/resources/products.d.ts.map +1 -1
  163. package/resources/promo-codes.d.mts +22 -12
  164. package/resources/promo-codes.d.mts.map +1 -1
  165. package/resources/promo-codes.d.ts +22 -12
  166. package/resources/promo-codes.d.ts.map +1 -1
  167. package/resources/reactions.d.mts +1 -1
  168. package/resources/reactions.d.ts +1 -1
  169. package/resources/refunds.d.mts +19 -15
  170. package/resources/refunds.d.mts.map +1 -1
  171. package/resources/refunds.d.ts +19 -15
  172. package/resources/refunds.d.ts.map +1 -1
  173. package/resources/reviews.d.mts +10 -10
  174. package/resources/reviews.d.ts +10 -10
  175. package/resources/setup-intents.d.mts +18 -20
  176. package/resources/setup-intents.d.mts.map +1 -1
  177. package/resources/setup-intents.d.ts +18 -20
  178. package/resources/setup-intents.d.ts.map +1 -1
  179. package/resources/shared.d.mts +209 -137
  180. package/resources/shared.d.mts.map +1 -1
  181. package/resources/shared.d.ts +209 -137
  182. package/resources/shared.d.ts.map +1 -1
  183. package/resources/shipments.d.mts +4 -4
  184. package/resources/shipments.d.ts +4 -4
  185. package/resources/support-channels.d.mts +1 -1
  186. package/resources/support-channels.d.ts +1 -1
  187. package/resources/topups.d.mts +6 -4
  188. package/resources/topups.d.mts.map +1 -1
  189. package/resources/topups.d.ts +6 -4
  190. package/resources/topups.d.ts.map +1 -1
  191. package/resources/transfers.d.mts +8 -5
  192. package/resources/transfers.d.mts.map +1 -1
  193. package/resources/transfers.d.ts +8 -5
  194. package/resources/transfers.d.ts.map +1 -1
  195. package/resources/users.d.mts +46 -8
  196. package/resources/users.d.mts.map +1 -1
  197. package/resources/users.d.ts +46 -8
  198. package/resources/users.d.ts.map +1 -1
  199. package/resources/users.js +10 -0
  200. package/resources/users.js.map +1 -1
  201. package/resources/users.mjs +10 -0
  202. package/resources/users.mjs.map +1 -1
  203. package/resources/verifications.d.mts +12 -4
  204. package/resources/verifications.d.mts.map +1 -1
  205. package/resources/verifications.d.ts +12 -4
  206. package/resources/verifications.d.ts.map +1 -1
  207. package/resources/webhooks.d.mts +105 -350
  208. package/resources/webhooks.d.mts.map +1 -1
  209. package/resources/webhooks.d.ts +105 -350
  210. package/resources/webhooks.d.ts.map +1 -1
  211. package/resources/webhooks.js.map +1 -1
  212. package/resources/webhooks.mjs +2 -2
  213. package/resources/webhooks.mjs.map +1 -1
  214. package/resources/withdrawals.d.mts +32 -139
  215. package/resources/withdrawals.d.mts.map +1 -1
  216. package/resources/withdrawals.d.ts +32 -139
  217. package/resources/withdrawals.d.ts.map +1 -1
  218. package/src/client.ts +87 -41
  219. package/src/internal/parse.ts +6 -0
  220. package/src/resources/access-tokens.ts +35 -56
  221. package/src/resources/ai-chats.ts +36 -122
  222. package/src/resources/app-builds.ts +2 -2
  223. package/src/resources/apps.ts +5 -4
  224. package/src/resources/authorized-users.ts +49 -9
  225. package/src/resources/chat-channels.ts +1 -1
  226. package/src/resources/checkout-configurations.ts +24 -16
  227. package/src/resources/companies.ts +41 -26
  228. package/src/resources/company-token-transactions.ts +24 -126
  229. package/src/resources/course-chapters.ts +3 -3
  230. package/src/resources/course-lessons.ts +15 -15
  231. package/src/resources/course-students.ts +6 -6
  232. package/src/resources/courses.ts +8 -8
  233. package/src/resources/disputes.ts +20 -18
  234. package/src/resources/dm-channels.ts +212 -0
  235. package/src/resources/dm-members.ts +16 -78
  236. package/src/resources/entries.ts +6 -6
  237. package/src/resources/experiences.ts +6 -5
  238. package/src/resources/fee-markups.ts +6 -6
  239. package/src/resources/files.ts +10 -4
  240. package/src/resources/forum-posts.ts +8 -4
  241. package/src/resources/forums.ts +1 -1
  242. package/src/resources/index.ts +38 -18
  243. package/src/resources/invoices.ts +28 -20
  244. package/src/resources/leads.ts +21 -217
  245. package/src/resources/ledger-accounts.ts +12 -42
  246. package/src/resources/members.ts +15 -15
  247. package/src/resources/memberships.ts +34 -30
  248. package/src/resources/messages.ts +7 -3
  249. package/src/resources/payments.ts +67 -17
  250. package/src/resources/payout-methods.ts +21 -8
  251. package/src/resources/plans.ts +34 -24
  252. package/src/resources/products.ts +4 -2
  253. package/src/resources/promo-codes.ts +22 -12
  254. package/src/resources/reactions.ts +1 -1
  255. package/src/resources/refunds.ts +20 -15
  256. package/src/resources/reviews.ts +10 -10
  257. package/src/resources/setup-intents.ts +18 -20
  258. package/src/resources/shared.ts +217 -145
  259. package/src/resources/shipments.ts +4 -4
  260. package/src/resources/support-channels.ts +1 -1
  261. package/src/resources/topups.ts +6 -4
  262. package/src/resources/transfers.ts +8 -5
  263. package/src/resources/users.ts +58 -8
  264. package/src/resources/verifications.ts +50 -37
  265. package/src/resources/webhooks.ts +138 -785
  266. package/src/resources/withdrawals.ts +39 -216
  267. package/src/version.ts +1 -1
  268. package/version.d.mts +1 -1
  269. package/version.d.ts +1 -1
  270. package/version.js +1 -1
  271. package/version.mjs +1 -1
@@ -73,14 +73,13 @@ export type CheckoutConfigurationListResponsesCursorPage = CursorPage<CheckoutCo
73
73
  export type CheckoutModes = 'payment' | 'setup';
74
74
 
75
75
  /**
76
- * A checkout configuration object.
77
- * Can be used to create a reusable custom configuration for a checkout, including attaching plans, affiliates and custom metadata to the checkout.
78
- * This configuration can be re-used by multiple users.
79
- * All successful payments and memberships resulting from a checkout will contain the passed metadata.
76
+ * A checkout session is a reusable configuration for a checkout, including the
77
+ * plan, affiliate, and custom metadata. Payments and memberships created from a
78
+ * checkout session inherit its metadata.
80
79
  */
81
80
  export interface CheckoutConfigurationListResponse {
82
81
  /**
83
- * The ID of the checkout configuration
82
+ * The unique identifier for the checkout session.
84
83
  */
85
84
  id: string;
86
85
 
@@ -167,12 +166,12 @@ export namespace CheckoutConfigurationListResponse {
167
166
  */
168
167
  export interface Plan {
169
168
  /**
170
- * The internal ID of the plan.
169
+ * The unique identifier for the plan.
171
170
  */
172
171
  id: string;
173
172
 
174
173
  /**
175
- * The interval at which the plan charges (renewal plans).
174
+ * The interval in days at which the plan charges (renewal plans).
176
175
  */
177
176
  billing_period: number | null;
178
177
 
@@ -182,12 +181,15 @@ export namespace CheckoutConfigurationListResponse {
182
181
  currency: Shared.Currency;
183
182
 
184
183
  /**
185
- * The interval at which the plan charges (expiration plans).
184
+ * The number of days until the membership expires (for expiration-based plans).
185
+ * For example, 365 for a one-year access pass.
186
186
  */
187
187
  expiration_days: number | null;
188
188
 
189
189
  /**
190
- * The price a person has to pay for a plan on the initial purchase.
190
+ * The initial purchase price in the plan's base_currency (e.g., 49.99 for $49.99).
191
+ * For one-time plans, this is the full price. For renewal plans, this is charged
192
+ * on top of the first renewal_price.
191
193
  */
192
194
  initial_price: number;
193
195
 
@@ -202,7 +204,8 @@ export namespace CheckoutConfigurationListResponse {
202
204
  release_method: Shared.ReleaseMethod;
203
205
 
204
206
  /**
205
- * The price a person has to pay for a plan on the renewal purchase.
207
+ * The recurring price charged every billing_period in the plan's base_currency
208
+ * (e.g., 9.99 for $9.99/period). Zero for one-time plans.
206
209
  */
207
210
  renewal_price: number;
208
211
 
@@ -282,13 +285,15 @@ export declare namespace CheckoutConfigurationCreateParams {
282
285
 
283
286
  /**
284
287
  * The application fee amount collected by the platform from this connected
285
- * account. Must be less than the total payment amount. Only valid for connected
286
- * accounts with a parent company.
288
+ * account. Provided as a number in dollars (e.g., 5.00 for $5.00). Must be less
289
+ * than the total payment amount. Only valid for connected accounts with a parent
290
+ * company.
287
291
  */
288
292
  application_fee_amount?: number | null;
289
293
 
290
294
  /**
291
- * The interval at which the plan charges (renewal plans).
295
+ * The interval in days at which the plan charges (renewal plans). For example, 30
296
+ * for monthly billing.
292
297
  */
293
298
  billing_period?: number | null;
294
299
 
@@ -303,7 +308,8 @@ export declare namespace CheckoutConfigurationCreateParams {
303
308
  description?: string | null;
304
309
 
305
310
  /**
306
- * The interval at which the plan charges (expiration plans).
311
+ * The number of days until the membership expires (for expiration-based plans).
312
+ * For example, 365 for a one-year access pass.
307
313
  */
308
314
  expiration_days?: number | null;
309
315
 
@@ -319,7 +325,8 @@ export declare namespace CheckoutConfigurationCreateParams {
319
325
  image?: Plan.Image | null;
320
326
 
321
327
  /**
322
- * An additional amount charged upon first purchase.
328
+ * An additional amount charged upon first purchase. Provided as a number in
329
+ * dollars (e.g., 10.00 for $10.00).
323
330
  */
324
331
  initial_price?: number | null;
325
332
 
@@ -362,7 +369,8 @@ export declare namespace CheckoutConfigurationCreateParams {
362
369
  release_method?: Shared.ReleaseMethod | null;
363
370
 
364
371
  /**
365
- * The amount the customer is charged every billing period.
372
+ * The amount the customer is charged every billing period. Provided as a number in
373
+ * dollars (e.g., 9.99 for $9.99/period).
366
374
  */
367
375
  renewal_price?: number | null;
368
376
 
@@ -9,11 +9,12 @@ import { path } from '../internal/utils/path';
9
9
 
10
10
  export class Companies extends APIResource {
11
11
  /**
12
- * Create a new connected account for your platform
12
+ * Create a new company. Pass parent_company_id to create a sub-company under a
13
+ * platform, or omit it to create a company for the current user.
13
14
  *
14
15
  * Required permissions:
15
16
  *
16
- * - `company:create_child`
17
+ * - `company:create`
17
18
  * - `company:basic:read`
18
19
  */
19
20
  create(body: CompanyCreateParams, options?: RequestOptions): APIPromise<Shared.Company> {
@@ -49,14 +50,16 @@ export class Companies extends APIResource {
49
50
  }
50
51
 
51
52
  /**
52
- * Lists companies the current user has access to
53
+ * Lists companies. When parent_company_id is provided, lists connected accounts
54
+ * under that company. When omitted, lists companies the current user has access
55
+ * to.
53
56
  *
54
57
  * Required permissions:
55
58
  *
56
59
  * - `company:basic:read`
57
60
  */
58
61
  list(
59
- query: CompanyListParams,
62
+ query: CompanyListParams | null | undefined = {},
60
63
  options?: RequestOptions,
61
64
  ): PagePromise<CompanyListResponsesCursorPage, CompanyListResponse> {
62
65
  return this._client.getAPIList('/companies', CursorPage<CompanyListResponse>, { query, ...options });
@@ -66,11 +69,12 @@ export class Companies extends APIResource {
66
69
  export type CompanyListResponsesCursorPage = CursorPage<CompanyListResponse>;
67
70
 
68
71
  /**
69
- * An object representing a (sanitized) company.
72
+ * A company is a seller on Whop. Companies own products, manage members, and
73
+ * receive payouts.
70
74
  */
71
75
  export interface CompanyListResponse {
72
76
  /**
73
- * The ID (tag) of the company.
77
+ * The unique identifier for the company.
74
78
  */
75
79
  id: string;
76
80
 
@@ -80,7 +84,7 @@ export interface CompanyListResponse {
80
84
  business_type: Shared.BusinessTypes | null;
81
85
 
82
86
  /**
83
- * When the company was created (signed up)
87
+ * The datetime the company was created.
84
88
  */
85
89
  created_at: string;
86
90
 
@@ -136,7 +140,7 @@ export interface CompanyListResponse {
136
140
  title: string;
137
141
 
138
142
  /**
139
- * The time the company was last updated.
143
+ * The datetime the company was last updated.
140
144
  */
141
145
  updated_at: string;
142
146
 
@@ -163,7 +167,7 @@ export namespace CompanyListResponse {
163
167
  */
164
168
  export interface OwnerUser {
165
169
  /**
166
- * The internal ID of the user.
170
+ * The unique identifier for the user.
167
171
  */
168
172
  id: string;
169
173
 
@@ -181,24 +185,25 @@ export namespace CompanyListResponse {
181
185
 
182
186
  export interface CompanyCreateParams {
183
187
  /**
184
- * The email of the user who the company will belong to.
188
+ * The name of the company being created.
185
189
  */
186
- email: string;
190
+ title: string;
187
191
 
188
192
  /**
189
- * The company ID of the platform creating this company.
193
+ * The different business types a company can be.
190
194
  */
191
- parent_company_id: string;
195
+ business_type?: Shared.BusinessTypes | null;
192
196
 
193
197
  /**
194
- * The name of the company being created.
198
+ * A description of what the company offers or does.
195
199
  */
196
- title: string;
200
+ description?: string | null;
197
201
 
198
202
  /**
199
- * The different business types a company can be.
203
+ * The email of the user who the sub-company will belong to. Required when
204
+ * parent_company_id is provided.
200
205
  */
201
- business_type?: Shared.BusinessTypes | null;
206
+ email?: string | null;
202
207
 
203
208
  /**
204
209
  * The different industry types a company can be in.
@@ -211,15 +216,19 @@ export interface CompanyCreateParams {
211
216
  logo?: CompanyCreateParams.Logo | null;
212
217
 
213
218
  /**
214
- * Additional metadata for the account
219
+ * Additional metadata for the company
215
220
  */
216
221
  metadata?: { [key: string]: unknown } | null;
217
222
 
223
+ /**
224
+ * The company ID of the platform creating this sub-company. If omitted, the
225
+ * company is created for the current user.
226
+ */
227
+ parent_company_id?: string | null;
228
+
218
229
  /**
219
230
  * Whether Whop sends transactional emails to customers on behalf of this company.
220
- * Includes: order confirmations, payment failures, refund notifications, upcoming
221
- * renewals, and membership cancelations/expirations. When disabled, the platform
222
- * is responsible for handling these communications. This is defaulted to true.
231
+ * Only used when parent_company_id is provided.
223
232
  */
224
233
  send_customer_emails?: boolean | null;
225
234
  }
@@ -247,6 +256,11 @@ export interface CompanyUpdateParams {
247
256
  */
248
257
  business_type?: Shared.BusinessTypes | null;
249
258
 
259
+ /**
260
+ * A description of what the company offers or does.
261
+ */
262
+ description?: string | null;
263
+
250
264
  /**
251
265
  * The different industry types a company can be in.
252
266
  */
@@ -294,11 +308,6 @@ export namespace CompanyUpdateParams {
294
308
  }
295
309
 
296
310
  export interface CompanyListParams extends CursorPageParams {
297
- /**
298
- * The ID of the parent company to list connected accounts for
299
- */
300
- parent_company_id: string;
301
-
302
311
  /**
303
312
  * Returns the elements in the list that come before the specified cursor.
304
313
  */
@@ -328,6 +337,12 @@ export interface CompanyListParams extends CursorPageParams {
328
337
  * Returns the last _n_ elements from the list.
329
338
  */
330
339
  last?: number | null;
340
+
341
+ /**
342
+ * The ID of the parent company to list connected accounts for. Omit to list the
343
+ * current user's own companies.
344
+ */
345
+ parent_company_id?: string | null;
331
346
  }
332
347
 
333
348
  export declare namespace Companies {
@@ -31,7 +31,7 @@ export class CompanyTokenTransactions extends APIResource {
31
31
  create(
32
32
  body: CompanyTokenTransactionCreateParams,
33
33
  options?: RequestOptions,
34
- ): APIPromise<CompanyTokenTransactionCreateResponse> {
34
+ ): APIPromise<CompanyTokenTransaction> {
35
35
  return this._client.post('/company_token_transactions', { body, ...options });
36
36
  }
37
37
 
@@ -44,7 +44,7 @@ export class CompanyTokenTransactions extends APIResource {
44
44
  * - `member:basic:read`
45
45
  * - `company:basic:read`
46
46
  */
47
- retrieve(id: string, options?: RequestOptions): APIPromise<CompanyTokenTransactionRetrieveResponse> {
47
+ retrieve(id: string, options?: RequestOptions): APIPromise<CompanyTokenTransaction> {
48
48
  return this._client.get(path`/company_token_transactions/${id}`, options);
49
49
  }
50
50
 
@@ -72,118 +72,16 @@ export class CompanyTokenTransactions extends APIResource {
72
72
  export type CompanyTokenTransactionListResponsesCursorPage = CursorPage<CompanyTokenTransactionListResponse>;
73
73
 
74
74
  /**
75
- * A token transaction within a company
75
+ * The type of token transaction
76
76
  */
77
- export interface CompanyTokenTransactionCreateResponse {
78
- /**
79
- * The ID of the transaction
80
- */
81
- id: string;
82
-
83
- /**
84
- * The transaction amount (always positive)
85
- */
86
- amount: number;
87
-
88
- /**
89
- * The company
90
- */
91
- company: CompanyTokenTransactionCreateResponse.Company;
92
-
93
- /**
94
- * When the transaction was created
95
- */
96
- created_at: string;
97
-
98
- /**
99
- * Optional description
100
- */
101
- description: string | null;
102
-
103
- /**
104
- * Optional idempotency key to prevent duplicate transactions
105
- */
106
- idempotency_key: string | null;
107
-
108
- /**
109
- * For transfers, the ID of the linked transaction
110
- */
111
- linked_transaction_id: string | null;
112
-
113
- /**
114
- * The member
115
- */
116
- member: CompanyTokenTransactionCreateResponse.Member;
117
-
118
- /**
119
- * The type of transaction
120
- */
121
- transaction_type: 'add' | 'subtract' | 'transfer';
122
-
123
- /**
124
- * The user whose balance changed
125
- */
126
- user: CompanyTokenTransactionCreateResponse.User;
127
- }
128
-
129
- export namespace CompanyTokenTransactionCreateResponse {
130
- /**
131
- * The company
132
- */
133
- export interface Company {
134
- /**
135
- * The ID of the company
136
- */
137
- id: string;
138
-
139
- /**
140
- * The slug/route of the company on the Whop site.
141
- */
142
- route: string;
143
-
144
- /**
145
- * The written name of the company.
146
- */
147
- title: string;
148
- }
149
-
150
- /**
151
- * The member
152
- */
153
- export interface Member {
154
- /**
155
- * The ID of the member
156
- */
157
- id: string;
158
- }
159
-
160
- /**
161
- * The user whose balance changed
162
- */
163
- export interface User {
164
- /**
165
- * The internal ID of the user.
166
- */
167
- id: string;
168
-
169
- /**
170
- * The name of the user from their Whop account.
171
- */
172
- name: string | null;
173
-
174
- /**
175
- * The username of the user from their Whop account.
176
- */
177
- username: string;
178
- }
179
- }
77
+ export type BotTokenTransactionTypes = 'add' | 'subtract' | 'transfer';
180
78
 
181
79
  /**
182
80
  * A token transaction within a company
183
81
  */
184
- export interface CompanyTokenTransactionRetrieveResponse {
82
+ export interface CompanyTokenTransaction {
185
83
  /**
186
- * The ID of the transaction
84
+ * The unique identifier for the company token transaction.
187
85
  */
188
86
  id: string;
189
87
 
@@ -195,10 +93,10 @@ export interface CompanyTokenTransactionRetrieveResponse {
195
93
  /**
196
94
  * The company
197
95
  */
198
- company: CompanyTokenTransactionRetrieveResponse.Company;
96
+ company: CompanyTokenTransaction.Company;
199
97
 
200
98
  /**
201
- * When the transaction was created
99
+ * The datetime the company token transaction was created.
202
100
  */
203
101
  created_at: string;
204
102
 
@@ -220,26 +118,26 @@ export interface CompanyTokenTransactionRetrieveResponse {
220
118
  /**
221
119
  * The member
222
120
  */
223
- member: CompanyTokenTransactionRetrieveResponse.Member;
121
+ member: CompanyTokenTransaction.Member;
224
122
 
225
123
  /**
226
124
  * The type of transaction
227
125
  */
228
- transaction_type: 'add' | 'subtract' | 'transfer';
126
+ transaction_type: BotTokenTransactionTypes;
229
127
 
230
128
  /**
231
129
  * The user whose balance changed
232
130
  */
233
- user: CompanyTokenTransactionRetrieveResponse.User;
131
+ user: CompanyTokenTransaction.User;
234
132
  }
235
133
 
236
- export namespace CompanyTokenTransactionRetrieveResponse {
134
+ export namespace CompanyTokenTransaction {
237
135
  /**
238
136
  * The company
239
137
  */
240
138
  export interface Company {
241
139
  /**
242
- * The ID of the company
140
+ * The unique identifier for the company.
243
141
  */
244
142
  id: string;
245
143
 
@@ -259,7 +157,7 @@ export namespace CompanyTokenTransactionRetrieveResponse {
259
157
  */
260
158
  export interface Member {
261
159
  /**
262
- * The ID of the member
160
+ * The unique identifier for the company member.
263
161
  */
264
162
  id: string;
265
163
  }
@@ -269,7 +167,7 @@ export namespace CompanyTokenTransactionRetrieveResponse {
269
167
  */
270
168
  export interface User {
271
169
  /**
272
- * The internal ID of the user.
170
+ * The unique identifier for the user.
273
171
  */
274
172
  id: string;
275
173
 
@@ -290,7 +188,7 @@ export namespace CompanyTokenTransactionRetrieveResponse {
290
188
  */
291
189
  export interface CompanyTokenTransactionListResponse {
292
190
  /**
293
- * The ID of the transaction
191
+ * The unique identifier for the company token transaction.
294
192
  */
295
193
  id: string;
296
194
 
@@ -305,7 +203,7 @@ export interface CompanyTokenTransactionListResponse {
305
203
  company: CompanyTokenTransactionListResponse.Company;
306
204
 
307
205
  /**
308
- * When the transaction was created
206
+ * The datetime the company token transaction was created.
309
207
  */
310
208
  created_at: string;
311
209
 
@@ -332,7 +230,7 @@ export interface CompanyTokenTransactionListResponse {
332
230
  /**
333
231
  * The type of transaction
334
232
  */
335
- transaction_type: 'add' | 'subtract' | 'transfer';
233
+ transaction_type: BotTokenTransactionTypes;
336
234
 
337
235
  /**
338
236
  * The user whose balance changed
@@ -346,7 +244,7 @@ export namespace CompanyTokenTransactionListResponse {
346
244
  */
347
245
  export interface Company {
348
246
  /**
349
- * The ID of the company
247
+ * The unique identifier for the company.
350
248
  */
351
249
  id: string;
352
250
 
@@ -366,7 +264,7 @@ export namespace CompanyTokenTransactionListResponse {
366
264
  */
367
265
  export interface Member {
368
266
  /**
369
- * The ID of the member
267
+ * The unique identifier for the company member.
370
268
  */
371
269
  id: string;
372
270
  }
@@ -376,7 +274,7 @@ export namespace CompanyTokenTransactionListResponse {
376
274
  */
377
275
  export interface User {
378
276
  /**
379
- * The internal ID of the user.
277
+ * The unique identifier for the user.
380
278
  */
381
279
  id: string;
382
280
 
@@ -515,7 +413,7 @@ export interface CompanyTokenTransactionListParams extends CursorPageParams {
515
413
  /**
516
414
  * The type of token transaction
517
415
  */
518
- transaction_type?: 'add' | 'subtract' | 'transfer' | null;
416
+ transaction_type?: BotTokenTransactionTypes | null;
519
417
 
520
418
  /**
521
419
  * Filter by user ID
@@ -525,8 +423,8 @@ export interface CompanyTokenTransactionListParams extends CursorPageParams {
525
423
 
526
424
  export declare namespace CompanyTokenTransactions {
527
425
  export {
528
- type CompanyTokenTransactionCreateResponse as CompanyTokenTransactionCreateResponse,
529
- type CompanyTokenTransactionRetrieveResponse as CompanyTokenTransactionRetrieveResponse,
426
+ type BotTokenTransactionTypes as BotTokenTransactionTypes,
427
+ type CompanyTokenTransaction as CompanyTokenTransaction,
530
428
  type CompanyTokenTransactionListResponse as CompanyTokenTransactionListResponse,
531
429
  type CompanyTokenTransactionListResponsesCursorPage as CompanyTokenTransactionListResponsesCursorPage,
532
430
  type CompanyTokenTransactionCreateParams as CompanyTokenTransactionCreateParams,
@@ -115,7 +115,7 @@ export type CourseChapterListResponsesCursorPage = CursorPage<CourseChapterListR
115
115
  */
116
116
  export interface CourseChapter {
117
117
  /**
118
- * The ID of the chapter. Looks like chap_XXX
118
+ * The unique identifier for the chapter.
119
119
  */
120
120
  id: string;
121
121
 
@@ -141,7 +141,7 @@ export namespace CourseChapter {
141
141
  */
142
142
  export interface Lesson {
143
143
  /**
144
- * The ID of the lesson
144
+ * The unique identifier for the lesson.
145
145
  */
146
146
  id: string;
147
147
 
@@ -162,7 +162,7 @@ export namespace CourseChapter {
162
162
  */
163
163
  export interface CourseChapterListResponse {
164
164
  /**
165
- * The ID of the chapter. Looks like chap_XXX
165
+ * The unique identifier for the chapter.
166
166
  */
167
167
  id: string;
168
168