@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
@@ -31,7 +31,7 @@ export class Members extends APIResource {
31
31
  * - `member:phone:read`
32
32
  */
33
33
  list(
34
- query: MemberListParams,
34
+ query: MemberListParams | null | undefined = {},
35
35
  options?: RequestOptions,
36
36
  ): PagePromise<MemberListResponsesCursorPage, MemberListResponse> {
37
37
  return this._client.getAPIList('/members', CursorPage<MemberListResponse>, { query, ...options });
@@ -47,7 +47,7 @@ export type MemberListResponsesCursorPage = CursorPage<MemberListResponse>;
47
47
  */
48
48
  export interface MemberRetrieveResponse {
49
49
  /**
50
- * The ID of the member
50
+ * The unique identifier for the company member.
51
51
  */
52
52
  id: string;
53
53
 
@@ -70,7 +70,7 @@ export interface MemberRetrieveResponse {
70
70
  company_token_balance: number;
71
71
 
72
72
  /**
73
- * When the member was created
73
+ * The datetime the company member was created.
74
74
  */
75
75
  created_at: string;
76
76
 
@@ -100,7 +100,7 @@ export interface MemberRetrieveResponse {
100
100
  status: Shared.MemberStatuses;
101
101
 
102
102
  /**
103
- * The timestamp of when this member was last updated
103
+ * The datetime the company member was last updated.
104
104
  */
105
105
  updated_at: string;
106
106
 
@@ -121,7 +121,7 @@ export namespace MemberRetrieveResponse {
121
121
  */
122
122
  export interface Company {
123
123
  /**
124
- * The ID of the company
124
+ * The unique identifier for the company.
125
125
  */
126
126
  id: string;
127
127
 
@@ -141,7 +141,7 @@ export namespace MemberRetrieveResponse {
141
141
  */
142
142
  export interface User {
143
143
  /**
144
- * The internal ID of the user account.
144
+ * The unique identifier for the company member user.
145
145
  */
146
146
  id: string;
147
147
 
@@ -169,7 +169,7 @@ export namespace MemberRetrieveResponse {
169
169
  */
170
170
  export interface MemberListResponse {
171
171
  /**
172
- * The ID of the member
172
+ * The unique identifier for the company member.
173
173
  */
174
174
  id: string;
175
175
 
@@ -187,7 +187,7 @@ export interface MemberListResponse {
187
187
  company_token_balance: number;
188
188
 
189
189
  /**
190
- * When the member was created
190
+ * The datetime the company member was created.
191
191
  */
192
192
  created_at: string;
193
193
 
@@ -217,7 +217,7 @@ export interface MemberListResponse {
217
217
  status: Shared.MemberStatuses;
218
218
 
219
219
  /**
220
- * The timestamp of when this member was last updated
220
+ * The datetime the company member was last updated.
221
221
  */
222
222
  updated_at: string;
223
223
 
@@ -238,7 +238,7 @@ export namespace MemberListResponse {
238
238
  */
239
239
  export interface User {
240
240
  /**
241
- * The internal ID of the user account.
241
+ * The unique identifier for the company member user.
242
242
  */
243
243
  id: string;
244
244
 
@@ -260,11 +260,6 @@ export namespace MemberListResponse {
260
260
  }
261
261
 
262
262
  export interface MemberListParams extends CursorPageParams {
263
- /**
264
- * The ID of the company to list members for
265
- */
266
- company_id: string;
267
-
268
263
  /**
269
264
  * The access level a given user (or company) has to a product or company.
270
265
  */
@@ -275,6 +270,11 @@ export interface MemberListParams extends CursorPageParams {
275
270
  */
276
271
  before?: string | null;
277
272
 
273
+ /**
274
+ * The ID of the company to list members for
275
+ */
276
+ company_id?: string | null;
277
+
278
278
  /**
279
279
  * The minimum creation date to filter by
280
280
  */
@@ -117,12 +117,25 @@ export class Memberships extends APIResource {
117
117
  export type MembershipListResponsesCursorPage = CursorPage<MembershipListResponse>;
118
118
 
119
119
  /**
120
- * A membership represents a purchase between a User and a Company for a specific
121
- * Product.
120
+ * The different reasons a user can choose for why they are canceling their
121
+ * membership.
122
+ */
123
+ export type CancelOptions =
124
+ | 'too_expensive'
125
+ | 'switching'
126
+ | 'missing_features'
127
+ | 'technical_issues'
128
+ | 'bad_experience'
129
+ | 'other'
130
+ | 'testing';
131
+
132
+ /**
133
+ * A membership represents an active relationship between a user and a product. It
134
+ * tracks the user's access, billing status, and renewal schedule.
122
135
  */
123
136
  export interface MembershipListResponse {
124
137
  /**
125
- * The ID of the membership
138
+ * The unique identifier for the membership.
126
139
  */
127
140
  id: string;
128
141
 
@@ -136,15 +149,7 @@ export interface MembershipListResponse {
136
149
  * The different reasons a user can choose for why they are canceling their
137
150
  * membership.
138
151
  */
139
- cancel_option:
140
- | 'too_expensive'
141
- | 'switching'
142
- | 'missing_features'
143
- | 'technical_issues'
144
- | 'bad_experience'
145
- | 'other'
146
- | 'testing'
147
- | null;
152
+ cancel_option: CancelOptions | null;
148
153
 
149
154
  /**
150
155
  * The epoch timestamp of when the customer initiated a cancellation.
@@ -162,7 +167,7 @@ export interface MembershipListResponse {
162
167
  company: MembershipListResponse.Company;
163
168
 
164
169
  /**
165
- * The timestamp, in seconds, that this Membership was created at.
170
+ * The datetime the membership was created.
166
171
  */
167
172
  created_at: string;
168
173
 
@@ -171,6 +176,11 @@ export interface MembershipListResponse {
171
176
  */
172
177
  currency: Shared.Currency | null;
173
178
 
179
+ /**
180
+ * When the member joined the company.
181
+ */
182
+ joined_at: string | null;
183
+
174
184
  /**
175
185
  * The license key for this Membership. This is only present if the membership
176
186
  * grants access to an instance of the Whop Software app.
@@ -188,7 +198,8 @@ export interface MembershipListResponse {
188
198
  member: MembershipListResponse.Member | null;
189
199
 
190
200
  /**
191
- * A JSON object used to store software licensing information. Ex. HWID
201
+ * Custom key-value pairs for the membership (commonly used for software licensing,
202
+ * e.g., HWID). Max 50 keys, 500 chars per key, 5000 chars per value.
192
203
  */
193
204
  metadata: { [key: string]: unknown };
194
205
 
@@ -230,7 +241,7 @@ export interface MembershipListResponse {
230
241
  status: Shared.MembershipStatus;
231
242
 
232
243
  /**
233
- * A timestamp of when the membership was last updated
244
+ * The datetime the membership was last updated.
234
245
  */
235
246
  updated_at: string;
236
247
 
@@ -246,7 +257,7 @@ export namespace MembershipListResponse {
246
257
  */
247
258
  export interface Company {
248
259
  /**
249
- * The ID (tag) of the company.
260
+ * The unique identifier for the company.
250
261
  */
251
262
  id: string;
252
263
 
@@ -261,7 +272,7 @@ export namespace MembershipListResponse {
261
272
  */
262
273
  export interface Member {
263
274
  /**
264
- * The ID of the member
275
+ * The unique identifier for the member.
265
276
  */
266
277
  id: string;
267
278
  }
@@ -271,7 +282,7 @@ export namespace MembershipListResponse {
271
282
  */
272
283
  export interface Plan {
273
284
  /**
274
- * The internal ID of the plan.
285
+ * The unique identifier for the plan.
275
286
  */
276
287
  id: string;
277
288
  }
@@ -281,7 +292,7 @@ export namespace MembershipListResponse {
281
292
  */
282
293
  export interface Product {
283
294
  /**
284
- * The internal ID of the public product.
295
+ * The unique identifier for the product.
285
296
  */
286
297
  id: string;
287
298
 
@@ -296,7 +307,7 @@ export namespace MembershipListResponse {
296
307
  */
297
308
  export interface PromoCode {
298
309
  /**
299
- * The ID of the promo.
310
+ * The unique identifier for the promo code.
300
311
  */
301
312
  id: string;
302
313
  }
@@ -306,7 +317,7 @@ export namespace MembershipListResponse {
306
317
  */
307
318
  export interface User {
308
319
  /**
309
- * The internal ID of the user.
320
+ * The unique identifier for the user.
310
321
  */
311
322
  id: string;
312
323
 
@@ -343,15 +354,7 @@ export interface MembershipListParams extends CursorPageParams {
343
354
  /**
344
355
  * The cancel options to filter the memberships by
345
356
  */
346
- cancel_options?: Array<
347
- | 'too_expensive'
348
- | 'switching'
349
- | 'missing_features'
350
- | 'technical_issues'
351
- | 'bad_experience'
352
- | 'other'
353
- | 'testing'
354
- > | null;
357
+ cancel_options?: Array<CancelOptions> | null;
355
358
 
356
359
  /**
357
360
  * The ID of the company to list memberships for
@@ -431,6 +434,7 @@ export interface MembershipPauseParams {
431
434
 
432
435
  export declare namespace Memberships {
433
436
  export {
437
+ type CancelOptions as CancelOptions,
434
438
  type MembershipListResponse as MembershipListResponse,
435
439
  type MembershipListResponsesCursorPage as MembershipListResponsesCursorPage,
436
440
  type MembershipUpdateParams as MembershipUpdateParams,
@@ -74,7 +74,11 @@ export type MessageListResponsesCursorPage = CursorPage<MessageListResponse>;
74
74
  */
75
75
  export interface MessageListResponse {
76
76
  /**
77
- * The unique identifier of the resource.
77
+ * Represents a unique identifier that is Base64 obfuscated. It is often used to
78
+ * refetch an object or as key for a cache. The ID type appears in a JSON response
79
+ * as a String; however, it is not intended to be human-readable. When expected as
80
+ * an input type, any string (such as `"VXNlci0xMA=="`) or integer (such as `4`)
81
+ * input value will be accepted as an ID.
78
82
  */
79
83
  id: string;
80
84
 
@@ -156,7 +160,7 @@ export namespace MessageListResponse {
156
160
  */
157
161
  export interface Option {
158
162
  /**
159
- * The ID of the poll option
163
+ * The unique identifier for the poll option.
160
164
  */
161
165
  id: string;
162
166
 
@@ -202,7 +206,7 @@ export namespace MessageListResponse {
202
206
  */
203
207
  export interface User {
204
208
  /**
205
- * The internal ID of the user.
209
+ * The unique identifier for the user.
206
210
  */
207
211
  id: string;
208
212
 
@@ -253,6 +253,8 @@ export type CardBrands =
253
253
  | 'fuel_card'
254
254
  | 'dankort'
255
255
  | 'carnet'
256
+ | 'atm_card'
257
+ | 'china_union_payuzcard'
256
258
  | 'unknown';
257
259
 
258
260
  /**
@@ -277,6 +279,7 @@ export type PaymentMethodTypes =
277
279
  | 'capchase_pay'
278
280
  | 'card'
279
281
  | 'cashapp'
282
+ | 'claritypay'
280
283
  | 'coinbase'
281
284
  | 'crypto'
282
285
  | 'custom'
@@ -349,11 +352,12 @@ export type PaymentMethodTypes =
349
352
  | 'unknown';
350
353
 
351
354
  /**
352
- * An object representing a receipt for a membership.
355
+ * A payment represents a completed or attempted charge for a membership. Payments
356
+ * track the amount, status, currency, and payment method used.
353
357
  */
354
358
  export interface PaymentListResponse {
355
359
  /**
356
- * The payment ID
360
+ * The unique identifier for the payment.
357
361
  */
358
362
  id: string;
359
363
 
@@ -362,6 +366,11 @@ export interface PaymentListResponse {
362
366
  */
363
367
  amount_after_fees: number;
364
368
 
369
+ /**
370
+ * The application fee charged on this payment.
371
+ */
372
+ application_fee: PaymentListResponse.ApplicationFee | null;
373
+
365
374
  /**
366
375
  * Whether this payment was auto refunded or not
367
376
  */
@@ -393,7 +402,7 @@ export interface PaymentListResponse {
393
402
  company: PaymentListResponse.Company | null;
394
403
 
395
404
  /**
396
- * The datetime the payment was created
405
+ * The datetime the payment was created.
397
406
  */
398
407
  created_at: string;
399
408
 
@@ -534,6 +543,41 @@ export interface PaymentListResponse {
534
543
  }
535
544
 
536
545
  export namespace PaymentListResponse {
546
+ /**
547
+ * The application fee charged on this payment.
548
+ */
549
+ export interface ApplicationFee {
550
+ /**
551
+ * The unique identifier for the application fee.
552
+ */
553
+ id: string;
554
+
555
+ /**
556
+ * The application fee amount.
557
+ */
558
+ amount: number;
559
+
560
+ /**
561
+ * The amount of the application fee that has been captured.
562
+ */
563
+ amount_captured: number;
564
+
565
+ /**
566
+ * The amount of the application fee that has been refunded.
567
+ */
568
+ amount_refunded: number;
569
+
570
+ /**
571
+ * The datetime the application fee was created.
572
+ */
573
+ created_at: string;
574
+
575
+ /**
576
+ * The currency of the application fee.
577
+ */
578
+ currency: Shared.Currency;
579
+ }
580
+
537
581
  /**
538
582
  * The address of the user who made the payment.
539
583
  */
@@ -579,7 +623,7 @@ export namespace PaymentListResponse {
579
623
  */
580
624
  export interface Company {
581
625
  /**
582
- * The ID of the company
626
+ * The unique identifier for the company.
583
627
  */
584
628
  id: string;
585
629
 
@@ -599,7 +643,7 @@ export namespace PaymentListResponse {
599
643
  */
600
644
  export interface Member {
601
645
  /**
602
- * The ID of the member
646
+ * The unique identifier for the company member.
603
647
  */
604
648
  id: string;
605
649
 
@@ -614,7 +658,7 @@ export namespace PaymentListResponse {
614
658
  */
615
659
  export interface Membership {
616
660
  /**
617
- * The internal ID of the membership.
661
+ * The unique identifier for the membership.
618
662
  */
619
663
  id: string;
620
664
 
@@ -629,7 +673,7 @@ export namespace PaymentListResponse {
629
673
  */
630
674
  export interface PaymentMethod {
631
675
  /**
632
- * The ID of the payment method
676
+ * The unique identifier for the payment token.
633
677
  */
634
678
  id: string;
635
679
 
@@ -639,7 +683,7 @@ export namespace PaymentListResponse {
639
683
  card: PaymentMethod.Card | null;
640
684
 
641
685
  /**
642
- * The date and time the payment method was created
686
+ * The datetime the payment token was created.
643
687
  */
644
688
  created_at: string;
645
689
 
@@ -681,7 +725,7 @@ export namespace PaymentListResponse {
681
725
  */
682
726
  export interface Plan {
683
727
  /**
684
- * The internal ID of the plan.
728
+ * The unique identifier for the plan.
685
729
  */
686
730
  id: string;
687
731
  }
@@ -691,7 +735,7 @@ export namespace PaymentListResponse {
691
735
  */
692
736
  export interface Product {
693
737
  /**
694
- * The internal ID of the public product.
738
+ * The unique identifier for the product.
695
739
  */
696
740
  id: string;
697
741
 
@@ -711,12 +755,14 @@ export namespace PaymentListResponse {
711
755
  */
712
756
  export interface PromoCode {
713
757
  /**
714
- * The ID of the promo.
758
+ * The unique identifier for the promo code.
715
759
  */
716
760
  id: string;
717
761
 
718
762
  /**
719
- * The amount off (% or flat amount) for the promo.
763
+ * The discount amount. Interpretation depends on promo_type: if 'percentage', this
764
+ * is the percentage (e.g., 20 means 20% off); if 'flat_amount', this is dollars
765
+ * off (e.g., 10.00 means $10.00 off).
720
766
  */
721
767
  amount_off: number;
722
768
 
@@ -746,7 +792,7 @@ export namespace PaymentListResponse {
746
792
  */
747
793
  export interface User {
748
794
  /**
749
- * The internal ID of the user.
795
+ * The unique identifier for the user.
750
796
  */
751
797
  id: string;
752
798
 
@@ -867,7 +913,8 @@ export declare namespace PaymentCreateParams {
867
913
  currency: Shared.Currency;
868
914
 
869
915
  /**
870
- * The interval at which the plan charges (renewal plans).
916
+ * The interval in days at which the plan charges (renewal plans). For example, 30
917
+ * for monthly billing.
871
918
  */
872
919
  billing_period?: number | null;
873
920
 
@@ -877,7 +924,8 @@ export declare namespace PaymentCreateParams {
877
924
  description?: string | null;
878
925
 
879
926
  /**
880
- * The interval at which the plan charges (expiration plans).
927
+ * The number of days until the membership expires and revokes access (expiration
928
+ * plans). For example, 365 for one year.
881
929
  */
882
930
  expiration_days?: number | null;
883
931
 
@@ -888,7 +936,8 @@ export declare namespace PaymentCreateParams {
888
936
  force_create_new_plan?: boolean | null;
889
937
 
890
938
  /**
891
- * An additional amount charged upon first purchase.
939
+ * An additional amount charged upon first purchase. Provided as a number in the
940
+ * specified currency. Eg: 10.43 for $10.43 USD.
892
941
  */
893
942
  initial_price?: number | null;
894
943
 
@@ -914,7 +963,8 @@ export declare namespace PaymentCreateParams {
914
963
  product_id?: string | null;
915
964
 
916
965
  /**
917
- * The amount the customer is charged every billing period.
966
+ * The amount the customer is charged every billing period. Provided as a number in
967
+ * the specified currency. Eg: 10.43 for $10.43 USD.
918
968
  */
919
969
  renewal_price?: number | null;
920
970
 
@@ -1,6 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../core/resource';
4
+ import * as PayoutMethodsAPI from './payout-methods';
4
5
  import { APIPromise } from '../core/api-promise';
5
6
  import { CursorPage, type CursorPageParams, PagePromise } from '../core/pagination';
6
7
  import { RequestOptions } from '../internal/request-options';
@@ -38,12 +39,23 @@ export class PayoutMethods extends APIResource {
38
39
 
39
40
  export type PayoutMethodListResponsesCursorPage = CursorPage<PayoutMethodListResponse>;
40
41
 
42
+ /**
43
+ * The category of a payout destination.
44
+ */
45
+ export type PayoutDestinationCategory =
46
+ | 'crypto'
47
+ | 'rtp'
48
+ | 'next_day_bank'
49
+ | 'bank_wire'
50
+ | 'digital_wallet'
51
+ | 'unknown';
52
+
41
53
  /**
42
54
  * An object representing an user's setup payout destination.
43
55
  */
44
56
  export interface PayoutMethodRetrieveResponse {
45
57
  /**
46
- * The ID of the payout token
58
+ * The unique identifier for the payout token.
47
59
  */
48
60
  id: string;
49
61
 
@@ -59,7 +71,7 @@ export interface PayoutMethodRetrieveResponse {
59
71
  company: PayoutMethodRetrieveResponse.Company | null;
60
72
 
61
73
  /**
62
- * The date and time the payout token was created
74
+ * The datetime the payout token was created.
63
75
  */
64
76
  created_at: string;
65
77
 
@@ -97,7 +109,7 @@ export namespace PayoutMethodRetrieveResponse {
97
109
  */
98
110
  export interface Company {
99
111
  /**
100
- * The ID (tag) of the company.
112
+ * The unique identifier for the company.
101
113
  */
102
114
  id: string;
103
115
  }
@@ -109,7 +121,7 @@ export namespace PayoutMethodRetrieveResponse {
109
121
  /**
110
122
  * The category of the payout destination
111
123
  */
112
- category: 'crypto' | 'rtp' | 'next_day_bank' | 'bank_wire' | 'digital_wallet' | 'unknown';
124
+ category: PayoutMethodsAPI.PayoutDestinationCategory;
113
125
 
114
126
  /**
115
127
  * The country code of the payout destination
@@ -128,7 +140,7 @@ export namespace PayoutMethodRetrieveResponse {
128
140
  */
129
141
  export interface PayoutMethodListResponse {
130
142
  /**
131
- * The ID of the payout token
143
+ * The unique identifier for the payout token.
132
144
  */
133
145
  id: string;
134
146
 
@@ -144,7 +156,7 @@ export interface PayoutMethodListResponse {
144
156
  company: PayoutMethodListResponse.Company | null;
145
157
 
146
158
  /**
147
- * The date and time the payout token was created
159
+ * The datetime the payout token was created.
148
160
  */
149
161
  created_at: string;
150
162
 
@@ -182,7 +194,7 @@ export namespace PayoutMethodListResponse {
182
194
  */
183
195
  export interface Company {
184
196
  /**
185
- * The ID (tag) of the company.
197
+ * The unique identifier for the company.
186
198
  */
187
199
  id: string;
188
200
  }
@@ -194,7 +206,7 @@ export namespace PayoutMethodListResponse {
194
206
  /**
195
207
  * The category of the payout destination
196
208
  */
197
- category: 'crypto' | 'rtp' | 'next_day_bank' | 'bank_wire' | 'digital_wallet' | 'unknown';
209
+ category: PayoutMethodsAPI.PayoutDestinationCategory;
198
210
 
199
211
  /**
200
212
  * The country code of the payout destination
@@ -232,6 +244,7 @@ export interface PayoutMethodListParams extends CursorPageParams {
232
244
 
233
245
  export declare namespace PayoutMethods {
234
246
  export {
247
+ type PayoutDestinationCategory as PayoutDestinationCategory,
235
248
  type PayoutMethodRetrieveResponse as PayoutMethodRetrieveResponse,
236
249
  type PayoutMethodListResponse as PayoutMethodListResponse,
237
250
  type PayoutMethodListResponsesCursorPage as PayoutMethodListResponsesCursorPage,