@whop/sdk 0.0.2 → 0.0.3

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 (145) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/client.d.mts +23 -8
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +23 -8
  5. package/client.d.ts.map +1 -1
  6. package/client.js +16 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs +16 -1
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/checkout-configurations.d.mts +76 -2
  12. package/resources/checkout-configurations.d.mts.map +1 -1
  13. package/resources/checkout-configurations.d.ts +76 -2
  14. package/resources/checkout-configurations.d.ts.map +1 -1
  15. package/resources/checkout-configurations.js +2 -0
  16. package/resources/checkout-configurations.js.map +1 -1
  17. package/resources/checkout-configurations.mjs +2 -0
  18. package/resources/checkout-configurations.mjs.map +1 -1
  19. package/resources/course-chapters.d.mts +185 -0
  20. package/resources/course-chapters.d.mts.map +1 -0
  21. package/resources/course-chapters.d.ts +185 -0
  22. package/resources/course-chapters.d.ts.map +1 -0
  23. package/resources/course-chapters.js +103 -0
  24. package/resources/course-chapters.js.map +1 -0
  25. package/resources/course-chapters.mjs +99 -0
  26. package/resources/course-chapters.mjs.map +1 -0
  27. package/resources/course-lessons.d.mts +523 -0
  28. package/resources/course-lessons.d.mts.map +1 -0
  29. package/resources/course-lessons.d.ts +523 -0
  30. package/resources/course-lessons.d.ts.map +1 -0
  31. package/resources/course-lessons.js +101 -0
  32. package/resources/course-lessons.js.map +1 -0
  33. package/resources/course-lessons.mjs +97 -0
  34. package/resources/course-lessons.mjs.map +1 -0
  35. package/resources/courses.d.mts +465 -0
  36. package/resources/courses.d.mts.map +1 -0
  37. package/resources/courses.d.ts +465 -0
  38. package/resources/courses.d.ts.map +1 -0
  39. package/resources/courses.js +98 -0
  40. package/resources/courses.js.map +1 -0
  41. package/resources/courses.mjs +94 -0
  42. package/resources/courses.mjs.map +1 -0
  43. package/resources/experiences.d.mts +27 -1
  44. package/resources/experiences.d.mts.map +1 -1
  45. package/resources/experiences.d.ts +27 -1
  46. package/resources/experiences.d.ts.map +1 -1
  47. package/resources/experiences.js +22 -0
  48. package/resources/experiences.js.map +1 -1
  49. package/resources/experiences.mjs +22 -0
  50. package/resources/experiences.mjs.map +1 -1
  51. package/resources/forum-posts.d.mts +56 -1
  52. package/resources/forum-posts.d.mts.map +1 -1
  53. package/resources/forum-posts.d.ts +56 -1
  54. package/resources/forum-posts.d.ts.map +1 -1
  55. package/resources/forum-posts.js +11 -0
  56. package/resources/forum-posts.js.map +1 -1
  57. package/resources/forum-posts.mjs +11 -0
  58. package/resources/forum-posts.mjs.map +1 -1
  59. package/resources/index.d.mts +9 -4
  60. package/resources/index.d.mts.map +1 -1
  61. package/resources/index.d.ts +9 -4
  62. package/resources/index.d.ts.map +1 -1
  63. package/resources/index.js +11 -1
  64. package/resources/index.js.map +1 -1
  65. package/resources/index.mjs +5 -0
  66. package/resources/index.mjs.map +1 -1
  67. package/resources/ledger-accounts.d.mts +1 -1
  68. package/resources/ledger-accounts.d.mts.map +1 -1
  69. package/resources/ledger-accounts.d.ts +1 -1
  70. package/resources/ledger-accounts.d.ts.map +1 -1
  71. package/resources/members.d.mts +4 -0
  72. package/resources/members.d.mts.map +1 -1
  73. package/resources/members.d.ts +4 -0
  74. package/resources/members.d.ts.map +1 -1
  75. package/resources/memberships.d.mts +26 -5
  76. package/resources/memberships.d.mts.map +1 -1
  77. package/resources/memberships.d.ts +26 -5
  78. package/resources/memberships.d.ts.map +1 -1
  79. package/resources/memberships.js +1 -1
  80. package/resources/memberships.js.map +1 -1
  81. package/resources/memberships.mjs +1 -1
  82. package/resources/memberships.mjs.map +1 -1
  83. package/resources/messages.d.mts +38 -1
  84. package/resources/messages.d.mts.map +1 -1
  85. package/resources/messages.d.ts +38 -1
  86. package/resources/messages.d.ts.map +1 -1
  87. package/resources/messages.js +6 -0
  88. package/resources/messages.js.map +1 -1
  89. package/resources/messages.mjs +6 -0
  90. package/resources/messages.mjs.map +1 -1
  91. package/resources/payments.d.mts +28 -13
  92. package/resources/payments.d.mts.map +1 -1
  93. package/resources/payments.d.ts +28 -13
  94. package/resources/payments.d.ts.map +1 -1
  95. package/resources/plans.d.mts +49 -1
  96. package/resources/plans.d.mts.map +1 -1
  97. package/resources/plans.d.ts +49 -1
  98. package/resources/plans.d.ts.map +1 -1
  99. package/resources/products.d.mts +17 -25
  100. package/resources/products.d.mts.map +1 -1
  101. package/resources/products.d.ts +17 -25
  102. package/resources/products.d.ts.map +1 -1
  103. package/resources/promo-codes.d.mts +394 -0
  104. package/resources/promo-codes.d.mts.map +1 -0
  105. package/resources/promo-codes.d.ts +394 -0
  106. package/resources/promo-codes.d.ts.map +1 -0
  107. package/resources/promo-codes.js +91 -0
  108. package/resources/promo-codes.js.map +1 -0
  109. package/resources/promo-codes.mjs +87 -0
  110. package/resources/promo-codes.mjs.map +1 -0
  111. package/resources/reviews.d.mts +277 -0
  112. package/resources/reviews.d.mts.map +1 -0
  113. package/resources/reviews.d.ts +277 -0
  114. package/resources/reviews.d.ts.map +1 -0
  115. package/resources/reviews.js +23 -0
  116. package/resources/reviews.js.map +1 -0
  117. package/resources/reviews.mjs +19 -0
  118. package/resources/reviews.mjs.map +1 -0
  119. package/resources/shared.d.mts +70 -14
  120. package/resources/shared.d.mts.map +1 -1
  121. package/resources/shared.d.ts +70 -14
  122. package/resources/shared.d.ts.map +1 -1
  123. package/src/client.ts +134 -1
  124. package/src/resources/checkout-configurations.ts +91 -2
  125. package/src/resources/course-chapters.ts +236 -0
  126. package/src/resources/course-lessons.ts +646 -0
  127. package/src/resources/courses.ts +594 -0
  128. package/src/resources/experiences.ts +35 -0
  129. package/src/resources/forum-posts.ts +71 -0
  130. package/src/resources/index.ts +59 -0
  131. package/src/resources/ledger-accounts.ts +13 -1
  132. package/src/resources/members.ts +5 -0
  133. package/src/resources/memberships.ts +31 -6
  134. package/src/resources/messages.ts +50 -0
  135. package/src/resources/payments.ts +139 -19
  136. package/src/resources/plans.ts +60 -1
  137. package/src/resources/products.ts +20 -29
  138. package/src/resources/promo-codes.ts +490 -0
  139. package/src/resources/reviews.ts +348 -0
  140. package/src/resources/shared.ts +80 -14
  141. package/src/version.ts +1 -1
  142. package/version.d.mts +1 -1
  143. package/version.d.ts +1 -1
  144. package/version.js +1 -1
  145. package/version.mjs +1 -1
@@ -42,6 +42,22 @@ export class ForumPosts extends APIResource {
42
42
  return this._client.get(path`/forum_posts/${id}`, options);
43
43
  }
44
44
 
45
+ /**
46
+ * Update an existing forum post
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const forumPost = await client.forumPosts.update('id');
51
+ * ```
52
+ */
53
+ update(
54
+ id: string,
55
+ body: ForumPostUpdateParams | null | undefined = {},
56
+ options?: RequestOptions,
57
+ ): APIPromise<Shared.ForumPost> {
58
+ return this._client.patch(path`/forum_posts/${id}`, { body, ...options });
59
+ }
60
+
45
61
  /**
46
62
  * Lists forum posts
47
63
  *
@@ -88,6 +104,11 @@ export interface ForumPostListResponse {
88
104
  */
89
105
  content: string | null;
90
106
 
107
+ /**
108
+ * The timestamp when the post was created
109
+ */
110
+ created_at: string;
111
+
91
112
  /**
92
113
  * Whether the forum post has been edited
93
114
  */
@@ -118,6 +139,11 @@ export interface ForumPostListResponse {
118
139
  */
119
140
  title: string | null;
120
141
 
142
+ /**
143
+ * The timestamp when the post was last updated
144
+ */
145
+ updated_at: string;
146
+
121
147
  /**
122
148
  * The user who created this forum post
123
149
  */
@@ -256,6 +282,50 @@ export namespace ForumPostCreateParams {
256
282
  }
257
283
  }
258
284
 
285
+ export interface ForumPostUpdateParams {
286
+ /**
287
+ * The attachments for this post
288
+ */
289
+ attachments?: Array<ForumPostUpdateParams.Attachment> | null;
290
+
291
+ /**
292
+ * This is the main body of the post in Markdown format. Hidden if paywalled and
293
+ * user hasn't purchased access to it.
294
+ */
295
+ content?: string | null;
296
+
297
+ /**
298
+ * Whether the post is pinned. You can only pin a top level posts (not comments).
299
+ */
300
+ is_pinned?: boolean | null;
301
+
302
+ /**
303
+ * The title of the post. Only visible if paywalled.
304
+ */
305
+ title?: string | null;
306
+ }
307
+
308
+ export namespace ForumPostUpdateParams {
309
+ /**
310
+ * Input for an attachment
311
+ */
312
+ export interface Attachment {
313
+ /**
314
+ * The ID of an existing attachment object. Use this when updating a resource and
315
+ * keeping a subset of the attachments. Don't use this unless you know what you're
316
+ * doing.
317
+ */
318
+ id?: string | null;
319
+
320
+ /**
321
+ * This ID should be used the first time you upload an attachment. It is the ID of
322
+ * the direct upload that was created when uploading the file to S3 via the
323
+ * mediaDirectUpload mutation.
324
+ */
325
+ direct_upload_id?: string | null;
326
+ }
327
+ }
328
+
259
329
  export interface ForumPostListParams extends CursorPageParams {
260
330
  /**
261
331
  * The ID of the experience to list forum posts for
@@ -293,6 +363,7 @@ export declare namespace ForumPosts {
293
363
  type ForumPostListResponse as ForumPostListResponse,
294
364
  type ForumPostListResponsesCursorPage as ForumPostListResponsesCursorPage,
295
365
  type ForumPostCreateParams as ForumPostCreateParams,
366
+ type ForumPostUpdateParams as ForumPostUpdateParams,
296
367
  type ForumPostListParams as ForumPostListParams,
297
368
  };
298
369
  }
@@ -38,10 +38,44 @@ export {
38
38
  type CheckoutConfigurationListResponsesCursorPage,
39
39
  } from './checkout-configurations';
40
40
  export { Companies } from './companies';
41
+ export {
42
+ CourseChapters,
43
+ type CourseChapter,
44
+ type CourseChapterListResponse,
45
+ type CourseChapterDeleteResponse,
46
+ type CourseChapterCreateParams,
47
+ type CourseChapterUpdateParams,
48
+ type CourseChapterListParams,
49
+ type CourseChapterListResponsesCursorPage,
50
+ } from './course-chapters';
41
51
  export {
42
52
  CourseLessonInteractions,
43
53
  type CourseLessonInteractionListParams,
44
54
  } from './course-lesson-interactions';
55
+ export {
56
+ CourseLessons,
57
+ type AssessmentQuestionTypes,
58
+ type Lesson,
59
+ type LessonTypes,
60
+ type LessonVisibilities,
61
+ type CourseLessonListResponse,
62
+ type CourseLessonDeleteResponse,
63
+ type CourseLessonCreateParams,
64
+ type CourseLessonUpdateParams,
65
+ type CourseLessonListParams,
66
+ type CourseLessonListResponsesCursorPage,
67
+ } from './course-lessons';
68
+ export {
69
+ Courses,
70
+ type Course,
71
+ type Languages,
72
+ type CourseListResponse,
73
+ type CourseDeleteResponse,
74
+ type CourseCreateParams,
75
+ type CourseUpdateParams,
76
+ type CourseListParams,
77
+ type CourseListResponsesCursorPage,
78
+ } from './courses';
45
79
  export {
46
80
  Entries,
47
81
  type EntryListResponse,
@@ -58,12 +92,14 @@ export {
58
92
  type ExperienceListParams,
59
93
  type ExperienceAttachParams,
60
94
  type ExperienceDetachParams,
95
+ type ExperienceDuplicateParams,
61
96
  type ExperienceListResponsesCursorPage,
62
97
  } from './experiences';
63
98
  export {
64
99
  ForumPosts,
65
100
  type ForumPostListResponse,
66
101
  type ForumPostCreateParams,
102
+ type ForumPostUpdateParams,
67
103
  type ForumPostListParams,
68
104
  type ForumPostListResponsesCursorPage,
69
105
  } from './forum-posts';
@@ -102,11 +138,15 @@ export {
102
138
  Messages,
103
139
  type MessageListResponse,
104
140
  type MessageCreateParams,
141
+ type MessageUpdateParams,
105
142
  type MessageListParams,
106
143
  type MessageListResponsesCursorPage,
107
144
  } from './messages';
108
145
  export {
109
146
  Payments,
147
+ type BillingReasons,
148
+ type CardBrands,
149
+ type PaymentMethodTypes,
110
150
  type PaymentListResponse,
111
151
  type PaymentListParams,
112
152
  type PaymentRefundParams,
@@ -128,6 +168,17 @@ export {
128
168
  type ProductUpdateParams,
129
169
  type ProductListParams,
130
170
  } from './products';
171
+ export {
172
+ PromoCodes,
173
+ type PromoCode,
174
+ type PromoCodeStatus,
175
+ type PromoDuration,
176
+ type PromoCodeListResponse,
177
+ type PromoCodeDeleteResponse,
178
+ type PromoCodeCreateParams,
179
+ type PromoCodeListParams,
180
+ type PromoCodeListResponsesCursorPage,
181
+ } from './promo-codes';
131
182
  export {
132
183
  Reactions,
133
184
  type ReactionListResponse,
@@ -135,6 +186,14 @@ export {
135
186
  type ReactionListParams,
136
187
  type ReactionListResponsesCursorPage,
137
188
  } from './reactions';
189
+ export {
190
+ Reviews,
191
+ type ReviewStatus,
192
+ type ReviewRetrieveResponse,
193
+ type ReviewListResponse,
194
+ type ReviewListParams,
195
+ type ReviewListResponsesCursorPage,
196
+ } from './reviews';
138
197
  export {
139
198
  Shipments,
140
199
  type ShipmentListResponse,
@@ -36,7 +36,19 @@ export interface LedgerAccountRetrieveResponse {
36
36
  /**
37
37
  * The different statuses a LedgerAccountAudit can be
38
38
  */
39
- ledger_account_audit_status: 'reserves_imposed' | 'requested_more_information' | null;
39
+ ledger_account_audit_status:
40
+ | 'pending'
41
+ | 'approved'
42
+ | 'reserves_imposed'
43
+ | 'suspended'
44
+ | 'ignored'
45
+ | 'rejected'
46
+ | 'requested_more_information'
47
+ | 'information_submitted'
48
+ | 'requested_tos_violation_correction'
49
+ | 'clawback_attempted'
50
+ | 'awaiting_sales_review'
51
+ | null;
40
52
 
41
53
  /**
42
54
  * The type of ledger account.
@@ -325,6 +325,11 @@ export interface MemberListParams extends CursorPageParams {
325
325
  * The statuses to filter the members by
326
326
  */
327
327
  statuses?: Array<Shared.MemberStatuses> | null;
328
+
329
+ /**
330
+ * The user IDs to filter the members by
331
+ */
332
+ user_ids?: Array<string> | null;
328
333
  }
329
334
 
330
335
  export declare namespace Members {
@@ -43,7 +43,7 @@ export class Memberships extends APIResource {
43
43
  * - `member:basic:read`
44
44
  */
45
45
  list(
46
- query: MembershipListParams,
46
+ query: MembershipListParams | null | undefined = {},
47
47
  options?: RequestOptions,
48
48
  ): PagePromise<MembershipListResponsesCursorPage, MembershipListResponse> {
49
49
  return this._client.getAPIList('/memberships', CursorPage<MembershipListResponse>, { query, ...options });
@@ -169,6 +169,11 @@ export interface MembershipListResponse {
169
169
  */
170
170
  plan: MembershipListResponse.Plan;
171
171
 
172
+ /**
173
+ * The Product this Membership grants access to.
174
+ */
175
+ product: MembershipListResponse.Product;
176
+
172
177
  /**
173
178
  * The Promo Code that is currently applied to this Membership.
174
179
  */
@@ -238,6 +243,21 @@ export namespace MembershipListResponse {
238
243
  id: string;
239
244
  }
240
245
 
246
+ /**
247
+ * The Product this Membership grants access to.
248
+ */
249
+ export interface Product {
250
+ /**
251
+ * The internal ID of the public product.
252
+ */
253
+ id: string;
254
+
255
+ /**
256
+ * The title of the product. Use for Whop 4.0.
257
+ */
258
+ title: string;
259
+ }
260
+
241
261
  /**
242
262
  * The Promo Code that is currently applied to this Membership.
243
263
  */
@@ -277,11 +297,6 @@ export interface MembershipUpdateParams {
277
297
  }
278
298
 
279
299
  export interface MembershipListParams extends CursorPageParams {
280
- /**
281
- * The ID of the company to list memberships for
282
- */
283
- company_id: string;
284
-
285
300
  /**
286
301
  * The access pass IDs to filter the memberships by
287
302
  */
@@ -305,6 +320,11 @@ export interface MembershipListParams extends CursorPageParams {
305
320
  | 'testing'
306
321
  > | null;
307
322
 
323
+ /**
324
+ * The ID of the company to list memberships for
325
+ */
326
+ company_id?: string | null;
327
+
308
328
  /**
309
329
  * The minimum creation date to filter by
310
330
  */
@@ -349,6 +369,11 @@ export interface MembershipListParams extends CursorPageParams {
349
369
  * The membership status to filter the memberships by
350
370
  */
351
371
  statuses?: Array<Shared.MembershipStatus> | null;
372
+
373
+ /**
374
+ * Only return memberships from these whop user ids
375
+ */
376
+ user_ids?: Array<string> | null;
352
377
  }
353
378
 
354
379
  export interface MembershipCancelParams {
@@ -30,6 +30,17 @@ export class Messages extends APIResource {
30
30
  return this._client.get(path`/messages/${id}`, options);
31
31
  }
32
32
 
33
+ /**
34
+ * Updates an existing message
35
+ */
36
+ update(
37
+ id: string,
38
+ body: MessageUpdateParams | null | undefined = {},
39
+ options?: RequestOptions,
40
+ ): APIPromise<Shared.Message> {
41
+ return this._client.patch(path`/messages/${id}`, { body, ...options });
42
+ }
43
+
33
44
  /**
34
45
  * Lists messages inside a channel
35
46
  *
@@ -266,6 +277,44 @@ export namespace MessageCreateParams {
266
277
  }
267
278
  }
268
279
 
280
+ export interface MessageUpdateParams {
281
+ /**
282
+ * The attachments for this message
283
+ */
284
+ attachments?: Array<MessageUpdateParams.Attachment> | null;
285
+
286
+ /**
287
+ * The content of the message in Markdown format
288
+ */
289
+ content?: string | null;
290
+
291
+ /**
292
+ * Whether this message is pinned
293
+ */
294
+ is_pinned?: boolean | null;
295
+ }
296
+
297
+ export namespace MessageUpdateParams {
298
+ /**
299
+ * Input for an attachment
300
+ */
301
+ export interface Attachment {
302
+ /**
303
+ * The ID of an existing attachment object. Use this when updating a resource and
304
+ * keeping a subset of the attachments. Don't use this unless you know what you're
305
+ * doing.
306
+ */
307
+ id?: string | null;
308
+
309
+ /**
310
+ * This ID should be used the first time you upload an attachment. It is the ID of
311
+ * the direct upload that was created when uploading the file to S3 via the
312
+ * mediaDirectUpload mutation.
313
+ */
314
+ direct_upload_id?: string | null;
315
+ }
316
+ }
317
+
269
318
  export interface MessageListParams extends CursorPageParams {
270
319
  /**
271
320
  * The ID of the channel or the experience ID to list messages for
@@ -298,6 +347,7 @@ export declare namespace Messages {
298
347
  type MessageListResponse as MessageListResponse,
299
348
  type MessageListResponsesCursorPage as MessageListResponsesCursorPage,
300
349
  type MessageCreateParams as MessageCreateParams,
350
+ type MessageUpdateParams as MessageUpdateParams,
301
351
  type MessageListParams as MessageListParams,
302
352
  };
303
353
  }
@@ -141,6 +141,127 @@ export class Payments extends APIResource {
141
141
 
142
142
  export type PaymentListResponsesCursorPage = CursorPage<PaymentListResponse>;
143
143
 
144
+ /**
145
+ * The reason why a specific payment was billed
146
+ */
147
+ export type BillingReasons =
148
+ | 'subscription_create'
149
+ | 'subscription_cycle'
150
+ | 'subscription_update'
151
+ | 'one_time'
152
+ | 'manual'
153
+ | 'subscription';
154
+
155
+ /**
156
+ * Possible card brands that a payment token can have
157
+ */
158
+ export type CardBrands =
159
+ | 'mastercard'
160
+ | 'visa'
161
+ | 'amex'
162
+ | 'discover'
163
+ | 'unionpay'
164
+ | 'jcb'
165
+ | 'diners'
166
+ | 'link'
167
+ | 'troy'
168
+ | 'visadankort'
169
+ | 'visabancontact'
170
+ | 'china_union_pay'
171
+ | 'rupay'
172
+ | 'jcbrupay'
173
+ | 'elo'
174
+ | 'unknown';
175
+
176
+ /**
177
+ * The different types of payment methods that can be used.
178
+ */
179
+ export type PaymentMethodTypes =
180
+ | 'acss_debit'
181
+ | 'affirm'
182
+ | 'afterpay_clearpay'
183
+ | 'alipay'
184
+ | 'alma'
185
+ | 'amazon_pay'
186
+ | 'apple_pay'
187
+ | 'au_becs_debit'
188
+ | 'bacs_debit'
189
+ | 'bancontact'
190
+ | 'billie'
191
+ | 'blik'
192
+ | 'boleto'
193
+ | 'card'
194
+ | 'cashapp'
195
+ | 'crypto'
196
+ | 'eps'
197
+ | 'fpx'
198
+ | 'giropay'
199
+ | 'google_pay'
200
+ | 'grabpay'
201
+ | 'ideal'
202
+ | 'kakao_pay'
203
+ | 'klarna'
204
+ | 'konbini'
205
+ | 'kr_card'
206
+ | 'link'
207
+ | 'mobilepay'
208
+ | 'multibanco'
209
+ | 'naver_pay'
210
+ | 'nz_bank_account'
211
+ | 'oxxo'
212
+ | 'p24'
213
+ | 'pay_by_bank'
214
+ | 'payco'
215
+ | 'paynow'
216
+ | 'pix'
217
+ | 'promptpay'
218
+ | 'revolut_pay'
219
+ | 'samsung_pay'
220
+ | 'satispay'
221
+ | 'sepa_debit'
222
+ | 'sofort'
223
+ | 'swish'
224
+ | 'twint'
225
+ | 'us_bank_account'
226
+ | 'wechat_pay'
227
+ | 'zip'
228
+ | 'bizum'
229
+ | 'capchase_pay'
230
+ | 'kriya'
231
+ | 'mondu'
232
+ | 'ng_wallet'
233
+ | 'paypay'
234
+ | 'sequra'
235
+ | 'scalapay'
236
+ | 'vipps'
237
+ | 'custom'
238
+ | 'customer_balance'
239
+ | 'gopay'
240
+ | 'mb_way'
241
+ | 'ng_bank'
242
+ | 'ng_bank_transfer'
243
+ | 'ng_card'
244
+ | 'ng_market'
245
+ | 'ng_ussd'
246
+ | 'paypal'
247
+ | 'payto'
248
+ | 'qris'
249
+ | 'rechnung'
250
+ | 'south_korea_market'
251
+ | 'kr_market'
252
+ | 'shopeepay'
253
+ | 'upi'
254
+ | 'sunbit'
255
+ | 'netbanking'
256
+ | 'id_bank_transfer'
257
+ | 'demo_pay'
258
+ | 'shop_pay'
259
+ | 'apple'
260
+ | 'sezzle'
261
+ | 'coinbase'
262
+ | 'splitit'
263
+ | 'unknown';
264
+
144
265
  /**
145
266
  * An object representing a receipt for a membership.
146
267
  */
@@ -166,14 +287,14 @@ export interface PaymentListResponse {
166
287
  billing_address: PaymentListResponse.BillingAddress | null;
167
288
 
168
289
  /**
169
- * The billing reason
290
+ * The reason why a specific payment was billed
170
291
  */
171
- billing_reason: string | null;
292
+ billing_reason: BillingReasons | null;
172
293
 
173
294
  /**
174
- * The type of card used as the payment method.
295
+ * Possible card brands that a payment token can have
175
296
  */
176
- card_brand: string | null;
297
+ card_brand: CardBrands | null;
177
298
 
178
299
  /**
179
300
  * The last 4 digits of the card used to make the payment.
@@ -226,10 +347,9 @@ export interface PaymentListResponse {
226
347
  paid_at: string | null;
227
348
 
228
349
  /**
229
- * Returns the type of payment method used for the payment, if available. Ex.
230
- * klarna, affirm, card, cashapp
350
+ * The different types of payment methods that can be used.
231
351
  */
232
- payment_method_type: string | null;
352
+ payment_method_type: PaymentMethodTypes | null;
233
353
 
234
354
  /**
235
355
  * The plan attached to this payment.
@@ -247,7 +367,8 @@ export interface PaymentListResponse {
247
367
  promo_code: PaymentListResponse.PromoCode | null;
248
368
 
249
369
  /**
250
- * Whether the payment can be refunded.
370
+ * True only for payments that are `paid`, have not been fully refunded, and were
371
+ * processed by a payment processor that allows refunds.
251
372
  */
252
373
  refundable: boolean;
253
374
 
@@ -262,7 +383,9 @@ export interface PaymentListResponse {
262
383
  refunded_at: string | null;
263
384
 
264
385
  /**
265
- * Whether the payment can be retried.
386
+ * True when the payment status is `open` and its membership is in one of the
387
+ * retry-eligible states (`active`, `trialing`, `completed`, or `past_due`);
388
+ * otherwise false. Used to decide if Whop can attempt the charge again.
266
389
  */
267
390
  retryable: boolean;
268
391
 
@@ -297,7 +420,8 @@ export interface PaymentListResponse {
297
420
  user: PaymentListResponse.User | null;
298
421
 
299
422
  /**
300
- * Whether the payment can be voided.
423
+ * True when the payment is tied to a membership in `past_due`, the payment status
424
+ * is `open`, and the processor allows voiding payments; otherwise false.
301
425
  */
302
426
  voidable: boolean;
303
427
  }
@@ -448,7 +572,7 @@ export namespace PaymentListResponse {
448
572
  code: string | null;
449
573
 
450
574
  /**
451
- * The number of billing cycles the promo is applied for.
575
+ * The number of months the promo is applied for.
452
576
  */
453
577
  number_of_intervals: number | null;
454
578
 
@@ -498,14 +622,7 @@ export interface PaymentListParams extends CursorPageParams {
498
622
  /**
499
623
  * The billing reason for the payment
500
624
  */
501
- billing_reasons?: Array<
502
- | 'subscription_create'
503
- | 'subscription_cycle'
504
- | 'subscription_update'
505
- | 'one_time'
506
- | 'manual'
507
- | 'subscription'
508
- > | null;
625
+ billing_reasons?: Array<BillingReasons> | null;
509
626
 
510
627
  /**
511
628
  * The minimum creation date to filter by
@@ -577,6 +694,9 @@ export interface PaymentRefundParams {
577
694
 
578
695
  export declare namespace Payments {
579
696
  export {
697
+ type BillingReasons as BillingReasons,
698
+ type CardBrands as CardBrands,
699
+ type PaymentMethodTypes as PaymentMethodTypes,
580
700
  type PaymentListResponse as PaymentListResponse,
581
701
  type PaymentListResponsesCursorPage as PaymentListResponsesCursorPage,
582
702
  type PaymentListParams as PaymentListParams,