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
@@ -355,6 +355,15 @@ const CreateInvoicePaymentIntentSchema = zod_1.z.object({
355
355
  gw_payment_method_id: zod_1.z.string().max(65000).optional(),
356
356
  additional_information: CreateInvoiceAdditionalInformationSchema.optional(),
357
357
  });
358
+ const CreateInvoiceAddonsItemSchema = zod_1.z.object({
359
+ id: zod_1.z.string().max(100).optional(),
360
+ quantity: zod_1.z.number().int().min(1).optional(),
361
+ unit_price: zod_1.z.number().int().min(0).optional(),
362
+ quantity_in_decimal: zod_1.z.string().max(33).optional(),
363
+ unit_price_in_decimal: zod_1.z.string().max(39).optional(),
364
+ date_from: zod_1.z.number().int().optional(),
365
+ date_to: zod_1.z.number().int().optional(),
366
+ });
358
367
  const CreateInvoiceAddonsSchema = zod_1.z.object({
359
368
  id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
360
369
  quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
@@ -364,6 +373,23 @@ const CreateInvoiceAddonsSchema = zod_1.z.object({
364
373
  date_from: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
365
374
  date_to: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
366
375
  });
376
+ const CreateInvoiceChargesItemSchema = zod_1.z.object({
377
+ amount: zod_1.z.number().int().min(1).optional(),
378
+ amount_in_decimal: zod_1.z.string().max(39).optional(),
379
+ description: zod_1.z.string().max(250).optional(),
380
+ taxable: zod_1.z.boolean().default(true).optional(),
381
+ tax_profile_id: zod_1.z.string().max(50).optional(),
382
+ avalara_tax_code: zod_1.z.string().max(50).optional(),
383
+ hsn_code: zod_1.z.string().max(50).optional(),
384
+ taxjar_product_code: zod_1.z.string().max(50).optional(),
385
+ avalara_sale_type: zod_1.z
386
+ .enum(['wholesale', 'retail', 'consumed', 'vendor_use'])
387
+ .optional(),
388
+ avalara_transaction_type: zod_1.z.number().int().optional(),
389
+ avalara_service_type: zod_1.z.number().int().optional(),
390
+ date_from: zod_1.z.number().int().optional(),
391
+ date_to: zod_1.z.number().int().optional(),
392
+ });
367
393
  const CreateInvoiceChargesSchema = zod_1.z.object({
368
394
  amount: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
369
395
  amount_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
@@ -381,11 +407,22 @@ const CreateInvoiceChargesSchema = zod_1.z.object({
381
407
  date_from: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
382
408
  date_to: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
383
409
  });
410
+ const CreateInvoiceTaxProvidersFieldsItemSchema = zod_1.z.object({
411
+ provider_name: zod_1.z.string().max(50).optional(),
412
+ field_id: zod_1.z.string().max(50).optional(),
413
+ field_value: zod_1.z.string().max(50).optional(),
414
+ });
384
415
  const CreateInvoiceTaxProvidersFieldsSchema = zod_1.z.object({
385
416
  provider_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
386
417
  field_id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
387
418
  field_value: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
388
419
  });
420
+ const CreateInvoiceNotesToRemoveItemSchema = zod_1.z.object({
421
+ entity_type: zod_1.z
422
+ .enum(['plan', 'addon', 'customer', 'subscription', 'coupon'])
423
+ .optional(),
424
+ entity_id: zod_1.z.string().max(100).optional(),
425
+ });
389
426
  const CreateInvoiceNotesToRemoveSchema = zod_1.z.object({
390
427
  entity_type: zod_1.z
391
428
  .array(zod_1.z
@@ -417,10 +454,30 @@ const CreateInvoiceBodySchema = zod_1.z.looseObject({
417
454
  bank_account: CreateInvoiceBankAccountSchema.optional(),
418
455
  payment_method: CreateInvoicePaymentMethodSchema.optional(),
419
456
  payment_intent: CreateInvoicePaymentIntentSchema.optional(),
420
- addons: CreateInvoiceAddonsSchema.optional(),
421
- charges: CreateInvoiceChargesSchema.optional(),
422
- tax_providers_fields: CreateInvoiceTaxProvidersFieldsSchema.optional(),
423
- notes_to_remove: CreateInvoiceNotesToRemoveSchema.optional(),
457
+ addons: zod_1.z
458
+ .union([
459
+ zod_1.z.array(CreateInvoiceAddonsItemSchema.optional()),
460
+ CreateInvoiceAddonsSchema,
461
+ ])
462
+ .optional(),
463
+ charges: zod_1.z
464
+ .union([
465
+ zod_1.z.array(CreateInvoiceChargesItemSchema.optional()),
466
+ CreateInvoiceChargesSchema,
467
+ ])
468
+ .optional(),
469
+ tax_providers_fields: zod_1.z
470
+ .union([
471
+ zod_1.z.array(CreateInvoiceTaxProvidersFieldsItemSchema.optional()),
472
+ CreateInvoiceTaxProvidersFieldsSchema,
473
+ ])
474
+ .optional(),
475
+ notes_to_remove: zod_1.z
476
+ .union([
477
+ zod_1.z.array(CreateInvoiceNotesToRemoveItemSchema.optional()),
478
+ CreateInvoiceNotesToRemoveSchema,
479
+ ])
480
+ .optional(),
424
481
  });
425
482
  exports.CreateInvoiceBodySchema = CreateInvoiceBodySchema;
426
483
  //Invoice.createForChargeItemsAndCharges
@@ -773,6 +830,17 @@ const CreateForChargeItemsAndChargesInvoicePaymentIntentSchema = zod_1.z.object(
773
830
  gw_payment_method_id: zod_1.z.string().max(65000).optional(),
774
831
  additional_information: CreateForChargeItemsAndChargesInvoiceAdditionalInformationSchema.optional(),
775
832
  });
833
+ const CreateForChargeItemsAndChargesInvoiceItemPricesItemSchema = zod_1.z.object({
834
+ item_price_id: zod_1.z.string().max(100).optional(),
835
+ quantity: zod_1.z.number().int().min(1).optional(),
836
+ quantity_in_decimal: zod_1.z.string().max(33).optional(),
837
+ unit_price: zod_1.z.number().int().min(0).optional(),
838
+ unit_price_in_decimal: zod_1.z.string().max(39).optional(),
839
+ date_from: zod_1.z.number().int().optional(),
840
+ date_to: zod_1.z.number().int().optional(),
841
+ description: zod_1.z.string().max(250).optional(),
842
+ entity_description: zod_1.z.string().max(2000).optional(),
843
+ });
776
844
  const CreateForChargeItemsAndChargesInvoiceItemPricesSchema = zod_1.z.object({
777
845
  item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
778
846
  quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
@@ -784,6 +852,17 @@ const CreateForChargeItemsAndChargesInvoiceItemPricesSchema = zod_1.z.object({
784
852
  description: zod_1.z.array(zod_1.z.string().max(250).optional()).optional(),
785
853
  entity_description: zod_1.z.array(zod_1.z.string().max(2000).optional()).optional(),
786
854
  });
855
+ const CreateForChargeItemsAndChargesInvoiceItemTiersItemSchema = zod_1.z.object({
856
+ item_price_id: zod_1.z.string().max(100).optional(),
857
+ starting_unit: zod_1.z.number().int().min(1).optional(),
858
+ ending_unit: zod_1.z.number().int().optional(),
859
+ price: zod_1.z.number().int().min(0).optional(),
860
+ starting_unit_in_decimal: zod_1.z.string().max(33).optional(),
861
+ ending_unit_in_decimal: zod_1.z.string().max(33).optional(),
862
+ price_in_decimal: zod_1.z.string().max(39).optional(),
863
+ pricing_type: zod_1.z.enum(['per_unit', 'flat_fee', 'package']).optional(),
864
+ package_size: zod_1.z.number().int().min(1).optional(),
865
+ });
787
866
  const CreateForChargeItemsAndChargesInvoiceItemTiersSchema = zod_1.z.object({
788
867
  item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
789
868
  starting_unit: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
@@ -797,6 +876,24 @@ const CreateForChargeItemsAndChargesInvoiceItemTiersSchema = zod_1.z.object({
797
876
  .optional(),
798
877
  package_size: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
799
878
  });
879
+ const CreateForChargeItemsAndChargesInvoiceChargesItemSchema = zod_1.z.object({
880
+ entity_description: zod_1.z.string().max(2000).optional(),
881
+ amount: zod_1.z.number().int().min(1).optional(),
882
+ amount_in_decimal: zod_1.z.string().max(39).optional(),
883
+ description: zod_1.z.string().max(250).optional(),
884
+ taxable: zod_1.z.boolean().default(true).optional(),
885
+ tax_profile_id: zod_1.z.string().max(50).optional(),
886
+ avalara_tax_code: zod_1.z.string().max(50).optional(),
887
+ hsn_code: zod_1.z.string().max(50).optional(),
888
+ taxjar_product_code: zod_1.z.string().max(50).optional(),
889
+ avalara_sale_type: zod_1.z
890
+ .enum(['wholesale', 'retail', 'consumed', 'vendor_use'])
891
+ .optional(),
892
+ avalara_transaction_type: zod_1.z.number().int().optional(),
893
+ avalara_service_type: zod_1.z.number().int().optional(),
894
+ date_from: zod_1.z.number().int().optional(),
895
+ date_to: zod_1.z.number().int().optional(),
896
+ });
800
897
  const CreateForChargeItemsAndChargesInvoiceChargesSchema = zod_1.z.object({
801
898
  entity_description: zod_1.z.array(zod_1.z.string().max(2000).optional()).optional(),
802
899
  amount: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
@@ -815,6 +912,19 @@ const CreateForChargeItemsAndChargesInvoiceChargesSchema = zod_1.z.object({
815
912
  date_from: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
816
913
  date_to: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
817
914
  });
915
+ const CreateForChargeItemsAndChargesInvoiceNotesToRemoveItemSchema = zod_1.z.object({
916
+ entity_type: zod_1.z
917
+ .enum([
918
+ 'customer',
919
+ 'subscription',
920
+ 'coupon',
921
+ 'plan_item_price',
922
+ 'addon_item_price',
923
+ 'charge_item_price',
924
+ ])
925
+ .optional(),
926
+ entity_id: zod_1.z.string().max(100).optional(),
927
+ });
818
928
  const CreateForChargeItemsAndChargesInvoiceNotesToRemoveSchema = zod_1.z.object({
819
929
  entity_type: zod_1.z
820
930
  .array(zod_1.z
@@ -830,11 +940,23 @@ const CreateForChargeItemsAndChargesInvoiceNotesToRemoveSchema = zod_1.z.object(
830
940
  .optional(),
831
941
  entity_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
832
942
  });
943
+ const CreateForChargeItemsAndChargesInvoiceTaxProvidersFieldsItemSchema = zod_1.z.object({
944
+ provider_name: zod_1.z.string().max(50).optional(),
945
+ field_id: zod_1.z.string().max(50).optional(),
946
+ field_value: zod_1.z.string().max(50).optional(),
947
+ });
833
948
  const CreateForChargeItemsAndChargesInvoiceTaxProvidersFieldsSchema = zod_1.z.object({
834
949
  provider_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
835
950
  field_id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
836
951
  field_value: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
837
952
  });
953
+ const CreateForChargeItemsAndChargesInvoiceDiscountsItemSchema = zod_1.z.object({
954
+ percentage: zod_1.z.number().min(0.01).max(100).optional(),
955
+ amount: zod_1.z.number().int().min(0).optional(),
956
+ quantity: zod_1.z.number().int().min(1).optional(),
957
+ apply_on: zod_1.z.enum(['invoice_amount', 'specific_item_price']),
958
+ item_price_id: zod_1.z.string().max(100).optional(),
959
+ });
838
960
  const CreateForChargeItemsAndChargesInvoiceDiscountsSchema = zod_1.z.object({
839
961
  percentage: zod_1.z.array(zod_1.z.number().min(0.01).max(100).optional()).optional(),
840
962
  amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
@@ -855,6 +977,23 @@ const CreateForChargeItemsAndChargesInvoiceBodySchema = zod_1.z.looseObject({
855
977
  payment_source_id: zod_1.z.string().max(40).optional(),
856
978
  auto_collection: zod_1.z.enum(['on', 'off']).optional(),
857
979
  net_term_days: zod_1.z.number().int().optional(),
980
+ offline_payment_method: zod_1.z
981
+ .enum([
982
+ 'no_preference',
983
+ 'cash',
984
+ 'check',
985
+ 'bank_transfer',
986
+ 'ach_credit',
987
+ 'sepa_credit',
988
+ 'boleto',
989
+ 'us_automated_bank_transfer',
990
+ 'eu_automated_bank_transfer',
991
+ 'uk_automated_bank_transfer',
992
+ 'jp_automated_bank_transfer',
993
+ 'mx_automated_bank_transfer',
994
+ 'custom',
995
+ ])
996
+ .optional(),
858
997
  invoice_date: zod_1.z.number().int().optional(),
859
998
  create_pending_invoice: zod_1.z.boolean().optional(),
860
999
  token_id: zod_1.z.string().max(40).optional(),
@@ -867,15 +1006,50 @@ const CreateForChargeItemsAndChargesInvoiceBodySchema = zod_1.z.looseObject({
867
1006
  bank_account: CreateForChargeItemsAndChargesInvoiceBankAccountSchema.optional(),
868
1007
  payment_method: CreateForChargeItemsAndChargesInvoicePaymentMethodSchema.optional(),
869
1008
  payment_intent: CreateForChargeItemsAndChargesInvoicePaymentIntentSchema.optional(),
870
- item_prices: CreateForChargeItemsAndChargesInvoiceItemPricesSchema.optional(),
871
- item_tiers: CreateForChargeItemsAndChargesInvoiceItemTiersSchema.optional(),
872
- charges: CreateForChargeItemsAndChargesInvoiceChargesSchema.optional(),
873
- notes_to_remove: CreateForChargeItemsAndChargesInvoiceNotesToRemoveSchema.optional(),
874
- tax_providers_fields: CreateForChargeItemsAndChargesInvoiceTaxProvidersFieldsSchema.optional(),
875
- discounts: CreateForChargeItemsAndChargesInvoiceDiscountsSchema.optional(),
1009
+ item_prices: zod_1.z
1010
+ .union([
1011
+ zod_1.z.array(CreateForChargeItemsAndChargesInvoiceItemPricesItemSchema.optional()),
1012
+ CreateForChargeItemsAndChargesInvoiceItemPricesSchema,
1013
+ ])
1014
+ .optional(),
1015
+ item_tiers: zod_1.z
1016
+ .union([
1017
+ zod_1.z.array(CreateForChargeItemsAndChargesInvoiceItemTiersItemSchema.optional()),
1018
+ CreateForChargeItemsAndChargesInvoiceItemTiersSchema,
1019
+ ])
1020
+ .optional(),
1021
+ charges: zod_1.z
1022
+ .union([
1023
+ zod_1.z.array(CreateForChargeItemsAndChargesInvoiceChargesItemSchema.optional()),
1024
+ CreateForChargeItemsAndChargesInvoiceChargesSchema,
1025
+ ])
1026
+ .optional(),
1027
+ notes_to_remove: zod_1.z
1028
+ .union([
1029
+ zod_1.z.array(CreateForChargeItemsAndChargesInvoiceNotesToRemoveItemSchema.optional()),
1030
+ CreateForChargeItemsAndChargesInvoiceNotesToRemoveSchema,
1031
+ ])
1032
+ .optional(),
1033
+ tax_providers_fields: zod_1.z
1034
+ .union([
1035
+ zod_1.z.array(CreateForChargeItemsAndChargesInvoiceTaxProvidersFieldsItemSchema.optional()),
1036
+ CreateForChargeItemsAndChargesInvoiceTaxProvidersFieldsSchema,
1037
+ ])
1038
+ .optional(),
1039
+ discounts: zod_1.z
1040
+ .union([
1041
+ zod_1.z.array(CreateForChargeItemsAndChargesInvoiceDiscountsItemSchema.optional()),
1042
+ CreateForChargeItemsAndChargesInvoiceDiscountsSchema,
1043
+ ])
1044
+ .optional(),
876
1045
  });
877
1046
  exports.CreateForChargeItemsAndChargesInvoiceBodySchema = CreateForChargeItemsAndChargesInvoiceBodySchema;
878
1047
  //Invoice.charge
1048
+ const ChargeInvoiceTaxProvidersFieldsItemSchema = zod_1.z.object({
1049
+ provider_name: zod_1.z.string().max(50).optional(),
1050
+ field_id: zod_1.z.string().max(50).optional(),
1051
+ field_value: zod_1.z.string().max(50).optional(),
1052
+ });
879
1053
  const ChargeInvoiceTaxProvidersFieldsSchema = zod_1.z.object({
880
1054
  provider_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
881
1055
  field_id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
@@ -901,7 +1075,12 @@ const ChargeInvoiceBodySchema = zod_1.z.looseObject({
901
1075
  invoice_date: zod_1.z.number().int().optional(),
902
1076
  payment_source_id: zod_1.z.string().max(40).optional(),
903
1077
  payment_initiator: zod_1.z.enum(['customer', 'merchant']).optional(),
904
- tax_providers_fields: ChargeInvoiceTaxProvidersFieldsSchema.optional(),
1078
+ tax_providers_fields: zod_1.z
1079
+ .union([
1080
+ zod_1.z.array(ChargeInvoiceTaxProvidersFieldsItemSchema.optional()),
1081
+ ChargeInvoiceTaxProvidersFieldsSchema,
1082
+ ])
1083
+ .optional(),
905
1084
  });
906
1085
  exports.ChargeInvoiceBodySchema = ChargeInvoiceBodySchema;
907
1086
  //Invoice.chargeAddon
@@ -933,6 +1112,16 @@ const CreateForChargeItemInvoiceItemPriceSchema = zod_1.z.object({
933
1112
  date_from: zod_1.z.number().int().optional(),
934
1113
  date_to: zod_1.z.number().int().optional(),
935
1114
  });
1115
+ const CreateForChargeItemInvoiceItemTiersItemSchema = zod_1.z.object({
1116
+ starting_unit: zod_1.z.number().int().min(1).optional(),
1117
+ ending_unit: zod_1.z.number().int().optional(),
1118
+ price: zod_1.z.number().int().min(0).optional(),
1119
+ starting_unit_in_decimal: zod_1.z.string().max(33).optional(),
1120
+ ending_unit_in_decimal: zod_1.z.string().max(33).optional(),
1121
+ price_in_decimal: zod_1.z.string().max(39).optional(),
1122
+ pricing_type: zod_1.z.enum(['per_unit', 'flat_fee', 'package']).optional(),
1123
+ package_size: zod_1.z.number().int().min(1).optional(),
1124
+ });
936
1125
  const CreateForChargeItemInvoiceItemTiersSchema = zod_1.z.object({
937
1126
  starting_unit: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
938
1127
  ending_unit: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
@@ -954,7 +1143,12 @@ const CreateForChargeItemInvoiceBodySchema = zod_1.z.looseObject({
954
1143
  payment_initiator: zod_1.z.enum(['customer', 'merchant']).optional(),
955
1144
  invoice_date: zod_1.z.number().int().optional(),
956
1145
  item_price: CreateForChargeItemInvoiceItemPriceSchema.optional(),
957
- item_tiers: CreateForChargeItemInvoiceItemTiersSchema.optional(),
1146
+ item_tiers: zod_1.z
1147
+ .union([
1148
+ zod_1.z.array(CreateForChargeItemInvoiceItemTiersItemSchema.optional()),
1149
+ CreateForChargeItemInvoiceItemTiersSchema,
1150
+ ])
1151
+ .optional(),
958
1152
  });
959
1153
  exports.CreateForChargeItemInvoiceBodySchema = CreateForChargeItemInvoiceBodySchema;
960
1154
  //Invoice.stopDunning
@@ -1013,6 +1207,74 @@ const ImportInvoiceInvoiceShippingAddressSchema = zod_1.z.object({
1013
1207
  .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
1014
1208
  .optional(),
1015
1209
  });
1210
+ const ImportInvoiceInvoiceLineItemsItemSchema = zod_1.z.object({
1211
+ id: zod_1.z.string().max(40).optional(),
1212
+ date_from: zod_1.z.number().int().optional(),
1213
+ date_to: zod_1.z.number().int().optional(),
1214
+ subscription_id: zod_1.z.string().max(50).optional(),
1215
+ description: zod_1.z.string().max(250),
1216
+ unit_amount: zod_1.z.number().int().optional(),
1217
+ quantity: zod_1.z.number().int().optional(),
1218
+ amount: zod_1.z.number().int().optional(),
1219
+ unit_amount_in_decimal: zod_1.z.string().max(39).optional(),
1220
+ quantity_in_decimal: zod_1.z.string().max(33).optional(),
1221
+ amount_in_decimal: zod_1.z.string().max(39).optional(),
1222
+ entity_type: zod_1.z
1223
+ .enum([
1224
+ 'adhoc',
1225
+ 'plan_item_price',
1226
+ 'addon_item_price',
1227
+ 'charge_item_price',
1228
+ 'plan_setup',
1229
+ 'plan',
1230
+ 'addon',
1231
+ ])
1232
+ .optional(),
1233
+ entity_id: zod_1.z.string().max(100).optional(),
1234
+ item_level_discount1_entity_id: zod_1.z.string().max(100).optional(),
1235
+ item_level_discount1_amount: zod_1.z.number().int().min(0).optional(),
1236
+ item_level_discount2_entity_id: zod_1.z.string().max(100).optional(),
1237
+ item_level_discount2_amount: zod_1.z.number().int().min(0).optional(),
1238
+ tax1_name: zod_1.z.string().max(50).optional(),
1239
+ tax1_amount: zod_1.z.number().int().min(0).optional(),
1240
+ tax2_name: zod_1.z.string().max(50).optional(),
1241
+ tax2_amount: zod_1.z.number().int().min(0).optional(),
1242
+ tax3_name: zod_1.z.string().max(50).optional(),
1243
+ tax3_amount: zod_1.z.number().int().min(0).optional(),
1244
+ tax4_name: zod_1.z.string().max(50).optional(),
1245
+ tax4_amount: zod_1.z.number().int().min(0).optional(),
1246
+ tax5_name: zod_1.z.string().max(50).optional(),
1247
+ tax5_amount: zod_1.z.number().int().min(0).optional(),
1248
+ tax6_name: zod_1.z.string().max(50).optional(),
1249
+ tax6_amount: zod_1.z.number().int().min(0).optional(),
1250
+ tax7_name: zod_1.z.string().max(50).optional(),
1251
+ tax7_amount: zod_1.z.number().int().min(0).optional(),
1252
+ tax8_name: zod_1.z.string().max(50).optional(),
1253
+ tax8_amount: zod_1.z.number().int().min(0).optional(),
1254
+ tax9_name: zod_1.z.string().max(50).optional(),
1255
+ tax9_amount: zod_1.z.number().int().min(0).optional(),
1256
+ tax10_name: zod_1.z.string().max(50).optional(),
1257
+ tax10_amount: zod_1.z.number().int().min(0).optional(),
1258
+ is_partial_tax_applied: zod_1.z.boolean().optional(),
1259
+ taxable_amount: zod_1.z.number().int().min(0).optional(),
1260
+ tax_exempt_reason: zod_1.z
1261
+ .enum([
1262
+ 'region_non_taxable',
1263
+ 'export',
1264
+ 'customer_exempt',
1265
+ 'product_exempt',
1266
+ 'zero_rated',
1267
+ 'reverse_charge',
1268
+ 'high_value_physical_goods',
1269
+ 'zero_value_item',
1270
+ 'tax_not_configured_external_provider',
1271
+ ])
1272
+ .optional(),
1273
+ proration_mode: zod_1.z
1274
+ .enum(['reset', 'delta', 'service_period_revision', 'adjusted_term'])
1275
+ .optional(),
1276
+ created_at: zod_1.z.number().int().optional(),
1277
+ });
1016
1278
  const ImportInvoiceInvoiceLineItemsSchema = zod_1.z.object({
1017
1279
  id: zod_1.z.array(zod_1.z.string().max(40).optional()).optional(),
1018
1280
  date_from: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
@@ -1095,11 +1357,27 @@ const ImportInvoiceInvoiceLineItemsSchema = zod_1.z.object({
1095
1357
  .optional(),
1096
1358
  created_at: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
1097
1359
  });
1360
+ const ImportInvoiceInvoicePaymentReferenceNumbersItemSchema = zod_1.z.object({
1361
+ id: zod_1.z.string().max(40).optional(),
1362
+ type: zod_1.z.enum(['kid', 'ocr', 'frn', 'fik', 'swiss_reference']),
1363
+ number: zod_1.z.string().max(100),
1364
+ });
1098
1365
  const ImportInvoiceInvoicePaymentReferenceNumbersSchema = zod_1.z.object({
1099
1366
  id: zod_1.z.array(zod_1.z.string().max(40).optional()).optional(),
1100
1367
  type: zod_1.z.array(zod_1.z.enum(['kid', 'ocr', 'frn', 'fik', 'swiss_reference']).optional()),
1101
1368
  number: zod_1.z.array(zod_1.z.string().max(100).optional()),
1102
1369
  });
1370
+ const ImportInvoiceInvoiceLineItemTiersItemSchema = zod_1.z.object({
1371
+ line_item_id: zod_1.z.string().max(40),
1372
+ starting_unit: zod_1.z.number().int().min(0).optional(),
1373
+ ending_unit: zod_1.z.number().int().optional(),
1374
+ quantity_used: zod_1.z.number().int().min(0).optional(),
1375
+ unit_amount: zod_1.z.number().int().min(0).optional(),
1376
+ starting_unit_in_decimal: zod_1.z.string().max(33).optional(),
1377
+ ending_unit_in_decimal: zod_1.z.string().max(33).optional(),
1378
+ quantity_used_in_decimal: zod_1.z.string().max(33).optional(),
1379
+ unit_amount_in_decimal: zod_1.z.string().max(40).optional(),
1380
+ });
1103
1381
  const ImportInvoiceInvoiceLineItemTiersSchema = zod_1.z.object({
1104
1382
  line_item_id: zod_1.z.array(zod_1.z.string().max(40).optional()),
1105
1383
  starting_unit: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
@@ -1111,6 +1389,19 @@ const ImportInvoiceInvoiceLineItemTiersSchema = zod_1.z.object({
1111
1389
  quantity_used_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
1112
1390
  unit_amount_in_decimal: zod_1.z.array(zod_1.z.string().max(40).optional()).optional(),
1113
1391
  });
1392
+ const ImportInvoiceInvoiceDiscountsItemSchema = zod_1.z.object({
1393
+ line_item_id: zod_1.z.string().max(40).optional(),
1394
+ entity_type: zod_1.z.enum([
1395
+ 'item_level_coupon',
1396
+ 'document_level_coupon',
1397
+ 'promotional_credits',
1398
+ 'item_level_discount',
1399
+ 'document_level_discount',
1400
+ ]),
1401
+ entity_id: zod_1.z.string().max(100).optional(),
1402
+ description: zod_1.z.string().max(250).optional(),
1403
+ amount: zod_1.z.number().int().min(0),
1404
+ });
1114
1405
  const ImportInvoiceInvoiceDiscountsSchema = zod_1.z.object({
1115
1406
  line_item_id: zod_1.z.array(zod_1.z.string().max(40).optional()).optional(),
1116
1407
  entity_type: zod_1.z.array(zod_1.z
@@ -1126,6 +1417,26 @@ const ImportInvoiceInvoiceDiscountsSchema = zod_1.z.object({
1126
1417
  description: zod_1.z.array(zod_1.z.string().max(250).optional()).optional(),
1127
1418
  amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()),
1128
1419
  });
1420
+ const ImportInvoiceInvoiceTaxesItemSchema = zod_1.z.object({
1421
+ name: zod_1.z.string().max(100),
1422
+ rate: zod_1.z.number().min(0).max(100),
1423
+ amount: zod_1.z.number().int().min(0).optional(),
1424
+ description: zod_1.z.string().max(50).optional(),
1425
+ juris_type: zod_1.z
1426
+ .enum([
1427
+ 'country',
1428
+ 'federal',
1429
+ 'state',
1430
+ 'county',
1431
+ 'city',
1432
+ 'special',
1433
+ 'unincorporated',
1434
+ 'other',
1435
+ ])
1436
+ .optional(),
1437
+ juris_name: zod_1.z.string().max(250).optional(),
1438
+ juris_code: zod_1.z.string().max(250).optional(),
1439
+ });
1129
1440
  const ImportInvoiceInvoiceTaxesSchema = zod_1.z.object({
1130
1441
  name: zod_1.z.array(zod_1.z.string().max(100).optional()),
1131
1442
  rate: zod_1.z.array(zod_1.z.number().min(0).max(100).optional()),
@@ -1148,6 +1459,21 @@ const ImportInvoiceInvoiceTaxesSchema = zod_1.z.object({
1148
1459
  juris_name: zod_1.z.array(zod_1.z.string().max(250).optional()).optional(),
1149
1460
  juris_code: zod_1.z.array(zod_1.z.string().max(250).optional()).optional(),
1150
1461
  });
1462
+ const ImportInvoiceInvoicePaymentsItemSchema = zod_1.z.object({
1463
+ id: zod_1.z.string().max(40).optional(),
1464
+ amount: zod_1.z.number().int().min(1),
1465
+ payment_method: zod_1.z.enum([
1466
+ 'cash',
1467
+ 'check',
1468
+ 'bank_transfer',
1469
+ 'other',
1470
+ 'app_store',
1471
+ 'play_store',
1472
+ 'custom',
1473
+ ]),
1474
+ date: zod_1.z.number().int().optional(),
1475
+ reference_number: zod_1.z.string().max(100).min(1).optional(),
1476
+ });
1151
1477
  const ImportInvoiceInvoicePaymentsSchema = zod_1.z.object({
1152
1478
  id: zod_1.z.array(zod_1.z.string().max(40).optional()).optional(),
1153
1479
  amount: zod_1.z.array(zod_1.z.number().int().min(1).optional()),
@@ -1160,17 +1486,25 @@ const ImportInvoiceInvoicePaymentsSchema = zod_1.z.object({
1160
1486
  'app_store',
1161
1487
  'play_store',
1162
1488
  'custom',
1163
- 'tamara',
1164
- 'qpay',
1165
- 'blik',
1166
- 'fpx',
1167
- 'wero',
1168
- 'p24',
1169
1489
  ])
1170
1490
  .optional()),
1171
1491
  date: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
1172
1492
  reference_number: zod_1.z.array(zod_1.z.string().max(100).min(1).optional()).optional(),
1173
1493
  });
1494
+ const ImportInvoiceInvoiceNotesItemSchema = zod_1.z.object({
1495
+ entity_type: zod_1.z
1496
+ .enum([
1497
+ 'coupon',
1498
+ 'plan_item_price',
1499
+ 'addon_item_price',
1500
+ 'charge_item_price',
1501
+ 'plan',
1502
+ 'addon',
1503
+ ])
1504
+ .optional(),
1505
+ entity_id: zod_1.z.string().max(50).optional(),
1506
+ note: zod_1.z.string().max(65000).optional(),
1507
+ });
1174
1508
  const ImportInvoiceInvoiceNotesSchema = zod_1.z.object({
1175
1509
  entity_type: zod_1.z
1176
1510
  .array(zod_1.z
@@ -1187,6 +1521,25 @@ const ImportInvoiceInvoiceNotesSchema = zod_1.z.object({
1187
1521
  entity_id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
1188
1522
  note: zod_1.z.array(zod_1.z.string().max(65000).optional()).optional(),
1189
1523
  });
1524
+ const ImportInvoiceInvoiceLineItemAddressesItemSchema = zod_1.z.object({
1525
+ line_item_id: zod_1.z.string().max(40).optional(),
1526
+ first_name: zod_1.z.string().max(150).optional(),
1527
+ last_name: zod_1.z.string().max(150).optional(),
1528
+ email: zod_1.z.string().email().max(70).optional(),
1529
+ company: zod_1.z.string().max(250).optional(),
1530
+ phone: zod_1.z.string().max(50).optional(),
1531
+ line1: zod_1.z.string().max(150).optional(),
1532
+ line2: zod_1.z.string().max(150).optional(),
1533
+ line3: zod_1.z.string().max(150).optional(),
1534
+ city: zod_1.z.string().max(50).optional(),
1535
+ state_code: zod_1.z.string().max(50).optional(),
1536
+ state: zod_1.z.string().max(50).optional(),
1537
+ zip: zod_1.z.string().max(20).optional(),
1538
+ country: zod_1.z.string().max(50).optional(),
1539
+ validation_status: zod_1.z
1540
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
1541
+ .optional(),
1542
+ });
1190
1543
  const ImportInvoiceInvoiceLineItemAddressesSchema = zod_1.z.object({
1191
1544
  line_item_id: zod_1.z.array(zod_1.z.string().max(40).optional()).optional(),
1192
1545
  first_name: zod_1.z.array(zod_1.z.string().max(150).optional()).optional(),
@@ -1249,41 +1602,110 @@ const ImportInvoiceInvoiceBodySchema = zod_1.z.looseObject({
1249
1602
  credit_note: ImportInvoiceInvoiceCreditNoteSchema.optional(),
1250
1603
  billing_address: ImportInvoiceInvoiceBillingAddressSchema.optional(),
1251
1604
  shipping_address: ImportInvoiceInvoiceShippingAddressSchema.optional(),
1252
- line_items: ImportInvoiceInvoiceLineItemsSchema.optional(),
1253
- payment_reference_numbers: ImportInvoiceInvoicePaymentReferenceNumbersSchema.optional(),
1254
- line_item_tiers: ImportInvoiceInvoiceLineItemTiersSchema.optional(),
1255
- discounts: ImportInvoiceInvoiceDiscountsSchema.optional(),
1256
- taxes: ImportInvoiceInvoiceTaxesSchema.optional(),
1257
- payments: ImportInvoiceInvoicePaymentsSchema.optional(),
1258
- notes: ImportInvoiceInvoiceNotesSchema.optional(),
1259
- line_item_addresses: ImportInvoiceInvoiceLineItemAddressesSchema.optional(),
1605
+ line_items: zod_1.z
1606
+ .union([
1607
+ zod_1.z.array(ImportInvoiceInvoiceLineItemsItemSchema.optional()),
1608
+ ImportInvoiceInvoiceLineItemsSchema,
1609
+ ])
1610
+ .optional(),
1611
+ payment_reference_numbers: zod_1.z
1612
+ .union([
1613
+ zod_1.z.array(ImportInvoiceInvoicePaymentReferenceNumbersItemSchema.optional()),
1614
+ ImportInvoiceInvoicePaymentReferenceNumbersSchema,
1615
+ ])
1616
+ .optional(),
1617
+ line_item_tiers: zod_1.z
1618
+ .union([
1619
+ zod_1.z.array(ImportInvoiceInvoiceLineItemTiersItemSchema.optional()),
1620
+ ImportInvoiceInvoiceLineItemTiersSchema,
1621
+ ])
1622
+ .optional(),
1623
+ discounts: zod_1.z
1624
+ .union([
1625
+ zod_1.z.array(ImportInvoiceInvoiceDiscountsItemSchema.optional()),
1626
+ ImportInvoiceInvoiceDiscountsSchema,
1627
+ ])
1628
+ .optional(),
1629
+ taxes: zod_1.z
1630
+ .union([
1631
+ zod_1.z.array(ImportInvoiceInvoiceTaxesItemSchema.optional()),
1632
+ ImportInvoiceInvoiceTaxesSchema,
1633
+ ])
1634
+ .optional(),
1635
+ payments: zod_1.z
1636
+ .union([
1637
+ zod_1.z.array(ImportInvoiceInvoicePaymentsItemSchema.optional()),
1638
+ ImportInvoiceInvoicePaymentsSchema,
1639
+ ])
1640
+ .optional(),
1641
+ notes: zod_1.z
1642
+ .union([
1643
+ zod_1.z.array(ImportInvoiceInvoiceNotesItemSchema.optional()),
1644
+ ImportInvoiceInvoiceNotesSchema,
1645
+ ])
1646
+ .optional(),
1647
+ line_item_addresses: zod_1.z
1648
+ .union([
1649
+ zod_1.z.array(ImportInvoiceInvoiceLineItemAddressesItemSchema.optional()),
1650
+ ImportInvoiceInvoiceLineItemAddressesSchema,
1651
+ ])
1652
+ .optional(),
1260
1653
  });
1261
1654
  exports.ImportInvoiceInvoiceBodySchema = ImportInvoiceInvoiceBodySchema;
1262
1655
  //Invoice.applyPayments
1656
+ const ApplyPaymentsInvoiceTransactionsItemSchema = zod_1.z.object({
1657
+ id: zod_1.z.string().max(40).optional(),
1658
+ amount: zod_1.z.number().int().min(0).optional(),
1659
+ });
1263
1660
  const ApplyPaymentsInvoiceTransactionsSchema = zod_1.z.object({
1264
1661
  id: zod_1.z.array(zod_1.z.string().max(40).optional()).optional(),
1265
1662
  amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
1266
1663
  });
1267
1664
  const ApplyPaymentsInvoiceBodySchema = zod_1.z.looseObject({
1268
1665
  comment: zod_1.z.string().max(300).optional(),
1269
- transactions: ApplyPaymentsInvoiceTransactionsSchema.optional(),
1666
+ transactions: zod_1.z
1667
+ .union([
1668
+ zod_1.z.array(ApplyPaymentsInvoiceTransactionsItemSchema.optional()),
1669
+ ApplyPaymentsInvoiceTransactionsSchema,
1670
+ ])
1671
+ .optional(),
1270
1672
  });
1271
1673
  exports.ApplyPaymentsInvoiceBodySchema = ApplyPaymentsInvoiceBodySchema;
1272
1674
  //Invoice.deleteLineItems
1675
+ const DeleteLineItemsInvoiceLineItemsItemSchema = zod_1.z.object({
1676
+ id: zod_1.z.string().max(40).optional(),
1677
+ });
1273
1678
  const DeleteLineItemsInvoiceLineItemsSchema = zod_1.z.object({
1274
1679
  id: zod_1.z.array(zod_1.z.string().max(40).optional()).optional(),
1275
1680
  });
1276
1681
  const DeleteLineItemsInvoiceBodySchema = zod_1.z.looseObject({
1277
- line_items: DeleteLineItemsInvoiceLineItemsSchema.optional(),
1682
+ line_items: zod_1.z
1683
+ .union([
1684
+ zod_1.z.array(DeleteLineItemsInvoiceLineItemsItemSchema.optional()),
1685
+ DeleteLineItemsInvoiceLineItemsSchema,
1686
+ ])
1687
+ .optional(),
1278
1688
  });
1279
1689
  exports.DeleteLineItemsInvoiceBodySchema = DeleteLineItemsInvoiceBodySchema;
1280
1690
  //Invoice.applyCredits
1691
+ const ApplyCreditsInvoiceCreditNotesItemSchema = zod_1.z.object({
1692
+ id: zod_1.z.string().max(50).optional(),
1693
+ amount: zod_1.z.number().int().min(1).optional(),
1694
+ applied_at: zod_1.z.number().int().optional(),
1695
+ });
1281
1696
  const ApplyCreditsInvoiceCreditNotesSchema = zod_1.z.object({
1282
1697
  id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
1698
+ amount: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
1699
+ applied_at: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
1283
1700
  });
1284
1701
  const ApplyCreditsInvoiceBodySchema = zod_1.z.looseObject({
1285
1702
  comment: zod_1.z.string().max(300).optional(),
1286
- credit_notes: ApplyCreditsInvoiceCreditNotesSchema.optional(),
1703
+ credit_notes: zod_1.z
1704
+ .union([
1705
+ zod_1.z.array(ApplyCreditsInvoiceCreditNotesItemSchema.optional()),
1706
+ ApplyCreditsInvoiceCreditNotesSchema,
1707
+ ])
1708
+ .optional(),
1287
1709
  });
1288
1710
  exports.ApplyCreditsInvoiceBodySchema = ApplyCreditsInvoiceBodySchema;
1289
1711
  //Invoice.list
@@ -1291,26 +1713,56 @@ const ListInvoiceIdSchema = zod_1.z.object({
1291
1713
  is: zod_1.z.string().min(1).optional(),
1292
1714
  is_not: zod_1.z.string().min(1).optional(),
1293
1715
  starts_with: zod_1.z.string().min(1).optional(),
1294
- in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1295
- not_in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1716
+ in: zod_1.z
1717
+ .union([
1718
+ zod_1.z.array(zod_1.z.string().optional()),
1719
+ zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
1720
+ ])
1721
+ .optional(),
1722
+ not_in: zod_1.z
1723
+ .union([
1724
+ zod_1.z.array(zod_1.z.string().optional()),
1725
+ zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
1726
+ ])
1727
+ .optional(),
1296
1728
  });
1297
1729
  const ListInvoiceSubscriptionIdSchema = zod_1.z.object({
1298
1730
  is: zod_1.z.string().min(1).optional(),
1299
1731
  is_not: zod_1.z.string().min(1).optional(),
1300
1732
  starts_with: zod_1.z.string().min(1).optional(),
1301
- is_present: zod_1.z.enum(['true', 'false']).optional(),
1302
- in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1303
- not_in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1733
+ is_present: zod_1.z.union([zod_1.z.boolean(), zod_1.z.enum(['true', 'false'])]).optional(),
1734
+ in: zod_1.z
1735
+ .union([
1736
+ zod_1.z.array(zod_1.z.string().optional()),
1737
+ zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
1738
+ ])
1739
+ .optional(),
1740
+ not_in: zod_1.z
1741
+ .union([
1742
+ zod_1.z.array(zod_1.z.string().optional()),
1743
+ zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
1744
+ ])
1745
+ .optional(),
1304
1746
  });
1305
1747
  const ListInvoiceCustomerIdSchema = zod_1.z.object({
1306
1748
  is: zod_1.z.string().min(1).optional(),
1307
1749
  is_not: zod_1.z.string().min(1).optional(),
1308
1750
  starts_with: zod_1.z.string().min(1).optional(),
1309
- in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1310
- not_in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1751
+ in: zod_1.z
1752
+ .union([
1753
+ zod_1.z.array(zod_1.z.string().optional()),
1754
+ zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
1755
+ ])
1756
+ .optional(),
1757
+ not_in: zod_1.z
1758
+ .union([
1759
+ zod_1.z.array(zod_1.z.string().optional()),
1760
+ zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
1761
+ ])
1762
+ .optional(),
1311
1763
  });
1312
1764
  const ListInvoiceRecurringSchema = zod_1.z.object({
1313
- is: zod_1.z.enum(['true', 'false']).optional(),
1765
+ is: zod_1.z.union([zod_1.z.boolean(), zod_1.z.enum(['true', 'false'])]).optional(),
1314
1766
  });
1315
1767
  const ListInvoiceStatusSchema = zod_1.z.object({
1316
1768
  is: zod_1.z
@@ -1320,113 +1772,330 @@ const ListInvoiceStatusSchema = zod_1.z.object({
1320
1772
  .enum(['paid', 'posted', 'payment_due', 'not_paid', 'voided', 'pending'])
1321
1773
  .optional(),
1322
1774
  in: zod_1.z
1323
- .enum(['paid', 'posted', 'payment_due', 'not_paid', 'voided', 'pending'])
1775
+ .union([
1776
+ zod_1.z.array(zod_1.z
1777
+ .enum([
1778
+ 'paid',
1779
+ 'posted',
1780
+ 'payment_due',
1781
+ 'not_paid',
1782
+ 'voided',
1783
+ 'pending',
1784
+ ])
1785
+ .optional()),
1786
+ zod_1.z.enum([
1787
+ 'paid',
1788
+ 'posted',
1789
+ 'payment_due',
1790
+ 'not_paid',
1791
+ 'voided',
1792
+ 'pending',
1793
+ ]),
1794
+ ])
1324
1795
  .optional(),
1325
1796
  not_in: zod_1.z
1326
- .enum(['paid', 'posted', 'payment_due', 'not_paid', 'voided', 'pending'])
1797
+ .union([
1798
+ zod_1.z.array(zod_1.z
1799
+ .enum([
1800
+ 'paid',
1801
+ 'posted',
1802
+ 'payment_due',
1803
+ 'not_paid',
1804
+ 'voided',
1805
+ 'pending',
1806
+ ])
1807
+ .optional()),
1808
+ zod_1.z.enum([
1809
+ 'paid',
1810
+ 'posted',
1811
+ 'payment_due',
1812
+ 'not_paid',
1813
+ 'voided',
1814
+ 'pending',
1815
+ ]),
1816
+ ])
1327
1817
  .optional(),
1328
1818
  });
1329
1819
  const ListInvoicePriceTypeSchema = zod_1.z.object({
1330
1820
  is: zod_1.z.enum(['tax_exclusive', 'tax_inclusive']).optional(),
1331
1821
  is_not: zod_1.z.enum(['tax_exclusive', 'tax_inclusive']).optional(),
1332
- in: zod_1.z.enum(['tax_exclusive', 'tax_inclusive']).optional(),
1333
- not_in: zod_1.z.enum(['tax_exclusive', 'tax_inclusive']).optional(),
1822
+ in: zod_1.z
1823
+ .union([
1824
+ zod_1.z.array(zod_1.z.enum(['tax_exclusive', 'tax_inclusive']).optional()),
1825
+ zod_1.z.enum(['tax_exclusive', 'tax_inclusive']),
1826
+ ])
1827
+ .optional(),
1828
+ not_in: zod_1.z
1829
+ .union([
1830
+ zod_1.z.array(zod_1.z.enum(['tax_exclusive', 'tax_inclusive']).optional()),
1831
+ zod_1.z.enum(['tax_exclusive', 'tax_inclusive']),
1832
+ ])
1833
+ .optional(),
1334
1834
  });
1335
1835
  const ListInvoiceDateSchema = zod_1.z.object({
1336
- after: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
1337
- before: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
1338
- on: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
1339
- between: zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
1836
+ after: zod_1.z
1837
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
1838
+ .optional(),
1839
+ before: zod_1.z
1840
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
1841
+ .optional(),
1842
+ on: zod_1.z
1843
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
1844
+ .optional(),
1845
+ between: zod_1.z
1846
+ .union([
1847
+ zod_1.z.array(zod_1.z.number().int().optional()).min(2).max(2),
1848
+ zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
1849
+ ])
1850
+ .optional(),
1340
1851
  });
1341
1852
  const ListInvoicePaidAtSchema = zod_1.z.object({
1342
- after: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
1343
- before: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
1344
- on: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
1345
- between: zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
1853
+ after: zod_1.z
1854
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
1855
+ .optional(),
1856
+ before: zod_1.z
1857
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
1858
+ .optional(),
1859
+ on: zod_1.z
1860
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
1861
+ .optional(),
1862
+ between: zod_1.z
1863
+ .union([
1864
+ zod_1.z.array(zod_1.z.number().int().optional()).min(2).max(2),
1865
+ zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
1866
+ ])
1867
+ .optional(),
1346
1868
  });
1347
1869
  const ListInvoiceTotalSchema = zod_1.z.object({
1348
- is: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
1349
- is_not: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
1350
- lt: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
1351
- lte: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
1352
- gt: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
1353
- gte: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
1354
- between: zod_1.z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')).optional(),
1870
+ is: zod_1.z
1871
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
1872
+ .optional(),
1873
+ is_not: zod_1.z
1874
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
1875
+ .optional(),
1876
+ lt: zod_1.z
1877
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
1878
+ .optional(),
1879
+ lte: zod_1.z
1880
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
1881
+ .optional(),
1882
+ gt: zod_1.z
1883
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
1884
+ .optional(),
1885
+ gte: zod_1.z
1886
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
1887
+ .optional(),
1888
+ between: zod_1.z
1889
+ .union([
1890
+ zod_1.z.array(zod_1.z.number().int().optional()).min(2).max(2),
1891
+ zod_1.z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')),
1892
+ ])
1893
+ .optional(),
1355
1894
  });
1356
1895
  const ListInvoiceAmountPaidSchema = zod_1.z.object({
1357
- is: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
1358
- is_not: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
1359
- lt: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
1360
- lte: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
1361
- gt: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
1362
- gte: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
1363
- between: zod_1.z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')).optional(),
1896
+ is: zod_1.z
1897
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
1898
+ .optional(),
1899
+ is_not: zod_1.z
1900
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
1901
+ .optional(),
1902
+ lt: zod_1.z
1903
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
1904
+ .optional(),
1905
+ lte: zod_1.z
1906
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
1907
+ .optional(),
1908
+ gt: zod_1.z
1909
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
1910
+ .optional(),
1911
+ gte: zod_1.z
1912
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
1913
+ .optional(),
1914
+ between: zod_1.z
1915
+ .union([
1916
+ zod_1.z.array(zod_1.z.number().int().optional()).min(2).max(2),
1917
+ zod_1.z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')),
1918
+ ])
1919
+ .optional(),
1364
1920
  });
1365
1921
  const ListInvoiceAmountAdjustedSchema = zod_1.z.object({
1366
- is: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
1367
- is_not: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
1368
- lt: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
1369
- lte: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
1370
- gt: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
1371
- gte: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
1372
- between: zod_1.z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')).optional(),
1922
+ is: zod_1.z
1923
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
1924
+ .optional(),
1925
+ is_not: zod_1.z
1926
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
1927
+ .optional(),
1928
+ lt: zod_1.z
1929
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
1930
+ .optional(),
1931
+ lte: zod_1.z
1932
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
1933
+ .optional(),
1934
+ gt: zod_1.z
1935
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
1936
+ .optional(),
1937
+ gte: zod_1.z
1938
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
1939
+ .optional(),
1940
+ between: zod_1.z
1941
+ .union([
1942
+ zod_1.z.array(zod_1.z.number().int().optional()).min(2).max(2),
1943
+ zod_1.z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')),
1944
+ ])
1945
+ .optional(),
1373
1946
  });
1374
1947
  const ListInvoiceCreditsAppliedSchema = zod_1.z.object({
1375
- is: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
1376
- is_not: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
1377
- lt: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
1378
- lte: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
1379
- gt: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
1380
- gte: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
1381
- between: zod_1.z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')).optional(),
1948
+ is: zod_1.z
1949
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
1950
+ .optional(),
1951
+ is_not: zod_1.z
1952
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
1953
+ .optional(),
1954
+ lt: zod_1.z
1955
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
1956
+ .optional(),
1957
+ lte: zod_1.z
1958
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
1959
+ .optional(),
1960
+ gt: zod_1.z
1961
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
1962
+ .optional(),
1963
+ gte: zod_1.z
1964
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
1965
+ .optional(),
1966
+ between: zod_1.z
1967
+ .union([
1968
+ zod_1.z.array(zod_1.z.number().int().optional()).min(2).max(2),
1969
+ zod_1.z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')),
1970
+ ])
1971
+ .optional(),
1382
1972
  });
1383
1973
  const ListInvoiceAmountDueSchema = zod_1.z.object({
1384
- is: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
1385
- is_not: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
1386
- lt: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
1387
- lte: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
1388
- gt: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
1389
- gte: zod_1.z.string().regex(RegExp('^-?\\d+$')).optional(),
1390
- between: zod_1.z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')).optional(),
1974
+ is: zod_1.z
1975
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
1976
+ .optional(),
1977
+ is_not: zod_1.z
1978
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
1979
+ .optional(),
1980
+ lt: zod_1.z
1981
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
1982
+ .optional(),
1983
+ lte: zod_1.z
1984
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
1985
+ .optional(),
1986
+ gt: zod_1.z
1987
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
1988
+ .optional(),
1989
+ gte: zod_1.z
1990
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
1991
+ .optional(),
1992
+ between: zod_1.z
1993
+ .union([
1994
+ zod_1.z.array(zod_1.z.number().int().optional()).min(2).max(2),
1995
+ zod_1.z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')),
1996
+ ])
1997
+ .optional(),
1391
1998
  });
1392
1999
  const ListInvoiceDunningStatusSchema = zod_1.z.object({
1393
2000
  is: zod_1.z.enum(['in_progress', 'exhausted', 'stopped', 'success']).optional(),
1394
2001
  is_not: zod_1.z.enum(['in_progress', 'exhausted', 'stopped', 'success']).optional(),
1395
- in: zod_1.z.enum(['in_progress', 'exhausted', 'stopped', 'success']).optional(),
1396
- not_in: zod_1.z.enum(['in_progress', 'exhausted', 'stopped', 'success']).optional(),
1397
- is_present: zod_1.z.enum(['true', 'false']).optional(),
2002
+ in: zod_1.z
2003
+ .union([
2004
+ zod_1.z.array(zod_1.z.enum(['in_progress', 'exhausted', 'stopped', 'success']).optional()),
2005
+ zod_1.z.enum(['in_progress', 'exhausted', 'stopped', 'success']),
2006
+ ])
2007
+ .optional(),
2008
+ not_in: zod_1.z
2009
+ .union([
2010
+ zod_1.z.array(zod_1.z.enum(['in_progress', 'exhausted', 'stopped', 'success']).optional()),
2011
+ zod_1.z.enum(['in_progress', 'exhausted', 'stopped', 'success']),
2012
+ ])
2013
+ .optional(),
2014
+ is_present: zod_1.z.union([zod_1.z.boolean(), zod_1.z.enum(['true', 'false'])]).optional(),
1398
2015
  });
1399
2016
  const ListInvoicePaymentOwnerSchema = zod_1.z.object({
1400
2017
  is: zod_1.z.string().min(1).optional(),
1401
2018
  is_not: zod_1.z.string().min(1).optional(),
1402
2019
  starts_with: zod_1.z.string().min(1).optional(),
1403
- in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1404
- not_in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
2020
+ in: zod_1.z
2021
+ .union([
2022
+ zod_1.z.array(zod_1.z.string().optional()),
2023
+ zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
2024
+ ])
2025
+ .optional(),
2026
+ not_in: zod_1.z
2027
+ .union([
2028
+ zod_1.z.array(zod_1.z.string().optional()),
2029
+ zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
2030
+ ])
2031
+ .optional(),
1405
2032
  });
1406
2033
  const ListInvoiceUpdatedAtSchema = zod_1.z.object({
1407
- after: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
1408
- before: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
1409
- on: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
1410
- between: zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
2034
+ after: zod_1.z
2035
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
2036
+ .optional(),
2037
+ before: zod_1.z
2038
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
2039
+ .optional(),
2040
+ on: zod_1.z
2041
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
2042
+ .optional(),
2043
+ between: zod_1.z
2044
+ .union([
2045
+ zod_1.z.array(zod_1.z.number().int().optional()).min(2).max(2),
2046
+ zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
2047
+ ])
2048
+ .optional(),
1411
2049
  });
1412
2050
  const ListInvoiceChannelSchema = zod_1.z.object({
1413
2051
  is: zod_1.z.enum(['web', 'app_store', 'play_store']).optional(),
1414
2052
  is_not: zod_1.z.enum(['web', 'app_store', 'play_store']).optional(),
1415
- in: zod_1.z.enum(['web', 'app_store', 'play_store']).optional(),
1416
- not_in: zod_1.z.enum(['web', 'app_store', 'play_store']).optional(),
2053
+ in: zod_1.z
2054
+ .union([
2055
+ zod_1.z.array(zod_1.z.enum(['web', 'app_store', 'play_store']).optional()),
2056
+ zod_1.z.enum(['web', 'app_store', 'play_store']),
2057
+ ])
2058
+ .optional(),
2059
+ not_in: zod_1.z
2060
+ .union([
2061
+ zod_1.z.array(zod_1.z.enum(['web', 'app_store', 'play_store']).optional()),
2062
+ zod_1.z.enum(['web', 'app_store', 'play_store']),
2063
+ ])
2064
+ .optional(),
1417
2065
  });
1418
2066
  const ListInvoiceVoidedAtSchema = zod_1.z.object({
1419
- after: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
1420
- before: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
1421
- on: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
1422
- between: zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
2067
+ after: zod_1.z
2068
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
2069
+ .optional(),
2070
+ before: zod_1.z
2071
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
2072
+ .optional(),
2073
+ on: zod_1.z
2074
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
2075
+ .optional(),
2076
+ between: zod_1.z
2077
+ .union([
2078
+ zod_1.z.array(zod_1.z.number().int().optional()).min(2).max(2),
2079
+ zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
2080
+ ])
2081
+ .optional(),
1423
2082
  });
1424
2083
  const ListInvoiceVoidReasonCodeSchema = zod_1.z.object({
1425
2084
  is: zod_1.z.string().min(1).optional(),
1426
2085
  is_not: zod_1.z.string().min(1).optional(),
1427
2086
  starts_with: zod_1.z.string().min(1).optional(),
1428
- in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1429
- not_in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
2087
+ in: zod_1.z
2088
+ .union([
2089
+ zod_1.z.array(zod_1.z.string().optional()),
2090
+ zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
2091
+ ])
2092
+ .optional(),
2093
+ not_in: zod_1.z
2094
+ .union([
2095
+ zod_1.z.array(zod_1.z.string().optional()),
2096
+ zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
2097
+ ])
2098
+ .optional(),
1430
2099
  });
1431
2100
  const ListInvoiceSortBySchema = zod_1.z.looseObject({
1432
2101
  asc: zod_1.z.enum(['date', 'updated_at']).optional(),
@@ -1499,23 +2168,31 @@ const PdfInvoiceBodySchema = zod_1.z.looseObject({
1499
2168
  exports.PdfInvoiceBodySchema = PdfInvoiceBodySchema;
1500
2169
  //Invoice.listPaymentReferenceNumbers
1501
2170
  const ListPaymentReferenceNumbersInvoiceIdSchema = zod_1.z.object({
1502
- in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
2171
+ in: zod_1.z
2172
+ .union([
2173
+ zod_1.z.array(zod_1.z.string().optional()),
2174
+ zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
2175
+ ])
2176
+ .optional(),
1503
2177
  is: zod_1.z.string().min(1).optional(),
1504
2178
  });
1505
2179
  const ListPaymentReferenceNumbersInvoiceNumberSchema = zod_1.z.object({
1506
- in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
2180
+ in: zod_1.z
2181
+ .union([
2182
+ zod_1.z.array(zod_1.z.string().optional()),
2183
+ zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
2184
+ ])
2185
+ .optional(),
1507
2186
  is: zod_1.z.string().min(1).optional(),
1508
2187
  });
1509
- const ListPaymentReferenceNumbersInvoicePaymentReferenceNumberItemSchema = zod_1.z.object({
2188
+ const ListPaymentReferenceNumbersInvoicePaymentReferenceNumberSchema = zod_1.z.object({
1510
2189
  number: ListPaymentReferenceNumbersInvoiceNumberSchema.optional(),
1511
2190
  });
1512
2191
  const ListPaymentReferenceNumbersInvoiceBodySchema = zod_1.z.looseObject({
1513
2192
  limit: zod_1.z.number().int().min(1).max(100).optional(),
1514
2193
  offset: zod_1.z.string().max(1000).optional(),
1515
2194
  id: ListPaymentReferenceNumbersInvoiceIdSchema.optional(),
1516
- payment_reference_number: zod_1.z
1517
- .array(ListPaymentReferenceNumbersInvoicePaymentReferenceNumberItemSchema.optional())
1518
- .optional(),
2195
+ payment_reference_number: ListPaymentReferenceNumbersInvoicePaymentReferenceNumberSchema.optional(),
1519
2196
  });
1520
2197
  exports.ListPaymentReferenceNumbersInvoiceBodySchema = ListPaymentReferenceNumbersInvoiceBodySchema;
1521
2198
  //Invoice.addCharge
@@ -1565,6 +2242,16 @@ const AddChargeItemInvoiceItemPriceSchema = zod_1.z.object({
1565
2242
  date_from: zod_1.z.number().int().optional(),
1566
2243
  date_to: zod_1.z.number().int().optional(),
1567
2244
  });
2245
+ const AddChargeItemInvoiceItemTiersItemSchema = zod_1.z.object({
2246
+ starting_unit: zod_1.z.number().int().min(1).optional(),
2247
+ ending_unit: zod_1.z.number().int().optional(),
2248
+ price: zod_1.z.number().int().min(0).optional(),
2249
+ starting_unit_in_decimal: zod_1.z.string().max(33).optional(),
2250
+ ending_unit_in_decimal: zod_1.z.string().max(33).optional(),
2251
+ price_in_decimal: zod_1.z.string().max(39).optional(),
2252
+ pricing_type: zod_1.z.enum(['per_unit', 'flat_fee', 'package']).optional(),
2253
+ package_size: zod_1.z.number().int().min(1).optional(),
2254
+ });
1568
2255
  const AddChargeItemInvoiceItemTiersSchema = zod_1.z.object({
1569
2256
  starting_unit: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
1570
2257
  ending_unit: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
@@ -1581,10 +2268,30 @@ const AddChargeItemInvoiceBodySchema = zod_1.z.looseObject({
1581
2268
  comment: zod_1.z.string().max(300).optional(),
1582
2269
  subscription_id: zod_1.z.string().max(50).optional(),
1583
2270
  item_price: AddChargeItemInvoiceItemPriceSchema.optional(),
1584
- item_tiers: AddChargeItemInvoiceItemTiersSchema.optional(),
2271
+ item_tiers: zod_1.z
2272
+ .union([
2273
+ zod_1.z.array(AddChargeItemInvoiceItemTiersItemSchema.optional()),
2274
+ AddChargeItemInvoiceItemTiersSchema,
2275
+ ])
2276
+ .optional(),
1585
2277
  });
1586
2278
  exports.AddChargeItemInvoiceBodySchema = AddChargeItemInvoiceBodySchema;
1587
2279
  //Invoice.close
2280
+ const CloseInvoiceNotesToRemoveItemSchema = zod_1.z.object({
2281
+ entity_type: zod_1.z
2282
+ .enum([
2283
+ 'customer',
2284
+ 'subscription',
2285
+ 'coupon',
2286
+ 'plan_item_price',
2287
+ 'addon_item_price',
2288
+ 'charge_item_price',
2289
+ 'plan',
2290
+ 'addon',
2291
+ ])
2292
+ .optional(),
2293
+ entity_id: zod_1.z.string().max(100).optional(),
2294
+ });
1588
2295
  const CloseInvoiceNotesToRemoveSchema = zod_1.z.object({
1589
2296
  entity_type: zod_1.z
1590
2297
  .array(zod_1.z
@@ -1607,7 +2314,12 @@ const CloseInvoiceBodySchema = zod_1.z.looseObject({
1607
2314
  invoice_note: zod_1.z.string().max(2000).optional(),
1608
2315
  remove_general_note: zod_1.z.boolean().default(false).optional(),
1609
2316
  invoice_date: zod_1.z.number().int().optional(),
1610
- notes_to_remove: CloseInvoiceNotesToRemoveSchema.optional(),
2317
+ notes_to_remove: zod_1.z
2318
+ .union([
2319
+ zod_1.z.array(CloseInvoiceNotesToRemoveItemSchema.optional()),
2320
+ CloseInvoiceNotesToRemoveSchema,
2321
+ ])
2322
+ .optional(),
1611
2323
  });
1612
2324
  exports.CloseInvoiceBodySchema = CloseInvoiceBodySchema;
1613
2325
  //Invoice.collectPayment
@@ -1630,12 +2342,6 @@ const RecordPaymentInvoiceTransactionSchema = zod_1.z.object({
1630
2342
  'app_store',
1631
2343
  'play_store',
1632
2344
  'custom',
1633
- 'tamara',
1634
- 'qpay',
1635
- 'blik',
1636
- 'fpx',
1637
- 'wero',
1638
- 'p24',
1639
2345
  ]),
1640
2346
  reference_number: zod_1.z.string().max(100).optional(),
1641
2347
  custom_payment_method_id: zod_1.z.string().max(50).optional(),
@@ -1702,12 +2408,6 @@ const RecordRefundInvoiceTransactionSchema = zod_1.z.object({
1702
2408
  'app_store',
1703
2409
  'play_store',
1704
2410
  'custom',
1705
- 'tamara',
1706
- 'qpay',
1707
- 'blik',
1708
- 'fpx',
1709
- 'wero',
1710
- 'p24',
1711
2411
  ]),
1712
2412
  reference_number: zod_1.z.string().max(100).optional(),
1713
2413
  custom_payment_method_id: zod_1.z.string().max(50).optional(),