@whop/sdk 0.0.24 → 0.0.26
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.
- package/CHANGELOG.md +68 -0
- package/README.md +2 -2
- package/client.d.mts +30 -18
- package/client.d.mts.map +1 -1
- package/client.d.ts +30 -18
- package/client.d.ts.map +1 -1
- package/client.js +15 -2
- package/client.js.map +1 -1
- package/client.mjs +17 -4
- package/client.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +5 -0
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +5 -0
- package/internal/parse.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/ai-chats.d.mts +169 -0
- package/resources/ai-chats.d.mts.map +1 -0
- package/resources/ai-chats.d.ts +169 -0
- package/resources/ai-chats.d.ts.map +1 -0
- package/resources/ai-chats.js +53 -0
- package/resources/ai-chats.js.map +1 -0
- package/resources/ai-chats.mjs +49 -0
- package/resources/ai-chats.mjs.map +1 -0
- package/resources/apps.d.mts +1 -1
- package/resources/apps.d.mts.map +1 -1
- package/resources/apps.d.ts +1 -1
- package/resources/apps.d.ts.map +1 -1
- package/resources/authorized-users.d.mts +39 -5
- package/resources/authorized-users.d.mts.map +1 -1
- package/resources/authorized-users.d.ts +39 -5
- package/resources/authorized-users.d.ts.map +1 -1
- package/resources/authorized-users.js +1 -1
- package/resources/authorized-users.js.map +1 -1
- package/resources/authorized-users.mjs +1 -1
- package/resources/authorized-users.mjs.map +1 -1
- package/resources/checkout-configurations.d.mts +12 -0
- package/resources/checkout-configurations.d.mts.map +1 -1
- package/resources/checkout-configurations.d.ts +12 -0
- package/resources/checkout-configurations.d.ts.map +1 -1
- package/resources/company-token-transactions.d.mts +339 -0
- package/resources/company-token-transactions.d.mts.map +1 -0
- package/resources/company-token-transactions.d.ts +339 -0
- package/resources/company-token-transactions.d.ts.map +1 -0
- package/resources/company-token-transactions.js +59 -0
- package/resources/company-token-transactions.js.map +1 -0
- package/resources/company-token-transactions.mjs +55 -0
- package/resources/company-token-transactions.mjs.map +1 -0
- package/resources/dm-channels.d.mts +161 -0
- package/resources/dm-channels.d.mts.map +1 -0
- package/resources/dm-channels.d.ts +161 -0
- package/resources/dm-channels.d.ts.map +1 -0
- package/resources/dm-channels.js +87 -0
- package/resources/dm-channels.js.map +1 -0
- package/resources/dm-channels.mjs +83 -0
- package/resources/dm-channels.mjs.map +1 -0
- package/resources/dm-members.d.mts +190 -0
- package/resources/dm-members.d.mts.map +1 -0
- package/resources/dm-members.d.ts +190 -0
- package/resources/dm-members.d.ts.map +1 -0
- package/resources/dm-members.js +94 -0
- package/resources/dm-members.js.map +1 -0
- package/resources/dm-members.mjs +90 -0
- package/resources/dm-members.mjs.map +1 -0
- package/resources/files.d.mts +7 -3
- package/resources/files.d.mts.map +1 -1
- package/resources/files.d.ts +7 -3
- package/resources/files.d.ts.map +1 -1
- package/resources/index.d.mts +13 -9
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +13 -9
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +9 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +6 -2
- package/resources/index.mjs.map +1 -1
- package/resources/leads.d.mts +9 -177
- package/resources/leads.d.mts.map +1 -1
- package/resources/leads.d.ts +9 -177
- package/resources/leads.d.ts.map +1 -1
- package/resources/ledger-accounts.d.mts +3 -2
- package/resources/ledger-accounts.d.mts.map +1 -1
- package/resources/ledger-accounts.d.ts +3 -2
- package/resources/ledger-accounts.d.ts.map +1 -1
- package/resources/ledger-accounts.js.map +1 -1
- package/resources/ledger-accounts.mjs.map +1 -1
- package/resources/members.d.mts +13 -5
- package/resources/members.d.mts.map +1 -1
- package/resources/members.d.ts +13 -5
- package/resources/members.d.ts.map +1 -1
- package/resources/members.js +1 -1
- package/resources/members.js.map +1 -1
- package/resources/members.mjs +1 -1
- package/resources/members.mjs.map +1 -1
- package/resources/memberships.d.mts +32 -2
- package/resources/memberships.d.mts.map +1 -1
- package/resources/memberships.d.ts +32 -2
- package/resources/memberships.d.ts.map +1 -1
- package/resources/memberships.js +18 -0
- package/resources/memberships.js.map +1 -1
- package/resources/memberships.mjs +18 -0
- package/resources/memberships.mjs.map +1 -1
- package/resources/messages.d.mts +17 -1
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +17 -1
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +10 -0
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +10 -0
- package/resources/messages.mjs.map +1 -1
- package/resources/payments.d.mts +42 -1
- package/resources/payments.d.mts.map +1 -1
- package/resources/payments.d.ts +42 -1
- package/resources/payments.d.ts.map +1 -1
- package/resources/payout-methods.d.mts +26 -3
- package/resources/payout-methods.d.mts.map +1 -1
- package/resources/payout-methods.d.ts +26 -3
- package/resources/payout-methods.d.ts.map +1 -1
- package/resources/payout-methods.js.map +1 -1
- package/resources/payout-methods.mjs.map +1 -1
- package/resources/reactions.d.mts +24 -1
- package/resources/reactions.d.mts.map +1 -1
- package/resources/reactions.d.ts +24 -1
- package/resources/reactions.d.ts.map +1 -1
- package/resources/reactions.js +11 -0
- package/resources/reactions.js.map +1 -1
- package/resources/reactions.mjs +11 -0
- package/resources/reactions.mjs.map +1 -1
- package/resources/refunds.d.mts +1 -1
- package/resources/refunds.d.mts.map +1 -1
- package/resources/refunds.d.ts +1 -1
- package/resources/refunds.d.ts.map +1 -1
- package/resources/shared.d.mts +73 -1
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +73 -1
- package/resources/shared.d.ts.map +1 -1
- package/resources/verifications.d.mts +11 -3
- package/resources/verifications.d.mts.map +1 -1
- package/resources/verifications.d.ts +11 -3
- package/resources/verifications.d.ts.map +1 -1
- package/resources/webhooks.d.mts +43 -293
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +43 -293
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +2 -2
- package/resources/webhooks.mjs.map +1 -1
- package/resources/withdrawals.d.mts +21 -128
- package/resources/withdrawals.d.mts.map +1 -1
- package/resources/withdrawals.d.ts +21 -128
- package/resources/withdrawals.d.ts.map +1 -1
- package/src/client.ts +133 -18
- package/src/internal/parse.ts +6 -0
- package/src/resources/ai-chats.ts +227 -0
- package/src/resources/apps.ts +6 -0
- package/src/resources/authorized-users.ts +45 -5
- package/src/resources/checkout-configurations.ts +15 -0
- package/src/resources/company-token-transactions.ts +433 -0
- package/src/resources/dm-channels.ts +212 -0
- package/src/resources/dm-members.ts +248 -0
- package/src/resources/files.ts +8 -2
- package/src/resources/index.ts +64 -9
- package/src/resources/leads.ts +9 -205
- package/src/resources/ledger-accounts.ts +3 -35
- package/src/resources/members.ts +16 -6
- package/src/resources/memberships.ts +45 -9
- package/src/resources/messages.ts +22 -0
- package/src/resources/payments.ts +109 -57
- package/src/resources/payout-methods.ts +37 -2
- package/src/resources/reactions.ts +36 -0
- package/src/resources/refunds.ts +2 -1
- package/src/resources/shared.ts +110 -11
- package/src/resources/verifications.ts +49 -36
- package/src/resources/webhooks.ts +78 -728
- package/src/resources/withdrawals.ts +29 -205
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../core/resource';
|
|
4
4
|
import * as Shared from './shared';
|
|
5
|
+
import * as VerificationsAPI from './verifications';
|
|
5
6
|
import { APIPromise } from '../core/api-promise';
|
|
6
7
|
import { RequestOptions } from '../internal/request-options';
|
|
7
8
|
import { path } from '../internal/utils/path';
|
|
@@ -250,27 +251,7 @@ export namespace LedgerAccountRetrieveResponse {
|
|
|
250
251
|
/**
|
|
251
252
|
* An error code for a verification attempt.
|
|
252
253
|
*/
|
|
253
|
-
last_error_code:
|
|
254
|
-
| 'abandoned'
|
|
255
|
-
| 'consent_declined'
|
|
256
|
-
| 'country_not_supported'
|
|
257
|
-
| 'device_not_supported'
|
|
258
|
-
| 'document_expired'
|
|
259
|
-
| 'document_type_not_supported'
|
|
260
|
-
| 'document_unverified_other'
|
|
261
|
-
| 'email_unverified_other'
|
|
262
|
-
| 'email_verification_declined'
|
|
263
|
-
| 'id_number_insufficient_document_data'
|
|
264
|
-
| 'id_number_mismatch'
|
|
265
|
-
| 'id_number_unverified_other'
|
|
266
|
-
| 'phone_unverified_other'
|
|
267
|
-
| 'phone_verification_declined'
|
|
268
|
-
| 'selfie_document_missing_photo'
|
|
269
|
-
| 'selfie_face_mismatch'
|
|
270
|
-
| 'selfie_manipulated'
|
|
271
|
-
| 'selfie_unverified_other'
|
|
272
|
-
| 'under_supported_age'
|
|
273
|
-
| null;
|
|
254
|
+
last_error_code: VerificationsAPI.VerificationErrorCode | null;
|
|
274
255
|
|
|
275
256
|
/**
|
|
276
257
|
* The last error reason that occurred during the verification.
|
|
@@ -280,20 +261,7 @@ export namespace LedgerAccountRetrieveResponse {
|
|
|
280
261
|
/**
|
|
281
262
|
* The status of the verification.
|
|
282
263
|
*/
|
|
283
|
-
status:
|
|
284
|
-
| 'requires_input'
|
|
285
|
-
| 'processing'
|
|
286
|
-
| 'verified'
|
|
287
|
-
| 'canceled'
|
|
288
|
-
| 'created'
|
|
289
|
-
| 'started'
|
|
290
|
-
| 'submitted'
|
|
291
|
-
| 'approved'
|
|
292
|
-
| 'declined'
|
|
293
|
-
| 'resubmission_requested'
|
|
294
|
-
| 'expired'
|
|
295
|
-
| 'abandoned'
|
|
296
|
-
| 'review';
|
|
264
|
+
status: VerificationsAPI.VerificationStatus;
|
|
297
265
|
}
|
|
298
266
|
}
|
|
299
267
|
}
|
package/src/resources/members.ts
CHANGED
|
@@ -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 });
|
|
@@ -64,6 +64,11 @@ export interface MemberRetrieveResponse {
|
|
|
64
64
|
*/
|
|
65
65
|
company: MemberRetrieveResponse.Company;
|
|
66
66
|
|
|
67
|
+
/**
|
|
68
|
+
* The member's token balance for this company
|
|
69
|
+
*/
|
|
70
|
+
company_token_balance: number;
|
|
71
|
+
|
|
67
72
|
/**
|
|
68
73
|
* When the member was created
|
|
69
74
|
*/
|
|
@@ -176,6 +181,11 @@ export interface MemberListResponse {
|
|
|
176
181
|
*/
|
|
177
182
|
access_level: Shared.AccessLevel;
|
|
178
183
|
|
|
184
|
+
/**
|
|
185
|
+
* The member's token balance for this company
|
|
186
|
+
*/
|
|
187
|
+
company_token_balance: number;
|
|
188
|
+
|
|
179
189
|
/**
|
|
180
190
|
* When the member was created
|
|
181
191
|
*/
|
|
@@ -250,11 +260,6 @@ export namespace MemberListResponse {
|
|
|
250
260
|
}
|
|
251
261
|
|
|
252
262
|
export interface MemberListParams extends CursorPageParams {
|
|
253
|
-
/**
|
|
254
|
-
* The ID of the company to list members for
|
|
255
|
-
*/
|
|
256
|
-
company_id: string;
|
|
257
|
-
|
|
258
263
|
/**
|
|
259
264
|
* The access level a given user (or company) has to a product or company.
|
|
260
265
|
*/
|
|
@@ -265,6 +270,11 @@ export interface MemberListParams extends CursorPageParams {
|
|
|
265
270
|
*/
|
|
266
271
|
before?: string | null;
|
|
267
272
|
|
|
273
|
+
/**
|
|
274
|
+
* The ID of the company to list members for
|
|
275
|
+
*/
|
|
276
|
+
company_id?: string | null;
|
|
277
|
+
|
|
268
278
|
/**
|
|
269
279
|
* The minimum creation date to filter by
|
|
270
280
|
*/
|
|
@@ -14,6 +14,7 @@ export class Memberships extends APIResource {
|
|
|
14
14
|
* Required permissions:
|
|
15
15
|
*
|
|
16
16
|
* - `member:basic:read`
|
|
17
|
+
* - `member:email:read`
|
|
17
18
|
*/
|
|
18
19
|
retrieve(id: string, options?: RequestOptions): APIPromise<Shared.Membership> {
|
|
19
20
|
return this._client.get(path`/memberships/${id}`, options);
|
|
@@ -25,6 +26,7 @@ export class Memberships extends APIResource {
|
|
|
25
26
|
* Required permissions:
|
|
26
27
|
*
|
|
27
28
|
* - `member:manage`
|
|
29
|
+
* - `member:email:read`
|
|
28
30
|
* - `member:basic:read`
|
|
29
31
|
*/
|
|
30
32
|
update(
|
|
@@ -41,6 +43,7 @@ export class Memberships extends APIResource {
|
|
|
41
43
|
* Required permissions:
|
|
42
44
|
*
|
|
43
45
|
* - `member:basic:read`
|
|
46
|
+
* - `member:email:read`
|
|
44
47
|
*/
|
|
45
48
|
list(
|
|
46
49
|
query: MembershipListParams | null | undefined = {},
|
|
@@ -56,6 +59,7 @@ export class Memberships extends APIResource {
|
|
|
56
59
|
* Required permissions:
|
|
57
60
|
*
|
|
58
61
|
* - `member:manage`
|
|
62
|
+
* - `member:email:read`
|
|
59
63
|
* - `member:basic:read`
|
|
60
64
|
*/
|
|
61
65
|
cancel(
|
|
@@ -72,6 +76,7 @@ export class Memberships extends APIResource {
|
|
|
72
76
|
* Required permissions:
|
|
73
77
|
*
|
|
74
78
|
* - `member:manage`
|
|
79
|
+
* - `member:email:read`
|
|
75
80
|
* - `member:basic:read`
|
|
76
81
|
*/
|
|
77
82
|
pause(
|
|
@@ -88,15 +93,42 @@ export class Memberships extends APIResource {
|
|
|
88
93
|
* Required permissions:
|
|
89
94
|
*
|
|
90
95
|
* - `member:manage`
|
|
96
|
+
* - `member:email:read`
|
|
91
97
|
* - `member:basic:read`
|
|
92
98
|
*/
|
|
93
99
|
resume(id: string, options?: RequestOptions): APIPromise<Shared.Membership> {
|
|
94
100
|
return this._client.post(path`/memberships/${id}/resume`, options);
|
|
95
101
|
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Uncancels a membership that was scheduled to cancel at period end
|
|
105
|
+
*
|
|
106
|
+
* Required permissions:
|
|
107
|
+
*
|
|
108
|
+
* - `member:manage`
|
|
109
|
+
* - `member:email:read`
|
|
110
|
+
* - `member:basic:read`
|
|
111
|
+
*/
|
|
112
|
+
uncancel(id: string, options?: RequestOptions): APIPromise<Shared.Membership> {
|
|
113
|
+
return this._client.post(path`/memberships/${id}/uncancel`, options);
|
|
114
|
+
}
|
|
96
115
|
}
|
|
97
116
|
|
|
98
117
|
export type MembershipListResponsesCursorPage = CursorPage<MembershipListResponse>;
|
|
99
118
|
|
|
119
|
+
/**
|
|
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
|
+
|
|
100
132
|
/**
|
|
101
133
|
* A membership represents a purchase between a User and a Company for a specific
|
|
102
134
|
* Product.
|
|
@@ -113,6 +145,12 @@ export interface MembershipListResponse {
|
|
|
113
145
|
*/
|
|
114
146
|
cancel_at_period_end: boolean;
|
|
115
147
|
|
|
148
|
+
/**
|
|
149
|
+
* The different reasons a user can choose for why they are canceling their
|
|
150
|
+
* membership.
|
|
151
|
+
*/
|
|
152
|
+
cancel_option: CancelOptions | null;
|
|
153
|
+
|
|
116
154
|
/**
|
|
117
155
|
* The epoch timestamp of when the customer initiated a cancellation.
|
|
118
156
|
*/
|
|
@@ -277,6 +315,11 @@ export namespace MembershipListResponse {
|
|
|
277
315
|
*/
|
|
278
316
|
id: string;
|
|
279
317
|
|
|
318
|
+
/**
|
|
319
|
+
* The email of the user
|
|
320
|
+
*/
|
|
321
|
+
email: string | null;
|
|
322
|
+
|
|
280
323
|
/**
|
|
281
324
|
* The name of the user from their Whop account.
|
|
282
325
|
*/
|
|
@@ -305,15 +348,7 @@ export interface MembershipListParams extends CursorPageParams {
|
|
|
305
348
|
/**
|
|
306
349
|
* The cancel options to filter the memberships by
|
|
307
350
|
*/
|
|
308
|
-
cancel_options?: Array<
|
|
309
|
-
| 'too_expensive'
|
|
310
|
-
| 'switching'
|
|
311
|
-
| 'missing_features'
|
|
312
|
-
| 'technical_issues'
|
|
313
|
-
| 'bad_experience'
|
|
314
|
-
| 'other'
|
|
315
|
-
| 'testing'
|
|
316
|
-
> | null;
|
|
351
|
+
cancel_options?: Array<CancelOptions> | null;
|
|
317
352
|
|
|
318
353
|
/**
|
|
319
354
|
* The ID of the company to list memberships for
|
|
@@ -393,6 +428,7 @@ export interface MembershipPauseParams {
|
|
|
393
428
|
|
|
394
429
|
export declare namespace Memberships {
|
|
395
430
|
export {
|
|
431
|
+
type CancelOptions as CancelOptions,
|
|
396
432
|
type MembershipListResponse as MembershipListResponse,
|
|
397
433
|
type MembershipListResponsesCursorPage as MembershipListResponsesCursorPage,
|
|
398
434
|
type MembershipUpdateParams as MembershipUpdateParams,
|
|
@@ -54,6 +54,17 @@ export class Messages extends APIResource {
|
|
|
54
54
|
): PagePromise<MessageListResponsesCursorPage, MessageListResponse> {
|
|
55
55
|
return this._client.getAPIList('/messages', CursorPage<MessageListResponse>, { query, ...options });
|
|
56
56
|
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Deletes a message
|
|
60
|
+
*
|
|
61
|
+
* Required permissions:
|
|
62
|
+
*
|
|
63
|
+
* - `chat:message:create`
|
|
64
|
+
*/
|
|
65
|
+
delete(id: string, options?: RequestOptions): APIPromise<MessageDeleteResponse> {
|
|
66
|
+
return this._client.delete(path`/messages/${id}`, options);
|
|
67
|
+
}
|
|
57
68
|
}
|
|
58
69
|
|
|
59
70
|
export type MessageListResponsesCursorPage = CursorPage<MessageListResponse>;
|
|
@@ -207,6 +218,11 @@ export namespace MessageListResponse {
|
|
|
207
218
|
}
|
|
208
219
|
}
|
|
209
220
|
|
|
221
|
+
/**
|
|
222
|
+
* Represents `true` or `false` values.
|
|
223
|
+
*/
|
|
224
|
+
export type MessageDeleteResponse = boolean;
|
|
225
|
+
|
|
210
226
|
export interface MessageCreateParams {
|
|
211
227
|
/**
|
|
212
228
|
* The ID of the channel or experience to send to.
|
|
@@ -227,6 +243,11 @@ export interface MessageCreateParams {
|
|
|
227
243
|
* The poll for this message
|
|
228
244
|
*/
|
|
229
245
|
poll?: MessageCreateParams.Poll | null;
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* The ID of the message this is replying to, if applicable.
|
|
249
|
+
*/
|
|
250
|
+
replying_to_message_id?: string | null;
|
|
230
251
|
}
|
|
231
252
|
|
|
232
253
|
export namespace MessageCreateParams {
|
|
@@ -327,6 +348,7 @@ export interface MessageListParams extends CursorPageParams {
|
|
|
327
348
|
export declare namespace Messages {
|
|
328
349
|
export {
|
|
329
350
|
type MessageListResponse as MessageListResponse,
|
|
351
|
+
type MessageDeleteResponse as MessageDeleteResponse,
|
|
330
352
|
type MessageListResponsesCursorPage as MessageListResponsesCursorPage,
|
|
331
353
|
type MessageCreateParams as MessageCreateParams,
|
|
332
354
|
type MessageUpdateParams as MessageUpdateParams,
|
|
@@ -259,91 +259,93 @@ export type CardBrands =
|
|
|
259
259
|
* The different types of payment methods that can be used.
|
|
260
260
|
*/
|
|
261
261
|
export type PaymentMethodTypes =
|
|
262
|
+
| 'acss_debit'
|
|
263
|
+
| 'affirm'
|
|
262
264
|
| 'afterpay_clearpay'
|
|
263
265
|
| 'alipay'
|
|
266
|
+
| 'alma'
|
|
264
267
|
| 'amazon_pay'
|
|
268
|
+
| 'apple'
|
|
265
269
|
| 'apple_pay'
|
|
270
|
+
| 'au_becs_debit'
|
|
271
|
+
| 'bacs_debit'
|
|
266
272
|
| 'bancontact'
|
|
273
|
+
| 'billie'
|
|
274
|
+
| 'bizum'
|
|
275
|
+
| 'blik'
|
|
276
|
+
| 'boleto'
|
|
277
|
+
| 'capchase_pay'
|
|
267
278
|
| 'card'
|
|
268
279
|
| 'cashapp'
|
|
280
|
+
| 'coinbase'
|
|
269
281
|
| 'crypto'
|
|
282
|
+
| 'custom'
|
|
283
|
+
| 'customer_balance'
|
|
284
|
+
| 'demo_pay'
|
|
285
|
+
| 'eps'
|
|
286
|
+
| 'eu_bank_transfer'
|
|
287
|
+
| 'fpx'
|
|
288
|
+
| 'giropay'
|
|
270
289
|
| 'google_pay'
|
|
290
|
+
| 'gopay'
|
|
291
|
+
| 'grabpay'
|
|
292
|
+
| 'id_bank_transfer'
|
|
271
293
|
| 'ideal'
|
|
294
|
+
| 'interac'
|
|
295
|
+
| 'kakao_pay'
|
|
272
296
|
| 'klarna'
|
|
297
|
+
| 'konbini'
|
|
298
|
+
| 'kr_card'
|
|
299
|
+
| 'kr_market'
|
|
300
|
+
| 'kriya'
|
|
301
|
+
| 'link'
|
|
302
|
+
| 'mb_way'
|
|
273
303
|
| 'mobilepay'
|
|
274
|
-
| '
|
|
275
|
-
| 'swish'
|
|
276
|
-
| 'twint'
|
|
277
|
-
| 'us_bank_account'
|
|
278
|
-
| 'zip'
|
|
279
|
-
| 'vipps'
|
|
280
|
-
| 'paypal'
|
|
281
|
-
| 'sezzle'
|
|
282
|
-
| 'coinbase'
|
|
283
|
-
| 'splitit'
|
|
284
|
-
| 'platform_balance'
|
|
285
|
-
| 'apple'
|
|
286
|
-
| 'venmo'
|
|
287
|
-
| 'affirm'
|
|
304
|
+
| 'mondu'
|
|
288
305
|
| 'multibanco'
|
|
289
|
-
| 'wechat_pay'
|
|
290
306
|
| 'naver_pay'
|
|
307
|
+
| 'netbanking'
|
|
308
|
+
| 'ng_bank'
|
|
309
|
+
| 'ng_bank_transfer'
|
|
310
|
+
| 'ng_card'
|
|
311
|
+
| 'ng_market'
|
|
312
|
+
| 'ng_ussd'
|
|
313
|
+
| 'ng_wallet'
|
|
291
314
|
| 'nz_bank_account'
|
|
292
315
|
| 'oxxo'
|
|
293
316
|
| 'p24'
|
|
294
317
|
| 'pay_by_bank'
|
|
295
318
|
| 'payco'
|
|
296
319
|
| 'paynow'
|
|
320
|
+
| 'paypal'
|
|
321
|
+
| 'paypay'
|
|
322
|
+
| 'payto'
|
|
297
323
|
| 'pix'
|
|
324
|
+
| 'platform_balance'
|
|
298
325
|
| 'promptpay'
|
|
326
|
+
| 'qris'
|
|
327
|
+
| 'rechnung'
|
|
299
328
|
| 'revolut_pay'
|
|
300
329
|
| 'samsung_pay'
|
|
301
330
|
| 'satispay'
|
|
302
|
-
| 'sofort'
|
|
303
|
-
| 'konbini'
|
|
304
|
-
| 'kr_card'
|
|
305
|
-
| 'link'
|
|
306
|
-
| 'grabpay'
|
|
307
|
-
| 'kakao_pay'
|
|
308
|
-
| 'billie'
|
|
309
|
-
| 'blik'
|
|
310
|
-
| 'boleto'
|
|
311
|
-
| 'eps'
|
|
312
|
-
| 'fpx'
|
|
313
|
-
| 'giropay'
|
|
314
|
-
| 'acss_debit'
|
|
315
|
-
| 'alma'
|
|
316
|
-
| 'au_becs_debit'
|
|
317
|
-
| 'bacs_debit'
|
|
318
|
-
| 'bizum'
|
|
319
|
-
| 'capchase_pay'
|
|
320
|
-
| 'kriya'
|
|
321
|
-
| 'mondu'
|
|
322
|
-
| 'ng_wallet'
|
|
323
|
-
| 'paypay'
|
|
324
|
-
| 'sequra'
|
|
325
331
|
| 'scalapay'
|
|
326
|
-
| '
|
|
327
|
-
| '
|
|
328
|
-
| '
|
|
329
|
-
| '
|
|
330
|
-
| 'ng_bank'
|
|
331
|
-
| 'ng_bank_transfer'
|
|
332
|
-
| 'ng_card'
|
|
333
|
-
| 'ng_market'
|
|
334
|
-
| 'ng_ussd'
|
|
335
|
-
| 'payto'
|
|
336
|
-
| 'qris'
|
|
337
|
-
| 'rechnung'
|
|
338
|
-
| 'south_korea_market'
|
|
339
|
-
| 'kr_market'
|
|
332
|
+
| 'sepa_debit'
|
|
333
|
+
| 'sequra'
|
|
334
|
+
| 'sezzle'
|
|
335
|
+
| 'shop_pay'
|
|
340
336
|
| 'shopeepay'
|
|
341
|
-
| '
|
|
337
|
+
| 'sofort'
|
|
338
|
+
| 'south_korea_market'
|
|
339
|
+
| 'splitit'
|
|
342
340
|
| 'sunbit'
|
|
343
|
-
| '
|
|
344
|
-
| '
|
|
345
|
-
| '
|
|
346
|
-
| '
|
|
341
|
+
| 'swish'
|
|
342
|
+
| 'twint'
|
|
343
|
+
| 'upi'
|
|
344
|
+
| 'us_bank_account'
|
|
345
|
+
| 'venmo'
|
|
346
|
+
| 'vipps'
|
|
347
|
+
| 'wechat_pay'
|
|
348
|
+
| 'zip'
|
|
347
349
|
| 'unknown';
|
|
348
350
|
|
|
349
351
|
/**
|
|
@@ -360,6 +362,11 @@ export interface PaymentListResponse {
|
|
|
360
362
|
*/
|
|
361
363
|
amount_after_fees: number;
|
|
362
364
|
|
|
365
|
+
/**
|
|
366
|
+
* The application fee charged on this payment.
|
|
367
|
+
*/
|
|
368
|
+
application_fee: PaymentListResponse.ApplicationFee | null;
|
|
369
|
+
|
|
363
370
|
/**
|
|
364
371
|
* Whether this payment was auto refunded or not
|
|
365
372
|
*/
|
|
@@ -431,6 +438,11 @@ export interface PaymentListResponse {
|
|
|
431
438
|
*/
|
|
432
439
|
metadata: { [key: string]: unknown } | null;
|
|
433
440
|
|
|
441
|
+
/**
|
|
442
|
+
* The time of the next schedule payment retry.
|
|
443
|
+
*/
|
|
444
|
+
next_payment_attempt: string | null;
|
|
445
|
+
|
|
434
446
|
/**
|
|
435
447
|
* The datetime the payment was paid
|
|
436
448
|
*/
|
|
@@ -446,6 +458,11 @@ export interface PaymentListResponse {
|
|
|
446
458
|
*/
|
|
447
459
|
payment_method_type: PaymentMethodTypes | null;
|
|
448
460
|
|
|
461
|
+
/**
|
|
462
|
+
* The number of failed payment attempts for the payment.
|
|
463
|
+
*/
|
|
464
|
+
payments_failed: number | null;
|
|
465
|
+
|
|
449
466
|
/**
|
|
450
467
|
* The plan attached to this payment.
|
|
451
468
|
*/
|
|
@@ -522,6 +539,41 @@ export interface PaymentListResponse {
|
|
|
522
539
|
}
|
|
523
540
|
|
|
524
541
|
export namespace PaymentListResponse {
|
|
542
|
+
/**
|
|
543
|
+
* The application fee charged on this payment.
|
|
544
|
+
*/
|
|
545
|
+
export interface ApplicationFee {
|
|
546
|
+
/**
|
|
547
|
+
* The unique identifier for the application fee.
|
|
548
|
+
*/
|
|
549
|
+
id: string;
|
|
550
|
+
|
|
551
|
+
/**
|
|
552
|
+
* The application fee amount.
|
|
553
|
+
*/
|
|
554
|
+
amount: number;
|
|
555
|
+
|
|
556
|
+
/**
|
|
557
|
+
* The amount of the application fee that has been captured.
|
|
558
|
+
*/
|
|
559
|
+
amount_captured: number;
|
|
560
|
+
|
|
561
|
+
/**
|
|
562
|
+
* The amount of the application fee that has been refunded.
|
|
563
|
+
*/
|
|
564
|
+
amount_refunded: number;
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* When the application fee was created.
|
|
568
|
+
*/
|
|
569
|
+
created_at: string;
|
|
570
|
+
|
|
571
|
+
/**
|
|
572
|
+
* The currency of the application fee.
|
|
573
|
+
*/
|
|
574
|
+
currency: Shared.Currency;
|
|
575
|
+
}
|
|
576
|
+
|
|
525
577
|
/**
|
|
526
578
|
* The address of the user who made the payment.
|
|
527
579
|
*/
|
|
@@ -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,6 +39,17 @@ 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
|
*/
|
|
@@ -47,6 +59,12 @@ export interface PayoutMethodRetrieveResponse {
|
|
|
47
59
|
*/
|
|
48
60
|
id: string;
|
|
49
61
|
|
|
62
|
+
/**
|
|
63
|
+
* A reference to identify the payout destination, such as the last 4 digits of an
|
|
64
|
+
* account number or an email address.
|
|
65
|
+
*/
|
|
66
|
+
account_reference: string | null;
|
|
67
|
+
|
|
50
68
|
/**
|
|
51
69
|
* The company associated with the payout token
|
|
52
70
|
*/
|
|
@@ -68,6 +86,11 @@ export interface PayoutMethodRetrieveResponse {
|
|
|
68
86
|
*/
|
|
69
87
|
destination: PayoutMethodRetrieveResponse.Destination | null;
|
|
70
88
|
|
|
89
|
+
/**
|
|
90
|
+
* The name of the bank or financial institution.
|
|
91
|
+
*/
|
|
92
|
+
institution_name: string | null;
|
|
93
|
+
|
|
71
94
|
/**
|
|
72
95
|
* Whether this payout token is the default for the payout account
|
|
73
96
|
*/
|
|
@@ -98,7 +121,7 @@ export namespace PayoutMethodRetrieveResponse {
|
|
|
98
121
|
/**
|
|
99
122
|
* The category of the payout destination
|
|
100
123
|
*/
|
|
101
|
-
category:
|
|
124
|
+
category: PayoutMethodsAPI.PayoutDestinationCategory;
|
|
102
125
|
|
|
103
126
|
/**
|
|
104
127
|
* The country code of the payout destination
|
|
@@ -121,6 +144,12 @@ export interface PayoutMethodListResponse {
|
|
|
121
144
|
*/
|
|
122
145
|
id: string;
|
|
123
146
|
|
|
147
|
+
/**
|
|
148
|
+
* A reference to identify the payout destination, such as the last 4 digits of an
|
|
149
|
+
* account number or an email address.
|
|
150
|
+
*/
|
|
151
|
+
account_reference: string | null;
|
|
152
|
+
|
|
124
153
|
/**
|
|
125
154
|
* The company associated with the payout token
|
|
126
155
|
*/
|
|
@@ -142,6 +171,11 @@ export interface PayoutMethodListResponse {
|
|
|
142
171
|
*/
|
|
143
172
|
destination: PayoutMethodListResponse.Destination | null;
|
|
144
173
|
|
|
174
|
+
/**
|
|
175
|
+
* The name of the bank or financial institution.
|
|
176
|
+
*/
|
|
177
|
+
institution_name: string | null;
|
|
178
|
+
|
|
145
179
|
/**
|
|
146
180
|
* Whether this payout token is the default for the payout account
|
|
147
181
|
*/
|
|
@@ -172,7 +206,7 @@ export namespace PayoutMethodListResponse {
|
|
|
172
206
|
/**
|
|
173
207
|
* The category of the payout destination
|
|
174
208
|
*/
|
|
175
|
-
category:
|
|
209
|
+
category: PayoutMethodsAPI.PayoutDestinationCategory;
|
|
176
210
|
|
|
177
211
|
/**
|
|
178
212
|
* The country code of the payout destination
|
|
@@ -210,6 +244,7 @@ export interface PayoutMethodListParams extends CursorPageParams {
|
|
|
210
244
|
|
|
211
245
|
export declare namespace PayoutMethods {
|
|
212
246
|
export {
|
|
247
|
+
type PayoutDestinationCategory as PayoutDestinationCategory,
|
|
213
248
|
type PayoutMethodRetrieveResponse as PayoutMethodRetrieveResponse,
|
|
214
249
|
type PayoutMethodListResponse as PayoutMethodListResponse,
|
|
215
250
|
type PayoutMethodListResponsesCursorPage as PayoutMethodListResponsesCursorPage,
|
|
@@ -43,6 +43,22 @@ export class Reactions extends APIResource {
|
|
|
43
43
|
): PagePromise<ReactionListResponsesCursorPage, ReactionListResponse> {
|
|
44
44
|
return this._client.getAPIList('/reactions', CursorPage<ReactionListResponse>, { query, ...options });
|
|
45
45
|
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Deletes a reaction
|
|
49
|
+
*
|
|
50
|
+
* Required permissions:
|
|
51
|
+
*
|
|
52
|
+
* - `chat:read`
|
|
53
|
+
*/
|
|
54
|
+
delete(
|
|
55
|
+
id: string,
|
|
56
|
+
params: ReactionDeleteParams | null | undefined = {},
|
|
57
|
+
options?: RequestOptions,
|
|
58
|
+
): APIPromise<ReactionDeleteResponse> {
|
|
59
|
+
const { emoji } = params ?? {};
|
|
60
|
+
return this._client.delete(path`/reactions/${id}`, { query: { emoji }, ...options });
|
|
61
|
+
}
|
|
46
62
|
}
|
|
47
63
|
|
|
48
64
|
export type ReactionListResponsesCursorPage = CursorPage<ReactionListResponse>;
|
|
@@ -94,6 +110,11 @@ export namespace ReactionListResponse {
|
|
|
94
110
|
}
|
|
95
111
|
}
|
|
96
112
|
|
|
113
|
+
/**
|
|
114
|
+
* Represents `true` or `false` values.
|
|
115
|
+
*/
|
|
116
|
+
export type ReactionDeleteResponse = boolean;
|
|
117
|
+
|
|
97
118
|
export interface ReactionCreateParams {
|
|
98
119
|
/**
|
|
99
120
|
* The ID of the post or message to react to.
|
|
@@ -105,6 +126,12 @@ export interface ReactionCreateParams {
|
|
|
105
126
|
* as everything will be :heart:
|
|
106
127
|
*/
|
|
107
128
|
emoji?: string | null;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* The ID of the poll option to vote for. Only valid for messages or posts with
|
|
132
|
+
* polls.
|
|
133
|
+
*/
|
|
134
|
+
poll_option_id?: string | null;
|
|
108
135
|
}
|
|
109
136
|
|
|
110
137
|
export interface ReactionListParams extends CursorPageParams {
|
|
@@ -129,11 +156,20 @@ export interface ReactionListParams extends CursorPageParams {
|
|
|
129
156
|
last?: number | null;
|
|
130
157
|
}
|
|
131
158
|
|
|
159
|
+
export interface ReactionDeleteParams {
|
|
160
|
+
/**
|
|
161
|
+
* The emoji to remove (e.g., :heart: or '😀').
|
|
162
|
+
*/
|
|
163
|
+
emoji?: string | null;
|
|
164
|
+
}
|
|
165
|
+
|
|
132
166
|
export declare namespace Reactions {
|
|
133
167
|
export {
|
|
134
168
|
type ReactionListResponse as ReactionListResponse,
|
|
169
|
+
type ReactionDeleteResponse as ReactionDeleteResponse,
|
|
135
170
|
type ReactionListResponsesCursorPage as ReactionListResponsesCursorPage,
|
|
136
171
|
type ReactionCreateParams as ReactionCreateParams,
|
|
137
172
|
type ReactionListParams as ReactionListParams,
|
|
173
|
+
type ReactionDeleteParams as ReactionDeleteParams,
|
|
138
174
|
};
|
|
139
175
|
}
|