@whop/sdk 0.0.32 → 0.0.33

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 (57) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/client.d.mts +10 -4
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +10 -4
  5. package/client.d.ts.map +1 -1
  6. package/client.js +6 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +6 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/index.d.mts +3 -2
  12. package/resources/index.d.mts.map +1 -1
  13. package/resources/index.d.ts +3 -2
  14. package/resources/index.d.ts.map +1 -1
  15. package/resources/index.js +4 -2
  16. package/resources/index.js.map +1 -1
  17. package/resources/index.mjs +1 -0
  18. package/resources/index.mjs.map +1 -1
  19. package/resources/ledger-accounts.d.mts +6 -0
  20. package/resources/ledger-accounts.d.mts.map +1 -1
  21. package/resources/ledger-accounts.d.ts +6 -0
  22. package/resources/ledger-accounts.d.ts.map +1 -1
  23. package/resources/ledger-accounts.js.map +1 -1
  24. package/resources/ledger-accounts.mjs.map +1 -1
  25. package/resources/payout-accounts.d.mts +139 -0
  26. package/resources/payout-accounts.d.mts.map +1 -0
  27. package/resources/payout-accounts.d.ts +139 -0
  28. package/resources/payout-accounts.d.ts.map +1 -0
  29. package/resources/payout-accounts.js +23 -0
  30. package/resources/payout-accounts.js.map +1 -0
  31. package/resources/payout-accounts.mjs +19 -0
  32. package/resources/payout-accounts.mjs.map +1 -0
  33. package/resources/verifications.d.mts +53 -1
  34. package/resources/verifications.d.mts.map +1 -1
  35. package/resources/verifications.d.ts +53 -1
  36. package/resources/verifications.d.ts.map +1 -1
  37. package/resources/verifications.js +15 -0
  38. package/resources/verifications.js.map +1 -1
  39. package/resources/verifications.mjs +15 -0
  40. package/resources/verifications.mjs.map +1 -1
  41. package/resources/webhooks.d.mts +145 -3
  42. package/resources/webhooks.d.mts.map +1 -1
  43. package/resources/webhooks.d.ts +145 -3
  44. package/resources/webhooks.d.ts.map +1 -1
  45. package/resources/webhooks.js.map +1 -1
  46. package/resources/webhooks.mjs.map +1 -1
  47. package/src/client.ts +24 -0
  48. package/src/resources/index.ts +9 -0
  49. package/src/resources/ledger-accounts.ts +7 -0
  50. package/src/resources/payout-accounts.ts +177 -0
  51. package/src/resources/verifications.ts +73 -0
  52. package/src/resources/webhooks.ts +173 -0
  53. package/src/version.ts +1 -1
  54. package/version.d.mts +1 -1
  55. package/version.d.ts +1 -1
  56. package/version.js +1 -1
  57. package/version.mjs +1 -1
@@ -0,0 +1,177 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import * as VerificationsAPI from './verifications';
5
+ import { APIPromise } from '../core/api-promise';
6
+ import { RequestOptions } from '../internal/request-options';
7
+ import { path } from '../internal/utils/path';
8
+
9
+ /**
10
+ * Payout accounts
11
+ */
12
+ export class PayoutAccounts extends APIResource {
13
+ /**
14
+ * Retrieves the details of an existing payout account.
15
+ *
16
+ * Required permissions:
17
+ *
18
+ * - `payout:account:read`
19
+ */
20
+ retrieve(id: string, options?: RequestOptions): APIPromise<PayoutAccountRetrieveResponse> {
21
+ return this._client.get(path`/payout_accounts/${id}`, options);
22
+ }
23
+ }
24
+
25
+ /**
26
+ * The granular calculated statuses reflecting payout account KYC and withdrawal
27
+ * readiness.
28
+ */
29
+ export type PayoutAccountCalculatedStatuses =
30
+ | 'connected'
31
+ | 'disabled'
32
+ | 'action_required'
33
+ | 'pending_verification'
34
+ | 'verification_failed'
35
+ | 'not_started';
36
+
37
+ /**
38
+ * An object representing an account used for payouts.
39
+ */
40
+ export interface PayoutAccountRetrieveResponse {
41
+ /**
42
+ * The unique identifier for the payout account.
43
+ */
44
+ id: string;
45
+
46
+ /**
47
+ * The physical address associated with this payout account
48
+ */
49
+ address: PayoutAccountRetrieveResponse.Address | null;
50
+
51
+ /**
52
+ * The company's legal name
53
+ */
54
+ business_name: string | null;
55
+
56
+ /**
57
+ * The business representative for this payout account
58
+ */
59
+ business_representative: PayoutAccountRetrieveResponse.BusinessRepresentative | null;
60
+
61
+ /**
62
+ * The email address of the representative
63
+ */
64
+ email: string | null;
65
+
66
+ /**
67
+ * The latest verification for the connected account.
68
+ */
69
+ latest_verification: PayoutAccountRetrieveResponse.LatestVerification | null;
70
+
71
+ /**
72
+ * The business representative's phone
73
+ */
74
+ phone: string | null;
75
+
76
+ /**
77
+ * The granular calculated statuses reflecting payout account KYC and withdrawal
78
+ * readiness.
79
+ */
80
+ status: PayoutAccountCalculatedStatuses | null;
81
+ }
82
+
83
+ export namespace PayoutAccountRetrieveResponse {
84
+ /**
85
+ * The physical address associated with this payout account
86
+ */
87
+ export interface Address {
88
+ /**
89
+ * The city of the address.
90
+ */
91
+ city: string | null;
92
+
93
+ /**
94
+ * The country of the address.
95
+ */
96
+ country: string | null;
97
+
98
+ /**
99
+ * The line 1 of the address.
100
+ */
101
+ line1: string | null;
102
+
103
+ /**
104
+ * The line 2 of the address.
105
+ */
106
+ line2: string | null;
107
+
108
+ /**
109
+ * The postal code of the address.
110
+ */
111
+ postal_code: string | null;
112
+
113
+ /**
114
+ * The state of the address.
115
+ */
116
+ state: string | null;
117
+ }
118
+
119
+ /**
120
+ * The business representative for this payout account
121
+ */
122
+ export interface BusinessRepresentative {
123
+ /**
124
+ * The date of birth of the business representative in ISO 8601 format
125
+ * (YYYY-MM-DD).
126
+ */
127
+ date_of_birth: string | null;
128
+
129
+ /**
130
+ * The first name of the business representative.
131
+ */
132
+ first_name: string | null;
133
+
134
+ /**
135
+ * The last name of the business representative.
136
+ */
137
+ last_name: string | null;
138
+
139
+ /**
140
+ * The middle name of the business representative.
141
+ */
142
+ middle_name: string | null;
143
+ }
144
+
145
+ /**
146
+ * The latest verification for the connected account.
147
+ */
148
+ export interface LatestVerification {
149
+ /**
150
+ * The unique identifier for the verification.
151
+ */
152
+ id: string;
153
+
154
+ /**
155
+ * An error code for a verification attempt.
156
+ */
157
+ last_error_code: VerificationsAPI.VerificationErrorCode | null;
158
+
159
+ /**
160
+ * A human-readable explanation of the most recent verification error. Null if no
161
+ * error has occurred.
162
+ */
163
+ last_error_reason: string | null;
164
+
165
+ /**
166
+ * The current status of this verification session.
167
+ */
168
+ status: VerificationsAPI.VerificationStatus;
169
+ }
170
+ }
171
+
172
+ export declare namespace PayoutAccounts {
173
+ export {
174
+ type PayoutAccountCalculatedStatuses as PayoutAccountCalculatedStatuses,
175
+ type PayoutAccountRetrieveResponse as PayoutAccountRetrieveResponse,
176
+ };
177
+ }
@@ -2,6 +2,7 @@
2
2
 
3
3
  import { APIResource } from '../core/resource';
4
4
  import { APIPromise } from '../core/api-promise';
5
+ import { CursorPage, type CursorPageParams, PagePromise } from '../core/pagination';
5
6
  import { RequestOptions } from '../internal/request-options';
6
7
  import { path } from '../internal/utils/path';
7
8
 
@@ -19,8 +20,28 @@ export class Verifications extends APIResource {
19
20
  retrieve(id: string, options?: RequestOptions): APIPromise<VerificationRetrieveResponse> {
20
21
  return this._client.get(path`/verifications/${id}`, options);
21
22
  }
23
+
24
+ /**
25
+ * Returns a list of identity verifications for a payout account, ordered by most
26
+ * recent first.
27
+ *
28
+ * Required permissions:
29
+ *
30
+ * - `payout:account:read`
31
+ */
32
+ list(
33
+ query: VerificationListParams,
34
+ options?: RequestOptions,
35
+ ): PagePromise<VerificationListResponsesCursorPage, VerificationListResponse> {
36
+ return this._client.getAPIList('/verifications', CursorPage<VerificationListResponse>, {
37
+ query,
38
+ ...options,
39
+ });
40
+ }
22
41
  }
23
42
 
43
+ export type VerificationListResponsesCursorPage = CursorPage<VerificationListResponse>;
44
+
24
45
  /**
25
46
  * An error code for a verification attempt.
26
47
  */
@@ -90,10 +111,62 @@ export interface VerificationRetrieveResponse {
90
111
  status: VerificationStatus;
91
112
  }
92
113
 
114
+ /**
115
+ * An identity verification session used to confirm a person or entity's identity
116
+ * for payout account eligibility.
117
+ */
118
+ export interface VerificationListResponse {
119
+ /**
120
+ * The unique identifier for the verification.
121
+ */
122
+ id: string;
123
+
124
+ /**
125
+ * An error code for a verification attempt.
126
+ */
127
+ last_error_code: VerificationErrorCode | null;
128
+
129
+ /**
130
+ * A human-readable explanation of the most recent verification error. Null if no
131
+ * error has occurred.
132
+ */
133
+ last_error_reason: string | null;
134
+
135
+ /**
136
+ * The current status of this verification session.
137
+ */
138
+ status: VerificationStatus;
139
+ }
140
+
141
+ export interface VerificationListParams extends CursorPageParams {
142
+ /**
143
+ * The unique identifier of the payout account to list verifications for.
144
+ */
145
+ payout_account_id: string;
146
+
147
+ /**
148
+ * Returns the elements in the list that come before the specified cursor.
149
+ */
150
+ before?: string | null;
151
+
152
+ /**
153
+ * Returns the first _n_ elements from the list.
154
+ */
155
+ first?: number | null;
156
+
157
+ /**
158
+ * Returns the last _n_ elements from the list.
159
+ */
160
+ last?: number | null;
161
+ }
162
+
93
163
  export declare namespace Verifications {
94
164
  export {
95
165
  type VerificationErrorCode as VerificationErrorCode,
96
166
  type VerificationStatus as VerificationStatus,
97
167
  type VerificationRetrieveResponse as VerificationRetrieveResponse,
168
+ type VerificationListResponse as VerificationListResponse,
169
+ type VerificationListResponsesCursorPage as VerificationListResponsesCursorPage,
170
+ type VerificationListParams as VerificationListParams,
98
171
  };
99
172
  }
@@ -4,6 +4,7 @@ import { APIResource } from '../core/resource';
4
4
  import * as DisputeAlertsAPI from './dispute-alerts';
5
5
  import * as DisputesAPI from './disputes';
6
6
  import * as PaymentsAPI from './payments';
7
+ import * as PayoutAccountsAPI from './payout-accounts';
7
8
  import * as PayoutMethodsAPI from './payout-methods';
8
9
  import * as RefundsAPI from './refunds';
9
10
  import * as SetupIntentsAPI from './setup-intents';
@@ -217,6 +218,7 @@ export type WebhookEvent =
217
218
  | 'course_lesson_interaction.completed'
218
219
  | 'payout_method.created'
219
220
  | 'verification.succeeded'
221
+ | 'payout_account.status_updated'
220
222
  | 'payment.created'
221
223
  | 'payment.succeeded'
222
224
  | 'payment.failed'
@@ -1052,6 +1054,175 @@ export namespace VerificationSucceededWebhookEvent {
1052
1054
  }
1053
1055
  }
1054
1056
 
1057
+ export interface PayoutAccountStatusUpdatedWebhookEvent {
1058
+ /**
1059
+ * A unique ID for every single webhook request
1060
+ */
1061
+ id: string;
1062
+
1063
+ /**
1064
+ * The API version for this webhook
1065
+ */
1066
+ api_version: 'v1';
1067
+
1068
+ /**
1069
+ * An object representing an account used for payouts.
1070
+ */
1071
+ data: PayoutAccountStatusUpdatedWebhookEvent.Data;
1072
+
1073
+ /**
1074
+ * The timestamp in ISO 8601 format that the webhook was sent at on the server
1075
+ */
1076
+ timestamp: string;
1077
+
1078
+ /**
1079
+ * The webhook event type
1080
+ */
1081
+ type: 'payout_account.status_updated';
1082
+
1083
+ /**
1084
+ * The company ID that this webhook event is associated with
1085
+ */
1086
+ company_id?: string | null;
1087
+ }
1088
+
1089
+ export namespace PayoutAccountStatusUpdatedWebhookEvent {
1090
+ /**
1091
+ * An object representing an account used for payouts.
1092
+ */
1093
+ export interface Data {
1094
+ /**
1095
+ * The unique identifier for the payout account.
1096
+ */
1097
+ id: string;
1098
+
1099
+ /**
1100
+ * The physical address associated with this payout account
1101
+ */
1102
+ address: Data.Address | null;
1103
+
1104
+ /**
1105
+ * The company's legal name
1106
+ */
1107
+ business_name: string | null;
1108
+
1109
+ /**
1110
+ * The business representative for this payout account
1111
+ */
1112
+ business_representative: Data.BusinessRepresentative | null;
1113
+
1114
+ /**
1115
+ * The email address of the representative
1116
+ */
1117
+ email: string | null;
1118
+
1119
+ /**
1120
+ * The latest verification for the connected account.
1121
+ */
1122
+ latest_verification: Data.LatestVerification | null;
1123
+
1124
+ /**
1125
+ * The business representative's phone
1126
+ */
1127
+ phone: string | null;
1128
+
1129
+ /**
1130
+ * The granular calculated statuses reflecting payout account KYC and withdrawal
1131
+ * readiness.
1132
+ */
1133
+ status: PayoutAccountsAPI.PayoutAccountCalculatedStatuses | null;
1134
+ }
1135
+
1136
+ export namespace Data {
1137
+ /**
1138
+ * The physical address associated with this payout account
1139
+ */
1140
+ export interface Address {
1141
+ /**
1142
+ * The city of the address.
1143
+ */
1144
+ city: string | null;
1145
+
1146
+ /**
1147
+ * The country of the address.
1148
+ */
1149
+ country: string | null;
1150
+
1151
+ /**
1152
+ * The line 1 of the address.
1153
+ */
1154
+ line1: string | null;
1155
+
1156
+ /**
1157
+ * The line 2 of the address.
1158
+ */
1159
+ line2: string | null;
1160
+
1161
+ /**
1162
+ * The postal code of the address.
1163
+ */
1164
+ postal_code: string | null;
1165
+
1166
+ /**
1167
+ * The state of the address.
1168
+ */
1169
+ state: string | null;
1170
+ }
1171
+
1172
+ /**
1173
+ * The business representative for this payout account
1174
+ */
1175
+ export interface BusinessRepresentative {
1176
+ /**
1177
+ * The date of birth of the business representative in ISO 8601 format
1178
+ * (YYYY-MM-DD).
1179
+ */
1180
+ date_of_birth: string | null;
1181
+
1182
+ /**
1183
+ * The first name of the business representative.
1184
+ */
1185
+ first_name: string | null;
1186
+
1187
+ /**
1188
+ * The last name of the business representative.
1189
+ */
1190
+ last_name: string | null;
1191
+
1192
+ /**
1193
+ * The middle name of the business representative.
1194
+ */
1195
+ middle_name: string | null;
1196
+ }
1197
+
1198
+ /**
1199
+ * The latest verification for the connected account.
1200
+ */
1201
+ export interface LatestVerification {
1202
+ /**
1203
+ * The unique identifier for the verification.
1204
+ */
1205
+ id: string;
1206
+
1207
+ /**
1208
+ * An error code for a verification attempt.
1209
+ */
1210
+ last_error_code: VerificationsAPI.VerificationErrorCode | null;
1211
+
1212
+ /**
1213
+ * A human-readable explanation of the most recent verification error. Null if no
1214
+ * error has occurred.
1215
+ */
1216
+ last_error_reason: string | null;
1217
+
1218
+ /**
1219
+ * The current status of this verification session.
1220
+ */
1221
+ status: VerificationsAPI.VerificationStatus;
1222
+ }
1223
+ }
1224
+ }
1225
+
1055
1226
  export interface PaymentCreatedWebhookEvent {
1056
1227
  /**
1057
1228
  * A unique ID for every single webhook request
@@ -2086,6 +2257,7 @@ export type UnwrapWebhookEvent =
2086
2257
  | CourseLessonInteractionCompletedWebhookEvent
2087
2258
  | PayoutMethodCreatedWebhookEvent
2088
2259
  | VerificationSucceededWebhookEvent
2260
+ | PayoutAccountStatusUpdatedWebhookEvent
2089
2261
  | PaymentCreatedWebhookEvent
2090
2262
  | PaymentSucceededWebhookEvent
2091
2263
  | PaymentFailedWebhookEvent
@@ -2206,6 +2378,7 @@ export declare namespace Webhooks {
2206
2378
  type CourseLessonInteractionCompletedWebhookEvent as CourseLessonInteractionCompletedWebhookEvent,
2207
2379
  type PayoutMethodCreatedWebhookEvent as PayoutMethodCreatedWebhookEvent,
2208
2380
  type VerificationSucceededWebhookEvent as VerificationSucceededWebhookEvent,
2381
+ type PayoutAccountStatusUpdatedWebhookEvent as PayoutAccountStatusUpdatedWebhookEvent,
2209
2382
  type PaymentCreatedWebhookEvent as PaymentCreatedWebhookEvent,
2210
2383
  type PaymentSucceededWebhookEvent as PaymentSucceededWebhookEvent,
2211
2384
  type PaymentFailedWebhookEvent as PaymentFailedWebhookEvent,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.0.32'; // x-release-please-version
1
+ export const VERSION = '0.0.33'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.0.32";
1
+ export declare const VERSION = "0.0.33";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.0.32";
1
+ export declare const VERSION = "0.0.33";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.0.32'; // x-release-please-version
4
+ exports.VERSION = '0.0.33'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.0.32'; // x-release-please-version
1
+ export const VERSION = '0.0.33'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map