@whop/sdk 0.0.21 → 0.0.22

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 (66) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/client.d.mts +11 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +11 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js +9 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +9 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/index.d.mts +4 -1
  12. package/resources/index.d.mts.map +1 -1
  13. package/resources/index.d.ts +4 -1
  14. package/resources/index.d.ts.map +1 -1
  15. package/resources/index.js +7 -1
  16. package/resources/index.js.map +1 -1
  17. package/resources/index.mjs +3 -0
  18. package/resources/index.mjs.map +1 -1
  19. package/resources/leads.d.mts +489 -0
  20. package/resources/leads.d.mts.map +1 -0
  21. package/resources/leads.d.ts +489 -0
  22. package/resources/leads.d.ts.map +1 -0
  23. package/resources/leads.js +94 -0
  24. package/resources/leads.js.map +1 -0
  25. package/resources/leads.mjs +90 -0
  26. package/resources/leads.mjs.map +1 -0
  27. package/resources/ledger-accounts.d.mts +25 -0
  28. package/resources/ledger-accounts.d.mts.map +1 -1
  29. package/resources/ledger-accounts.d.ts +25 -0
  30. package/resources/ledger-accounts.d.ts.map +1 -1
  31. package/resources/payout-methods.d.mts +69 -1
  32. package/resources/payout-methods.d.mts.map +1 -1
  33. package/resources/payout-methods.d.ts +69 -1
  34. package/resources/payout-methods.d.ts.map +1 -1
  35. package/resources/payout-methods.js +11 -0
  36. package/resources/payout-methods.js.map +1 -1
  37. package/resources/payout-methods.mjs +11 -0
  38. package/resources/payout-methods.mjs.map +1 -1
  39. package/resources/topups.d.mts +79 -0
  40. package/resources/topups.d.mts.map +1 -0
  41. package/resources/topups.d.ts +79 -0
  42. package/resources/topups.d.ts.map +1 -0
  43. package/resources/topups.js +29 -0
  44. package/resources/topups.js.map +1 -0
  45. package/resources/topups.mjs +25 -0
  46. package/resources/topups.mjs.map +1 -0
  47. package/resources/verifications.d.mts +38 -0
  48. package/resources/verifications.d.mts.map +1 -0
  49. package/resources/verifications.d.ts +38 -0
  50. package/resources/verifications.d.ts.map +1 -0
  51. package/resources/verifications.js +20 -0
  52. package/resources/verifications.js.map +1 -0
  53. package/resources/verifications.mjs +16 -0
  54. package/resources/verifications.mjs.map +1 -0
  55. package/src/client.ts +44 -0
  56. package/src/resources/index.ts +14 -0
  57. package/src/resources/leads.ts +583 -0
  58. package/src/resources/ledger-accounts.ts +63 -0
  59. package/src/resources/payout-methods.ts +83 -0
  60. package/src/resources/topups.ts +95 -0
  61. package/src/resources/verifications.ts +81 -0
  62. package/src/version.ts +1 -1
  63. package/version.d.mts +1 -1
  64. package/version.d.ts +1 -1
  65. package/version.js +1 -1
  66. package/version.mjs +1 -1
@@ -1,10 +1,23 @@
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 { APIPromise } from '../core/api-promise';
4
5
  import { CursorPage, type CursorPageParams, PagePromise } from '../core/pagination';
5
6
  import { RequestOptions } from '../internal/request-options';
7
+ import { path } from '../internal/utils/path';
6
8
 
7
9
  export class PayoutMethods extends APIResource {
10
+ /**
11
+ * Retrieves a payout method by ID
12
+ *
13
+ * Required permissions:
14
+ *
15
+ * - `payout:destination:read`
16
+ */
17
+ retrieve(id: string, options?: RequestOptions): APIPromise<PayoutMethodRetrieveResponse> {
18
+ return this._client.get(path`/payout_methods/${id}`, options);
19
+ }
20
+
8
21
  /**
9
22
  * Lists payout destinations for a company
10
23
  *
@@ -25,6 +38,75 @@ export class PayoutMethods extends APIResource {
25
38
 
26
39
  export type PayoutMethodListResponsesCursorPage = CursorPage<PayoutMethodListResponse>;
27
40
 
41
+ /**
42
+ * An object representing an user's setup payout destination.
43
+ */
44
+ export interface PayoutMethodRetrieveResponse {
45
+ /**
46
+ * The ID of the payout token
47
+ */
48
+ id: string;
49
+
50
+ /**
51
+ * The company associated with the payout token
52
+ */
53
+ company: PayoutMethodRetrieveResponse.Company | null;
54
+
55
+ /**
56
+ * The currency code of the payout destination. This is the currency that payouts
57
+ * will be made in for this token.
58
+ */
59
+ currency: string;
60
+
61
+ /**
62
+ * The payout destination associated with the payout token
63
+ */
64
+ destination: PayoutMethodRetrieveResponse.Destination | null;
65
+
66
+ /**
67
+ * Whether this payout token is the default for the payout account
68
+ */
69
+ is_default: boolean;
70
+
71
+ /**
72
+ * An optional nickname for the payout token to help the user identify it. This is
73
+ * not used by the provider and is only for the user's reference.
74
+ */
75
+ nickname: string | null;
76
+ }
77
+
78
+ export namespace PayoutMethodRetrieveResponse {
79
+ /**
80
+ * The company associated with the payout token
81
+ */
82
+ export interface Company {
83
+ /**
84
+ * The ID (tag) of the company.
85
+ */
86
+ id: string;
87
+ }
88
+
89
+ /**
90
+ * The payout destination associated with the payout token
91
+ */
92
+ export interface Destination {
93
+ /**
94
+ * The category of the payout destination
95
+ */
96
+ category: 'crypto' | 'rtp' | 'next_day_bank' | 'bank_wire' | 'digital_wallet' | 'unknown';
97
+
98
+ /**
99
+ * The country code of the payout destination
100
+ */
101
+ country_code: string;
102
+
103
+ /**
104
+ * The name of the payer associated with the payout destination
105
+ */
106
+ name: string;
107
+ }
108
+ }
109
+
28
110
  /**
29
111
  * An object representing an user's setup payout destination.
30
112
  */
@@ -118,6 +200,7 @@ export interface PayoutMethodListParams extends CursorPageParams {
118
200
 
119
201
  export declare namespace PayoutMethods {
120
202
  export {
203
+ type PayoutMethodRetrieveResponse as PayoutMethodRetrieveResponse,
121
204
  type PayoutMethodListResponse as PayoutMethodListResponse,
122
205
  type PayoutMethodListResponsesCursorPage as PayoutMethodListResponsesCursorPage,
123
206
  type PayoutMethodListParams as PayoutMethodListParams,
@@ -0,0 +1,95 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import * as Shared from './shared';
5
+ import { APIPromise } from '../core/api-promise';
6
+ import { RequestOptions } from '../internal/request-options';
7
+
8
+ export class Topups extends APIResource {
9
+ /**
10
+ * Add funds to your platform balance by charging a stored payment method.
11
+ *
12
+ * Required permissions:
13
+ *
14
+ * - `payment:charge`
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * const topup = await client.topups.create({
19
+ * amount: 6.9,
20
+ * company_id: 'biz_xxxxxxxxxxxxxx',
21
+ * currency: 'usd',
22
+ * payment_method_id: 'pmt_xxxxxxxxxxxxxx',
23
+ * });
24
+ * ```
25
+ */
26
+ create(body: TopupCreateParams, options?: RequestOptions): APIPromise<TopupCreateResponse> {
27
+ return this._client.post('/topups', { body, ...options });
28
+ }
29
+ }
30
+
31
+ /**
32
+ * An object representing a receipt for a membership.
33
+ */
34
+ export interface TopupCreateResponse {
35
+ /**
36
+ * The payment ID
37
+ */
38
+ id: string;
39
+
40
+ /**
41
+ * The datetime the payment was created
42
+ */
43
+ created_at: string;
44
+
45
+ /**
46
+ * The available currencies on the platform
47
+ */
48
+ currency: Shared.Currency | null;
49
+
50
+ /**
51
+ * If the payment failed, the reason for the failure.
52
+ */
53
+ failure_message: string | null;
54
+
55
+ /**
56
+ * The datetime the payment was paid
57
+ */
58
+ paid_at: string | null;
59
+
60
+ /**
61
+ * The status of a receipt
62
+ */
63
+ status: Shared.ReceiptStatus | null;
64
+
65
+ /**
66
+ * The total to show to the creator (excluding buyer fees).
67
+ */
68
+ total: number | null;
69
+ }
70
+
71
+ export interface TopupCreateParams {
72
+ /**
73
+ * The amount to add to the balance.
74
+ */
75
+ amount: number;
76
+
77
+ /**
78
+ * The ID of the company to add funds to.
79
+ */
80
+ company_id: string;
81
+
82
+ /**
83
+ * The currency of the top-up.
84
+ */
85
+ currency: Shared.Currency;
86
+
87
+ /**
88
+ * The ID of the payment method to charge for the top-up.
89
+ */
90
+ payment_method_id: string;
91
+ }
92
+
93
+ export declare namespace Topups {
94
+ export { type TopupCreateResponse as TopupCreateResponse, type TopupCreateParams as TopupCreateParams };
95
+ }
@@ -0,0 +1,81 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
+ import { RequestOptions } from '../internal/request-options';
6
+ import { path } from '../internal/utils/path';
7
+
8
+ export class Verifications extends APIResource {
9
+ /**
10
+ * Retrieves a verification by ID
11
+ *
12
+ * Required permissions:
13
+ *
14
+ * - `payout:account:read`
15
+ */
16
+ retrieve(id: string, options?: RequestOptions): APIPromise<VerificationRetrieveResponse> {
17
+ return this._client.get(path`/verifications/${id}`, options);
18
+ }
19
+ }
20
+
21
+ /**
22
+ * An object representing an identity verification session
23
+ */
24
+ export interface VerificationRetrieveResponse {
25
+ /**
26
+ * A unique identifier for the verification.
27
+ */
28
+ id: string;
29
+
30
+ /**
31
+ * An error code for a verification attempt.
32
+ */
33
+ last_error_code:
34
+ | 'abandoned'
35
+ | 'consent_declined'
36
+ | 'country_not_supported'
37
+ | 'device_not_supported'
38
+ | 'document_expired'
39
+ | 'document_type_not_supported'
40
+ | 'document_unverified_other'
41
+ | 'email_unverified_other'
42
+ | 'email_verification_declined'
43
+ | 'id_number_insufficient_document_data'
44
+ | 'id_number_mismatch'
45
+ | 'id_number_unverified_other'
46
+ | 'phone_unverified_other'
47
+ | 'phone_verification_declined'
48
+ | 'selfie_document_missing_photo'
49
+ | 'selfie_face_mismatch'
50
+ | 'selfie_manipulated'
51
+ | 'selfie_unverified_other'
52
+ | 'under_supported_age'
53
+ | null;
54
+
55
+ /**
56
+ * The last error reason that occurred during the verification.
57
+ */
58
+ last_error_reason: string | null;
59
+
60
+ /**
61
+ * The status of the verification.
62
+ */
63
+ status:
64
+ | 'requires_input'
65
+ | 'processing'
66
+ | 'verified'
67
+ | 'canceled'
68
+ | 'created'
69
+ | 'started'
70
+ | 'submitted'
71
+ | 'approved'
72
+ | 'declined'
73
+ | 'resubmission_requested'
74
+ | 'expired'
75
+ | 'abandoned'
76
+ | 'review';
77
+ }
78
+
79
+ export declare namespace Verifications {
80
+ export { type VerificationRetrieveResponse as VerificationRetrieveResponse };
81
+ }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.0.21'; // x-release-please-version
1
+ export const VERSION = '0.0.22'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.0.21";
1
+ export declare const VERSION = "0.0.22";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.0.21";
1
+ export declare const VERSION = "0.0.22";
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.21'; // x-release-please-version
4
+ exports.VERSION = '0.0.22'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.0.21'; // x-release-please-version
1
+ export const VERSION = '0.0.22'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map