@polar-sh/sdk 0.45.1 → 0.46.0

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 (81) hide show
  1. package/dist/commonjs/lib/config.d.ts +3 -3
  2. package/dist/commonjs/lib/config.js +3 -3
  3. package/dist/commonjs/lib/config.js.map +1 -1
  4. package/dist/commonjs/models/components/checkout.d.ts +34 -1
  5. package/dist/commonjs/models/components/checkout.d.ts.map +1 -1
  6. package/dist/commonjs/models/components/checkout.js +41 -1
  7. package/dist/commonjs/models/components/checkout.js.map +1 -1
  8. package/dist/commonjs/models/components/checkoutconfirmstripe.d.ts +7 -0
  9. package/dist/commonjs/models/components/checkoutconfirmstripe.d.ts.map +1 -1
  10. package/dist/commonjs/models/components/checkoutconfirmstripe.js +2 -0
  11. package/dist/commonjs/models/components/checkoutconfirmstripe.js.map +1 -1
  12. package/dist/commonjs/models/components/checkoutcreate.d.ts +11 -1
  13. package/dist/commonjs/models/components/checkoutcreate.d.ts.map +1 -1
  14. package/dist/commonjs/models/components/checkoutcreate.js +4 -0
  15. package/dist/commonjs/models/components/checkoutcreate.js.map +1 -1
  16. package/dist/commonjs/models/components/checkoutpublic.d.ts +25 -1
  17. package/dist/commonjs/models/components/checkoutpublic.d.ts.map +1 -1
  18. package/dist/commonjs/models/components/checkoutpublic.js +21 -1
  19. package/dist/commonjs/models/components/checkoutpublic.js.map +1 -1
  20. package/dist/commonjs/models/components/checkoutpublicconfirmed.d.ts +25 -1
  21. package/dist/commonjs/models/components/checkoutpublicconfirmed.d.ts.map +1 -1
  22. package/dist/commonjs/models/components/checkoutpublicconfirmed.js +21 -1
  23. package/dist/commonjs/models/components/checkoutpublicconfirmed.js.map +1 -1
  24. package/dist/commonjs/models/components/checkoutupdate.d.ts +7 -0
  25. package/dist/commonjs/models/components/checkoutupdate.d.ts.map +1 -1
  26. package/dist/commonjs/models/components/checkoutupdate.js +2 -0
  27. package/dist/commonjs/models/components/checkoutupdate.js.map +1 -1
  28. package/dist/commonjs/models/components/checkoutupdatepublic.d.ts +7 -0
  29. package/dist/commonjs/models/components/checkoutupdatepublic.d.ts.map +1 -1
  30. package/dist/commonjs/models/components/checkoutupdatepublic.js +2 -0
  31. package/dist/commonjs/models/components/checkoutupdatepublic.js.map +1 -1
  32. package/dist/commonjs/models/components/organizationfeaturesettings.d.ts +5 -0
  33. package/dist/commonjs/models/components/organizationfeaturesettings.d.ts.map +1 -1
  34. package/dist/commonjs/models/components/organizationfeaturesettings.js +4 -0
  35. package/dist/commonjs/models/components/organizationfeaturesettings.js.map +1 -1
  36. package/dist/esm/lib/config.d.ts +3 -3
  37. package/dist/esm/lib/config.js +3 -3
  38. package/dist/esm/lib/config.js.map +1 -1
  39. package/dist/esm/models/components/checkout.d.ts +34 -1
  40. package/dist/esm/models/components/checkout.d.ts.map +1 -1
  41. package/dist/esm/models/components/checkout.js +38 -0
  42. package/dist/esm/models/components/checkout.js.map +1 -1
  43. package/dist/esm/models/components/checkoutconfirmstripe.d.ts +7 -0
  44. package/dist/esm/models/components/checkoutconfirmstripe.d.ts.map +1 -1
  45. package/dist/esm/models/components/checkoutconfirmstripe.js +2 -0
  46. package/dist/esm/models/components/checkoutconfirmstripe.js.map +1 -1
  47. package/dist/esm/models/components/checkoutcreate.d.ts +11 -1
  48. package/dist/esm/models/components/checkoutcreate.d.ts.map +1 -1
  49. package/dist/esm/models/components/checkoutcreate.js +4 -0
  50. package/dist/esm/models/components/checkoutcreate.js.map +1 -1
  51. package/dist/esm/models/components/checkoutpublic.d.ts +25 -1
  52. package/dist/esm/models/components/checkoutpublic.d.ts.map +1 -1
  53. package/dist/esm/models/components/checkoutpublic.js +19 -0
  54. package/dist/esm/models/components/checkoutpublic.js.map +1 -1
  55. package/dist/esm/models/components/checkoutpublicconfirmed.d.ts +25 -1
  56. package/dist/esm/models/components/checkoutpublicconfirmed.d.ts.map +1 -1
  57. package/dist/esm/models/components/checkoutpublicconfirmed.js +19 -0
  58. package/dist/esm/models/components/checkoutpublicconfirmed.js.map +1 -1
  59. package/dist/esm/models/components/checkoutupdate.d.ts +7 -0
  60. package/dist/esm/models/components/checkoutupdate.d.ts.map +1 -1
  61. package/dist/esm/models/components/checkoutupdate.js +2 -0
  62. package/dist/esm/models/components/checkoutupdate.js.map +1 -1
  63. package/dist/esm/models/components/checkoutupdatepublic.d.ts +7 -0
  64. package/dist/esm/models/components/checkoutupdatepublic.d.ts.map +1 -1
  65. package/dist/esm/models/components/checkoutupdatepublic.js +2 -0
  66. package/dist/esm/models/components/checkoutupdatepublic.js.map +1 -1
  67. package/dist/esm/models/components/organizationfeaturesettings.d.ts +5 -0
  68. package/dist/esm/models/components/organizationfeaturesettings.d.ts.map +1 -1
  69. package/dist/esm/models/components/organizationfeaturesettings.js +4 -0
  70. package/dist/esm/models/components/organizationfeaturesettings.js.map +1 -1
  71. package/jsr.json +1 -1
  72. package/package.json +1 -1
  73. package/src/lib/config.ts +3 -3
  74. package/src/models/components/checkout.ts +95 -1
  75. package/src/models/components/checkoutconfirmstripe.ts +9 -0
  76. package/src/models/components/checkoutcreate.ts +15 -1
  77. package/src/models/components/checkoutpublic.ts +57 -1
  78. package/src/models/components/checkoutpublicconfirmed.ts +58 -1
  79. package/src/models/components/checkoutupdate.ts +9 -0
  80. package/src/models/components/checkoutupdatepublic.ts +9 -0
  81. package/src/models/components/organizationfeaturesettings.ts +9 -0
@@ -92,6 +92,8 @@ import {
92
92
 
93
93
  export type CheckoutCustomFieldData = string | number | boolean | Date;
94
94
 
95
+ export type CheckoutProductPrice = LegacyRecurringProductPrice | ProductPrice;
96
+
95
97
  export type CheckoutPrices = LegacyRecurringProductPrice | ProductPrice;
96
98
 
97
99
  export type CheckoutDiscount =
@@ -155,9 +157,17 @@ export type Checkout = {
155
157
  */
156
158
  amount: number;
157
159
  /**
158
- * Number of seats for seat-based pricing.
160
+ * Predefined number of seats (works with seat-based pricing only)
159
161
  */
160
162
  seats?: number | null | undefined;
163
+ /**
164
+ * Minimum number of seats (works with seat-based pricing only)
165
+ */
166
+ minSeats?: number | null | undefined;
167
+ /**
168
+ * Maximum number of seats (works with seat-based pricing only)
169
+ */
170
+ maxSeats?: number | null | undefined;
161
171
  /**
162
172
  * Price per seat in cents for the current seat count, based on the applicable tier. Only relevant for seat-based pricing.
163
173
  */
@@ -206,6 +216,12 @@ export type Checkout = {
206
216
  * ID of the product to checkout.
207
217
  */
208
218
  productId: string | null;
219
+ /**
220
+ * ID of the product price to checkout.
221
+ *
222
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
223
+ */
224
+ productPriceId: string | null;
209
225
  /**
210
226
  * ID of the discount applied to the checkout.
211
227
  */
@@ -279,6 +295,12 @@ export type Checkout = {
279
295
  * Product selected to checkout.
280
296
  */
281
297
  product: CheckoutProduct | null;
298
+ /**
299
+ * Price of the selected product.
300
+ *
301
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
302
+ */
303
+ productPrice: LegacyRecurringProductPrice | ProductPrice | null;
282
304
  /**
283
305
  * Mapping of product IDs to their list of prices.
284
306
  */
@@ -341,6 +363,45 @@ export function checkoutCustomFieldDataFromJSON(
341
363
  );
342
364
  }
343
365
 
366
+ /** @internal */
367
+ export const CheckoutProductPrice$inboundSchema: z.ZodMiniType<
368
+ CheckoutProductPrice,
369
+ unknown
370
+ > = smartUnion([
371
+ LegacyRecurringProductPrice$inboundSchema,
372
+ ProductPrice$inboundSchema,
373
+ ]);
374
+ /** @internal */
375
+ export type CheckoutProductPrice$Outbound =
376
+ | LegacyRecurringProductPrice$Outbound
377
+ | ProductPrice$Outbound;
378
+
379
+ /** @internal */
380
+ export const CheckoutProductPrice$outboundSchema: z.ZodMiniType<
381
+ CheckoutProductPrice$Outbound,
382
+ CheckoutProductPrice
383
+ > = smartUnion([
384
+ LegacyRecurringProductPrice$outboundSchema,
385
+ ProductPrice$outboundSchema,
386
+ ]);
387
+
388
+ export function checkoutProductPriceToJSON(
389
+ checkoutProductPrice: CheckoutProductPrice,
390
+ ): string {
391
+ return JSON.stringify(
392
+ CheckoutProductPrice$outboundSchema.parse(checkoutProductPrice),
393
+ );
394
+ }
395
+ export function checkoutProductPriceFromJSON(
396
+ jsonString: string,
397
+ ): SafeParseResult<CheckoutProductPrice, SDKValidationError> {
398
+ return safeParse(
399
+ jsonString,
400
+ (x) => CheckoutProductPrice$inboundSchema.parse(JSON.parse(x)),
401
+ `Failed to parse 'CheckoutProductPrice' from JSON`,
402
+ );
403
+ }
404
+
344
405
  /** @internal */
345
406
  export const CheckoutPrices$inboundSchema: z.ZodMiniType<
346
407
  CheckoutPrices,
@@ -492,6 +553,8 @@ export const Checkout$inboundSchema: z.ZodMiniType<Checkout, unknown> = z.pipe(
492
553
  embed_origin: z.nullable(z.string()),
493
554
  amount: z.int(),
494
555
  seats: z.optional(z.nullable(z.int())),
556
+ min_seats: z.optional(z.nullable(z.int())),
557
+ max_seats: z.optional(z.nullable(z.int())),
495
558
  price_per_seat: z.optional(z.nullable(z.int())),
496
559
  discount_amount: z.int(),
497
560
  net_amount: z.int(),
@@ -506,6 +569,7 @@ export const Checkout$inboundSchema: z.ZodMiniType<Checkout, unknown> = z.pipe(
506
569
  ),
507
570
  organization_id: z.string(),
508
571
  product_id: z.nullable(z.string()),
572
+ product_price_id: z.nullable(z.string()),
509
573
  discount_id: z.nullable(z.string()),
510
574
  allow_discount_codes: z.boolean(),
511
575
  require_billing_address: z.boolean(),
@@ -531,6 +595,12 @@ export const Checkout$inboundSchema: z.ZodMiniType<Checkout, unknown> = z.pipe(
531
595
  external_customer_id: z.nullable(z.string()),
532
596
  products: z.array(CheckoutProduct$inboundSchema),
533
597
  product: z.nullable(CheckoutProduct$inboundSchema),
598
+ product_price: z.nullable(
599
+ smartUnion([
600
+ LegacyRecurringProductPrice$inboundSchema,
601
+ ProductPrice$inboundSchema,
602
+ ]),
603
+ ),
534
604
  prices: z.nullable(
535
605
  z.record(
536
606
  z.string(),
@@ -570,6 +640,8 @@ export const Checkout$inboundSchema: z.ZodMiniType<Checkout, unknown> = z.pipe(
570
640
  "success_url": "successUrl",
571
641
  "return_url": "returnUrl",
572
642
  "embed_origin": "embedOrigin",
643
+ "min_seats": "minSeats",
644
+ "max_seats": "maxSeats",
573
645
  "price_per_seat": "pricePerSeat",
574
646
  "discount_amount": "discountAmount",
575
647
  "net_amount": "netAmount",
@@ -581,6 +653,7 @@ export const Checkout$inboundSchema: z.ZodMiniType<Checkout, unknown> = z.pipe(
581
653
  "trial_end": "trialEnd",
582
654
  "organization_id": "organizationId",
583
655
  "product_id": "productId",
656
+ "product_price_id": "productPriceId",
584
657
  "discount_id": "discountId",
585
658
  "allow_discount_codes": "allowDiscountCodes",
586
659
  "require_billing_address": "requireBillingAddress",
@@ -602,6 +675,7 @@ export const Checkout$inboundSchema: z.ZodMiniType<Checkout, unknown> = z.pipe(
602
675
  "trial_interval": "trialInterval",
603
676
  "trial_interval_count": "trialIntervalCount",
604
677
  "external_customer_id": "externalCustomerId",
678
+ "product_price": "productPrice",
605
679
  "subscription_id": "subscriptionId",
606
680
  "attached_custom_fields": "attachedCustomFields",
607
681
  "customer_metadata": "customerMetadata",
@@ -626,6 +700,8 @@ export type Checkout$Outbound = {
626
700
  embed_origin: string | null;
627
701
  amount: number;
628
702
  seats?: number | null | undefined;
703
+ min_seats?: number | null | undefined;
704
+ max_seats?: number | null | undefined;
629
705
  price_per_seat?: number | null | undefined;
630
706
  discount_amount: number;
631
707
  net_amount: number;
@@ -638,6 +714,7 @@ export type Checkout$Outbound = {
638
714
  trial_end: string | null;
639
715
  organization_id: string;
640
716
  product_id: string | null;
717
+ product_price_id: string | null;
641
718
  discount_id: string | null;
642
719
  allow_discount_codes: boolean;
643
720
  require_billing_address: boolean;
@@ -663,6 +740,10 @@ export type Checkout$Outbound = {
663
740
  external_customer_id: string | null;
664
741
  products: Array<CheckoutProduct$Outbound>;
665
742
  product: CheckoutProduct$Outbound | null;
743
+ product_price:
744
+ | LegacyRecurringProductPrice$Outbound
745
+ | ProductPrice$Outbound
746
+ | null;
666
747
  prices: {
667
748
  [k: string]: Array<
668
749
  LegacyRecurringProductPrice$Outbound | ProductPrice$Outbound
@@ -711,6 +792,8 @@ export const Checkout$outboundSchema: z.ZodMiniType<
711
792
  embedOrigin: z.nullable(z.string()),
712
793
  amount: z.int(),
713
794
  seats: z.optional(z.nullable(z.int())),
795
+ minSeats: z.optional(z.nullable(z.int())),
796
+ maxSeats: z.optional(z.nullable(z.int())),
714
797
  pricePerSeat: z.optional(z.nullable(z.int())),
715
798
  discountAmount: z.int(),
716
799
  netAmount: z.int(),
@@ -723,6 +806,7 @@ export const Checkout$outboundSchema: z.ZodMiniType<
723
806
  trialEnd: z.nullable(z.pipe(z.date(), z.transform(v => v.toISOString()))),
724
807
  organizationId: z.string(),
725
808
  productId: z.nullable(z.string()),
809
+ productPriceId: z.nullable(z.string()),
726
810
  discountId: z.nullable(z.string()),
727
811
  allowDiscountCodes: z.boolean(),
728
812
  requireBillingAddress: z.boolean(),
@@ -748,6 +832,12 @@ export const Checkout$outboundSchema: z.ZodMiniType<
748
832
  externalCustomerId: z.nullable(z.string()),
749
833
  products: z.array(CheckoutProduct$outboundSchema),
750
834
  product: z.nullable(CheckoutProduct$outboundSchema),
835
+ productPrice: z.nullable(
836
+ smartUnion([
837
+ LegacyRecurringProductPrice$outboundSchema,
838
+ ProductPrice$outboundSchema,
839
+ ]),
840
+ ),
751
841
  prices: z.nullable(
752
842
  z.record(
753
843
  z.string(),
@@ -787,6 +877,8 @@ export const Checkout$outboundSchema: z.ZodMiniType<
787
877
  successUrl: "success_url",
788
878
  returnUrl: "return_url",
789
879
  embedOrigin: "embed_origin",
880
+ minSeats: "min_seats",
881
+ maxSeats: "max_seats",
790
882
  pricePerSeat: "price_per_seat",
791
883
  discountAmount: "discount_amount",
792
884
  netAmount: "net_amount",
@@ -798,6 +890,7 @@ export const Checkout$outboundSchema: z.ZodMiniType<
798
890
  trialEnd: "trial_end",
799
891
  organizationId: "organization_id",
800
892
  productId: "product_id",
893
+ productPriceId: "product_price_id",
801
894
  discountId: "discount_id",
802
895
  allowDiscountCodes: "allow_discount_codes",
803
896
  requireBillingAddress: "require_billing_address",
@@ -819,6 +912,7 @@ export const Checkout$outboundSchema: z.ZodMiniType<
819
912
  trialInterval: "trial_interval",
820
913
  trialIntervalCount: "trial_interval_count",
821
914
  externalCustomerId: "external_customer_id",
915
+ productPrice: "product_price",
822
916
  subscriptionId: "subscription_id",
823
917
  attachedCustomFields: "attached_custom_fields",
824
918
  customerMetadata: "customer_metadata",
@@ -31,6 +31,12 @@ export type CheckoutConfirmStripe = {
31
31
  * ID of the product to checkout. Must be present in the checkout's product list.
32
32
  */
33
33
  productId?: string | null | undefined;
34
+ /**
35
+ * ID of the product price to checkout. Must correspond to a price present in the checkout's product list.
36
+ *
37
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
38
+ */
39
+ productPriceId?: string | null | undefined;
34
40
  amount?: number | null | undefined;
35
41
  /**
36
42
  * Number of seats for seat-based pricing.
@@ -91,6 +97,7 @@ export type CheckoutConfirmStripe$Outbound = {
91
97
  | { [k: string]: string | number | boolean | string | null }
92
98
  | undefined;
93
99
  product_id?: string | null | undefined;
100
+ product_price_id?: string | null | undefined;
94
101
  amount?: number | null | undefined;
95
102
  seats?: number | null | undefined;
96
103
  is_business_customer?: boolean | null | undefined;
@@ -125,6 +132,7 @@ export const CheckoutConfirmStripe$outboundSchema: z.ZodMiniType<
125
132
  ),
126
133
  ),
127
134
  productId: z.optional(z.nullable(z.string())),
135
+ productPriceId: z.optional(z.nullable(z.string())),
128
136
  amount: z.optional(z.nullable(z.int())),
129
137
  seats: z.optional(z.nullable(z.int())),
130
138
  isBusinessCustomer: z.optional(z.nullable(z.boolean())),
@@ -142,6 +150,7 @@ export const CheckoutConfirmStripe$outboundSchema: z.ZodMiniType<
142
150
  return remap$(v, {
143
151
  customFieldData: "custom_field_data",
144
152
  productId: "product_id",
153
+ productPriceId: "product_price_id",
145
154
  isBusinessCustomer: "is_business_customer",
146
155
  customerName: "customer_name",
147
156
  customerEmail: "customer_email",
@@ -111,9 +111,17 @@ export type CheckoutCreate = {
111
111
  requireBillingAddress?: boolean | undefined;
112
112
  amount?: number | null | undefined;
113
113
  /**
114
- * Number of seats for seat-based pricing. Required for seat-based products.
114
+ * Predefined number of seats (works with seat-based pricing only)
115
115
  */
116
116
  seats?: number | null | undefined;
117
+ /**
118
+ * Minimum number of seats (works with seat-based pricing only)
119
+ */
120
+ minSeats?: number | null | undefined;
121
+ /**
122
+ * Maximum number of seats (works with seat-based pricing only)
123
+ */
124
+ maxSeats?: number | null | undefined;
117
125
  /**
118
126
  * Whether to enable the trial period for the checkout session. If `false`, the trial period will be disabled, even if the selected product has a trial configured.
119
127
  */
@@ -306,6 +314,8 @@ export type CheckoutCreate$Outbound = {
306
314
  require_billing_address: boolean;
307
315
  amount?: number | null | undefined;
308
316
  seats?: number | null | undefined;
317
+ min_seats?: number | null | undefined;
318
+ max_seats?: number | null | undefined;
309
319
  allow_trial: boolean;
310
320
  customer_id?: string | null | undefined;
311
321
  is_business_customer: boolean;
@@ -372,6 +382,8 @@ export const CheckoutCreate$outboundSchema: z.ZodMiniType<
372
382
  requireBillingAddress: z._default(z.boolean(), false),
373
383
  amount: z.optional(z.nullable(z.int())),
374
384
  seats: z.optional(z.nullable(z.int())),
385
+ minSeats: z.optional(z.nullable(z.int())),
386
+ maxSeats: z.optional(z.nullable(z.int())),
375
387
  allowTrial: z._default(z.boolean(), true),
376
388
  customerId: z.optional(z.nullable(z.string())),
377
389
  isBusinessCustomer: z._default(z.boolean(), false),
@@ -420,6 +432,8 @@ export const CheckoutCreate$outboundSchema: z.ZodMiniType<
420
432
  discountId: "discount_id",
421
433
  allowDiscountCodes: "allow_discount_codes",
422
434
  requireBillingAddress: "require_billing_address",
435
+ minSeats: "min_seats",
436
+ maxSeats: "max_seats",
423
437
  allowTrial: "allow_trial",
424
438
  customerId: "customer_id",
425
439
  isBusinessCustomer: "is_business_customer",
@@ -58,6 +58,10 @@ import { TrialInterval, TrialInterval$inboundSchema } from "./trialinterval.js";
58
58
 
59
59
  export type CheckoutPublicCustomFieldData = string | number | boolean | Date;
60
60
 
61
+ export type CheckoutPublicProductPrice =
62
+ | LegacyRecurringProductPrice
63
+ | ProductPrice;
64
+
61
65
  export type CheckoutPublicPrices = LegacyRecurringProductPrice | ProductPrice;
62
66
 
63
67
  export type CheckoutPublicDiscount =
@@ -119,9 +123,17 @@ export type CheckoutPublic = {
119
123
  */
120
124
  amount: number;
121
125
  /**
122
- * Number of seats for seat-based pricing.
126
+ * Predefined number of seats (works with seat-based pricing only)
123
127
  */
124
128
  seats?: number | null | undefined;
129
+ /**
130
+ * Minimum number of seats (works with seat-based pricing only)
131
+ */
132
+ minSeats?: number | null | undefined;
133
+ /**
134
+ * Maximum number of seats (works with seat-based pricing only)
135
+ */
136
+ maxSeats?: number | null | undefined;
125
137
  /**
126
138
  * Price per seat in cents for the current seat count, based on the applicable tier. Only relevant for seat-based pricing.
127
139
  */
@@ -170,6 +182,12 @@ export type CheckoutPublic = {
170
182
  * ID of the product to checkout.
171
183
  */
172
184
  productId: string | null;
185
+ /**
186
+ * ID of the product price to checkout.
187
+ *
188
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
189
+ */
190
+ productPriceId: string | null;
173
191
  /**
174
192
  * ID of the discount applied to the checkout.
175
193
  */
@@ -230,6 +248,12 @@ export type CheckoutPublic = {
230
248
  * Product selected to checkout.
231
249
  */
232
250
  product: CheckoutProduct | null;
251
+ /**
252
+ * Price of the selected product.
253
+ *
254
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
255
+ */
256
+ productPrice: LegacyRecurringProductPrice | ProductPrice | null;
233
257
  /**
234
258
  * Mapping of product IDs to their list of prices.
235
259
  */
@@ -267,6 +291,25 @@ export function checkoutPublicCustomFieldDataFromJSON(
267
291
  );
268
292
  }
269
293
 
294
+ /** @internal */
295
+ export const CheckoutPublicProductPrice$inboundSchema: z.ZodMiniType<
296
+ CheckoutPublicProductPrice,
297
+ unknown
298
+ > = smartUnion([
299
+ LegacyRecurringProductPrice$inboundSchema,
300
+ ProductPrice$inboundSchema,
301
+ ]);
302
+
303
+ export function checkoutPublicProductPriceFromJSON(
304
+ jsonString: string,
305
+ ): SafeParseResult<CheckoutPublicProductPrice, SDKValidationError> {
306
+ return safeParse(
307
+ jsonString,
308
+ (x) => CheckoutPublicProductPrice$inboundSchema.parse(JSON.parse(x)),
309
+ `Failed to parse 'CheckoutPublicProductPrice' from JSON`,
310
+ );
311
+ }
312
+
270
313
  /** @internal */
271
314
  export const CheckoutPublicPrices$inboundSchema: z.ZodMiniType<
272
315
  CheckoutPublicPrices,
@@ -350,6 +393,8 @@ export const CheckoutPublic$inboundSchema: z.ZodMiniType<
350
393
  embed_origin: z.nullable(z.string()),
351
394
  amount: z.int(),
352
395
  seats: z.optional(z.nullable(z.int())),
396
+ min_seats: z.optional(z.nullable(z.int())),
397
+ max_seats: z.optional(z.nullable(z.int())),
353
398
  price_per_seat: z.optional(z.nullable(z.int())),
354
399
  discount_amount: z.int(),
355
400
  net_amount: z.int(),
@@ -364,6 +409,7 @@ export const CheckoutPublic$inboundSchema: z.ZodMiniType<
364
409
  ),
365
410
  organization_id: z.string(),
366
411
  product_id: z.nullable(z.string()),
412
+ product_price_id: z.nullable(z.string()),
367
413
  discount_id: z.nullable(z.string()),
368
414
  allow_discount_codes: z.boolean(),
369
415
  require_billing_address: z.boolean(),
@@ -385,6 +431,12 @@ export const CheckoutPublic$inboundSchema: z.ZodMiniType<
385
431
  billing_address_fields: CheckoutBillingAddressFields$inboundSchema,
386
432
  products: z.array(CheckoutProduct$inboundSchema),
387
433
  product: z.nullable(CheckoutProduct$inboundSchema),
434
+ product_price: z.nullable(
435
+ smartUnion([
436
+ LegacyRecurringProductPrice$inboundSchema,
437
+ ProductPrice$inboundSchema,
438
+ ]),
439
+ ),
388
440
  prices: z.nullable(
389
441
  z.record(
390
442
  z.string(),
@@ -420,6 +472,8 @@ export const CheckoutPublic$inboundSchema: z.ZodMiniType<
420
472
  "success_url": "successUrl",
421
473
  "return_url": "returnUrl",
422
474
  "embed_origin": "embedOrigin",
475
+ "min_seats": "minSeats",
476
+ "max_seats": "maxSeats",
423
477
  "price_per_seat": "pricePerSeat",
424
478
  "discount_amount": "discountAmount",
425
479
  "net_amount": "netAmount",
@@ -431,6 +485,7 @@ export const CheckoutPublic$inboundSchema: z.ZodMiniType<
431
485
  "trial_end": "trialEnd",
432
486
  "organization_id": "organizationId",
433
487
  "product_id": "productId",
488
+ "product_price_id": "productPriceId",
434
489
  "discount_id": "discountId",
435
490
  "allow_discount_codes": "allowDiscountCodes",
436
491
  "require_billing_address": "requireBillingAddress",
@@ -449,6 +504,7 @@ export const CheckoutPublic$inboundSchema: z.ZodMiniType<
449
504
  "customer_tax_id": "customerTaxId",
450
505
  "payment_processor_metadata": "paymentProcessorMetadata",
451
506
  "billing_address_fields": "billingAddressFields",
507
+ "product_price": "productPrice",
452
508
  "attached_custom_fields": "attachedCustomFields",
453
509
  });
454
510
  }),
@@ -58,6 +58,10 @@ export type CheckoutPublicConfirmedCustomFieldData =
58
58
  | boolean
59
59
  | Date;
60
60
 
61
+ export type CheckoutPublicConfirmedProductPrice =
62
+ | LegacyRecurringProductPrice
63
+ | ProductPrice;
64
+
61
65
  export type CheckoutPublicConfirmedPrices =
62
66
  | LegacyRecurringProductPrice
63
67
  | ProductPrice;
@@ -126,9 +130,17 @@ export type CheckoutPublicConfirmed = {
126
130
  */
127
131
  amount: number;
128
132
  /**
129
- * Number of seats for seat-based pricing.
133
+ * Predefined number of seats (works with seat-based pricing only)
130
134
  */
131
135
  seats?: number | null | undefined;
136
+ /**
137
+ * Minimum number of seats (works with seat-based pricing only)
138
+ */
139
+ minSeats?: number | null | undefined;
140
+ /**
141
+ * Maximum number of seats (works with seat-based pricing only)
142
+ */
143
+ maxSeats?: number | null | undefined;
132
144
  /**
133
145
  * Price per seat in cents for the current seat count, based on the applicable tier. Only relevant for seat-based pricing.
134
146
  */
@@ -177,6 +189,12 @@ export type CheckoutPublicConfirmed = {
177
189
  * ID of the product to checkout.
178
190
  */
179
191
  productId: string | null;
192
+ /**
193
+ * ID of the product price to checkout.
194
+ *
195
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
196
+ */
197
+ productPriceId: string | null;
180
198
  /**
181
199
  * ID of the discount applied to the checkout.
182
200
  */
@@ -237,6 +255,12 @@ export type CheckoutPublicConfirmed = {
237
255
  * Product selected to checkout.
238
256
  */
239
257
  product: CheckoutProduct | null;
258
+ /**
259
+ * Price of the selected product.
260
+ *
261
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
262
+ */
263
+ productPrice: LegacyRecurringProductPrice | ProductPrice | null;
240
264
  /**
241
265
  * Mapping of product IDs to their list of prices.
242
266
  */
@@ -274,6 +298,26 @@ export function checkoutPublicConfirmedCustomFieldDataFromJSON(
274
298
  );
275
299
  }
276
300
 
301
+ /** @internal */
302
+ export const CheckoutPublicConfirmedProductPrice$inboundSchema: z.ZodMiniType<
303
+ CheckoutPublicConfirmedProductPrice,
304
+ unknown
305
+ > = smartUnion([
306
+ LegacyRecurringProductPrice$inboundSchema,
307
+ ProductPrice$inboundSchema,
308
+ ]);
309
+
310
+ export function checkoutPublicConfirmedProductPriceFromJSON(
311
+ jsonString: string,
312
+ ): SafeParseResult<CheckoutPublicConfirmedProductPrice, SDKValidationError> {
313
+ return safeParse(
314
+ jsonString,
315
+ (x) =>
316
+ CheckoutPublicConfirmedProductPrice$inboundSchema.parse(JSON.parse(x)),
317
+ `Failed to parse 'CheckoutPublicConfirmedProductPrice' from JSON`,
318
+ );
319
+ }
320
+
277
321
  /** @internal */
278
322
  export const CheckoutPublicConfirmedPrices$inboundSchema: z.ZodMiniType<
279
323
  CheckoutPublicConfirmedPrices,
@@ -357,6 +401,8 @@ export const CheckoutPublicConfirmed$inboundSchema: z.ZodMiniType<
357
401
  embed_origin: z.nullable(z.string()),
358
402
  amount: z.int(),
359
403
  seats: z.optional(z.nullable(z.int())),
404
+ min_seats: z.optional(z.nullable(z.int())),
405
+ max_seats: z.optional(z.nullable(z.int())),
360
406
  price_per_seat: z.optional(z.nullable(z.int())),
361
407
  discount_amount: z.int(),
362
408
  net_amount: z.int(),
@@ -371,6 +417,7 @@ export const CheckoutPublicConfirmed$inboundSchema: z.ZodMiniType<
371
417
  ),
372
418
  organization_id: z.string(),
373
419
  product_id: z.nullable(z.string()),
420
+ product_price_id: z.nullable(z.string()),
374
421
  discount_id: z.nullable(z.string()),
375
422
  allow_discount_codes: z.boolean(),
376
423
  require_billing_address: z.boolean(),
@@ -392,6 +439,12 @@ export const CheckoutPublicConfirmed$inboundSchema: z.ZodMiniType<
392
439
  billing_address_fields: CheckoutBillingAddressFields$inboundSchema,
393
440
  products: z.array(CheckoutProduct$inboundSchema),
394
441
  product: z.nullable(CheckoutProduct$inboundSchema),
442
+ product_price: z.nullable(
443
+ smartUnion([
444
+ LegacyRecurringProductPrice$inboundSchema,
445
+ ProductPrice$inboundSchema,
446
+ ]),
447
+ ),
395
448
  prices: z.nullable(
396
449
  z.record(
397
450
  z.string(),
@@ -428,6 +481,8 @@ export const CheckoutPublicConfirmed$inboundSchema: z.ZodMiniType<
428
481
  "success_url": "successUrl",
429
482
  "return_url": "returnUrl",
430
483
  "embed_origin": "embedOrigin",
484
+ "min_seats": "minSeats",
485
+ "max_seats": "maxSeats",
431
486
  "price_per_seat": "pricePerSeat",
432
487
  "discount_amount": "discountAmount",
433
488
  "net_amount": "netAmount",
@@ -439,6 +494,7 @@ export const CheckoutPublicConfirmed$inboundSchema: z.ZodMiniType<
439
494
  "trial_end": "trialEnd",
440
495
  "organization_id": "organizationId",
441
496
  "product_id": "productId",
497
+ "product_price_id": "productPriceId",
442
498
  "discount_id": "discountId",
443
499
  "allow_discount_codes": "allowDiscountCodes",
444
500
  "require_billing_address": "requireBillingAddress",
@@ -457,6 +513,7 @@ export const CheckoutPublicConfirmed$inboundSchema: z.ZodMiniType<
457
513
  "customer_tax_id": "customerTaxId",
458
514
  "payment_processor_metadata": "paymentProcessorMetadata",
459
515
  "billing_address_fields": "billingAddressFields",
516
+ "product_price": "productPrice",
460
517
  "attached_custom_fields": "attachedCustomFields",
461
518
  "customer_session_token": "customerSessionToken",
462
519
  });
@@ -39,6 +39,12 @@ export type CheckoutUpdate = {
39
39
  * ID of the product to checkout. Must be present in the checkout's product list.
40
40
  */
41
41
  productId?: string | null | undefined;
42
+ /**
43
+ * ID of the product price to checkout. Must correspond to a price present in the checkout's product list.
44
+ *
45
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
46
+ */
47
+ productPriceId?: string | null | undefined;
42
48
  amount?: number | null | undefined;
43
49
  /**
44
50
  * Number of seats for seat-based pricing.
@@ -204,6 +210,7 @@ export type CheckoutUpdate$Outbound = {
204
210
  | { [k: string]: string | number | boolean | string | null }
205
211
  | undefined;
206
212
  product_id?: string | null | undefined;
213
+ product_price_id?: string | null | undefined;
207
214
  amount?: number | null | undefined;
208
215
  seats?: number | null | undefined;
209
216
  is_business_customer?: boolean | null | undefined;
@@ -251,6 +258,7 @@ export const CheckoutUpdate$outboundSchema: z.ZodMiniType<
251
258
  ),
252
259
  ),
253
260
  productId: z.optional(z.nullable(z.string())),
261
+ productPriceId: z.optional(z.nullable(z.string())),
254
262
  amount: z.optional(z.nullable(z.int())),
255
263
  seats: z.optional(z.nullable(z.int())),
256
264
  isBusinessCustomer: z.optional(z.nullable(z.boolean())),
@@ -290,6 +298,7 @@ export const CheckoutUpdate$outboundSchema: z.ZodMiniType<
290
298
  return remap$(v, {
291
299
  customFieldData: "custom_field_data",
292
300
  productId: "product_id",
301
+ productPriceId: "product_price_id",
293
302
  isBusinessCustomer: "is_business_customer",
294
303
  customerName: "customer_name",
295
304
  customerEmail: "customer_email",
@@ -31,6 +31,12 @@ export type CheckoutUpdatePublic = {
31
31
  * ID of the product to checkout. Must be present in the checkout's product list.
32
32
  */
33
33
  productId?: string | null | undefined;
34
+ /**
35
+ * ID of the product price to checkout. Must correspond to a price present in the checkout's product list.
36
+ *
37
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
38
+ */
39
+ productPriceId?: string | null | undefined;
34
40
  amount?: number | null | undefined;
35
41
  /**
36
42
  * Number of seats for seat-based pricing.
@@ -87,6 +93,7 @@ export type CheckoutUpdatePublic$Outbound = {
87
93
  | { [k: string]: string | number | boolean | string | null }
88
94
  | undefined;
89
95
  product_id?: string | null | undefined;
96
+ product_price_id?: string | null | undefined;
90
97
  amount?: number | null | undefined;
91
98
  seats?: number | null | undefined;
92
99
  is_business_customer?: boolean | null | undefined;
@@ -120,6 +127,7 @@ export const CheckoutUpdatePublic$outboundSchema: z.ZodMiniType<
120
127
  ),
121
128
  ),
122
129
  productId: z.optional(z.nullable(z.string())),
130
+ productPriceId: z.optional(z.nullable(z.string())),
123
131
  amount: z.optional(z.nullable(z.int())),
124
132
  seats: z.optional(z.nullable(z.int())),
125
133
  isBusinessCustomer: z.optional(z.nullable(z.boolean())),
@@ -136,6 +144,7 @@ export const CheckoutUpdatePublic$outboundSchema: z.ZodMiniType<
136
144
  return remap$(v, {
137
145
  customFieldData: "custom_field_data",
138
146
  productId: "product_id",
147
+ productPriceId: "product_price_id",
139
148
  isBusinessCustomer: "is_business_customer",
140
149
  customerName: "customer_name",
141
150
  customerEmail: "customer_email",