@whop/sdk 0.0.36 → 0.0.38

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 (89) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/client.d.mts +20 -7
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +20 -7
  5. package/client.d.ts.map +1 -1
  6. package/client.js +7 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs +7 -1
  9. package/client.mjs.map +1 -1
  10. package/lib/verify-user-token.d.mts +1 -0
  11. package/lib/verify-user-token.d.mts.map +1 -1
  12. package/lib/verify-user-token.d.ts +1 -0
  13. package/lib/verify-user-token.d.ts.map +1 -1
  14. package/lib/verify-user-token.js +39 -13
  15. package/lib/verify-user-token.js.map +1 -1
  16. package/lib/verify-user-token.mjs +40 -14
  17. package/lib/verify-user-token.mjs.map +1 -1
  18. package/package.json +1 -1
  19. package/resources/checkout-configurations.d.mts +27 -6
  20. package/resources/checkout-configurations.d.mts.map +1 -1
  21. package/resources/checkout-configurations.d.ts +27 -6
  22. package/resources/checkout-configurations.d.ts.map +1 -1
  23. package/resources/checkout-configurations.js.map +1 -1
  24. package/resources/checkout-configurations.mjs.map +1 -1
  25. package/resources/forums.d.mts +5 -0
  26. package/resources/forums.d.mts.map +1 -1
  27. package/resources/forums.d.ts +5 -0
  28. package/resources/forums.d.ts.map +1 -1
  29. package/resources/index.d.mts +3 -3
  30. package/resources/index.d.mts.map +1 -1
  31. package/resources/index.d.ts +3 -3
  32. package/resources/index.d.ts.map +1 -1
  33. package/resources/index.js.map +1 -1
  34. package/resources/index.mjs.map +1 -1
  35. package/resources/invoices.d.mts +332 -7
  36. package/resources/invoices.d.mts.map +1 -1
  37. package/resources/invoices.d.ts +332 -7
  38. package/resources/invoices.d.ts.map +1 -1
  39. package/resources/invoices.js +70 -0
  40. package/resources/invoices.js.map +1 -1
  41. package/resources/invoices.mjs +70 -0
  42. package/resources/invoices.mjs.map +1 -1
  43. package/resources/payments.d.mts +5 -1
  44. package/resources/payments.d.mts.map +1 -1
  45. package/resources/payments.d.ts +5 -1
  46. package/resources/payments.d.ts.map +1 -1
  47. package/resources/plans.d.mts +15 -6
  48. package/resources/plans.d.mts.map +1 -1
  49. package/resources/plans.d.ts +15 -6
  50. package/resources/plans.d.ts.map +1 -1
  51. package/resources/plans.js.map +1 -1
  52. package/resources/plans.mjs.map +1 -1
  53. package/resources/refunds.d.mts +1 -1
  54. package/resources/refunds.d.mts.map +1 -1
  55. package/resources/refunds.d.ts +1 -1
  56. package/resources/refunds.d.ts.map +1 -1
  57. package/resources/shared.d.mts +10 -1
  58. package/resources/shared.d.mts.map +1 -1
  59. package/resources/shared.d.ts +10 -1
  60. package/resources/shared.d.ts.map +1 -1
  61. package/resources/users.d.mts +77 -34
  62. package/resources/users.d.mts.map +1 -1
  63. package/resources/users.d.ts +77 -34
  64. package/resources/users.d.ts.map +1 -1
  65. package/resources/users.js +42 -12
  66. package/resources/users.js.map +1 -1
  67. package/resources/users.mjs +42 -12
  68. package/resources/users.mjs.map +1 -1
  69. package/resources/verifications.d.mts +1 -1
  70. package/resources/verifications.d.mts.map +1 -1
  71. package/resources/verifications.d.ts +1 -1
  72. package/resources/verifications.d.ts.map +1 -1
  73. package/src/client.ts +35 -2
  74. package/src/lib/verify-user-token.ts +49 -16
  75. package/src/resources/checkout-configurations.ts +31 -6
  76. package/src/resources/forums.ts +6 -0
  77. package/src/resources/index.ts +6 -1
  78. package/src/resources/invoices.ts +396 -6
  79. package/src/resources/payments.ts +15 -0
  80. package/src/resources/plans.ts +18 -5
  81. package/src/resources/refunds.ts +2 -1
  82. package/src/resources/shared.ts +12 -1
  83. package/src/resources/users.ts +95 -44
  84. package/src/resources/verifications.ts +2 -1
  85. package/src/version.ts +1 -1
  86. package/version.d.mts +1 -1
  87. package/version.d.ts +1 -1
  88. package/version.js +1 -1
  89. package/version.mjs +1 -1
@@ -2,6 +2,7 @@
2
2
 
3
3
  import { APIResource } from '../core/resource';
4
4
  import * as PaymentsAPI from './payments';
5
+ import * as PlansAPI from './plans';
5
6
  import * as Shared from './shared';
6
7
  import { APIPromise } from '../core/api-promise';
7
8
  import { CursorPage, type CursorPageParams, PagePromise } from '../core/pagination';
@@ -92,6 +93,12 @@ export interface CheckoutConfigurationListResponse {
92
93
  */
93
94
  affiliate_code: string | null;
94
95
 
96
+ /**
97
+ * Whether the checkout configuration allows promo codes. When false, the promo
98
+ * code input is hidden and promo codes are rejected.
99
+ */
100
+ allow_promo_codes: boolean;
101
+
95
102
  /**
96
103
  * The ID of the company to use for the checkout configuration
97
104
  */
@@ -249,6 +256,12 @@ export declare namespace CheckoutConfigurationCreateParams {
249
256
  */
250
257
  affiliate_code?: string | null;
251
258
 
259
+ /**
260
+ * Whether the checkout should show the promo code input field and accept promo
261
+ * codes. Defaults to true.
262
+ */
263
+ allow_promo_codes?: boolean | null;
264
+
252
265
  /**
253
266
  * Checkout styling overrides for this session. Overrides plan and company
254
267
  * defaults.
@@ -565,7 +578,7 @@ export declare namespace CheckoutConfigurationCreateParams {
565
578
  /**
566
579
  * The different border-radius styles available for checkout pages.
567
580
  */
568
- border_style?: 'rounded' | 'pill' | 'rectangular' | null;
581
+ border_style?: PlansAPI.CheckoutShape | null;
569
582
 
570
583
  /**
571
584
  * A hex color code for the button color (e.g. #FF5733).
@@ -575,7 +588,7 @@ export declare namespace CheckoutConfigurationCreateParams {
575
588
  /**
576
589
  * The different font families available for checkout pages.
577
590
  */
578
- font_family?: 'system' | 'roboto' | 'open_sans' | null;
591
+ font_family?: PlansAPI.CheckoutFont | null;
579
592
  }
580
593
 
581
594
  /**
@@ -618,6 +631,12 @@ export declare namespace CheckoutConfigurationCreateParams {
618
631
  */
619
632
  affiliate_code?: string | null;
620
633
 
634
+ /**
635
+ * Whether the checkout should show the promo code input field and accept promo
636
+ * codes. Defaults to true.
637
+ */
638
+ allow_promo_codes?: boolean | null;
639
+
621
640
  /**
622
641
  * Checkout styling overrides for this session. Overrides plan and company
623
642
  * defaults.
@@ -662,7 +681,7 @@ export declare namespace CheckoutConfigurationCreateParams {
662
681
  /**
663
682
  * The different border-radius styles available for checkout pages.
664
683
  */
665
- border_style?: 'rounded' | 'pill' | 'rectangular' | null;
684
+ border_style?: PlansAPI.CheckoutShape | null;
666
685
 
667
686
  /**
668
687
  * A hex color code for the button color (e.g. #FF5733).
@@ -672,7 +691,7 @@ export declare namespace CheckoutConfigurationCreateParams {
672
691
  /**
673
692
  * The different font families available for checkout pages.
674
693
  */
675
- font_family?: 'system' | 'roboto' | 'open_sans' | null;
694
+ font_family?: PlansAPI.CheckoutFont | null;
676
695
  }
677
696
 
678
697
  /**
@@ -712,6 +731,12 @@ export declare namespace CheckoutConfigurationCreateParams {
712
731
 
713
732
  mode: 'setup';
714
733
 
734
+ /**
735
+ * Whether the checkout should show the promo code input field and accept promo
736
+ * codes. Defaults to true.
737
+ */
738
+ allow_promo_codes?: boolean | null;
739
+
715
740
  /**
716
741
  * Checkout styling overrides for this session. Overrides plan and company
717
742
  * defaults.
@@ -754,7 +779,7 @@ export declare namespace CheckoutConfigurationCreateParams {
754
779
  /**
755
780
  * The different border-radius styles available for checkout pages.
756
781
  */
757
- border_style?: 'rounded' | 'pill' | 'rectangular' | null;
782
+ border_style?: PlansAPI.CheckoutShape | null;
758
783
 
759
784
  /**
760
785
  * A hex color code for the button color (e.g. #FF5733).
@@ -764,7 +789,7 @@ export declare namespace CheckoutConfigurationCreateParams {
764
789
  /**
765
790
  * The different font families available for checkout pages.
766
791
  */
767
- font_family?: 'system' | 'roboto' | 'open_sans' | null;
792
+ font_family?: PlansAPI.CheckoutFont | null;
768
793
  }
769
794
 
770
795
  /**
@@ -109,6 +109,12 @@ export namespace ForumListResponse {
109
109
  }
110
110
 
111
111
  export interface ForumUpdateParams {
112
+ /**
113
+ * A list of words that are automatically blocked from posts in this forum. For
114
+ * example, ['spam', 'scam'].
115
+ */
116
+ banned_words?: Array<string> | null;
117
+
112
118
  /**
113
119
  * The banner image displayed at the top of the forum page. Pass null to remove the
114
120
  * existing banner.
@@ -229,10 +229,12 @@ export {
229
229
  export {
230
230
  Invoices,
231
231
  type TaxIdentifierType,
232
+ type InvoiceDeleteResponse,
232
233
  type InvoiceMarkPaidResponse,
233
234
  type InvoiceMarkUncollectibleResponse,
234
235
  type InvoiceVoidResponse,
235
236
  type InvoiceCreateParams,
237
+ type InvoiceUpdateParams,
236
238
  type InvoiceListParams,
237
239
  } from './invoices';
238
240
  export {
@@ -315,6 +317,8 @@ export {
315
317
  } from './payout-methods';
316
318
  export {
317
319
  Plans,
320
+ type CheckoutFont,
321
+ type CheckoutShape,
318
322
  type PlanListResponse,
319
323
  type PlanDeleteResponse,
320
324
  type PlanCreateParams,
@@ -415,9 +419,10 @@ export {
415
419
  type User,
416
420
  type UserListResponse,
417
421
  type UserCheckAccessResponse,
422
+ type UserRetrieveParams,
423
+ type UserUpdateParams,
418
424
  type UserListParams,
419
425
  type UserCheckAccessParams,
420
- type UserUpdateProfileParams,
421
426
  type UserListResponsesCursorPage,
422
427
  } from './users';
423
428
  export {
@@ -42,11 +42,40 @@ export class Invoices extends APIResource {
42
42
  * Required permissions:
43
43
  *
44
44
  * - `invoice:basic:read`
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * const invoice = await client.invoices.retrieve(
49
+ * 'inv_xxxxxxxxxxxxxx',
50
+ * );
51
+ * ```
45
52
  */
46
53
  retrieve(id: string, options?: RequestOptions): APIPromise<Shared.Invoice> {
47
54
  return this._client.get(path`/invoices/${id}`, options);
48
55
  }
49
56
 
57
+ /**
58
+ * Update a draft invoice's details.
59
+ *
60
+ * Required permissions:
61
+ *
62
+ * - `invoice:update`
63
+ *
64
+ * @example
65
+ * ```ts
66
+ * const invoice = await client.invoices.update(
67
+ * 'inv_xxxxxxxxxxxxxx',
68
+ * );
69
+ * ```
70
+ */
71
+ update(
72
+ id: string,
73
+ body: InvoiceUpdateParams | null | undefined = {},
74
+ options?: RequestOptions,
75
+ ): APIPromise<Shared.Invoice> {
76
+ return this._client.patch(path`/invoices/${id}`, { body, ...options });
77
+ }
78
+
50
79
  /**
51
80
  * Returns a paginated list of invoices for a company, with optional filtering by
52
81
  * product, status, collection method, and creation date.
@@ -54,6 +83,14 @@ export class Invoices extends APIResource {
54
83
  * Required permissions:
55
84
  *
56
85
  * - `invoice:basic:read`
86
+ *
87
+ * @example
88
+ * ```ts
89
+ * // Automatically fetches more pages as needed.
90
+ * for await (const invoiceListItem of client.invoices.list()) {
91
+ * // ...
92
+ * }
93
+ * ```
57
94
  */
58
95
  list(
59
96
  query: InvoiceListParams | null | undefined = {},
@@ -62,12 +99,37 @@ export class Invoices extends APIResource {
62
99
  return this._client.getAPIList('/invoices', CursorPage<Shared.InvoiceListItem>, { query, ...options });
63
100
  }
64
101
 
102
+ /**
103
+ * Delete a draft invoice.
104
+ *
105
+ * Required permissions:
106
+ *
107
+ * - `invoice:update`
108
+ *
109
+ * @example
110
+ * ```ts
111
+ * const invoice = await client.invoices.delete(
112
+ * 'inv_xxxxxxxxxxxxxx',
113
+ * );
114
+ * ```
115
+ */
116
+ delete(id: string, options?: RequestOptions): APIPromise<InvoiceDeleteResponse> {
117
+ return this._client.delete(path`/invoices/${id}`, options);
118
+ }
119
+
65
120
  /**
66
121
  * Mark an open invoice as paid when payment was collected outside of Whop.
67
122
  *
68
123
  * Required permissions:
69
124
  *
70
125
  * - `invoice:update`
126
+ *
127
+ * @example
128
+ * ```ts
129
+ * const response = await client.invoices.markPaid(
130
+ * 'inv_xxxxxxxxxxxxxx',
131
+ * );
132
+ * ```
71
133
  */
72
134
  markPaid(id: string, options?: RequestOptions): APIPromise<InvoiceMarkPaidResponse> {
73
135
  return this._client.post(path`/invoices/${id}/mark_paid`, options);
@@ -79,6 +141,13 @@ export class Invoices extends APIResource {
79
141
  * Required permissions:
80
142
  *
81
143
  * - `invoice:update`
144
+ *
145
+ * @example
146
+ * ```ts
147
+ * const response = await client.invoices.markUncollectible(
148
+ * 'inv_xxxxxxxxxxxxxx',
149
+ * );
150
+ * ```
82
151
  */
83
152
  markUncollectible(id: string, options?: RequestOptions): APIPromise<InvoiceMarkUncollectibleResponse> {
84
153
  return this._client.post(path`/invoices/${id}/mark_uncollectible`, options);
@@ -91,6 +160,13 @@ export class Invoices extends APIResource {
91
160
  * Required permissions:
92
161
  *
93
162
  * - `invoice:update`
163
+ *
164
+ * @example
165
+ * ```ts
166
+ * const response = await client.invoices.void(
167
+ * 'inv_xxxxxxxxxxxxxx',
168
+ * );
169
+ * ```
94
170
  */
95
171
  void(id: string, options?: RequestOptions): APIPromise<InvoiceVoidResponse> {
96
172
  return this._client.post(path`/invoices/${id}/void`, options);
@@ -213,6 +289,11 @@ export type TaxIdentifierType =
213
289
  | 'sr_fin'
214
290
  | 'xi_vat';
215
291
 
292
+ /**
293
+ * Represents `true` or `false` values.
294
+ */
295
+ export type InvoiceDeleteResponse = boolean;
296
+
216
297
  /**
217
298
  * Represents `true` or `false` values.
218
299
  */
@@ -258,9 +339,9 @@ export declare namespace InvoiceCreateParams {
258
339
  product: CreateInvoiceInputWithProduct.Product;
259
340
 
260
341
  /**
261
- * The date and time when the invoice will be automatically finalized and charged.
262
- * Only valid when collection_method is charge_automatically. If not provided, the
263
- * charge will be processed immediately.
342
+ * The date and time when the invoice will be automatically finalized. For
343
+ * charge_automatically, triggers an automatic charge. For send_invoice, sends the
344
+ * invoice email to the customer at the specified time.
264
345
  */
265
346
  automatically_finalizes_at?: string | null;
266
347
 
@@ -328,6 +409,12 @@ export declare namespace InvoiceCreateParams {
328
409
  * customer and due date requirements.
329
410
  */
330
411
  save_as_draft?: boolean | null;
412
+
413
+ /**
414
+ * The date that defines when the subscription billing cycle should start. When set
415
+ * on a renewal plan invoice, this anchors all future billing periods to this date.
416
+ */
417
+ subscription_billing_anchor_at?: string | null;
331
418
  }
332
419
 
333
420
  export namespace CreateInvoiceInputWithProduct {
@@ -598,9 +685,9 @@ export declare namespace InvoiceCreateParams {
598
685
  product_id: string;
599
686
 
600
687
  /**
601
- * The date and time when the invoice will be automatically finalized and charged.
602
- * Only valid when collection_method is charge_automatically. If not provided, the
603
- * charge will be processed immediately.
688
+ * The date and time when the invoice will be automatically finalized. For
689
+ * charge_automatically, triggers an automatic charge. For send_invoice, sends the
690
+ * invoice email to the customer at the specified time.
604
691
  */
605
692
  automatically_finalizes_at?: string | null;
606
693
 
@@ -668,6 +755,12 @@ export declare namespace InvoiceCreateParams {
668
755
  * customer and due date requirements.
669
756
  */
670
757
  save_as_draft?: boolean | null;
758
+
759
+ /**
760
+ * The date that defines when the subscription billing cycle should start. When set
761
+ * on a renewal plan invoice, this anchors all future billing periods to this date.
762
+ */
763
+ subscription_billing_anchor_at?: string | null;
671
764
  }
672
765
 
673
766
  export namespace CreateInvoiceInputWithProductID {
@@ -899,6 +992,301 @@ export declare namespace InvoiceCreateParams {
899
992
  }
900
993
  }
901
994
 
995
+ export interface InvoiceUpdateParams {
996
+ /**
997
+ * The date and time when the invoice will be automatically finalized. For
998
+ * charge_automatically, triggers an automatic charge. For send_invoice, sends the
999
+ * invoice email at the specified time.
1000
+ */
1001
+ automatically_finalizes_at?: string | null;
1002
+
1003
+ /**
1004
+ * Inline billing address to create or update a mailing address for this invoice.
1005
+ */
1006
+ billing_address?: InvoiceUpdateParams.BillingAddress | null;
1007
+
1008
+ /**
1009
+ * Whether to charge the customer a buyer fee on this invoice.
1010
+ */
1011
+ charge_buyer_fee?: boolean | null;
1012
+
1013
+ /**
1014
+ * The method of collection for an invoice.
1015
+ */
1016
+ collection_method?: Shared.CollectionMethod | null;
1017
+
1018
+ /**
1019
+ * The name of the customer.
1020
+ */
1021
+ customer_name?: string | null;
1022
+
1023
+ /**
1024
+ * The date by which the invoice must be paid.
1025
+ */
1026
+ due_date?: string | null;
1027
+
1028
+ /**
1029
+ * The email address of the customer.
1030
+ */
1031
+ email_address?: string | null;
1032
+
1033
+ /**
1034
+ * Line items that break down the invoice total.
1035
+ */
1036
+ line_items?: Array<InvoiceUpdateParams.LineItem> | null;
1037
+
1038
+ /**
1039
+ * The unique identifier of an existing mailing address to attach.
1040
+ */
1041
+ mailing_address_id?: string | null;
1042
+
1043
+ /**
1044
+ * The unique identifier of a member to assign as the customer.
1045
+ */
1046
+ member_id?: string | null;
1047
+
1048
+ /**
1049
+ * The unique identifier of the payment method to charge.
1050
+ */
1051
+ payment_method_id?: string | null;
1052
+
1053
+ /**
1054
+ * Updated plan attributes.
1055
+ */
1056
+ plan?: InvoiceUpdateParams.Plan | null;
1057
+
1058
+ /**
1059
+ * The date that defines when the subscription billing cycle should start.
1060
+ */
1061
+ subscription_billing_anchor_at?: string | null;
1062
+ }
1063
+
1064
+ export namespace InvoiceUpdateParams {
1065
+ /**
1066
+ * Inline billing address to create or update a mailing address for this invoice.
1067
+ */
1068
+ export interface BillingAddress {
1069
+ /**
1070
+ * The city of the address.
1071
+ */
1072
+ city?: string | null;
1073
+
1074
+ /**
1075
+ * The country of the address.
1076
+ */
1077
+ country?: string | null;
1078
+
1079
+ /**
1080
+ * The line 1 of the address.
1081
+ */
1082
+ line1?: string | null;
1083
+
1084
+ /**
1085
+ * The line 2 of the address.
1086
+ */
1087
+ line2?: string | null;
1088
+
1089
+ /**
1090
+ * The name of the customer.
1091
+ */
1092
+ name?: string | null;
1093
+
1094
+ /**
1095
+ * The phone number of the customer.
1096
+ */
1097
+ phone?: string | null;
1098
+
1099
+ /**
1100
+ * The postal code of the address.
1101
+ */
1102
+ postal_code?: string | null;
1103
+
1104
+ /**
1105
+ * The state of the address.
1106
+ */
1107
+ state?: string | null;
1108
+
1109
+ /**
1110
+ * The type of tax identifier
1111
+ */
1112
+ tax_id_type?: InvoicesAPI.TaxIdentifierType | null;
1113
+
1114
+ /**
1115
+ * The value of the tax identifier.
1116
+ */
1117
+ tax_id_value?: string | null;
1118
+ }
1119
+
1120
+ /**
1121
+ * A single line item to include on the invoice, with a label, quantity, and unit
1122
+ * price.
1123
+ */
1124
+ export interface LineItem {
1125
+ /**
1126
+ * The label or description for this line item.
1127
+ */
1128
+ label: string;
1129
+
1130
+ /**
1131
+ * The unit price for this line item. Provided as a number in the specified
1132
+ * currency. Eg: 10.43 for $10.43
1133
+ */
1134
+ unit_price: number;
1135
+
1136
+ /**
1137
+ * The quantity of this line item. Defaults to 1.
1138
+ */
1139
+ quantity?: number | null;
1140
+ }
1141
+
1142
+ /**
1143
+ * Updated plan attributes.
1144
+ */
1145
+ export interface Plan {
1146
+ /**
1147
+ * The interval in days at which the plan charges (renewal plans).
1148
+ */
1149
+ billing_period?: number | null;
1150
+
1151
+ /**
1152
+ * An array of custom field objects.
1153
+ */
1154
+ custom_fields?: Array<Plan.CustomField> | null;
1155
+
1156
+ /**
1157
+ * The description of the plan.
1158
+ */
1159
+ description?: string | null;
1160
+
1161
+ /**
1162
+ * The number of days until the membership expires and revokes access (expiration
1163
+ * plans). For example, 365 for a one-year access period.
1164
+ */
1165
+ expiration_days?: number | null;
1166
+
1167
+ /**
1168
+ * An additional amount charged upon first purchase. Use only if a one time payment
1169
+ * OR you want to charge an additional amount on top of the renewal price. Provided
1170
+ * as a number in the specified currency. Eg: 10.43 for $10.43
1171
+ */
1172
+ initial_price?: number | null;
1173
+
1174
+ /**
1175
+ * A personal description or notes section for the business.
1176
+ */
1177
+ internal_notes?: string | null;
1178
+
1179
+ /**
1180
+ * Whether this plan uses legacy payment method controls
1181
+ */
1182
+ legacy_payment_method_controls?: boolean | null;
1183
+
1184
+ /**
1185
+ * The explicit payment method configuration for the plan. If not provided, the
1186
+ * platform or company's defaults will apply.
1187
+ */
1188
+ payment_method_configuration?: Plan.PaymentMethodConfiguration | null;
1189
+
1190
+ /**
1191
+ * The type of plan that can be attached to a product
1192
+ */
1193
+ plan_type?: Shared.PlanType | null;
1194
+
1195
+ /**
1196
+ * The methods of how a plan can be released.
1197
+ */
1198
+ release_method?: Shared.ReleaseMethod | null;
1199
+
1200
+ /**
1201
+ * The amount the customer is charged every billing period. Use only if a recurring
1202
+ * payment. Provided as a number in the specified currency. Eg: 10.43 for $10.43
1203
+ */
1204
+ renewal_price?: number | null;
1205
+
1206
+ /**
1207
+ * The number of units available for purchase.
1208
+ */
1209
+ stock?: number | null;
1210
+
1211
+ /**
1212
+ * The number of free trial days added before a renewal plan.
1213
+ */
1214
+ trial_period_days?: number | null;
1215
+
1216
+ /**
1217
+ * When true, the plan has unlimited stock (stock field is ignored). When false,
1218
+ * purchases are limited by the stock field.
1219
+ */
1220
+ unlimited_stock?: boolean | null;
1221
+
1222
+ /**
1223
+ * Visibility of a resource
1224
+ */
1225
+ visibility?: Shared.Visibility | null;
1226
+ }
1227
+
1228
+ export namespace Plan {
1229
+ export interface CustomField {
1230
+ /**
1231
+ * The type of the custom field.
1232
+ */
1233
+ field_type: 'text';
1234
+
1235
+ /**
1236
+ * The name of the custom field.
1237
+ */
1238
+ name: string;
1239
+
1240
+ /**
1241
+ * The ID of the custom field (if being updated)
1242
+ */
1243
+ id?: string | null;
1244
+
1245
+ /**
1246
+ * The order of the field.
1247
+ */
1248
+ order?: number | null;
1249
+
1250
+ /**
1251
+ * The placeholder value of the field.
1252
+ */
1253
+ placeholder?: string | null;
1254
+
1255
+ /**
1256
+ * Whether or not the field is required.
1257
+ */
1258
+ required?: boolean | null;
1259
+ }
1260
+
1261
+ /**
1262
+ * The explicit payment method configuration for the plan. If not provided, the
1263
+ * platform or company's defaults will apply.
1264
+ */
1265
+ export interface PaymentMethodConfiguration {
1266
+ /**
1267
+ * An array of payment method identifiers that are explicitly disabled. Only
1268
+ * applies if the include_platform_defaults is true.
1269
+ */
1270
+ disabled: Array<PaymentsAPI.PaymentMethodTypes>;
1271
+
1272
+ /**
1273
+ * An array of payment method identifiers that are explicitly enabled. This means
1274
+ * these payment methods will be shown on checkout. Example use case is to only
1275
+ * enable a specific payment method like cashapp, or extending the platform
1276
+ * defaults with additional methods.
1277
+ */
1278
+ enabled: Array<PaymentsAPI.PaymentMethodTypes>;
1279
+
1280
+ /**
1281
+ * Whether Whop's platform default payment method enablement settings are included
1282
+ * in this configuration. The full list of default payment methods can be found in
1283
+ * the documentation at docs.whop.com/payments.
1284
+ */
1285
+ include_platform_defaults: boolean;
1286
+ }
1287
+ }
1288
+ }
1289
+
902
1290
  export interface InvoiceListParams extends CursorPageParams {
903
1291
  /**
904
1292
  * Returns the elements in the list that come before the specified cursor.
@@ -960,10 +1348,12 @@ export interface InvoiceListParams extends CursorPageParams {
960
1348
  export declare namespace Invoices {
961
1349
  export {
962
1350
  type TaxIdentifierType as TaxIdentifierType,
1351
+ type InvoiceDeleteResponse as InvoiceDeleteResponse,
963
1352
  type InvoiceMarkPaidResponse as InvoiceMarkPaidResponse,
964
1353
  type InvoiceMarkUncollectibleResponse as InvoiceMarkUncollectibleResponse,
965
1354
  type InvoiceVoidResponse as InvoiceVoidResponse,
966
1355
  type InvoiceCreateParams as InvoiceCreateParams,
1356
+ type InvoiceUpdateParams as InvoiceUpdateParams,
967
1357
  type InvoiceListParams as InvoiceListParams,
968
1358
  };
969
1359
  }