chargebee 3.34.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 (198) hide show
  1. package/CHANGELOG.md +237 -0
  2. package/cjs/environment.js +1 -1
  3. package/cjs/resources/api_endpoints.js +230 -2
  4. package/cjs/resources/webhook/eventType.js +25 -1
  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 +43 -6
  10. package/cjs/schema/business_rule.schema.js +2 -2
  11. package/cjs/schema/business_ruleset.schema.js +2 -2
  12. package/cjs/schema/collections_payment_promise.schema.js +43 -0
  13. package/cjs/schema/comment.schema.js +17 -4
  14. package/cjs/schema/coupon.schema.js +218 -37
  15. package/cjs/schema/coupon_code.schema.js +36 -6
  16. package/cjs/schema/coupon_set.schema.js +108 -27
  17. package/cjs/schema/credit_note.schema.js +497 -105
  18. package/cjs/schema/credit_unit.schema.js +12 -2
  19. package/cjs/schema/customer.schema.js +212 -62
  20. package/cjs/schema/differential_price.schema.js +100 -12
  21. package/cjs/schema/dispute.schema.js +125 -33
  22. package/cjs/schema/einvoice.schema.js +27 -6
  23. package/cjs/schema/email_log.schema.js +15 -4
  24. package/cjs/schema/entitlement.schema.js +35 -6
  25. package/cjs/schema/entitlement_override.schema.js +17 -1
  26. package/cjs/schema/estimate.schema.js +585 -40
  27. package/cjs/schema/event.schema.js +1334 -585
  28. package/cjs/schema/export.schema.js +4459 -1412
  29. package/cjs/schema/feature.schema.js +73 -11
  30. package/cjs/schema/gateway_request_log.schema.js +309 -0
  31. package/cjs/schema/gateway_webhook_log.schema.js +257 -0
  32. package/cjs/schema/gift.schema.js +51 -5
  33. package/cjs/schema/grant_block.schema.js +45 -12
  34. package/cjs/schema/hosted_page.schema.js +564 -68
  35. package/cjs/schema/index.js +6 -0
  36. package/cjs/schema/invoice.schema.js +843 -123
  37. package/cjs/schema/item.schema.js +151 -28
  38. package/cjs/schema/item_entitlement.schema.js +23 -2
  39. package/cjs/schema/item_family.schema.js +29 -8
  40. package/cjs/schema/item_price.schema.js +263 -48
  41. package/cjs/schema/ledger_account_balance.schema.js +11 -2
  42. package/cjs/schema/ledger_operation.schema.js +44 -17
  43. package/cjs/schema/metered_feature.schema.js +10 -1
  44. package/cjs/schema/omnichannel_one_time_order.schema.js +42 -4
  45. package/cjs/schema/omnichannel_subscription.schema.js +146 -32
  46. package/cjs/schema/order.schema.js +233 -61
  47. package/cjs/schema/organization_detail.schema.js +36 -0
  48. package/cjs/schema/payment_schedule.schema.js +39 -8
  49. package/cjs/schema/payment_schedule_scheme.schema.js +37 -7
  50. package/cjs/schema/payment_source.schema.js +375 -148
  51. package/cjs/schema/payment_voucher.schema.js +33 -5
  52. package/cjs/schema/plan.schema.js +345 -57
  53. package/cjs/schema/price_ramp.schema.js +153 -0
  54. package/cjs/schema/price_variant.schema.js +88 -18
  55. package/cjs/schema/pricing_page_session.schema.js +36 -2
  56. package/cjs/schema/promotional_credit.schema.js +27 -6
  57. package/cjs/schema/purchase.schema.js +210 -12
  58. package/cjs/schema/quote.schema.js +907 -87
  59. package/cjs/schema/quote_entitlement.schema.js +6 -2
  60. package/cjs/schema/ramp.schema.js +242 -24
  61. package/cjs/schema/retry_segment.schema.js +12 -0
  62. package/cjs/schema/site_migration_detail.schema.js +50 -16
  63. package/cjs/schema/subscription.schema.js +1002 -173
  64. package/cjs/schema/subscription_entitlement.schema.js +9 -1
  65. package/cjs/schema/transaction.schema.js +780 -342
  66. package/cjs/schema/unbilled_charge.schema.js +141 -13
  67. package/cjs/schema/usage.schema.js +59 -11
  68. package/cjs/schema/usage_event.schema.js +13 -1
  69. package/cjs/schema/usage_summary.schema.js +1 -0
  70. package/cjs/schema/virtual_bank_account.schema.js +42 -10
  71. package/cjs/schema/webhook_endpoint.schema.js +50 -2
  72. package/esm/environment.js +1 -1
  73. package/esm/resources/api_endpoints.js +230 -2
  74. package/esm/resources/webhook/eventType.js +25 -1
  75. package/esm/schema/addon.schema.js +221 -40
  76. package/esm/schema/alert.schema.js +17 -2
  77. package/esm/schema/alert_status.schema.js +6 -1
  78. package/esm/schema/attached_item.schema.js +101 -26
  79. package/esm/schema/business_entity.schema.js +42 -5
  80. package/esm/schema/business_rule.schema.js +2 -2
  81. package/esm/schema/business_ruleset.schema.js +2 -2
  82. package/esm/schema/collections_payment_promise.schema.js +40 -0
  83. package/esm/schema/comment.schema.js +17 -4
  84. package/esm/schema/coupon.schema.js +218 -37
  85. package/esm/schema/coupon_code.schema.js +36 -6
  86. package/esm/schema/coupon_set.schema.js +108 -27
  87. package/esm/schema/credit_note.schema.js +497 -105
  88. package/esm/schema/credit_unit.schema.js +12 -2
  89. package/esm/schema/customer.schema.js +212 -62
  90. package/esm/schema/differential_price.schema.js +100 -12
  91. package/esm/schema/dispute.schema.js +125 -33
  92. package/esm/schema/einvoice.schema.js +27 -6
  93. package/esm/schema/email_log.schema.js +15 -4
  94. package/esm/schema/entitlement.schema.js +35 -6
  95. package/esm/schema/entitlement_override.schema.js +17 -1
  96. package/esm/schema/estimate.schema.js +585 -40
  97. package/esm/schema/event.schema.js +1334 -585
  98. package/esm/schema/export.schema.js +4459 -1412
  99. package/esm/schema/feature.schema.js +73 -11
  100. package/esm/schema/gateway_request_log.schema.js +306 -0
  101. package/esm/schema/gateway_webhook_log.schema.js +254 -0
  102. package/esm/schema/gift.schema.js +51 -5
  103. package/esm/schema/grant_block.schema.js +45 -12
  104. package/esm/schema/hosted_page.schema.js +564 -68
  105. package/esm/schema/index.js +6 -0
  106. package/esm/schema/invoice.schema.js +842 -122
  107. package/esm/schema/item.schema.js +151 -28
  108. package/esm/schema/item_entitlement.schema.js +23 -2
  109. package/esm/schema/item_family.schema.js +29 -8
  110. package/esm/schema/item_price.schema.js +263 -48
  111. package/esm/schema/ledger_account_balance.schema.js +10 -1
  112. package/esm/schema/ledger_operation.schema.js +44 -17
  113. package/esm/schema/metered_feature.schema.js +10 -1
  114. package/esm/schema/omnichannel_one_time_order.schema.js +42 -4
  115. package/esm/schema/omnichannel_subscription.schema.js +146 -32
  116. package/esm/schema/order.schema.js +233 -61
  117. package/esm/schema/organization_detail.schema.js +33 -0
  118. package/esm/schema/payment_schedule.schema.js +39 -8
  119. package/esm/schema/payment_schedule_scheme.schema.js +37 -7
  120. package/esm/schema/payment_source.schema.js +375 -148
  121. package/esm/schema/payment_voucher.schema.js +33 -5
  122. package/esm/schema/plan.schema.js +345 -57
  123. package/esm/schema/price_ramp.schema.js +150 -0
  124. package/esm/schema/price_variant.schema.js +88 -18
  125. package/esm/schema/pricing_page_session.schema.js +36 -2
  126. package/esm/schema/promotional_credit.schema.js +27 -6
  127. package/esm/schema/purchase.schema.js +210 -12
  128. package/esm/schema/quote.schema.js +907 -87
  129. package/esm/schema/quote_entitlement.schema.js +6 -2
  130. package/esm/schema/ramp.schema.js +242 -24
  131. package/esm/schema/retry_segment.schema.js +9 -0
  132. package/esm/schema/site_migration_detail.schema.js +50 -16
  133. package/esm/schema/subscription.schema.js +1002 -173
  134. package/esm/schema/subscription_entitlement.schema.js +9 -1
  135. package/esm/schema/transaction.schema.js +780 -342
  136. package/esm/schema/unbilled_charge.schema.js +141 -13
  137. package/esm/schema/usage.schema.js +59 -11
  138. package/esm/schema/usage_event.schema.js +13 -1
  139. package/esm/schema/usage_summary.schema.js +1 -0
  140. package/esm/schema/virtual_bank_account.schema.js +42 -10
  141. package/esm/schema/webhook_endpoint.schema.js +50 -2
  142. package/package.json +1 -1
  143. package/types/core.d.ts +63 -74
  144. package/types/index.d.ts +29 -1
  145. package/types/resources/BillingLineItem.d.ts +10 -0
  146. package/types/resources/BillingMetadata.d.ts +9 -0
  147. package/types/resources/BusinessEntity.d.ts +52 -0
  148. package/types/resources/Citation.d.ts +13 -0
  149. package/types/resources/CollectionsDispute.d.ts +24 -0
  150. package/types/resources/CollectionsPaymentPromise.d.ts +93 -0
  151. package/types/resources/CollectionsReminderSequence.d.ts +35 -0
  152. package/types/resources/Comment.d.ts +2 -1
  153. package/types/resources/Content.d.ts +23 -1
  154. package/types/resources/CreditNote.d.ts +1 -0
  155. package/types/resources/CustomData.d.ts +14 -0
  156. package/types/resources/Discount.d.ts +1 -0
  157. package/types/resources/DraftEstimate.d.ts +13 -0
  158. package/types/resources/DraftRequest.d.ts +45 -0
  159. package/types/resources/EmailAttachment.d.ts +16 -0
  160. package/types/resources/EmailConversation.d.ts +18 -0
  161. package/types/resources/EmailLog.d.ts +1 -0
  162. package/types/resources/EmailMessage.d.ts +40 -0
  163. package/types/resources/Estimate.d.ts +3 -0
  164. package/types/resources/Event.d.ts +25 -1
  165. package/types/resources/Execution.d.ts +12 -0
  166. package/types/resources/GatewayPaymentMethodToken.d.ts +2 -2
  167. package/types/resources/GatewayRequestLog.d.ts +82 -0
  168. package/types/resources/GatewayWebhookLog.d.ts +74 -0
  169. package/types/resources/GrantBlock.d.ts +5 -0
  170. package/types/resources/GroupByAttribute.d.ts +15 -0
  171. package/types/resources/GroupByRecommendation.d.ts +10 -0
  172. package/types/resources/HostedPage.d.ts +18 -0
  173. package/types/resources/Invoice.d.ts +19 -0
  174. package/types/resources/ItemPrice.d.ts +1 -0
  175. package/types/resources/LedgerAccountBalance.d.ts +19 -0
  176. package/types/resources/Meter.d.ts +1 -0
  177. package/types/resources/MeteredFeature.d.ts +1 -0
  178. package/types/resources/OmnichannelOneTimeOrder.d.ts +5 -1
  179. package/types/resources/OmnichannelSubscription.d.ts +6 -1
  180. package/types/resources/OmnichannelSubscriptionItem.d.ts +4 -1
  181. package/types/resources/OrganizationDetail.d.ts +84 -0
  182. package/types/resources/PaymentSchedule.d.ts +1 -1
  183. package/types/resources/PaymentScheduleEstimate.d.ts +1 -1
  184. package/types/resources/PaymentSource.d.ts +19 -0
  185. package/types/resources/PreferenceVariant.d.ts +10 -0
  186. package/types/resources/PriceRamp.d.ts +113 -0
  187. package/types/resources/PrivateNote.d.ts +18 -0
  188. package/types/resources/Purchase.d.ts +6 -0
  189. package/types/resources/Ramp.d.ts +6 -0
  190. package/types/resources/RampInterval.d.ts +12 -0
  191. package/types/resources/RecordedPurchase.d.ts +5 -1
  192. package/types/resources/RetrySegment.d.ts +36 -0
  193. package/types/resources/Subscription.d.ts +3 -0
  194. package/types/resources/Transaction.d.ts +4 -0
  195. package/types/resources/Usage.d.ts +7 -0
  196. package/types/resources/UsageSummary.d.ts +2 -0
  197. package/types/resources/WebhookEvent.d.ts +159 -5
  198. package/types/resources/AppliedBusinessRule.d.ts +0 -15
@@ -1,5 +1,5 @@
1
1
  // Generated Zod schemas: Invoice
2
- // Actions: create, createForChargeItemsAndCharges, charge, chargeAddon, createForChargeItem, stopDunning, pauseDunning, resumeDunning, importInvoice, applyPayments, deleteLineItems, applyCredits, list, invoicesForCustomer, invoicesForSubscription, retrieve, pdf, listPaymentReferenceNumbers, addCharge, addAddonCharge, addChargeItem, close, collectPayment, recordPayment, recordTaxWithheld, removeTaxWithheld, refund, recordRefund, removePayment, removeCreditNote, voidInvoice, writeOff, voidBeforeCapture, delete, updateDetails, applyPaymentScheduleScheme
2
+ // Actions: create, createForChargeItemsAndCharges, charge, chargeAddon, createForChargeItem, stopDunning, pauseDunning, resumeDunning, importInvoice, applyPayments, deleteLineItems, applyCredits, list, invoicesForCustomer, invoicesForSubscription, retrieve, pdf, listPaymentReferenceNumbers, addCharge, addAddonCharge, addChargeItem, close, collectPayment, recordPayment, recordTaxWithheld, removeTaxWithheld, refund, recordRefund, removePayment, removeCreditNote, voidInvoice, writeOff, voidBeforeCapture, delete, updateDetails, applyPaymentScheduleScheme, removePaymentScheduleScheme
3
3
  // Do not edit manually – regenerate via sdk-generator
4
4
  import { z } from 'zod';
5
5
  //Invoice.create
@@ -352,6 +352,15 @@ const CreateInvoicePaymentIntentSchema = z.object({
352
352
  gw_payment_method_id: z.string().max(65000).optional(),
353
353
  additional_information: CreateInvoiceAdditionalInformationSchema.optional(),
354
354
  });
355
+ const CreateInvoiceAddonsItemSchema = z.object({
356
+ id: z.string().max(100).optional(),
357
+ quantity: z.number().int().min(1).optional(),
358
+ unit_price: z.number().int().min(0).optional(),
359
+ quantity_in_decimal: z.string().max(33).optional(),
360
+ unit_price_in_decimal: z.string().max(39).optional(),
361
+ date_from: z.number().int().optional(),
362
+ date_to: z.number().int().optional(),
363
+ });
355
364
  const CreateInvoiceAddonsSchema = z.object({
356
365
  id: z.array(z.string().max(100).optional()).optional(),
357
366
  quantity: z.array(z.number().int().min(1).optional()).optional(),
@@ -361,6 +370,23 @@ const CreateInvoiceAddonsSchema = z.object({
361
370
  date_from: z.array(z.number().int().optional()).optional(),
362
371
  date_to: z.array(z.number().int().optional()).optional(),
363
372
  });
373
+ const CreateInvoiceChargesItemSchema = z.object({
374
+ amount: z.number().int().min(1).optional(),
375
+ amount_in_decimal: z.string().max(39).optional(),
376
+ description: z.string().max(250).optional(),
377
+ taxable: z.boolean().default(true).optional(),
378
+ tax_profile_id: z.string().max(50).optional(),
379
+ avalara_tax_code: z.string().max(50).optional(),
380
+ hsn_code: z.string().max(50).optional(),
381
+ taxjar_product_code: z.string().max(50).optional(),
382
+ avalara_sale_type: z
383
+ .enum(['wholesale', 'retail', 'consumed', 'vendor_use'])
384
+ .optional(),
385
+ avalara_transaction_type: z.number().int().optional(),
386
+ avalara_service_type: z.number().int().optional(),
387
+ date_from: z.number().int().optional(),
388
+ date_to: z.number().int().optional(),
389
+ });
364
390
  const CreateInvoiceChargesSchema = z.object({
365
391
  amount: z.array(z.number().int().min(1).optional()).optional(),
366
392
  amount_in_decimal: z.array(z.string().max(39).optional()).optional(),
@@ -378,11 +404,22 @@ const CreateInvoiceChargesSchema = z.object({
378
404
  date_from: z.array(z.number().int().optional()).optional(),
379
405
  date_to: z.array(z.number().int().optional()).optional(),
380
406
  });
407
+ const CreateInvoiceTaxProvidersFieldsItemSchema = z.object({
408
+ provider_name: z.string().max(50).optional(),
409
+ field_id: z.string().max(50).optional(),
410
+ field_value: z.string().max(50).optional(),
411
+ });
381
412
  const CreateInvoiceTaxProvidersFieldsSchema = z.object({
382
413
  provider_name: z.array(z.string().max(50).optional()).optional(),
383
414
  field_id: z.array(z.string().max(50).optional()).optional(),
384
415
  field_value: z.array(z.string().max(50).optional()).optional(),
385
416
  });
417
+ const CreateInvoiceNotesToRemoveItemSchema = z.object({
418
+ entity_type: z
419
+ .enum(['plan', 'addon', 'customer', 'subscription', 'coupon'])
420
+ .optional(),
421
+ entity_id: z.string().max(100).optional(),
422
+ });
386
423
  const CreateInvoiceNotesToRemoveSchema = z.object({
387
424
  entity_type: z
388
425
  .array(z
@@ -414,10 +451,30 @@ const CreateInvoiceBodySchema = z.looseObject({
414
451
  bank_account: CreateInvoiceBankAccountSchema.optional(),
415
452
  payment_method: CreateInvoicePaymentMethodSchema.optional(),
416
453
  payment_intent: CreateInvoicePaymentIntentSchema.optional(),
417
- addons: CreateInvoiceAddonsSchema.optional(),
418
- charges: CreateInvoiceChargesSchema.optional(),
419
- tax_providers_fields: CreateInvoiceTaxProvidersFieldsSchema.optional(),
420
- notes_to_remove: CreateInvoiceNotesToRemoveSchema.optional(),
454
+ addons: z
455
+ .union([
456
+ z.array(CreateInvoiceAddonsItemSchema.optional()),
457
+ CreateInvoiceAddonsSchema,
458
+ ])
459
+ .optional(),
460
+ charges: z
461
+ .union([
462
+ z.array(CreateInvoiceChargesItemSchema.optional()),
463
+ CreateInvoiceChargesSchema,
464
+ ])
465
+ .optional(),
466
+ tax_providers_fields: z
467
+ .union([
468
+ z.array(CreateInvoiceTaxProvidersFieldsItemSchema.optional()),
469
+ CreateInvoiceTaxProvidersFieldsSchema,
470
+ ])
471
+ .optional(),
472
+ notes_to_remove: z
473
+ .union([
474
+ z.array(CreateInvoiceNotesToRemoveItemSchema.optional()),
475
+ CreateInvoiceNotesToRemoveSchema,
476
+ ])
477
+ .optional(),
421
478
  });
422
479
  export { CreateInvoiceBodySchema };
423
480
  //Invoice.createForChargeItemsAndCharges
@@ -770,6 +827,17 @@ const CreateForChargeItemsAndChargesInvoicePaymentIntentSchema = z.object({
770
827
  gw_payment_method_id: z.string().max(65000).optional(),
771
828
  additional_information: CreateForChargeItemsAndChargesInvoiceAdditionalInformationSchema.optional(),
772
829
  });
830
+ const CreateForChargeItemsAndChargesInvoiceItemPricesItemSchema = z.object({
831
+ item_price_id: z.string().max(100).optional(),
832
+ quantity: z.number().int().min(1).optional(),
833
+ quantity_in_decimal: z.string().max(33).optional(),
834
+ unit_price: z.number().int().min(0).optional(),
835
+ unit_price_in_decimal: z.string().max(39).optional(),
836
+ date_from: z.number().int().optional(),
837
+ date_to: z.number().int().optional(),
838
+ description: z.string().max(250).optional(),
839
+ entity_description: z.string().max(2000).optional(),
840
+ });
773
841
  const CreateForChargeItemsAndChargesInvoiceItemPricesSchema = z.object({
774
842
  item_price_id: z.array(z.string().max(100).optional()).optional(),
775
843
  quantity: z.array(z.number().int().min(1).optional()).optional(),
@@ -781,6 +849,17 @@ const CreateForChargeItemsAndChargesInvoiceItemPricesSchema = z.object({
781
849
  description: z.array(z.string().max(250).optional()).optional(),
782
850
  entity_description: z.array(z.string().max(2000).optional()).optional(),
783
851
  });
852
+ const CreateForChargeItemsAndChargesInvoiceItemTiersItemSchema = z.object({
853
+ item_price_id: z.string().max(100).optional(),
854
+ starting_unit: z.number().int().min(1).optional(),
855
+ ending_unit: z.number().int().optional(),
856
+ price: z.number().int().min(0).optional(),
857
+ starting_unit_in_decimal: z.string().max(33).optional(),
858
+ ending_unit_in_decimal: z.string().max(33).optional(),
859
+ price_in_decimal: z.string().max(39).optional(),
860
+ pricing_type: z.enum(['per_unit', 'flat_fee', 'package']).optional(),
861
+ package_size: z.number().int().min(1).optional(),
862
+ });
784
863
  const CreateForChargeItemsAndChargesInvoiceItemTiersSchema = z.object({
785
864
  item_price_id: z.array(z.string().max(100).optional()).optional(),
786
865
  starting_unit: z.array(z.number().int().min(1).optional()).optional(),
@@ -794,6 +873,24 @@ const CreateForChargeItemsAndChargesInvoiceItemTiersSchema = z.object({
794
873
  .optional(),
795
874
  package_size: z.array(z.number().int().min(1).optional()).optional(),
796
875
  });
876
+ const CreateForChargeItemsAndChargesInvoiceChargesItemSchema = z.object({
877
+ entity_description: z.string().max(2000).optional(),
878
+ amount: z.number().int().min(1).optional(),
879
+ amount_in_decimal: z.string().max(39).optional(),
880
+ description: z.string().max(250).optional(),
881
+ taxable: z.boolean().default(true).optional(),
882
+ tax_profile_id: z.string().max(50).optional(),
883
+ avalara_tax_code: z.string().max(50).optional(),
884
+ hsn_code: z.string().max(50).optional(),
885
+ taxjar_product_code: z.string().max(50).optional(),
886
+ avalara_sale_type: z
887
+ .enum(['wholesale', 'retail', 'consumed', 'vendor_use'])
888
+ .optional(),
889
+ avalara_transaction_type: z.number().int().optional(),
890
+ avalara_service_type: z.number().int().optional(),
891
+ date_from: z.number().int().optional(),
892
+ date_to: z.number().int().optional(),
893
+ });
797
894
  const CreateForChargeItemsAndChargesInvoiceChargesSchema = z.object({
798
895
  entity_description: z.array(z.string().max(2000).optional()).optional(),
799
896
  amount: z.array(z.number().int().min(1).optional()).optional(),
@@ -812,6 +909,19 @@ const CreateForChargeItemsAndChargesInvoiceChargesSchema = z.object({
812
909
  date_from: z.array(z.number().int().optional()).optional(),
813
910
  date_to: z.array(z.number().int().optional()).optional(),
814
911
  });
912
+ const CreateForChargeItemsAndChargesInvoiceNotesToRemoveItemSchema = z.object({
913
+ entity_type: z
914
+ .enum([
915
+ 'customer',
916
+ 'subscription',
917
+ 'coupon',
918
+ 'plan_item_price',
919
+ 'addon_item_price',
920
+ 'charge_item_price',
921
+ ])
922
+ .optional(),
923
+ entity_id: z.string().max(100).optional(),
924
+ });
815
925
  const CreateForChargeItemsAndChargesInvoiceNotesToRemoveSchema = z.object({
816
926
  entity_type: z
817
927
  .array(z
@@ -827,11 +937,23 @@ const CreateForChargeItemsAndChargesInvoiceNotesToRemoveSchema = z.object({
827
937
  .optional(),
828
938
  entity_id: z.array(z.string().max(100).optional()).optional(),
829
939
  });
940
+ const CreateForChargeItemsAndChargesInvoiceTaxProvidersFieldsItemSchema = z.object({
941
+ provider_name: z.string().max(50).optional(),
942
+ field_id: z.string().max(50).optional(),
943
+ field_value: z.string().max(50).optional(),
944
+ });
830
945
  const CreateForChargeItemsAndChargesInvoiceTaxProvidersFieldsSchema = z.object({
831
946
  provider_name: z.array(z.string().max(50).optional()).optional(),
832
947
  field_id: z.array(z.string().max(50).optional()).optional(),
833
948
  field_value: z.array(z.string().max(50).optional()).optional(),
834
949
  });
950
+ const CreateForChargeItemsAndChargesInvoiceDiscountsItemSchema = z.object({
951
+ percentage: z.number().min(0.01).max(100).optional(),
952
+ amount: z.number().int().min(0).optional(),
953
+ quantity: z.number().int().min(1).optional(),
954
+ apply_on: z.enum(['invoice_amount', 'specific_item_price']),
955
+ item_price_id: z.string().max(100).optional(),
956
+ });
835
957
  const CreateForChargeItemsAndChargesInvoiceDiscountsSchema = z.object({
836
958
  percentage: z.array(z.number().min(0.01).max(100).optional()).optional(),
837
959
  amount: z.array(z.number().int().min(0).optional()).optional(),
@@ -852,6 +974,23 @@ const CreateForChargeItemsAndChargesInvoiceBodySchema = z.looseObject({
852
974
  payment_source_id: z.string().max(40).optional(),
853
975
  auto_collection: z.enum(['on', 'off']).optional(),
854
976
  net_term_days: z.number().int().optional(),
977
+ offline_payment_method: z
978
+ .enum([
979
+ 'no_preference',
980
+ 'cash',
981
+ 'check',
982
+ 'bank_transfer',
983
+ 'ach_credit',
984
+ 'sepa_credit',
985
+ 'boleto',
986
+ 'us_automated_bank_transfer',
987
+ 'eu_automated_bank_transfer',
988
+ 'uk_automated_bank_transfer',
989
+ 'jp_automated_bank_transfer',
990
+ 'mx_automated_bank_transfer',
991
+ 'custom',
992
+ ])
993
+ .optional(),
855
994
  invoice_date: z.number().int().optional(),
856
995
  create_pending_invoice: z.boolean().optional(),
857
996
  token_id: z.string().max(40).optional(),
@@ -864,15 +1003,50 @@ const CreateForChargeItemsAndChargesInvoiceBodySchema = z.looseObject({
864
1003
  bank_account: CreateForChargeItemsAndChargesInvoiceBankAccountSchema.optional(),
865
1004
  payment_method: CreateForChargeItemsAndChargesInvoicePaymentMethodSchema.optional(),
866
1005
  payment_intent: CreateForChargeItemsAndChargesInvoicePaymentIntentSchema.optional(),
867
- item_prices: CreateForChargeItemsAndChargesInvoiceItemPricesSchema.optional(),
868
- item_tiers: CreateForChargeItemsAndChargesInvoiceItemTiersSchema.optional(),
869
- charges: CreateForChargeItemsAndChargesInvoiceChargesSchema.optional(),
870
- notes_to_remove: CreateForChargeItemsAndChargesInvoiceNotesToRemoveSchema.optional(),
871
- tax_providers_fields: CreateForChargeItemsAndChargesInvoiceTaxProvidersFieldsSchema.optional(),
872
- discounts: CreateForChargeItemsAndChargesInvoiceDiscountsSchema.optional(),
1006
+ item_prices: z
1007
+ .union([
1008
+ z.array(CreateForChargeItemsAndChargesInvoiceItemPricesItemSchema.optional()),
1009
+ CreateForChargeItemsAndChargesInvoiceItemPricesSchema,
1010
+ ])
1011
+ .optional(),
1012
+ item_tiers: z
1013
+ .union([
1014
+ z.array(CreateForChargeItemsAndChargesInvoiceItemTiersItemSchema.optional()),
1015
+ CreateForChargeItemsAndChargesInvoiceItemTiersSchema,
1016
+ ])
1017
+ .optional(),
1018
+ charges: z
1019
+ .union([
1020
+ z.array(CreateForChargeItemsAndChargesInvoiceChargesItemSchema.optional()),
1021
+ CreateForChargeItemsAndChargesInvoiceChargesSchema,
1022
+ ])
1023
+ .optional(),
1024
+ notes_to_remove: z
1025
+ .union([
1026
+ z.array(CreateForChargeItemsAndChargesInvoiceNotesToRemoveItemSchema.optional()),
1027
+ CreateForChargeItemsAndChargesInvoiceNotesToRemoveSchema,
1028
+ ])
1029
+ .optional(),
1030
+ tax_providers_fields: z
1031
+ .union([
1032
+ z.array(CreateForChargeItemsAndChargesInvoiceTaxProvidersFieldsItemSchema.optional()),
1033
+ CreateForChargeItemsAndChargesInvoiceTaxProvidersFieldsSchema,
1034
+ ])
1035
+ .optional(),
1036
+ discounts: z
1037
+ .union([
1038
+ z.array(CreateForChargeItemsAndChargesInvoiceDiscountsItemSchema.optional()),
1039
+ CreateForChargeItemsAndChargesInvoiceDiscountsSchema,
1040
+ ])
1041
+ .optional(),
873
1042
  });
874
1043
  export { CreateForChargeItemsAndChargesInvoiceBodySchema };
875
1044
  //Invoice.charge
1045
+ const ChargeInvoiceTaxProvidersFieldsItemSchema = z.object({
1046
+ provider_name: z.string().max(50).optional(),
1047
+ field_id: z.string().max(50).optional(),
1048
+ field_value: z.string().max(50).optional(),
1049
+ });
876
1050
  const ChargeInvoiceTaxProvidersFieldsSchema = z.object({
877
1051
  provider_name: z.array(z.string().max(50).optional()).optional(),
878
1052
  field_id: z.array(z.string().max(50).optional()).optional(),
@@ -898,7 +1072,12 @@ const ChargeInvoiceBodySchema = z.looseObject({
898
1072
  invoice_date: z.number().int().optional(),
899
1073
  payment_source_id: z.string().max(40).optional(),
900
1074
  payment_initiator: z.enum(['customer', 'merchant']).optional(),
901
- tax_providers_fields: ChargeInvoiceTaxProvidersFieldsSchema.optional(),
1075
+ tax_providers_fields: z
1076
+ .union([
1077
+ z.array(ChargeInvoiceTaxProvidersFieldsItemSchema.optional()),
1078
+ ChargeInvoiceTaxProvidersFieldsSchema,
1079
+ ])
1080
+ .optional(),
902
1081
  });
903
1082
  export { ChargeInvoiceBodySchema };
904
1083
  //Invoice.chargeAddon
@@ -930,6 +1109,16 @@ const CreateForChargeItemInvoiceItemPriceSchema = z.object({
930
1109
  date_from: z.number().int().optional(),
931
1110
  date_to: z.number().int().optional(),
932
1111
  });
1112
+ const CreateForChargeItemInvoiceItemTiersItemSchema = z.object({
1113
+ starting_unit: z.number().int().min(1).optional(),
1114
+ ending_unit: z.number().int().optional(),
1115
+ price: z.number().int().min(0).optional(),
1116
+ starting_unit_in_decimal: z.string().max(33).optional(),
1117
+ ending_unit_in_decimal: z.string().max(33).optional(),
1118
+ price_in_decimal: z.string().max(39).optional(),
1119
+ pricing_type: z.enum(['per_unit', 'flat_fee', 'package']).optional(),
1120
+ package_size: z.number().int().min(1).optional(),
1121
+ });
933
1122
  const CreateForChargeItemInvoiceItemTiersSchema = z.object({
934
1123
  starting_unit: z.array(z.number().int().min(1).optional()).optional(),
935
1124
  ending_unit: z.array(z.number().int().optional()).optional(),
@@ -951,7 +1140,12 @@ const CreateForChargeItemInvoiceBodySchema = z.looseObject({
951
1140
  payment_initiator: z.enum(['customer', 'merchant']).optional(),
952
1141
  invoice_date: z.number().int().optional(),
953
1142
  item_price: CreateForChargeItemInvoiceItemPriceSchema.optional(),
954
- item_tiers: CreateForChargeItemInvoiceItemTiersSchema.optional(),
1143
+ item_tiers: z
1144
+ .union([
1145
+ z.array(CreateForChargeItemInvoiceItemTiersItemSchema.optional()),
1146
+ CreateForChargeItemInvoiceItemTiersSchema,
1147
+ ])
1148
+ .optional(),
955
1149
  });
956
1150
  export { CreateForChargeItemInvoiceBodySchema };
957
1151
  //Invoice.stopDunning
@@ -1010,6 +1204,74 @@ const ImportInvoiceInvoiceShippingAddressSchema = z.object({
1010
1204
  .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
1011
1205
  .optional(),
1012
1206
  });
1207
+ const ImportInvoiceInvoiceLineItemsItemSchema = z.object({
1208
+ id: z.string().max(40).optional(),
1209
+ date_from: z.number().int().optional(),
1210
+ date_to: z.number().int().optional(),
1211
+ subscription_id: z.string().max(50).optional(),
1212
+ description: z.string().max(250),
1213
+ unit_amount: z.number().int().optional(),
1214
+ quantity: z.number().int().optional(),
1215
+ amount: z.number().int().optional(),
1216
+ unit_amount_in_decimal: z.string().max(39).optional(),
1217
+ quantity_in_decimal: z.string().max(33).optional(),
1218
+ amount_in_decimal: z.string().max(39).optional(),
1219
+ entity_type: z
1220
+ .enum([
1221
+ 'adhoc',
1222
+ 'plan_item_price',
1223
+ 'addon_item_price',
1224
+ 'charge_item_price',
1225
+ 'plan_setup',
1226
+ 'plan',
1227
+ 'addon',
1228
+ ])
1229
+ .optional(),
1230
+ entity_id: z.string().max(100).optional(),
1231
+ item_level_discount1_entity_id: z.string().max(100).optional(),
1232
+ item_level_discount1_amount: z.number().int().min(0).optional(),
1233
+ item_level_discount2_entity_id: z.string().max(100).optional(),
1234
+ item_level_discount2_amount: z.number().int().min(0).optional(),
1235
+ tax1_name: z.string().max(50).optional(),
1236
+ tax1_amount: z.number().int().min(0).optional(),
1237
+ tax2_name: z.string().max(50).optional(),
1238
+ tax2_amount: z.number().int().min(0).optional(),
1239
+ tax3_name: z.string().max(50).optional(),
1240
+ tax3_amount: z.number().int().min(0).optional(),
1241
+ tax4_name: z.string().max(50).optional(),
1242
+ tax4_amount: z.number().int().min(0).optional(),
1243
+ tax5_name: z.string().max(50).optional(),
1244
+ tax5_amount: z.number().int().min(0).optional(),
1245
+ tax6_name: z.string().max(50).optional(),
1246
+ tax6_amount: z.number().int().min(0).optional(),
1247
+ tax7_name: z.string().max(50).optional(),
1248
+ tax7_amount: z.number().int().min(0).optional(),
1249
+ tax8_name: z.string().max(50).optional(),
1250
+ tax8_amount: z.number().int().min(0).optional(),
1251
+ tax9_name: z.string().max(50).optional(),
1252
+ tax9_amount: z.number().int().min(0).optional(),
1253
+ tax10_name: z.string().max(50).optional(),
1254
+ tax10_amount: z.number().int().min(0).optional(),
1255
+ is_partial_tax_applied: z.boolean().optional(),
1256
+ taxable_amount: z.number().int().min(0).optional(),
1257
+ tax_exempt_reason: z
1258
+ .enum([
1259
+ 'region_non_taxable',
1260
+ 'export',
1261
+ 'customer_exempt',
1262
+ 'product_exempt',
1263
+ 'zero_rated',
1264
+ 'reverse_charge',
1265
+ 'high_value_physical_goods',
1266
+ 'zero_value_item',
1267
+ 'tax_not_configured_external_provider',
1268
+ ])
1269
+ .optional(),
1270
+ proration_mode: z
1271
+ .enum(['reset', 'delta', 'service_period_revision', 'adjusted_term'])
1272
+ .optional(),
1273
+ created_at: z.number().int().optional(),
1274
+ });
1013
1275
  const ImportInvoiceInvoiceLineItemsSchema = z.object({
1014
1276
  id: z.array(z.string().max(40).optional()).optional(),
1015
1277
  date_from: z.array(z.number().int().optional()).optional(),
@@ -1070,6 +1332,21 @@ const ImportInvoiceInvoiceLineItemsSchema = z.object({
1070
1332
  tax10_amount: z.array(z.number().int().min(0).optional()).optional(),
1071
1333
  is_partial_tax_applied: z.array(z.boolean().optional()).optional(),
1072
1334
  taxable_amount: z.array(z.number().int().min(0).optional()).optional(),
1335
+ tax_exempt_reason: z
1336
+ .array(z
1337
+ .enum([
1338
+ 'region_non_taxable',
1339
+ 'export',
1340
+ 'customer_exempt',
1341
+ 'product_exempt',
1342
+ 'zero_rated',
1343
+ 'reverse_charge',
1344
+ 'high_value_physical_goods',
1345
+ 'zero_value_item',
1346
+ 'tax_not_configured_external_provider',
1347
+ ])
1348
+ .optional())
1349
+ .optional(),
1073
1350
  proration_mode: z
1074
1351
  .array(z
1075
1352
  .enum(['reset', 'delta', 'service_period_revision', 'adjusted_term'])
@@ -1077,11 +1354,27 @@ const ImportInvoiceInvoiceLineItemsSchema = z.object({
1077
1354
  .optional(),
1078
1355
  created_at: z.array(z.number().int().optional()).optional(),
1079
1356
  });
1357
+ const ImportInvoiceInvoicePaymentReferenceNumbersItemSchema = z.object({
1358
+ id: z.string().max(40).optional(),
1359
+ type: z.enum(['kid', 'ocr', 'frn', 'fik', 'swiss_reference']),
1360
+ number: z.string().max(100),
1361
+ });
1080
1362
  const ImportInvoiceInvoicePaymentReferenceNumbersSchema = z.object({
1081
1363
  id: z.array(z.string().max(40).optional()).optional(),
1082
1364
  type: z.array(z.enum(['kid', 'ocr', 'frn', 'fik', 'swiss_reference']).optional()),
1083
1365
  number: z.array(z.string().max(100).optional()),
1084
1366
  });
1367
+ const ImportInvoiceInvoiceLineItemTiersItemSchema = z.object({
1368
+ line_item_id: z.string().max(40),
1369
+ starting_unit: z.number().int().min(0).optional(),
1370
+ ending_unit: z.number().int().optional(),
1371
+ quantity_used: z.number().int().min(0).optional(),
1372
+ unit_amount: z.number().int().min(0).optional(),
1373
+ starting_unit_in_decimal: z.string().max(33).optional(),
1374
+ ending_unit_in_decimal: z.string().max(33).optional(),
1375
+ quantity_used_in_decimal: z.string().max(33).optional(),
1376
+ unit_amount_in_decimal: z.string().max(40).optional(),
1377
+ });
1085
1378
  const ImportInvoiceInvoiceLineItemTiersSchema = z.object({
1086
1379
  line_item_id: z.array(z.string().max(40).optional()),
1087
1380
  starting_unit: z.array(z.number().int().min(0).optional()).optional(),
@@ -1093,6 +1386,19 @@ const ImportInvoiceInvoiceLineItemTiersSchema = z.object({
1093
1386
  quantity_used_in_decimal: z.array(z.string().max(33).optional()).optional(),
1094
1387
  unit_amount_in_decimal: z.array(z.string().max(40).optional()).optional(),
1095
1388
  });
1389
+ const ImportInvoiceInvoiceDiscountsItemSchema = z.object({
1390
+ line_item_id: z.string().max(40).optional(),
1391
+ entity_type: z.enum([
1392
+ 'item_level_coupon',
1393
+ 'document_level_coupon',
1394
+ 'promotional_credits',
1395
+ 'item_level_discount',
1396
+ 'document_level_discount',
1397
+ ]),
1398
+ entity_id: z.string().max(100).optional(),
1399
+ description: z.string().max(250).optional(),
1400
+ amount: z.number().int().min(0),
1401
+ });
1096
1402
  const ImportInvoiceInvoiceDiscountsSchema = z.object({
1097
1403
  line_item_id: z.array(z.string().max(40).optional()).optional(),
1098
1404
  entity_type: z.array(z
@@ -1108,6 +1414,26 @@ const ImportInvoiceInvoiceDiscountsSchema = z.object({
1108
1414
  description: z.array(z.string().max(250).optional()).optional(),
1109
1415
  amount: z.array(z.number().int().min(0).optional()),
1110
1416
  });
1417
+ const ImportInvoiceInvoiceTaxesItemSchema = z.object({
1418
+ name: z.string().max(100),
1419
+ rate: z.number().min(0).max(100),
1420
+ amount: z.number().int().min(0).optional(),
1421
+ description: z.string().max(50).optional(),
1422
+ juris_type: z
1423
+ .enum([
1424
+ 'country',
1425
+ 'federal',
1426
+ 'state',
1427
+ 'county',
1428
+ 'city',
1429
+ 'special',
1430
+ 'unincorporated',
1431
+ 'other',
1432
+ ])
1433
+ .optional(),
1434
+ juris_name: z.string().max(250).optional(),
1435
+ juris_code: z.string().max(250).optional(),
1436
+ });
1111
1437
  const ImportInvoiceInvoiceTaxesSchema = z.object({
1112
1438
  name: z.array(z.string().max(100).optional()),
1113
1439
  rate: z.array(z.number().min(0).max(100).optional()),
@@ -1130,6 +1456,21 @@ const ImportInvoiceInvoiceTaxesSchema = z.object({
1130
1456
  juris_name: z.array(z.string().max(250).optional()).optional(),
1131
1457
  juris_code: z.array(z.string().max(250).optional()).optional(),
1132
1458
  });
1459
+ const ImportInvoiceInvoicePaymentsItemSchema = z.object({
1460
+ id: z.string().max(40).optional(),
1461
+ amount: z.number().int().min(1),
1462
+ payment_method: z.enum([
1463
+ 'cash',
1464
+ 'check',
1465
+ 'bank_transfer',
1466
+ 'other',
1467
+ 'app_store',
1468
+ 'play_store',
1469
+ 'custom',
1470
+ ]),
1471
+ date: z.number().int().optional(),
1472
+ reference_number: z.string().max(100).min(1).optional(),
1473
+ });
1133
1474
  const ImportInvoiceInvoicePaymentsSchema = z.object({
1134
1475
  id: z.array(z.string().max(40).optional()).optional(),
1135
1476
  amount: z.array(z.number().int().min(1).optional()),
@@ -1142,17 +1483,25 @@ const ImportInvoiceInvoicePaymentsSchema = z.object({
1142
1483
  'app_store',
1143
1484
  'play_store',
1144
1485
  'custom',
1145
- 'tamara',
1146
- 'qpay',
1147
- 'blik',
1148
- 'fpx',
1149
- 'wero',
1150
- 'p24',
1151
1486
  ])
1152
1487
  .optional()),
1153
1488
  date: z.array(z.number().int().optional()).optional(),
1154
1489
  reference_number: z.array(z.string().max(100).min(1).optional()).optional(),
1155
1490
  });
1491
+ const ImportInvoiceInvoiceNotesItemSchema = z.object({
1492
+ entity_type: z
1493
+ .enum([
1494
+ 'coupon',
1495
+ 'plan_item_price',
1496
+ 'addon_item_price',
1497
+ 'charge_item_price',
1498
+ 'plan',
1499
+ 'addon',
1500
+ ])
1501
+ .optional(),
1502
+ entity_id: z.string().max(50).optional(),
1503
+ note: z.string().max(65000).optional(),
1504
+ });
1156
1505
  const ImportInvoiceInvoiceNotesSchema = z.object({
1157
1506
  entity_type: z
1158
1507
  .array(z
@@ -1169,6 +1518,25 @@ const ImportInvoiceInvoiceNotesSchema = z.object({
1169
1518
  entity_id: z.array(z.string().max(50).optional()).optional(),
1170
1519
  note: z.array(z.string().max(65000).optional()).optional(),
1171
1520
  });
1521
+ const ImportInvoiceInvoiceLineItemAddressesItemSchema = z.object({
1522
+ line_item_id: z.string().max(40).optional(),
1523
+ first_name: z.string().max(150).optional(),
1524
+ last_name: z.string().max(150).optional(),
1525
+ email: z.string().email().max(70).optional(),
1526
+ company: z.string().max(250).optional(),
1527
+ phone: z.string().max(50).optional(),
1528
+ line1: z.string().max(150).optional(),
1529
+ line2: z.string().max(150).optional(),
1530
+ line3: z.string().max(150).optional(),
1531
+ city: z.string().max(50).optional(),
1532
+ state_code: z.string().max(50).optional(),
1533
+ state: z.string().max(50).optional(),
1534
+ zip: z.string().max(20).optional(),
1535
+ country: z.string().max(50).optional(),
1536
+ validation_status: z
1537
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
1538
+ .optional(),
1539
+ });
1172
1540
  const ImportInvoiceInvoiceLineItemAddressesSchema = z.object({
1173
1541
  line_item_id: z.array(z.string().max(40).optional()).optional(),
1174
1542
  first_name: z.array(z.string().max(150).optional()).optional(),
@@ -1231,41 +1599,110 @@ const ImportInvoiceInvoiceBodySchema = z.looseObject({
1231
1599
  credit_note: ImportInvoiceInvoiceCreditNoteSchema.optional(),
1232
1600
  billing_address: ImportInvoiceInvoiceBillingAddressSchema.optional(),
1233
1601
  shipping_address: ImportInvoiceInvoiceShippingAddressSchema.optional(),
1234
- line_items: ImportInvoiceInvoiceLineItemsSchema.optional(),
1235
- payment_reference_numbers: ImportInvoiceInvoicePaymentReferenceNumbersSchema.optional(),
1236
- line_item_tiers: ImportInvoiceInvoiceLineItemTiersSchema.optional(),
1237
- discounts: ImportInvoiceInvoiceDiscountsSchema.optional(),
1238
- taxes: ImportInvoiceInvoiceTaxesSchema.optional(),
1239
- payments: ImportInvoiceInvoicePaymentsSchema.optional(),
1240
- notes: ImportInvoiceInvoiceNotesSchema.optional(),
1241
- line_item_addresses: ImportInvoiceInvoiceLineItemAddressesSchema.optional(),
1602
+ line_items: z
1603
+ .union([
1604
+ z.array(ImportInvoiceInvoiceLineItemsItemSchema.optional()),
1605
+ ImportInvoiceInvoiceLineItemsSchema,
1606
+ ])
1607
+ .optional(),
1608
+ payment_reference_numbers: z
1609
+ .union([
1610
+ z.array(ImportInvoiceInvoicePaymentReferenceNumbersItemSchema.optional()),
1611
+ ImportInvoiceInvoicePaymentReferenceNumbersSchema,
1612
+ ])
1613
+ .optional(),
1614
+ line_item_tiers: z
1615
+ .union([
1616
+ z.array(ImportInvoiceInvoiceLineItemTiersItemSchema.optional()),
1617
+ ImportInvoiceInvoiceLineItemTiersSchema,
1618
+ ])
1619
+ .optional(),
1620
+ discounts: z
1621
+ .union([
1622
+ z.array(ImportInvoiceInvoiceDiscountsItemSchema.optional()),
1623
+ ImportInvoiceInvoiceDiscountsSchema,
1624
+ ])
1625
+ .optional(),
1626
+ taxes: z
1627
+ .union([
1628
+ z.array(ImportInvoiceInvoiceTaxesItemSchema.optional()),
1629
+ ImportInvoiceInvoiceTaxesSchema,
1630
+ ])
1631
+ .optional(),
1632
+ payments: z
1633
+ .union([
1634
+ z.array(ImportInvoiceInvoicePaymentsItemSchema.optional()),
1635
+ ImportInvoiceInvoicePaymentsSchema,
1636
+ ])
1637
+ .optional(),
1638
+ notes: z
1639
+ .union([
1640
+ z.array(ImportInvoiceInvoiceNotesItemSchema.optional()),
1641
+ ImportInvoiceInvoiceNotesSchema,
1642
+ ])
1643
+ .optional(),
1644
+ line_item_addresses: z
1645
+ .union([
1646
+ z.array(ImportInvoiceInvoiceLineItemAddressesItemSchema.optional()),
1647
+ ImportInvoiceInvoiceLineItemAddressesSchema,
1648
+ ])
1649
+ .optional(),
1242
1650
  });
1243
1651
  export { ImportInvoiceInvoiceBodySchema };
1244
1652
  //Invoice.applyPayments
1653
+ const ApplyPaymentsInvoiceTransactionsItemSchema = z.object({
1654
+ id: z.string().max(40).optional(),
1655
+ amount: z.number().int().min(0).optional(),
1656
+ });
1245
1657
  const ApplyPaymentsInvoiceTransactionsSchema = z.object({
1246
1658
  id: z.array(z.string().max(40).optional()).optional(),
1247
1659
  amount: z.array(z.number().int().min(0).optional()).optional(),
1248
1660
  });
1249
1661
  const ApplyPaymentsInvoiceBodySchema = z.looseObject({
1250
1662
  comment: z.string().max(300).optional(),
1251
- transactions: ApplyPaymentsInvoiceTransactionsSchema.optional(),
1663
+ transactions: z
1664
+ .union([
1665
+ z.array(ApplyPaymentsInvoiceTransactionsItemSchema.optional()),
1666
+ ApplyPaymentsInvoiceTransactionsSchema,
1667
+ ])
1668
+ .optional(),
1252
1669
  });
1253
1670
  export { ApplyPaymentsInvoiceBodySchema };
1254
1671
  //Invoice.deleteLineItems
1672
+ const DeleteLineItemsInvoiceLineItemsItemSchema = z.object({
1673
+ id: z.string().max(40).optional(),
1674
+ });
1255
1675
  const DeleteLineItemsInvoiceLineItemsSchema = z.object({
1256
1676
  id: z.array(z.string().max(40).optional()).optional(),
1257
1677
  });
1258
1678
  const DeleteLineItemsInvoiceBodySchema = z.looseObject({
1259
- line_items: DeleteLineItemsInvoiceLineItemsSchema.optional(),
1679
+ line_items: z
1680
+ .union([
1681
+ z.array(DeleteLineItemsInvoiceLineItemsItemSchema.optional()),
1682
+ DeleteLineItemsInvoiceLineItemsSchema,
1683
+ ])
1684
+ .optional(),
1260
1685
  });
1261
1686
  export { DeleteLineItemsInvoiceBodySchema };
1262
1687
  //Invoice.applyCredits
1688
+ const ApplyCreditsInvoiceCreditNotesItemSchema = z.object({
1689
+ id: z.string().max(50).optional(),
1690
+ amount: z.number().int().min(1).optional(),
1691
+ applied_at: z.number().int().optional(),
1692
+ });
1263
1693
  const ApplyCreditsInvoiceCreditNotesSchema = z.object({
1264
1694
  id: z.array(z.string().max(50).optional()).optional(),
1695
+ amount: z.array(z.number().int().min(1).optional()).optional(),
1696
+ applied_at: z.array(z.number().int().optional()).optional(),
1265
1697
  });
1266
1698
  const ApplyCreditsInvoiceBodySchema = z.looseObject({
1267
1699
  comment: z.string().max(300).optional(),
1268
- credit_notes: ApplyCreditsInvoiceCreditNotesSchema.optional(),
1700
+ credit_notes: z
1701
+ .union([
1702
+ z.array(ApplyCreditsInvoiceCreditNotesItemSchema.optional()),
1703
+ ApplyCreditsInvoiceCreditNotesSchema,
1704
+ ])
1705
+ .optional(),
1269
1706
  });
1270
1707
  export { ApplyCreditsInvoiceBodySchema };
1271
1708
  //Invoice.list
@@ -1273,26 +1710,56 @@ const ListInvoiceIdSchema = z.object({
1273
1710
  is: z.string().min(1).optional(),
1274
1711
  is_not: z.string().min(1).optional(),
1275
1712
  starts_with: z.string().min(1).optional(),
1276
- in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1277
- not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1713
+ in: z
1714
+ .union([
1715
+ z.array(z.string().optional()),
1716
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
1717
+ ])
1718
+ .optional(),
1719
+ not_in: z
1720
+ .union([
1721
+ z.array(z.string().optional()),
1722
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
1723
+ ])
1724
+ .optional(),
1278
1725
  });
1279
1726
  const ListInvoiceSubscriptionIdSchema = z.object({
1280
1727
  is: z.string().min(1).optional(),
1281
1728
  is_not: z.string().min(1).optional(),
1282
1729
  starts_with: z.string().min(1).optional(),
1283
- is_present: z.enum(['true', 'false']).optional(),
1284
- in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1285
- not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1730
+ is_present: z.union([z.boolean(), z.enum(['true', 'false'])]).optional(),
1731
+ in: z
1732
+ .union([
1733
+ z.array(z.string().optional()),
1734
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
1735
+ ])
1736
+ .optional(),
1737
+ not_in: z
1738
+ .union([
1739
+ z.array(z.string().optional()),
1740
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
1741
+ ])
1742
+ .optional(),
1286
1743
  });
1287
1744
  const ListInvoiceCustomerIdSchema = z.object({
1288
1745
  is: z.string().min(1).optional(),
1289
1746
  is_not: z.string().min(1).optional(),
1290
1747
  starts_with: z.string().min(1).optional(),
1291
- in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1292
- not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1748
+ in: z
1749
+ .union([
1750
+ z.array(z.string().optional()),
1751
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
1752
+ ])
1753
+ .optional(),
1754
+ not_in: z
1755
+ .union([
1756
+ z.array(z.string().optional()),
1757
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
1758
+ ])
1759
+ .optional(),
1293
1760
  });
1294
1761
  const ListInvoiceRecurringSchema = z.object({
1295
- is: z.enum(['true', 'false']).optional(),
1762
+ is: z.union([z.boolean(), z.enum(['true', 'false'])]).optional(),
1296
1763
  });
1297
1764
  const ListInvoiceStatusSchema = z.object({
1298
1765
  is: z
@@ -1302,113 +1769,330 @@ const ListInvoiceStatusSchema = z.object({
1302
1769
  .enum(['paid', 'posted', 'payment_due', 'not_paid', 'voided', 'pending'])
1303
1770
  .optional(),
1304
1771
  in: z
1305
- .enum(['paid', 'posted', 'payment_due', 'not_paid', 'voided', 'pending'])
1772
+ .union([
1773
+ z.array(z
1774
+ .enum([
1775
+ 'paid',
1776
+ 'posted',
1777
+ 'payment_due',
1778
+ 'not_paid',
1779
+ 'voided',
1780
+ 'pending',
1781
+ ])
1782
+ .optional()),
1783
+ z.enum([
1784
+ 'paid',
1785
+ 'posted',
1786
+ 'payment_due',
1787
+ 'not_paid',
1788
+ 'voided',
1789
+ 'pending',
1790
+ ]),
1791
+ ])
1306
1792
  .optional(),
1307
1793
  not_in: z
1308
- .enum(['paid', 'posted', 'payment_due', 'not_paid', 'voided', 'pending'])
1794
+ .union([
1795
+ z.array(z
1796
+ .enum([
1797
+ 'paid',
1798
+ 'posted',
1799
+ 'payment_due',
1800
+ 'not_paid',
1801
+ 'voided',
1802
+ 'pending',
1803
+ ])
1804
+ .optional()),
1805
+ z.enum([
1806
+ 'paid',
1807
+ 'posted',
1808
+ 'payment_due',
1809
+ 'not_paid',
1810
+ 'voided',
1811
+ 'pending',
1812
+ ]),
1813
+ ])
1309
1814
  .optional(),
1310
1815
  });
1311
1816
  const ListInvoicePriceTypeSchema = z.object({
1312
1817
  is: z.enum(['tax_exclusive', 'tax_inclusive']).optional(),
1313
1818
  is_not: z.enum(['tax_exclusive', 'tax_inclusive']).optional(),
1314
- in: z.enum(['tax_exclusive', 'tax_inclusive']).optional(),
1315
- not_in: z.enum(['tax_exclusive', 'tax_inclusive']).optional(),
1819
+ in: z
1820
+ .union([
1821
+ z.array(z.enum(['tax_exclusive', 'tax_inclusive']).optional()),
1822
+ z.enum(['tax_exclusive', 'tax_inclusive']),
1823
+ ])
1824
+ .optional(),
1825
+ not_in: z
1826
+ .union([
1827
+ z.array(z.enum(['tax_exclusive', 'tax_inclusive']).optional()),
1828
+ z.enum(['tax_exclusive', 'tax_inclusive']),
1829
+ ])
1830
+ .optional(),
1316
1831
  });
1317
1832
  const ListInvoiceDateSchema = z.object({
1318
- after: z.string().regex(RegExp('^\\d{10}$')).optional(),
1319
- before: z.string().regex(RegExp('^\\d{10}$')).optional(),
1320
- on: z.string().regex(RegExp('^\\d{10}$')).optional(),
1321
- between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
1833
+ after: z
1834
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
1835
+ .optional(),
1836
+ before: z
1837
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
1838
+ .optional(),
1839
+ on: z
1840
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
1841
+ .optional(),
1842
+ between: z
1843
+ .union([
1844
+ z.array(z.number().int().optional()).min(2).max(2),
1845
+ z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
1846
+ ])
1847
+ .optional(),
1322
1848
  });
1323
1849
  const ListInvoicePaidAtSchema = z.object({
1324
- after: z.string().regex(RegExp('^\\d{10}$')).optional(),
1325
- before: z.string().regex(RegExp('^\\d{10}$')).optional(),
1326
- on: z.string().regex(RegExp('^\\d{10}$')).optional(),
1327
- between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
1850
+ after: z
1851
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
1852
+ .optional(),
1853
+ before: z
1854
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
1855
+ .optional(),
1856
+ on: z
1857
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
1858
+ .optional(),
1859
+ between: z
1860
+ .union([
1861
+ z.array(z.number().int().optional()).min(2).max(2),
1862
+ z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
1863
+ ])
1864
+ .optional(),
1328
1865
  });
1329
1866
  const ListInvoiceTotalSchema = z.object({
1330
- is: z.string().regex(RegExp('^-?\\d+$')).optional(),
1331
- is_not: z.string().regex(RegExp('^-?\\d+$')).optional(),
1332
- lt: z.string().regex(RegExp('^-?\\d+$')).optional(),
1333
- lte: z.string().regex(RegExp('^-?\\d+$')).optional(),
1334
- gt: z.string().regex(RegExp('^-?\\d+$')).optional(),
1335
- gte: z.string().regex(RegExp('^-?\\d+$')).optional(),
1336
- between: z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')).optional(),
1867
+ is: z
1868
+ .union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
1869
+ .optional(),
1870
+ is_not: z
1871
+ .union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
1872
+ .optional(),
1873
+ lt: z
1874
+ .union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
1875
+ .optional(),
1876
+ lte: z
1877
+ .union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
1878
+ .optional(),
1879
+ gt: z
1880
+ .union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
1881
+ .optional(),
1882
+ gte: z
1883
+ .union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
1884
+ .optional(),
1885
+ between: z
1886
+ .union([
1887
+ z.array(z.number().int().optional()).min(2).max(2),
1888
+ z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')),
1889
+ ])
1890
+ .optional(),
1337
1891
  });
1338
1892
  const ListInvoiceAmountPaidSchema = z.object({
1339
- is: z.string().regex(RegExp('^-?\\d+$')).optional(),
1340
- is_not: z.string().regex(RegExp('^-?\\d+$')).optional(),
1341
- lt: z.string().regex(RegExp('^-?\\d+$')).optional(),
1342
- lte: z.string().regex(RegExp('^-?\\d+$')).optional(),
1343
- gt: z.string().regex(RegExp('^-?\\d+$')).optional(),
1344
- gte: z.string().regex(RegExp('^-?\\d+$')).optional(),
1345
- between: z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')).optional(),
1893
+ is: z
1894
+ .union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
1895
+ .optional(),
1896
+ is_not: z
1897
+ .union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
1898
+ .optional(),
1899
+ lt: z
1900
+ .union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
1901
+ .optional(),
1902
+ lte: z
1903
+ .union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
1904
+ .optional(),
1905
+ gt: z
1906
+ .union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
1907
+ .optional(),
1908
+ gte: z
1909
+ .union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
1910
+ .optional(),
1911
+ between: z
1912
+ .union([
1913
+ z.array(z.number().int().optional()).min(2).max(2),
1914
+ z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')),
1915
+ ])
1916
+ .optional(),
1346
1917
  });
1347
1918
  const ListInvoiceAmountAdjustedSchema = z.object({
1348
- is: z.string().regex(RegExp('^-?\\d+$')).optional(),
1349
- is_not: z.string().regex(RegExp('^-?\\d+$')).optional(),
1350
- lt: z.string().regex(RegExp('^-?\\d+$')).optional(),
1351
- lte: z.string().regex(RegExp('^-?\\d+$')).optional(),
1352
- gt: z.string().regex(RegExp('^-?\\d+$')).optional(),
1353
- gte: z.string().regex(RegExp('^-?\\d+$')).optional(),
1354
- between: z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')).optional(),
1919
+ is: z
1920
+ .union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
1921
+ .optional(),
1922
+ is_not: z
1923
+ .union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
1924
+ .optional(),
1925
+ lt: z
1926
+ .union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
1927
+ .optional(),
1928
+ lte: z
1929
+ .union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
1930
+ .optional(),
1931
+ gt: z
1932
+ .union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
1933
+ .optional(),
1934
+ gte: z
1935
+ .union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
1936
+ .optional(),
1937
+ between: z
1938
+ .union([
1939
+ z.array(z.number().int().optional()).min(2).max(2),
1940
+ z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')),
1941
+ ])
1942
+ .optional(),
1355
1943
  });
1356
1944
  const ListInvoiceCreditsAppliedSchema = z.object({
1357
- is: z.string().regex(RegExp('^-?\\d+$')).optional(),
1358
- is_not: z.string().regex(RegExp('^-?\\d+$')).optional(),
1359
- lt: z.string().regex(RegExp('^-?\\d+$')).optional(),
1360
- lte: z.string().regex(RegExp('^-?\\d+$')).optional(),
1361
- gt: z.string().regex(RegExp('^-?\\d+$')).optional(),
1362
- gte: z.string().regex(RegExp('^-?\\d+$')).optional(),
1363
- between: z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')).optional(),
1945
+ is: z
1946
+ .union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
1947
+ .optional(),
1948
+ is_not: z
1949
+ .union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
1950
+ .optional(),
1951
+ lt: z
1952
+ .union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
1953
+ .optional(),
1954
+ lte: z
1955
+ .union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
1956
+ .optional(),
1957
+ gt: z
1958
+ .union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
1959
+ .optional(),
1960
+ gte: z
1961
+ .union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
1962
+ .optional(),
1963
+ between: z
1964
+ .union([
1965
+ z.array(z.number().int().optional()).min(2).max(2),
1966
+ z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')),
1967
+ ])
1968
+ .optional(),
1364
1969
  });
1365
1970
  const ListInvoiceAmountDueSchema = z.object({
1366
- is: z.string().regex(RegExp('^-?\\d+$')).optional(),
1367
- is_not: z.string().regex(RegExp('^-?\\d+$')).optional(),
1368
- lt: z.string().regex(RegExp('^-?\\d+$')).optional(),
1369
- lte: z.string().regex(RegExp('^-?\\d+$')).optional(),
1370
- gt: z.string().regex(RegExp('^-?\\d+$')).optional(),
1371
- gte: z.string().regex(RegExp('^-?\\d+$')).optional(),
1372
- between: z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')).optional(),
1971
+ is: z
1972
+ .union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
1973
+ .optional(),
1974
+ is_not: z
1975
+ .union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
1976
+ .optional(),
1977
+ lt: z
1978
+ .union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
1979
+ .optional(),
1980
+ lte: z
1981
+ .union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
1982
+ .optional(),
1983
+ gt: z
1984
+ .union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
1985
+ .optional(),
1986
+ gte: z
1987
+ .union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
1988
+ .optional(),
1989
+ between: z
1990
+ .union([
1991
+ z.array(z.number().int().optional()).min(2).max(2),
1992
+ z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')),
1993
+ ])
1994
+ .optional(),
1373
1995
  });
1374
1996
  const ListInvoiceDunningStatusSchema = z.object({
1375
1997
  is: z.enum(['in_progress', 'exhausted', 'stopped', 'success']).optional(),
1376
1998
  is_not: z.enum(['in_progress', 'exhausted', 'stopped', 'success']).optional(),
1377
- in: z.enum(['in_progress', 'exhausted', 'stopped', 'success']).optional(),
1378
- not_in: z.enum(['in_progress', 'exhausted', 'stopped', 'success']).optional(),
1379
- is_present: z.enum(['true', 'false']).optional(),
1999
+ in: z
2000
+ .union([
2001
+ z.array(z.enum(['in_progress', 'exhausted', 'stopped', 'success']).optional()),
2002
+ z.enum(['in_progress', 'exhausted', 'stopped', 'success']),
2003
+ ])
2004
+ .optional(),
2005
+ not_in: z
2006
+ .union([
2007
+ z.array(z.enum(['in_progress', 'exhausted', 'stopped', 'success']).optional()),
2008
+ z.enum(['in_progress', 'exhausted', 'stopped', 'success']),
2009
+ ])
2010
+ .optional(),
2011
+ is_present: z.union([z.boolean(), z.enum(['true', 'false'])]).optional(),
1380
2012
  });
1381
2013
  const ListInvoicePaymentOwnerSchema = z.object({
1382
2014
  is: z.string().min(1).optional(),
1383
2015
  is_not: z.string().min(1).optional(),
1384
2016
  starts_with: z.string().min(1).optional(),
1385
- in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1386
- not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
2017
+ in: z
2018
+ .union([
2019
+ z.array(z.string().optional()),
2020
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
2021
+ ])
2022
+ .optional(),
2023
+ not_in: z
2024
+ .union([
2025
+ z.array(z.string().optional()),
2026
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
2027
+ ])
2028
+ .optional(),
1387
2029
  });
1388
2030
  const ListInvoiceUpdatedAtSchema = z.object({
1389
- after: z.string().regex(RegExp('^\\d{10}$')).optional(),
1390
- before: z.string().regex(RegExp('^\\d{10}$')).optional(),
1391
- on: z.string().regex(RegExp('^\\d{10}$')).optional(),
1392
- between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
2031
+ after: z
2032
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
2033
+ .optional(),
2034
+ before: z
2035
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
2036
+ .optional(),
2037
+ on: z
2038
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
2039
+ .optional(),
2040
+ between: z
2041
+ .union([
2042
+ z.array(z.number().int().optional()).min(2).max(2),
2043
+ z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
2044
+ ])
2045
+ .optional(),
1393
2046
  });
1394
2047
  const ListInvoiceChannelSchema = z.object({
1395
2048
  is: z.enum(['web', 'app_store', 'play_store']).optional(),
1396
2049
  is_not: z.enum(['web', 'app_store', 'play_store']).optional(),
1397
- in: z.enum(['web', 'app_store', 'play_store']).optional(),
1398
- not_in: z.enum(['web', 'app_store', 'play_store']).optional(),
2050
+ in: z
2051
+ .union([
2052
+ z.array(z.enum(['web', 'app_store', 'play_store']).optional()),
2053
+ z.enum(['web', 'app_store', 'play_store']),
2054
+ ])
2055
+ .optional(),
2056
+ not_in: z
2057
+ .union([
2058
+ z.array(z.enum(['web', 'app_store', 'play_store']).optional()),
2059
+ z.enum(['web', 'app_store', 'play_store']),
2060
+ ])
2061
+ .optional(),
1399
2062
  });
1400
2063
  const ListInvoiceVoidedAtSchema = z.object({
1401
- after: z.string().regex(RegExp('^\\d{10}$')).optional(),
1402
- before: z.string().regex(RegExp('^\\d{10}$')).optional(),
1403
- on: z.string().regex(RegExp('^\\d{10}$')).optional(),
1404
- between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
2064
+ after: z
2065
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
2066
+ .optional(),
2067
+ before: z
2068
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
2069
+ .optional(),
2070
+ on: z
2071
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
2072
+ .optional(),
2073
+ between: z
2074
+ .union([
2075
+ z.array(z.number().int().optional()).min(2).max(2),
2076
+ z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
2077
+ ])
2078
+ .optional(),
1405
2079
  });
1406
2080
  const ListInvoiceVoidReasonCodeSchema = z.object({
1407
2081
  is: z.string().min(1).optional(),
1408
2082
  is_not: z.string().min(1).optional(),
1409
2083
  starts_with: z.string().min(1).optional(),
1410
- in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1411
- not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
2084
+ in: z
2085
+ .union([
2086
+ z.array(z.string().optional()),
2087
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
2088
+ ])
2089
+ .optional(),
2090
+ not_in: z
2091
+ .union([
2092
+ z.array(z.string().optional()),
2093
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
2094
+ ])
2095
+ .optional(),
1412
2096
  });
1413
2097
  const ListInvoiceSortBySchema = z.looseObject({
1414
2098
  asc: z.enum(['date', 'updated_at']).optional(),
@@ -1481,23 +2165,31 @@ const PdfInvoiceBodySchema = z.looseObject({
1481
2165
  export { PdfInvoiceBodySchema };
1482
2166
  //Invoice.listPaymentReferenceNumbers
1483
2167
  const ListPaymentReferenceNumbersInvoiceIdSchema = z.object({
2168
+ in: z
2169
+ .union([
2170
+ z.array(z.string().optional()),
2171
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
2172
+ ])
2173
+ .optional(),
1484
2174
  is: z.string().min(1).optional(),
1485
- in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1486
2175
  });
1487
2176
  const ListPaymentReferenceNumbersInvoiceNumberSchema = z.object({
2177
+ in: z
2178
+ .union([
2179
+ z.array(z.string().optional()),
2180
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
2181
+ ])
2182
+ .optional(),
1488
2183
  is: z.string().min(1).optional(),
1489
- in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1490
2184
  });
1491
- const ListPaymentReferenceNumbersInvoicePaymentReferenceNumberItemSchema = z.object({
2185
+ const ListPaymentReferenceNumbersInvoicePaymentReferenceNumberSchema = z.object({
1492
2186
  number: ListPaymentReferenceNumbersInvoiceNumberSchema.optional(),
1493
2187
  });
1494
2188
  const ListPaymentReferenceNumbersInvoiceBodySchema = z.looseObject({
1495
2189
  limit: z.number().int().min(1).max(100).optional(),
1496
2190
  offset: z.string().max(1000).optional(),
1497
2191
  id: ListPaymentReferenceNumbersInvoiceIdSchema.optional(),
1498
- payment_reference_number: z
1499
- .array(ListPaymentReferenceNumbersInvoicePaymentReferenceNumberItemSchema.optional())
1500
- .optional(),
2192
+ payment_reference_number: ListPaymentReferenceNumbersInvoicePaymentReferenceNumberSchema.optional(),
1501
2193
  });
1502
2194
  export { ListPaymentReferenceNumbersInvoiceBodySchema };
1503
2195
  //Invoice.addCharge
@@ -1547,6 +2239,16 @@ const AddChargeItemInvoiceItemPriceSchema = z.object({
1547
2239
  date_from: z.number().int().optional(),
1548
2240
  date_to: z.number().int().optional(),
1549
2241
  });
2242
+ const AddChargeItemInvoiceItemTiersItemSchema = z.object({
2243
+ starting_unit: z.number().int().min(1).optional(),
2244
+ ending_unit: z.number().int().optional(),
2245
+ price: z.number().int().min(0).optional(),
2246
+ starting_unit_in_decimal: z.string().max(33).optional(),
2247
+ ending_unit_in_decimal: z.string().max(33).optional(),
2248
+ price_in_decimal: z.string().max(39).optional(),
2249
+ pricing_type: z.enum(['per_unit', 'flat_fee', 'package']).optional(),
2250
+ package_size: z.number().int().min(1).optional(),
2251
+ });
1550
2252
  const AddChargeItemInvoiceItemTiersSchema = z.object({
1551
2253
  starting_unit: z.array(z.number().int().min(1).optional()).optional(),
1552
2254
  ending_unit: z.array(z.number().int().optional()).optional(),
@@ -1563,10 +2265,30 @@ const AddChargeItemInvoiceBodySchema = z.looseObject({
1563
2265
  comment: z.string().max(300).optional(),
1564
2266
  subscription_id: z.string().max(50).optional(),
1565
2267
  item_price: AddChargeItemInvoiceItemPriceSchema.optional(),
1566
- item_tiers: AddChargeItemInvoiceItemTiersSchema.optional(),
2268
+ item_tiers: z
2269
+ .union([
2270
+ z.array(AddChargeItemInvoiceItemTiersItemSchema.optional()),
2271
+ AddChargeItemInvoiceItemTiersSchema,
2272
+ ])
2273
+ .optional(),
1567
2274
  });
1568
2275
  export { AddChargeItemInvoiceBodySchema };
1569
2276
  //Invoice.close
2277
+ const CloseInvoiceNotesToRemoveItemSchema = z.object({
2278
+ entity_type: z
2279
+ .enum([
2280
+ 'customer',
2281
+ 'subscription',
2282
+ 'coupon',
2283
+ 'plan_item_price',
2284
+ 'addon_item_price',
2285
+ 'charge_item_price',
2286
+ 'plan',
2287
+ 'addon',
2288
+ ])
2289
+ .optional(),
2290
+ entity_id: z.string().max(100).optional(),
2291
+ });
1570
2292
  const CloseInvoiceNotesToRemoveSchema = z.object({
1571
2293
  entity_type: z
1572
2294
  .array(z
@@ -1589,7 +2311,12 @@ const CloseInvoiceBodySchema = z.looseObject({
1589
2311
  invoice_note: z.string().max(2000).optional(),
1590
2312
  remove_general_note: z.boolean().default(false).optional(),
1591
2313
  invoice_date: z.number().int().optional(),
1592
- notes_to_remove: CloseInvoiceNotesToRemoveSchema.optional(),
2314
+ notes_to_remove: z
2315
+ .union([
2316
+ z.array(CloseInvoiceNotesToRemoveItemSchema.optional()),
2317
+ CloseInvoiceNotesToRemoveSchema,
2318
+ ])
2319
+ .optional(),
1593
2320
  });
1594
2321
  export { CloseInvoiceBodySchema };
1595
2322
  //Invoice.collectPayment
@@ -1612,12 +2339,6 @@ const RecordPaymentInvoiceTransactionSchema = z.object({
1612
2339
  'app_store',
1613
2340
  'play_store',
1614
2341
  'custom',
1615
- 'tamara',
1616
- 'qpay',
1617
- 'blik',
1618
- 'fpx',
1619
- 'wero',
1620
- 'p24',
1621
2342
  ]),
1622
2343
  reference_number: z.string().max(100).optional(),
1623
2344
  custom_payment_method_id: z.string().max(50).optional(),
@@ -1684,12 +2405,6 @@ const RecordRefundInvoiceTransactionSchema = z.object({
1684
2405
  'app_store',
1685
2406
  'play_store',
1686
2407
  'custom',
1687
- 'tamara',
1688
- 'qpay',
1689
- 'blik',
1690
- 'fpx',
1691
- 'wero',
1692
- 'p24',
1693
2408
  ]),
1694
2409
  reference_number: z.string().max(100).optional(),
1695
2410
  custom_payment_method_id: z.string().max(50).optional(),
@@ -1811,3 +2526,8 @@ const ApplyPaymentScheduleSchemeInvoiceBodySchema = z.looseObject({
1811
2526
  amount: z.number().int().min(0).optional(),
1812
2527
  });
1813
2528
  export { ApplyPaymentScheduleSchemeInvoiceBodySchema };
2529
+ //Invoice.removePaymentScheduleScheme
2530
+ const RemovePaymentScheduleSchemeInvoiceBodySchema = z.looseObject({
2531
+ comment: z.string().max(300).optional(),
2532
+ });
2533
+ export { RemovePaymentScheduleSchemeInvoiceBodySchema };