chargebee 3.35.0 → 3.36.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 (152) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/cjs/environment.js +1 -1
  3. package/cjs/resources/api_endpoints.js +56 -0
  4. package/cjs/resources/webhook/eventType.js +2 -0
  5. package/cjs/schema/addon.schema.js +221 -40
  6. package/cjs/schema/alert.schema.js +17 -2
  7. package/cjs/schema/alert_status.schema.js +6 -1
  8. package/cjs/schema/attached_item.schema.js +101 -26
  9. package/cjs/schema/business_entity.schema.js +16 -5
  10. package/cjs/schema/business_rule.schema.js +2 -2
  11. package/cjs/schema/business_ruleset.schema.js +2 -2
  12. package/cjs/schema/comment.schema.js +15 -4
  13. package/cjs/schema/coupon.schema.js +218 -37
  14. package/cjs/schema/coupon_code.schema.js +36 -6
  15. package/cjs/schema/coupon_set.schema.js +108 -27
  16. package/cjs/schema/credit_note.schema.js +496 -105
  17. package/cjs/schema/credit_unit.schema.js +12 -2
  18. package/cjs/schema/customer.schema.js +212 -62
  19. package/cjs/schema/differential_price.schema.js +100 -12
  20. package/cjs/schema/dispute.schema.js +125 -33
  21. package/cjs/schema/einvoice.schema.js +27 -6
  22. package/cjs/schema/email_log.schema.js +15 -4
  23. package/cjs/schema/entitlement.schema.js +33 -4
  24. package/cjs/schema/entitlement_override.schema.js +17 -1
  25. package/cjs/schema/estimate.schema.js +581 -36
  26. package/cjs/schema/event.schema.js +1282 -633
  27. package/cjs/schema/export.schema.js +4459 -1412
  28. package/cjs/schema/feature.schema.js +73 -11
  29. package/cjs/schema/gateway_request_log.schema.js +309 -0
  30. package/cjs/schema/gateway_webhook_log.schema.js +257 -0
  31. package/cjs/schema/gift.schema.js +51 -5
  32. package/cjs/schema/grant_block.schema.js +45 -12
  33. package/cjs/schema/hosted_page.schema.js +562 -66
  34. package/cjs/schema/index.js +3 -0
  35. package/cjs/schema/invoice.schema.js +821 -121
  36. package/cjs/schema/item.schema.js +151 -28
  37. package/cjs/schema/item_entitlement.schema.js +23 -2
  38. package/cjs/schema/item_family.schema.js +29 -8
  39. package/cjs/schema/item_price.schema.js +263 -48
  40. package/cjs/schema/ledger_operation.schema.js +42 -15
  41. package/cjs/schema/metered_feature.schema.js +10 -1
  42. package/cjs/schema/omnichannel_one_time_order.schema.js +32 -2
  43. package/cjs/schema/omnichannel_subscription.schema.js +136 -30
  44. package/cjs/schema/order.schema.js +233 -61
  45. package/cjs/schema/organization_detail.schema.js +36 -0
  46. package/cjs/schema/payment_schedule.schema.js +39 -8
  47. package/cjs/schema/payment_schedule_scheme.schema.js +37 -7
  48. package/cjs/schema/payment_source.schema.js +360 -148
  49. package/cjs/schema/payment_voucher.schema.js +33 -5
  50. package/cjs/schema/plan.schema.js +345 -57
  51. package/cjs/schema/price_ramp.schema.js +79 -14
  52. package/cjs/schema/price_variant.schema.js +88 -18
  53. package/cjs/schema/pricing_page_session.schema.js +36 -2
  54. package/cjs/schema/promotional_credit.schema.js +27 -6
  55. package/cjs/schema/purchase.schema.js +204 -12
  56. package/cjs/schema/quote.schema.js +901 -81
  57. package/cjs/schema/quote_entitlement.schema.js +6 -2
  58. package/cjs/schema/ramp.schema.js +238 -24
  59. package/cjs/schema/site_migration_detail.schema.js +50 -16
  60. package/cjs/schema/subscription.schema.js +998 -169
  61. package/cjs/schema/subscription_entitlement.schema.js +9 -1
  62. package/cjs/schema/transaction.schema.js +780 -342
  63. package/cjs/schema/unbilled_charge.schema.js +141 -13
  64. package/cjs/schema/usage.schema.js +55 -12
  65. package/cjs/schema/usage_event.schema.js +13 -1
  66. package/cjs/schema/virtual_bank_account.schema.js +42 -10
  67. package/cjs/schema/webhook_endpoint.schema.js +4 -0
  68. package/esm/environment.js +1 -1
  69. package/esm/resources/api_endpoints.js +56 -0
  70. package/esm/resources/webhook/eventType.js +2 -0
  71. package/esm/schema/addon.schema.js +221 -40
  72. package/esm/schema/alert.schema.js +17 -2
  73. package/esm/schema/alert_status.schema.js +6 -1
  74. package/esm/schema/attached_item.schema.js +101 -26
  75. package/esm/schema/business_entity.schema.js +16 -5
  76. package/esm/schema/business_rule.schema.js +2 -2
  77. package/esm/schema/business_ruleset.schema.js +2 -2
  78. package/esm/schema/comment.schema.js +15 -4
  79. package/esm/schema/coupon.schema.js +218 -37
  80. package/esm/schema/coupon_code.schema.js +36 -6
  81. package/esm/schema/coupon_set.schema.js +108 -27
  82. package/esm/schema/credit_note.schema.js +496 -105
  83. package/esm/schema/credit_unit.schema.js +12 -2
  84. package/esm/schema/customer.schema.js +212 -62
  85. package/esm/schema/differential_price.schema.js +100 -12
  86. package/esm/schema/dispute.schema.js +125 -33
  87. package/esm/schema/einvoice.schema.js +27 -6
  88. package/esm/schema/email_log.schema.js +15 -4
  89. package/esm/schema/entitlement.schema.js +33 -4
  90. package/esm/schema/entitlement_override.schema.js +17 -1
  91. package/esm/schema/estimate.schema.js +581 -36
  92. package/esm/schema/event.schema.js +1282 -633
  93. package/esm/schema/export.schema.js +4459 -1412
  94. package/esm/schema/feature.schema.js +73 -11
  95. package/esm/schema/gateway_request_log.schema.js +306 -0
  96. package/esm/schema/gateway_webhook_log.schema.js +254 -0
  97. package/esm/schema/gift.schema.js +51 -5
  98. package/esm/schema/grant_block.schema.js +45 -12
  99. package/esm/schema/hosted_page.schema.js +562 -66
  100. package/esm/schema/index.js +3 -0
  101. package/esm/schema/invoice.schema.js +821 -121
  102. package/esm/schema/item.schema.js +151 -28
  103. package/esm/schema/item_entitlement.schema.js +23 -2
  104. package/esm/schema/item_family.schema.js +29 -8
  105. package/esm/schema/item_price.schema.js +263 -48
  106. package/esm/schema/ledger_operation.schema.js +42 -15
  107. package/esm/schema/metered_feature.schema.js +10 -1
  108. package/esm/schema/omnichannel_one_time_order.schema.js +32 -2
  109. package/esm/schema/omnichannel_subscription.schema.js +136 -30
  110. package/esm/schema/order.schema.js +233 -61
  111. package/esm/schema/organization_detail.schema.js +33 -0
  112. package/esm/schema/payment_schedule.schema.js +39 -8
  113. package/esm/schema/payment_schedule_scheme.schema.js +37 -7
  114. package/esm/schema/payment_source.schema.js +360 -148
  115. package/esm/schema/payment_voucher.schema.js +33 -5
  116. package/esm/schema/plan.schema.js +345 -57
  117. package/esm/schema/price_ramp.schema.js +79 -14
  118. package/esm/schema/price_variant.schema.js +88 -18
  119. package/esm/schema/pricing_page_session.schema.js +36 -2
  120. package/esm/schema/promotional_credit.schema.js +27 -6
  121. package/esm/schema/purchase.schema.js +204 -12
  122. package/esm/schema/quote.schema.js +901 -81
  123. package/esm/schema/quote_entitlement.schema.js +6 -2
  124. package/esm/schema/ramp.schema.js +238 -24
  125. package/esm/schema/site_migration_detail.schema.js +50 -16
  126. package/esm/schema/subscription.schema.js +998 -169
  127. package/esm/schema/subscription_entitlement.schema.js +9 -1
  128. package/esm/schema/transaction.schema.js +780 -342
  129. package/esm/schema/unbilled_charge.schema.js +141 -13
  130. package/esm/schema/usage.schema.js +55 -12
  131. package/esm/schema/usage_event.schema.js +13 -1
  132. package/esm/schema/virtual_bank_account.schema.js +42 -10
  133. package/esm/schema/webhook_endpoint.schema.js +4 -0
  134. package/package.json +1 -1
  135. package/types/core.d.ts +10 -6
  136. package/types/index.d.ts +8 -1
  137. package/types/resources/BillingLineItem.d.ts +10 -0
  138. package/types/resources/BillingMetadata.d.ts +9 -0
  139. package/types/resources/Content.d.ts +5 -0
  140. package/types/resources/Discount.d.ts +1 -0
  141. package/types/resources/DraftRequest.d.ts +1 -1
  142. package/types/resources/Estimate.d.ts +3 -0
  143. package/types/resources/Event.d.ts +2 -0
  144. package/types/resources/GatewayRequestLog.d.ts +82 -0
  145. package/types/resources/GatewayWebhookLog.d.ts +74 -0
  146. package/types/resources/GrantBlock.d.ts +5 -0
  147. package/types/resources/HostedPage.d.ts +18 -0
  148. package/types/resources/Invoice.d.ts +4 -0
  149. package/types/resources/OrganizationDetail.d.ts +84 -0
  150. package/types/resources/Subscription.d.ts +3 -0
  151. package/types/resources/Usage.d.ts +1 -0
  152. package/types/resources/WebhookEvent.d.ts +10 -0
@@ -161,6 +161,14 @@ const CheckoutNewHostedPageContractTermSchema = z.object({
161
161
  action_at_term_end: z.enum(['renew', 'evergreen', 'cancel']).optional(),
162
162
  cancellation_cutoff_period: z.number().int().optional(),
163
163
  });
164
+ const CheckoutNewHostedPageAddonsItemSchema = z.object({
165
+ id: z.string().max(100).optional(),
166
+ quantity: z.number().int().min(1).optional(),
167
+ quantity_in_decimal: z.string().max(33).optional(),
168
+ unit_price: z.number().int().min(0).optional(),
169
+ unit_price_in_decimal: z.string().max(39).optional(),
170
+ billing_cycles: z.number().int().min(0).optional(),
171
+ });
164
172
  const CheckoutNewHostedPageAddonsSchema = z.object({
165
173
  id: z.array(z.string().max(100).optional()).optional(),
166
174
  quantity: z.array(z.number().int().min(1).optional()).optional(),
@@ -169,6 +177,25 @@ const CheckoutNewHostedPageAddonsSchema = z.object({
169
177
  unit_price_in_decimal: z.array(z.string().max(39).optional()).optional(),
170
178
  billing_cycles: z.array(z.number().int().min(0).optional()).optional(),
171
179
  });
180
+ const CheckoutNewHostedPageEventBasedAddonsItemSchema = z.object({
181
+ id: z.string().max(100).optional(),
182
+ quantity: z.number().int().min(1).optional(),
183
+ unit_price: z.number().int().min(0).optional(),
184
+ quantity_in_decimal: z.string().max(33).optional(),
185
+ unit_price_in_decimal: z.string().max(39).optional(),
186
+ service_period_in_days: z.number().int().min(1).max(4000).optional(),
187
+ on_event: z
188
+ .enum([
189
+ 'subscription_creation',
190
+ 'subscription_trial_start',
191
+ 'plan_activation',
192
+ 'subscription_activation',
193
+ 'contract_termination',
194
+ ])
195
+ .optional(),
196
+ charge_once: z.boolean().default(true).optional(),
197
+ charge_on: z.enum(['immediately', 'on_event']).optional(),
198
+ });
172
199
  const CheckoutNewHostedPageEventBasedAddonsSchema = z.object({
173
200
  id: z.array(z.string().max(100).optional()).optional(),
174
201
  quantity: z.array(z.number().int().min(1).optional()).optional(),
@@ -212,8 +239,18 @@ const CheckoutNewHostedPageBodySchema = z.looseObject({
212
239
  billing_address: CheckoutNewHostedPageBillingAddressSchema.optional(),
213
240
  shipping_address: CheckoutNewHostedPageShippingAddressSchema.optional(),
214
241
  contract_term: CheckoutNewHostedPageContractTermSchema.optional(),
215
- addons: CheckoutNewHostedPageAddonsSchema.optional(),
216
- event_based_addons: CheckoutNewHostedPageEventBasedAddonsSchema.optional(),
242
+ addons: z
243
+ .union([
244
+ z.array(CheckoutNewHostedPageAddonsItemSchema.optional()),
245
+ CheckoutNewHostedPageAddonsSchema,
246
+ ])
247
+ .optional(),
248
+ event_based_addons: z
249
+ .union([
250
+ z.array(CheckoutNewHostedPageEventBasedAddonsItemSchema.optional()),
251
+ CheckoutNewHostedPageEventBasedAddonsSchema,
252
+ ])
253
+ .optional(),
217
254
  });
218
255
  export { CheckoutNewHostedPageBodySchema };
219
256
  //HostedPage.checkoutOneTime
@@ -336,6 +373,15 @@ const CheckoutOneTimeHostedPageShippingAddressSchema = z.object({
336
373
  .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
337
374
  .optional(),
338
375
  });
376
+ const CheckoutOneTimeHostedPageAddonsItemSchema = z.object({
377
+ id: z.string().max(100).optional(),
378
+ quantity: z.number().int().min(1).optional(),
379
+ unit_price: z.number().int().min(0).optional(),
380
+ quantity_in_decimal: z.string().max(33).optional(),
381
+ unit_price_in_decimal: z.string().max(39).optional(),
382
+ date_from: z.number().int().optional(),
383
+ date_to: z.number().int().optional(),
384
+ });
339
385
  const CheckoutOneTimeHostedPageAddonsSchema = z.object({
340
386
  id: z.array(z.string().max(100).optional()).optional(),
341
387
  quantity: z.array(z.number().int().min(1).optional()).optional(),
@@ -345,6 +391,23 @@ const CheckoutOneTimeHostedPageAddonsSchema = z.object({
345
391
  date_from: z.array(z.number().int().optional()).optional(),
346
392
  date_to: z.array(z.number().int().optional()).optional(),
347
393
  });
394
+ const CheckoutOneTimeHostedPageChargesItemSchema = z.object({
395
+ amount: z.number().int().min(1).optional(),
396
+ amount_in_decimal: z.string().max(39).optional(),
397
+ description: z.string().max(250).optional(),
398
+ taxable: z.boolean().default(true).optional(),
399
+ tax_profile_id: z.string().max(50).optional(),
400
+ avalara_tax_code: z.string().max(50).optional(),
401
+ hsn_code: z.string().max(50).optional(),
402
+ taxjar_product_code: z.string().max(50).optional(),
403
+ avalara_sale_type: z
404
+ .enum(['wholesale', 'retail', 'consumed', 'vendor_use'])
405
+ .optional(),
406
+ avalara_transaction_type: z.number().int().optional(),
407
+ avalara_service_type: z.number().int().optional(),
408
+ date_from: z.number().int().optional(),
409
+ date_to: z.number().int().optional(),
410
+ });
348
411
  const CheckoutOneTimeHostedPageChargesSchema = z.object({
349
412
  amount: z.array(z.number().int().min(1).optional()).optional(),
350
413
  amount_in_decimal: z.array(z.string().max(39).optional()).optional(),
@@ -377,8 +440,18 @@ const CheckoutOneTimeHostedPageBodySchema = z.looseObject({
377
440
  card: CheckoutOneTimeHostedPageCardSchema.optional(),
378
441
  billing_address: CheckoutOneTimeHostedPageBillingAddressSchema.optional(),
379
442
  shipping_address: CheckoutOneTimeHostedPageShippingAddressSchema.optional(),
380
- addons: CheckoutOneTimeHostedPageAddonsSchema.optional(),
381
- charges: CheckoutOneTimeHostedPageChargesSchema.optional(),
443
+ addons: z
444
+ .union([
445
+ z.array(CheckoutOneTimeHostedPageAddonsItemSchema.optional()),
446
+ CheckoutOneTimeHostedPageAddonsSchema,
447
+ ])
448
+ .optional(),
449
+ charges: z
450
+ .union([
451
+ z.array(CheckoutOneTimeHostedPageChargesItemSchema.optional()),
452
+ CheckoutOneTimeHostedPageChargesSchema,
453
+ ])
454
+ .optional(),
382
455
  });
383
456
  export { CheckoutOneTimeHostedPageBodySchema };
384
457
  //HostedPage.checkoutOneTimeForItems
@@ -505,6 +578,15 @@ const CheckoutOneTimeForItemsHostedPageShippingAddressSchema = z.object({
505
578
  .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
506
579
  .optional(),
507
580
  });
581
+ const CheckoutOneTimeForItemsHostedPageItemPricesItemSchema = z.object({
582
+ item_price_id: z.string().max(100).optional(),
583
+ quantity: z.number().int().min(1).optional(),
584
+ quantity_in_decimal: z.string().max(33).optional(),
585
+ unit_price: z.number().int().min(0).optional(),
586
+ unit_price_in_decimal: z.string().max(39).optional(),
587
+ date_from: z.number().int().optional(),
588
+ date_to: z.number().int().optional(),
589
+ });
508
590
  const CheckoutOneTimeForItemsHostedPageItemPricesSchema = z.object({
509
591
  item_price_id: z.array(z.string().max(100).optional()).optional(),
510
592
  quantity: z.array(z.number().int().min(1).optional()).optional(),
@@ -514,6 +596,17 @@ const CheckoutOneTimeForItemsHostedPageItemPricesSchema = z.object({
514
596
  date_from: z.array(z.number().int().optional()).optional(),
515
597
  date_to: z.array(z.number().int().optional()).optional(),
516
598
  });
599
+ const CheckoutOneTimeForItemsHostedPageItemTiersItemSchema = z.object({
600
+ item_price_id: z.string().max(100).optional(),
601
+ starting_unit: z.number().int().min(1).optional(),
602
+ ending_unit: z.number().int().optional(),
603
+ price: z.number().int().min(0).optional(),
604
+ starting_unit_in_decimal: z.string().max(33).optional(),
605
+ ending_unit_in_decimal: z.string().max(33).optional(),
606
+ price_in_decimal: z.string().max(39).optional(),
607
+ pricing_type: z.enum(['per_unit', 'flat_fee', 'package']).optional(),
608
+ package_size: z.number().int().min(1).optional(),
609
+ });
517
610
  const CheckoutOneTimeForItemsHostedPageItemTiersSchema = z.object({
518
611
  item_price_id: z.array(z.string().max(100).optional()).optional(),
519
612
  starting_unit: z.array(z.number().int().min(1).optional()).optional(),
@@ -527,6 +620,23 @@ const CheckoutOneTimeForItemsHostedPageItemTiersSchema = z.object({
527
620
  .optional(),
528
621
  package_size: z.array(z.number().int().min(1).optional()).optional(),
529
622
  });
623
+ const CheckoutOneTimeForItemsHostedPageChargesItemSchema = z.object({
624
+ amount: z.number().int().min(1).optional(),
625
+ amount_in_decimal: z.string().max(39).optional(),
626
+ description: z.string().max(250).optional(),
627
+ taxable: z.boolean().default(true).optional(),
628
+ tax_profile_id: z.string().max(50).optional(),
629
+ avalara_tax_code: z.string().max(50).optional(),
630
+ hsn_code: z.string().max(50).optional(),
631
+ taxjar_product_code: z.string().max(50).optional(),
632
+ avalara_sale_type: z
633
+ .enum(['wholesale', 'retail', 'consumed', 'vendor_use'])
634
+ .optional(),
635
+ avalara_transaction_type: z.number().int().optional(),
636
+ avalara_service_type: z.number().int().optional(),
637
+ date_from: z.number().int().optional(),
638
+ date_to: z.number().int().optional(),
639
+ });
530
640
  const CheckoutOneTimeForItemsHostedPageChargesSchema = z.object({
531
641
  amount: z.array(z.number().int().min(1).optional()).optional(),
532
642
  amount_in_decimal: z.array(z.string().max(39).optional()).optional(),
@@ -544,6 +654,13 @@ const CheckoutOneTimeForItemsHostedPageChargesSchema = z.object({
544
654
  date_from: z.array(z.number().int().optional()).optional(),
545
655
  date_to: z.array(z.number().int().optional()).optional(),
546
656
  });
657
+ const CheckoutOneTimeForItemsHostedPageDiscountsItemSchema = z.object({
658
+ percentage: z.number().min(0.01).max(100).optional(),
659
+ amount: z.number().int().min(0).optional(),
660
+ quantity: z.number().int().min(1).optional(),
661
+ apply_on: z.enum(['invoice_amount', 'specific_item_price']),
662
+ item_price_id: z.string().max(100).optional(),
663
+ });
547
664
  const CheckoutOneTimeForItemsHostedPageDiscountsSchema = z.object({
548
665
  percentage: z.array(z.number().min(0.01).max(100).optional()).optional(),
549
666
  amount: z.array(z.number().int().min(0).optional()).optional(),
@@ -551,6 +668,13 @@ const CheckoutOneTimeForItemsHostedPageDiscountsSchema = z.object({
551
668
  apply_on: z.array(z.enum(['invoice_amount', 'specific_item_price']).optional()),
552
669
  item_price_id: z.array(z.string().max(100).optional()).optional(),
553
670
  });
671
+ const CheckoutOneTimeForItemsHostedPageEntityIdentifiersItemSchema = z.object({
672
+ id: z.string().max(40).optional(),
673
+ scheme: z.string().max(50).optional(),
674
+ value: z.string().max(50).optional(),
675
+ operation: z.enum(['create', 'update', 'delete']).optional(),
676
+ standard: z.string().max(50).optional(),
677
+ });
554
678
  const CheckoutOneTimeForItemsHostedPageEntityIdentifiersSchema = z.object({
555
679
  id: z.array(z.string().max(40).optional()).optional(),
556
680
  scheme: z.array(z.string().max(50).optional()).optional(),
@@ -576,11 +700,36 @@ const CheckoutOneTimeForItemsHostedPageBodySchema = z.looseObject({
576
700
  card: CheckoutOneTimeForItemsHostedPageCardSchema.optional(),
577
701
  billing_address: CheckoutOneTimeForItemsHostedPageBillingAddressSchema.optional(),
578
702
  shipping_address: CheckoutOneTimeForItemsHostedPageShippingAddressSchema.optional(),
579
- item_prices: CheckoutOneTimeForItemsHostedPageItemPricesSchema.optional(),
580
- item_tiers: CheckoutOneTimeForItemsHostedPageItemTiersSchema.optional(),
581
- charges: CheckoutOneTimeForItemsHostedPageChargesSchema.optional(),
582
- discounts: CheckoutOneTimeForItemsHostedPageDiscountsSchema.optional(),
583
- entity_identifiers: CheckoutOneTimeForItemsHostedPageEntityIdentifiersSchema.optional(),
703
+ item_prices: z
704
+ .union([
705
+ z.array(CheckoutOneTimeForItemsHostedPageItemPricesItemSchema.optional()),
706
+ CheckoutOneTimeForItemsHostedPageItemPricesSchema,
707
+ ])
708
+ .optional(),
709
+ item_tiers: z
710
+ .union([
711
+ z.array(CheckoutOneTimeForItemsHostedPageItemTiersItemSchema.optional()),
712
+ CheckoutOneTimeForItemsHostedPageItemTiersSchema,
713
+ ])
714
+ .optional(),
715
+ charges: z
716
+ .union([
717
+ z.array(CheckoutOneTimeForItemsHostedPageChargesItemSchema.optional()),
718
+ CheckoutOneTimeForItemsHostedPageChargesSchema,
719
+ ])
720
+ .optional(),
721
+ discounts: z
722
+ .union([
723
+ z.array(CheckoutOneTimeForItemsHostedPageDiscountsItemSchema.optional()),
724
+ CheckoutOneTimeForItemsHostedPageDiscountsSchema,
725
+ ])
726
+ .optional(),
727
+ entity_identifiers: z
728
+ .union([
729
+ z.array(CheckoutOneTimeForItemsHostedPageEntityIdentifiersItemSchema.optional()),
730
+ CheckoutOneTimeForItemsHostedPageEntityIdentifiersSchema,
731
+ ])
732
+ .optional(),
584
733
  });
585
734
  export { CheckoutOneTimeForItemsHostedPageBodySchema };
586
735
  //HostedPage.checkoutNewForItems
@@ -740,6 +889,28 @@ const CheckoutNewForItemsHostedPageContractTermSchema = z.object({
740
889
  action_at_term_end: z.enum(['renew', 'evergreen', 'cancel']).optional(),
741
890
  cancellation_cutoff_period: z.number().int().optional(),
742
891
  });
892
+ const CheckoutNewForItemsHostedPageSubscriptionItemsItemSchema = z.object({
893
+ item_price_id: z.string().max(100),
894
+ quantity: z.number().int().min(1).optional(),
895
+ quantity_in_decimal: z.string().max(33).optional(),
896
+ unit_price: z.number().int().min(0).optional(),
897
+ unit_price_in_decimal: z.string().max(39).optional(),
898
+ billing_cycles: z.number().int().min(0).optional(),
899
+ trial_end: z.number().int().optional(),
900
+ service_period_days: z.number().int().min(1).max(4000).optional(),
901
+ charge_on_event: z
902
+ .enum([
903
+ 'subscription_creation',
904
+ 'subscription_trial_start',
905
+ 'plan_activation',
906
+ 'subscription_activation',
907
+ 'contract_termination',
908
+ ])
909
+ .optional(),
910
+ charge_once: z.boolean().optional(),
911
+ item_type: z.enum(['plan', 'addon', 'charge']).optional(),
912
+ charge_on_option: z.enum(['immediately', 'on_event']).optional(),
913
+ });
743
914
  const CheckoutNewForItemsHostedPageSubscriptionItemsSchema = z.object({
744
915
  item_price_id: z.array(z.string().max(100).optional()),
745
916
  quantity: z.array(z.number().int().min(1).optional()).optional(),
@@ -768,6 +939,17 @@ const CheckoutNewForItemsHostedPageSubscriptionItemsSchema = z.object({
768
939
  .array(z.enum(['immediately', 'on_event']).optional())
769
940
  .optional(),
770
941
  });
942
+ const CheckoutNewForItemsHostedPageDiscountsItemSchema = z.object({
943
+ apply_on: z.enum(['invoice_amount', 'specific_item_price']).optional(),
944
+ duration_type: z.enum(['one_time', 'forever', 'limited_period']),
945
+ percentage: z.number().min(0.01).max(100).optional(),
946
+ amount: z.number().int().min(0).optional(),
947
+ period: z.number().int().min(1).optional(),
948
+ period_unit: z.enum(['day', 'week', 'month', 'year']).optional(),
949
+ included_in_mrr: z.boolean().optional(),
950
+ item_price_id: z.string().max(100).optional(),
951
+ quantity: z.number().int().min(1).optional(),
952
+ });
771
953
  const CheckoutNewForItemsHostedPageDiscountsSchema = z.object({
772
954
  apply_on: z
773
955
  .array(z.enum(['invoice_amount', 'specific_item_price']).optional())
@@ -783,6 +965,17 @@ const CheckoutNewForItemsHostedPageDiscountsSchema = z.object({
783
965
  item_price_id: z.array(z.string().max(100).optional()).optional(),
784
966
  quantity: z.array(z.number().int().min(1).optional()).optional(),
785
967
  });
968
+ const CheckoutNewForItemsHostedPageItemTiersItemSchema = z.object({
969
+ item_price_id: z.string().max(100).optional(),
970
+ starting_unit: z.number().int().min(1).optional(),
971
+ ending_unit: z.number().int().optional(),
972
+ price: z.number().int().min(0).optional(),
973
+ starting_unit_in_decimal: z.string().max(33).optional(),
974
+ ending_unit_in_decimal: z.string().max(33).optional(),
975
+ price_in_decimal: z.string().max(39).optional(),
976
+ pricing_type: z.enum(['per_unit', 'flat_fee', 'package']).optional(),
977
+ package_size: z.number().int().min(1).optional(),
978
+ });
786
979
  const CheckoutNewForItemsHostedPageItemTiersSchema = z.object({
787
980
  item_price_id: z.array(z.string().max(100).optional()).optional(),
788
981
  starting_unit: z.array(z.number().int().min(1).optional()).optional(),
@@ -796,6 +989,13 @@ const CheckoutNewForItemsHostedPageItemTiersSchema = z.object({
796
989
  .optional(),
797
990
  package_size: z.array(z.number().int().min(1).optional()).optional(),
798
991
  });
992
+ const CheckoutNewForItemsHostedPageEntityIdentifiersItemSchema = z.object({
993
+ id: z.string().max(40).optional(),
994
+ scheme: z.string().max(50).optional(),
995
+ value: z.string().max(50).optional(),
996
+ operation: z.enum(['create', 'update', 'delete']).optional(),
997
+ standard: z.string().max(50).optional(),
998
+ });
799
999
  const CheckoutNewForItemsHostedPageEntityIdentifiersSchema = z.object({
800
1000
  id: z.array(z.string().max(40).optional()).optional(),
801
1001
  scheme: z.array(z.string().max(50).optional()).optional(),
@@ -805,6 +1005,16 @@ const CheckoutNewForItemsHostedPageEntityIdentifiersSchema = z.object({
805
1005
  .optional(),
806
1006
  standard: z.array(z.string().max(50).optional()).optional(),
807
1007
  });
1008
+ const CheckoutNewForItemsHostedPageAllowedBillingFrequenciesItemSchema = z.object({
1009
+ period: z.number().int().min(1).optional(),
1010
+ period_unit: z.enum(['day', 'week', 'month', 'year']).optional(),
1011
+ });
1012
+ const CheckoutNewForItemsHostedPageAllowedBillingFrequenciesSchema = z.object({
1013
+ period: z.array(z.number().int().min(1).optional()).optional(),
1014
+ period_unit: z
1015
+ .array(z.enum(['day', 'week', 'month', 'year']).optional())
1016
+ .optional(),
1017
+ });
808
1018
  const CheckoutNewForItemsHostedPageBodySchema = z.looseObject({
809
1019
  layout: z.enum(['in_app', 'full_page']).optional(),
810
1020
  business_entity_id: z.string().max(50).optional(),
@@ -817,6 +1027,7 @@ const CheckoutNewForItemsHostedPageBodySchema = z.looseObject({
817
1027
  redirect_url: z.string().max(250).optional(),
818
1028
  cancel_url: z.string().max(250).optional(),
819
1029
  pass_thru_content: z.string().max(2048).optional(),
1030
+ show_billing_frequency_selector: z.boolean().optional(),
820
1031
  allow_offline_payment_methods: z.boolean().optional(),
821
1032
  subscription: CheckoutNewForItemsHostedPageSubscriptionSchema.optional(),
822
1033
  customer: CheckoutNewForItemsHostedPageCustomerSchema.optional(),
@@ -824,10 +1035,36 @@ const CheckoutNewForItemsHostedPageBodySchema = z.looseObject({
824
1035
  billing_address: CheckoutNewForItemsHostedPageBillingAddressSchema.optional(),
825
1036
  shipping_address: CheckoutNewForItemsHostedPageShippingAddressSchema.optional(),
826
1037
  contract_term: CheckoutNewForItemsHostedPageContractTermSchema.optional(),
827
- subscription_items: CheckoutNewForItemsHostedPageSubscriptionItemsSchema.optional(),
828
- discounts: CheckoutNewForItemsHostedPageDiscountsSchema.optional(),
829
- item_tiers: CheckoutNewForItemsHostedPageItemTiersSchema.optional(),
830
- entity_identifiers: CheckoutNewForItemsHostedPageEntityIdentifiersSchema.optional(),
1038
+ subscription_items: z
1039
+ .union([
1040
+ z.array(CheckoutNewForItemsHostedPageSubscriptionItemsItemSchema.optional()),
1041
+ CheckoutNewForItemsHostedPageSubscriptionItemsSchema,
1042
+ ])
1043
+ .optional(),
1044
+ discounts: z
1045
+ .union([
1046
+ z.array(CheckoutNewForItemsHostedPageDiscountsItemSchema.optional()),
1047
+ CheckoutNewForItemsHostedPageDiscountsSchema,
1048
+ ])
1049
+ .optional(),
1050
+ item_tiers: z
1051
+ .union([
1052
+ z.array(CheckoutNewForItemsHostedPageItemTiersItemSchema.optional()),
1053
+ CheckoutNewForItemsHostedPageItemTiersSchema,
1054
+ ])
1055
+ .optional(),
1056
+ entity_identifiers: z
1057
+ .union([
1058
+ z.array(CheckoutNewForItemsHostedPageEntityIdentifiersItemSchema.optional()),
1059
+ CheckoutNewForItemsHostedPageEntityIdentifiersSchema,
1060
+ ])
1061
+ .optional(),
1062
+ allowed_billing_frequencies: z
1063
+ .union([
1064
+ z.array(CheckoutNewForItemsHostedPageAllowedBillingFrequenciesItemSchema.optional()),
1065
+ CheckoutNewForItemsHostedPageAllowedBillingFrequenciesSchema,
1066
+ ])
1067
+ .optional(),
831
1068
  });
832
1069
  export { CheckoutNewForItemsHostedPageBodySchema };
833
1070
  //HostedPage.checkoutExisting
@@ -943,6 +1180,14 @@ const CheckoutExistingHostedPageContractTermSchema = z.object({
943
1180
  action_at_term_end: z.enum(['renew', 'evergreen', 'cancel']).optional(),
944
1181
  cancellation_cutoff_period: z.number().int().optional(),
945
1182
  });
1183
+ const CheckoutExistingHostedPageAddonsItemSchema = z.object({
1184
+ id: z.string().max(100).optional(),
1185
+ quantity: z.number().int().min(1).optional(),
1186
+ unit_price: z.number().int().min(0).optional(),
1187
+ billing_cycles: z.number().int().min(0).optional(),
1188
+ quantity_in_decimal: z.string().max(33).optional(),
1189
+ unit_price_in_decimal: z.string().max(39).optional(),
1190
+ });
946
1191
  const CheckoutExistingHostedPageAddonsSchema = z.object({
947
1192
  id: z.array(z.string().max(100).optional()).optional(),
948
1193
  quantity: z.array(z.number().int().min(1).optional()).optional(),
@@ -951,6 +1196,25 @@ const CheckoutExistingHostedPageAddonsSchema = z.object({
951
1196
  quantity_in_decimal: z.array(z.string().max(33).optional()).optional(),
952
1197
  unit_price_in_decimal: z.array(z.string().max(39).optional()).optional(),
953
1198
  });
1199
+ const CheckoutExistingHostedPageEventBasedAddonsItemSchema = z.object({
1200
+ id: z.string().max(100).optional(),
1201
+ quantity: z.number().int().min(1).optional(),
1202
+ unit_price: z.number().int().min(0).optional(),
1203
+ service_period_in_days: z.number().int().min(1).max(4000).optional(),
1204
+ charge_on: z.enum(['immediately', 'on_event']).optional(),
1205
+ on_event: z
1206
+ .enum([
1207
+ 'subscription_creation',
1208
+ 'subscription_trial_start',
1209
+ 'plan_activation',
1210
+ 'subscription_activation',
1211
+ 'contract_termination',
1212
+ ])
1213
+ .optional(),
1214
+ charge_once: z.boolean().default(true).optional(),
1215
+ quantity_in_decimal: z.string().max(33).optional(),
1216
+ unit_price_in_decimal: z.string().max(39).optional(),
1217
+ });
954
1218
  const CheckoutExistingHostedPageEventBasedAddonsSchema = z.object({
955
1219
  id: z.array(z.string().max(100).optional()).optional(),
956
1220
  quantity: z.array(z.number().int().min(1).optional()).optional(),
@@ -998,8 +1262,18 @@ const CheckoutExistingHostedPageBodySchema = z.looseObject({
998
1262
  customer: CheckoutExistingHostedPageCustomerSchema.optional(),
999
1263
  card: CheckoutExistingHostedPageCardSchema.optional(),
1000
1264
  contract_term: CheckoutExistingHostedPageContractTermSchema.optional(),
1001
- addons: CheckoutExistingHostedPageAddonsSchema.optional(),
1002
- event_based_addons: CheckoutExistingHostedPageEventBasedAddonsSchema.optional(),
1265
+ addons: z
1266
+ .union([
1267
+ z.array(CheckoutExistingHostedPageAddonsItemSchema.optional()),
1268
+ CheckoutExistingHostedPageAddonsSchema,
1269
+ ])
1270
+ .optional(),
1271
+ event_based_addons: z
1272
+ .union([
1273
+ z.array(CheckoutExistingHostedPageEventBasedAddonsItemSchema.optional()),
1274
+ CheckoutExistingHostedPageEventBasedAddonsSchema,
1275
+ ])
1276
+ .optional(),
1003
1277
  });
1004
1278
  export { CheckoutExistingHostedPageBodySchema };
1005
1279
  //HostedPage.checkoutExistingForItems
@@ -1113,6 +1387,28 @@ const CheckoutExistingForItemsHostedPageContractTermSchema = z.object({
1113
1387
  action_at_term_end: z.enum(['renew', 'evergreen', 'cancel']).optional(),
1114
1388
  cancellation_cutoff_period: z.number().int().optional(),
1115
1389
  });
1390
+ const CheckoutExistingForItemsHostedPageSubscriptionItemsItemSchema = z.object({
1391
+ item_price_id: z.string().max(100),
1392
+ quantity: z.number().int().min(1).optional(),
1393
+ quantity_in_decimal: z.string().max(33).optional(),
1394
+ unit_price: z.number().int().min(0).optional(),
1395
+ unit_price_in_decimal: z.string().max(39).optional(),
1396
+ billing_cycles: z.number().int().min(0).optional(),
1397
+ trial_end: z.number().int().optional(),
1398
+ service_period_days: z.number().int().min(1).max(4000).optional(),
1399
+ charge_on_event: z
1400
+ .enum([
1401
+ 'subscription_creation',
1402
+ 'subscription_trial_start',
1403
+ 'plan_activation',
1404
+ 'subscription_activation',
1405
+ 'contract_termination',
1406
+ ])
1407
+ .optional(),
1408
+ charge_once: z.boolean().optional(),
1409
+ charge_on_option: z.enum(['immediately', 'on_event']).optional(),
1410
+ item_type: z.enum(['plan', 'addon', 'charge']).optional(),
1411
+ });
1116
1412
  const CheckoutExistingForItemsHostedPageSubscriptionItemsSchema = z.object({
1117
1413
  item_price_id: z.array(z.string().max(100).optional()),
1118
1414
  quantity: z.array(z.number().int().min(1).optional()).optional(),
@@ -1141,6 +1437,19 @@ const CheckoutExistingForItemsHostedPageSubscriptionItemsSchema = z.object({
1141
1437
  .optional(),
1142
1438
  item_type: z.array(z.enum(['plan', 'addon', 'charge']).optional()).optional(),
1143
1439
  });
1440
+ const CheckoutExistingForItemsHostedPageDiscountsItemSchema = z.object({
1441
+ apply_on: z.enum(['invoice_amount', 'specific_item_price']).optional(),
1442
+ duration_type: z.enum(['one_time', 'forever', 'limited_period']),
1443
+ percentage: z.number().min(0.01).max(100).optional(),
1444
+ amount: z.number().int().min(0).optional(),
1445
+ period: z.number().int().min(1).optional(),
1446
+ period_unit: z.enum(['day', 'week', 'month', 'year']).optional(),
1447
+ included_in_mrr: z.boolean().optional(),
1448
+ item_price_id: z.string().max(100).optional(),
1449
+ quantity: z.number().int().min(1).optional(),
1450
+ operation_type: z.enum(['add', 'remove']),
1451
+ id: z.string().max(50).optional(),
1452
+ });
1144
1453
  const CheckoutExistingForItemsHostedPageDiscountsSchema = z.object({
1145
1454
  apply_on: z
1146
1455
  .array(z.enum(['invoice_amount', 'specific_item_price']).optional())
@@ -1158,6 +1467,17 @@ const CheckoutExistingForItemsHostedPageDiscountsSchema = z.object({
1158
1467
  operation_type: z.array(z.enum(['add', 'remove']).optional()),
1159
1468
  id: z.array(z.string().max(50).optional()).optional(),
1160
1469
  });
1470
+ const CheckoutExistingForItemsHostedPageItemTiersItemSchema = z.object({
1471
+ item_price_id: z.string().max(100).optional(),
1472
+ starting_unit: z.number().int().min(1).optional(),
1473
+ ending_unit: z.number().int().optional(),
1474
+ price: z.number().int().min(0).optional(),
1475
+ starting_unit_in_decimal: z.string().max(33).optional(),
1476
+ ending_unit_in_decimal: z.string().max(33).optional(),
1477
+ price_in_decimal: z.string().max(39).optional(),
1478
+ pricing_type: z.enum(['per_unit', 'flat_fee', 'package']).optional(),
1479
+ package_size: z.number().int().min(1).optional(),
1480
+ });
1161
1481
  const CheckoutExistingForItemsHostedPageItemTiersSchema = z.object({
1162
1482
  item_price_id: z.array(z.string().max(100).optional()).optional(),
1163
1483
  starting_unit: z.array(z.number().int().min(1).optional()).optional(),
@@ -1171,6 +1491,13 @@ const CheckoutExistingForItemsHostedPageItemTiersSchema = z.object({
1171
1491
  .optional(),
1172
1492
  package_size: z.array(z.number().int().min(1).optional()).optional(),
1173
1493
  });
1494
+ const CheckoutExistingForItemsHostedPageEntityIdentifiersItemSchema = z.object({
1495
+ id: z.string().max(40).optional(),
1496
+ scheme: z.string().max(50).optional(),
1497
+ value: z.string().max(50).optional(),
1498
+ operation: z.enum(['create', 'update', 'delete']).optional(),
1499
+ standard: z.string().max(50).optional(),
1500
+ });
1174
1501
  const CheckoutExistingForItemsHostedPageEntityIdentifiersSchema = z.object({
1175
1502
  id: z.array(z.string().max(40).optional()).optional(),
1176
1503
  scheme: z.array(z.string().max(50).optional()).optional(),
@@ -1180,6 +1507,16 @@ const CheckoutExistingForItemsHostedPageEntityIdentifiersSchema = z.object({
1180
1507
  .optional(),
1181
1508
  standard: z.array(z.string().max(50).optional()).optional(),
1182
1509
  });
1510
+ const CheckoutExistingForItemsHostedPageAllowedBillingFrequenciesItemSchema = z.object({
1511
+ period: z.number().int().min(1).optional(),
1512
+ period_unit: z.enum(['day', 'week', 'month', 'year']).optional(),
1513
+ });
1514
+ const CheckoutExistingForItemsHostedPageAllowedBillingFrequenciesSchema = z.object({
1515
+ period: z.array(z.number().int().min(1).optional()).optional(),
1516
+ period_unit: z
1517
+ .array(z.enum(['day', 'week', 'month', 'year']).optional())
1518
+ .optional(),
1519
+ });
1183
1520
  const CheckoutExistingForItemsHostedPageBodySchema = z.looseObject({
1184
1521
  layout: z.enum(['in_app', 'full_page']).optional(),
1185
1522
  brand_id: z.string().max(50).optional(),
@@ -1202,15 +1539,42 @@ const CheckoutExistingForItemsHostedPageBodySchema = z.looseObject({
1202
1539
  redirect_url: z.string().max(250).optional(),
1203
1540
  cancel_url: z.string().max(250).optional(),
1204
1541
  pass_thru_content: z.string().max(2048).optional(),
1542
+ show_billing_frequency_selector: z.boolean().optional(),
1205
1543
  allow_offline_payment_methods: z.boolean().optional(),
1206
1544
  subscription: CheckoutExistingForItemsHostedPageSubscriptionSchema.optional(),
1207
1545
  customer: CheckoutExistingForItemsHostedPageCustomerSchema.optional(),
1208
1546
  card: CheckoutExistingForItemsHostedPageCardSchema.optional(),
1209
1547
  contract_term: CheckoutExistingForItemsHostedPageContractTermSchema.optional(),
1210
- subscription_items: CheckoutExistingForItemsHostedPageSubscriptionItemsSchema.optional(),
1211
- discounts: CheckoutExistingForItemsHostedPageDiscountsSchema.optional(),
1212
- item_tiers: CheckoutExistingForItemsHostedPageItemTiersSchema.optional(),
1213
- entity_identifiers: CheckoutExistingForItemsHostedPageEntityIdentifiersSchema.optional(),
1548
+ subscription_items: z
1549
+ .union([
1550
+ z.array(CheckoutExistingForItemsHostedPageSubscriptionItemsItemSchema.optional()),
1551
+ CheckoutExistingForItemsHostedPageSubscriptionItemsSchema,
1552
+ ])
1553
+ .optional(),
1554
+ discounts: z
1555
+ .union([
1556
+ z.array(CheckoutExistingForItemsHostedPageDiscountsItemSchema.optional()),
1557
+ CheckoutExistingForItemsHostedPageDiscountsSchema,
1558
+ ])
1559
+ .optional(),
1560
+ item_tiers: z
1561
+ .union([
1562
+ z.array(CheckoutExistingForItemsHostedPageItemTiersItemSchema.optional()),
1563
+ CheckoutExistingForItemsHostedPageItemTiersSchema,
1564
+ ])
1565
+ .optional(),
1566
+ entity_identifiers: z
1567
+ .union([
1568
+ z.array(CheckoutExistingForItemsHostedPageEntityIdentifiersItemSchema.optional()),
1569
+ CheckoutExistingForItemsHostedPageEntityIdentifiersSchema,
1570
+ ])
1571
+ .optional(),
1572
+ allowed_billing_frequencies: z
1573
+ .union([
1574
+ z.array(CheckoutExistingForItemsHostedPageAllowedBillingFrequenciesItemSchema.optional()),
1575
+ CheckoutExistingForItemsHostedPageAllowedBillingFrequenciesSchema,
1576
+ ])
1577
+ .optional(),
1214
1578
  });
1215
1579
  export { CheckoutExistingForItemsHostedPageBodySchema };
1216
1580
  //HostedPage.updateCard
@@ -1570,6 +1934,11 @@ const CheckoutGiftHostedPageSubscriptionSchema = z.looseObject({
1570
1934
  plan_quantity_in_decimal: z.string().max(33).optional(),
1571
1935
  coupon: z.string().max(100).optional(),
1572
1936
  });
1937
+ const CheckoutGiftHostedPageAddonsItemSchema = z.object({
1938
+ id: z.string().max(100).optional(),
1939
+ quantity: z.number().int().min(1).optional(),
1940
+ quantity_in_decimal: z.string().max(33).optional(),
1941
+ });
1573
1942
  const CheckoutGiftHostedPageAddonsSchema = z.object({
1574
1943
  id: z.array(z.string().max(100).optional()).optional(),
1575
1944
  quantity: z.array(z.number().int().min(1).optional()).optional(),
@@ -1580,13 +1949,25 @@ const CheckoutGiftHostedPageBodySchema = z.looseObject({
1580
1949
  coupon_ids: z.array(z.string().max(100).optional()).optional(),
1581
1950
  gifter: CheckoutGiftHostedPageGifterSchema.optional(),
1582
1951
  subscription: CheckoutGiftHostedPageSubscriptionSchema.optional(),
1583
- addons: CheckoutGiftHostedPageAddonsSchema.optional(),
1952
+ addons: z
1953
+ .union([
1954
+ z.array(CheckoutGiftHostedPageAddonsItemSchema.optional()),
1955
+ CheckoutGiftHostedPageAddonsSchema,
1956
+ ])
1957
+ .optional(),
1584
1958
  });
1585
1959
  export { CheckoutGiftHostedPageBodySchema };
1586
1960
  //HostedPage.checkoutGiftForItems
1587
1961
  const CheckoutGiftForItemsHostedPageGifterSchema = z.object({
1588
1962
  customer_id: z.string().max(50).optional(),
1589
1963
  });
1964
+ const CheckoutGiftForItemsHostedPageSubscriptionItemsItemSchema = z.object({
1965
+ item_price_id: z.string().max(100).optional(),
1966
+ quantity: z.number().int().min(1).optional(),
1967
+ quantity_in_decimal: z.string().max(33).optional(),
1968
+ unit_price: z.number().int().min(0).optional(),
1969
+ unit_price_in_decimal: z.string().max(39).optional(),
1970
+ });
1590
1971
  const CheckoutGiftForItemsHostedPageSubscriptionItemsSchema = z.object({
1591
1972
  item_price_id: z.array(z.string().max(100).optional()).optional(),
1592
1973
  quantity: z.array(z.number().int().min(1).optional()).optional(),
@@ -1594,6 +1975,15 @@ const CheckoutGiftForItemsHostedPageSubscriptionItemsSchema = z.object({
1594
1975
  unit_price: z.array(z.number().int().min(0).optional()).optional(),
1595
1976
  unit_price_in_decimal: z.array(z.string().max(39).optional()).optional(),
1596
1977
  });
1978
+ const CheckoutGiftForItemsHostedPageItemTiersItemSchema = z.object({
1979
+ item_price_id: z.string().max(100).optional(),
1980
+ starting_unit: z.number().int().min(1).optional(),
1981
+ ending_unit: z.number().int().optional(),
1982
+ price: z.number().int().min(0).optional(),
1983
+ starting_unit_in_decimal: z.string().max(33).optional(),
1984
+ ending_unit_in_decimal: z.string().max(33).optional(),
1985
+ price_in_decimal: z.string().max(39).optional(),
1986
+ });
1597
1987
  const CheckoutGiftForItemsHostedPageItemTiersSchema = z.object({
1598
1988
  item_price_id: z.array(z.string().max(100).optional()).optional(),
1599
1989
  starting_unit: z.array(z.number().int().min(1).optional()).optional(),
@@ -1603,15 +1993,42 @@ const CheckoutGiftForItemsHostedPageItemTiersSchema = z.object({
1603
1993
  ending_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
1604
1994
  price_in_decimal: z.array(z.string().max(39).optional()).optional(),
1605
1995
  });
1996
+ const CheckoutGiftForItemsHostedPageAllowedBillingFrequenciesItemSchema = z.object({
1997
+ period: z.number().int().min(1).optional(),
1998
+ period_unit: z.enum(['day', 'week', 'month', 'year']).optional(),
1999
+ });
2000
+ const CheckoutGiftForItemsHostedPageAllowedBillingFrequenciesSchema = z.object({
2001
+ period: z.array(z.number().int().min(1).optional()).optional(),
2002
+ period_unit: z
2003
+ .array(z.enum(['day', 'week', 'month', 'year']).optional())
2004
+ .optional(),
2005
+ });
1606
2006
  const CheckoutGiftForItemsHostedPageBodySchema = z.looseObject({
1607
2007
  layout: z.enum(['in_app', 'full_page']).optional(),
1608
2008
  business_entity_id: z.string().max(50).optional(),
1609
2009
  brand_id: z.string().max(50).optional(),
1610
2010
  redirect_url: z.string().max(250).optional(),
1611
2011
  coupon_ids: z.array(z.string().max(100).optional()).optional(),
2012
+ show_billing_frequency_selector: z.boolean().optional(),
1612
2013
  gifter: CheckoutGiftForItemsHostedPageGifterSchema.optional(),
1613
- subscription_items: CheckoutGiftForItemsHostedPageSubscriptionItemsSchema.optional(),
1614
- item_tiers: CheckoutGiftForItemsHostedPageItemTiersSchema.optional(),
2014
+ subscription_items: z
2015
+ .union([
2016
+ z.array(CheckoutGiftForItemsHostedPageSubscriptionItemsItemSchema.optional()),
2017
+ CheckoutGiftForItemsHostedPageSubscriptionItemsSchema,
2018
+ ])
2019
+ .optional(),
2020
+ item_tiers: z
2021
+ .union([
2022
+ z.array(CheckoutGiftForItemsHostedPageItemTiersItemSchema.optional()),
2023
+ CheckoutGiftForItemsHostedPageItemTiersSchema,
2024
+ ])
2025
+ .optional(),
2026
+ allowed_billing_frequencies: z
2027
+ .union([
2028
+ z.array(CheckoutGiftForItemsHostedPageAllowedBillingFrequenciesItemSchema.optional()),
2029
+ CheckoutGiftForItemsHostedPageAllowedBillingFrequenciesSchema,
2030
+ ])
2031
+ .optional(),
1615
2032
  });
1616
2033
  export { CheckoutGiftForItemsHostedPageBodySchema };
1617
2034
  //HostedPage.claimGift
@@ -1638,8 +2055,18 @@ const ListHostedPageIdSchema = z.object({
1638
2055
  is: z.string().min(1).optional(),
1639
2056
  is_not: z.string().min(1).optional(),
1640
2057
  starts_with: z.string().min(1).optional(),
1641
- in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1642
- not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
2058
+ in: z
2059
+ .union([
2060
+ z.array(z.string().optional()),
2061
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
2062
+ ])
2063
+ .optional(),
2064
+ not_in: z
2065
+ .union([
2066
+ z.array(z.string().optional()),
2067
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
2068
+ ])
2069
+ .optional(),
1643
2070
  });
1644
2071
  const ListHostedPageTypeSchema = z.object({
1645
2072
  is: z
@@ -1673,33 +2100,67 @@ const ListHostedPageTypeSchema = z.object({
1673
2100
  ])
1674
2101
  .optional(),
1675
2102
  in: z
1676
- .enum([
1677
- 'checkout_new',
1678
- 'checkout_existing',
1679
- 'update_card',
1680
- 'update_payment_method',
1681
- 'manage_payment_sources',
1682
- 'collect_now',
1683
- 'extend_subscription',
1684
- 'checkout_one_time',
1685
- 'pre_cancel',
1686
- 'view_voucher',
1687
- 'accept_quote',
2103
+ .union([
2104
+ z.array(z
2105
+ .enum([
2106
+ 'checkout_new',
2107
+ 'checkout_existing',
2108
+ 'update_card',
2109
+ 'update_payment_method',
2110
+ 'manage_payment_sources',
2111
+ 'collect_now',
2112
+ 'extend_subscription',
2113
+ 'checkout_one_time',
2114
+ 'pre_cancel',
2115
+ 'view_voucher',
2116
+ 'accept_quote',
2117
+ ])
2118
+ .optional()),
2119
+ z.enum([
2120
+ 'checkout_new',
2121
+ 'checkout_existing',
2122
+ 'update_card',
2123
+ 'update_payment_method',
2124
+ 'manage_payment_sources',
2125
+ 'collect_now',
2126
+ 'extend_subscription',
2127
+ 'checkout_one_time',
2128
+ 'pre_cancel',
2129
+ 'view_voucher',
2130
+ 'accept_quote',
2131
+ ]),
1688
2132
  ])
1689
2133
  .optional(),
1690
2134
  not_in: z
1691
- .enum([
1692
- 'checkout_new',
1693
- 'checkout_existing',
1694
- 'update_card',
1695
- 'update_payment_method',
1696
- 'manage_payment_sources',
1697
- 'collect_now',
1698
- 'extend_subscription',
1699
- 'checkout_one_time',
1700
- 'pre_cancel',
1701
- 'view_voucher',
1702
- 'accept_quote',
2135
+ .union([
2136
+ z.array(z
2137
+ .enum([
2138
+ 'checkout_new',
2139
+ 'checkout_existing',
2140
+ 'update_card',
2141
+ 'update_payment_method',
2142
+ 'manage_payment_sources',
2143
+ 'collect_now',
2144
+ 'extend_subscription',
2145
+ 'checkout_one_time',
2146
+ 'pre_cancel',
2147
+ 'view_voucher',
2148
+ 'accept_quote',
2149
+ ])
2150
+ .optional()),
2151
+ z.enum([
2152
+ 'checkout_new',
2153
+ 'checkout_existing',
2154
+ 'update_card',
2155
+ 'update_payment_method',
2156
+ 'manage_payment_sources',
2157
+ 'collect_now',
2158
+ 'extend_subscription',
2159
+ 'checkout_one_time',
2160
+ 'pre_cancel',
2161
+ 'view_voucher',
2162
+ 'accept_quote',
2163
+ ]),
1703
2164
  ])
1704
2165
  .optional(),
1705
2166
  });
@@ -1725,31 +2186,66 @@ const ListHostedPageStateSchema = z.object({
1725
2186
  ])
1726
2187
  .optional(),
1727
2188
  in: z
1728
- .enum([
1729
- 'created',
1730
- 'requested',
1731
- 'succeeded',
1732
- 'cancelled',
1733
- 'failed',
1734
- 'acknowledged',
2189
+ .union([
2190
+ z.array(z
2191
+ .enum([
2192
+ 'created',
2193
+ 'requested',
2194
+ 'succeeded',
2195
+ 'cancelled',
2196
+ 'failed',
2197
+ 'acknowledged',
2198
+ ])
2199
+ .optional()),
2200
+ z.enum([
2201
+ 'created',
2202
+ 'requested',
2203
+ 'succeeded',
2204
+ 'cancelled',
2205
+ 'failed',
2206
+ 'acknowledged',
2207
+ ]),
1735
2208
  ])
1736
2209
  .optional(),
1737
2210
  not_in: z
1738
- .enum([
1739
- 'created',
1740
- 'requested',
1741
- 'succeeded',
1742
- 'cancelled',
1743
- 'failed',
1744
- 'acknowledged',
2211
+ .union([
2212
+ z.array(z
2213
+ .enum([
2214
+ 'created',
2215
+ 'requested',
2216
+ 'succeeded',
2217
+ 'cancelled',
2218
+ 'failed',
2219
+ 'acknowledged',
2220
+ ])
2221
+ .optional()),
2222
+ z.enum([
2223
+ 'created',
2224
+ 'requested',
2225
+ 'succeeded',
2226
+ 'cancelled',
2227
+ 'failed',
2228
+ 'acknowledged',
2229
+ ]),
1745
2230
  ])
1746
2231
  .optional(),
1747
2232
  });
1748
2233
  const ListHostedPageUpdatedAtSchema = z.object({
1749
- after: z.string().regex(RegExp('^\\d{10}$')).optional(),
1750
- before: z.string().regex(RegExp('^\\d{10}$')).optional(),
1751
- on: z.string().regex(RegExp('^\\d{10}$')).optional(),
1752
- between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
2234
+ after: z
2235
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
2236
+ .optional(),
2237
+ before: z
2238
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
2239
+ .optional(),
2240
+ on: z
2241
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
2242
+ .optional(),
2243
+ between: z
2244
+ .union([
2245
+ z.array(z.number().int().optional()).min(2).max(2),
2246
+ z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
2247
+ ])
2248
+ .optional(),
1753
2249
  });
1754
2250
  const ListHostedPageBodySchema = z.looseObject({
1755
2251
  limit: z.number().int().min(1).max(100).optional(),