chargebee 3.26.0 → 3.27.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 (163) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +39 -0
  3. package/cjs/RequestWrapper.js +27 -0
  4. package/cjs/chargebee.cjs.js +3 -0
  5. package/cjs/chargebee.cjs.worker.js +2 -0
  6. package/cjs/chargebeeZodValidationError.js +18 -0
  7. package/cjs/createChargebee.js +5 -0
  8. package/cjs/environment.js +1 -1
  9. package/cjs/schema/addon.schema.js +269 -0
  10. package/cjs/schema/address.schema.js +35 -0
  11. package/cjs/schema/alert.schema.js +74 -0
  12. package/cjs/schema/alert_status.schema.js +31 -0
  13. package/cjs/schema/attached_item.schema.js +144 -0
  14. package/cjs/schema/business_entity.schema.js +46 -0
  15. package/cjs/schema/card.schema.js +165 -0
  16. package/cjs/schema/comment.schema.js +69 -0
  17. package/cjs/schema/coupon.schema.js +323 -0
  18. package/cjs/schema/coupon_code.schema.js +49 -0
  19. package/cjs/schema/coupon_set.schema.js +88 -0
  20. package/cjs/schema/credit_note.schema.js +502 -0
  21. package/cjs/schema/currency.schema.js +32 -0
  22. package/cjs/schema/customer.schema.js +1201 -0
  23. package/cjs/schema/customer_entitlement.schema.js +14 -0
  24. package/cjs/schema/differential_price.schema.js +106 -0
  25. package/cjs/schema/entitlement.schema.js +54 -0
  26. package/cjs/schema/entitlement_override.schema.js +35 -0
  27. package/cjs/schema/estimate.schema.js +1535 -0
  28. package/cjs/schema/event.schema.js +1060 -0
  29. package/cjs/schema/export.schema.js +3385 -0
  30. package/cjs/schema/feature.schema.js +78 -0
  31. package/cjs/schema/gift.schema.js +293 -0
  32. package/cjs/schema/grant_block.schema.js +47 -0
  33. package/cjs/schema/hosted_page.schema.js +1777 -0
  34. package/cjs/schema/in_app_subscription.schema.js +68 -0
  35. package/cjs/schema/index.js +88 -0
  36. package/cjs/schema/invoice.schema.js +1685 -0
  37. package/cjs/schema/item.schema.js +195 -0
  38. package/cjs/schema/item_entitlement.schema.js +45 -0
  39. package/cjs/schema/item_family.schema.js +57 -0
  40. package/cjs/schema/item_price.schema.js +335 -0
  41. package/cjs/schema/ledger_account_balance.schema.js +21 -0
  42. package/cjs/schema/ledger_operation.schema.js +104 -0
  43. package/cjs/schema/meter.schema.js +13 -0
  44. package/cjs/schema/metered_feature.schema.js +20 -0
  45. package/cjs/schema/non_subscription.schema.js +28 -0
  46. package/cjs/schema/offer_event.schema.js +13 -0
  47. package/cjs/schema/offer_fulfillment.schema.js +20 -0
  48. package/cjs/schema/omnichannel_one_time_order.schema.js +26 -0
  49. package/cjs/schema/omnichannel_subscription.schema.js +122 -0
  50. package/cjs/schema/omnichannel_subscription_item.schema.js +13 -0
  51. package/cjs/schema/order.schema.js +441 -0
  52. package/cjs/schema/payment_intent.schema.js +127 -0
  53. package/cjs/schema/payment_schedule_scheme.schema.js +20 -0
  54. package/cjs/schema/payment_source.schema.js +630 -0
  55. package/cjs/schema/payment_voucher.schema.js +57 -0
  56. package/cjs/schema/personalized_offer.schema.js +28 -0
  57. package/cjs/schema/plan.schema.js +363 -0
  58. package/cjs/schema/portal_session.schema.js +22 -0
  59. package/cjs/schema/price_variant.schema.js +93 -0
  60. package/cjs/schema/pricing_page_session.schema.js +135 -0
  61. package/cjs/schema/promotional_credit.schema.js +78 -0
  62. package/cjs/schema/promotional_grant.schema.js +17 -0
  63. package/cjs/schema/purchase.schema.js +277 -0
  64. package/cjs/schema/quote.schema.js +1667 -0
  65. package/cjs/schema/ramp.schema.js +245 -0
  66. package/cjs/schema/recorded_purchase.schema.js +32 -0
  67. package/cjs/schema/resource_migration.schema.js +14 -0
  68. package/cjs/schema/site_migration_detail.schema.js +81 -0
  69. package/cjs/schema/subscription.schema.js +3344 -0
  70. package/cjs/schema/subscription_entitlement.schema.js +25 -0
  71. package/cjs/schema/time_machine.schema.js +17 -0
  72. package/cjs/schema/transaction.schema.js +744 -0
  73. package/cjs/schema/unbilled_charge.schema.js +139 -0
  74. package/cjs/schema/usage.schema.js +93 -0
  75. package/cjs/schema/usage_charge.schema.js +17 -0
  76. package/cjs/schema/usage_event.schema.js +28 -0
  77. package/cjs/schema/usage_file.schema.js +13 -0
  78. package/cjs/schema/usage_summary.schema.js +17 -0
  79. package/cjs/schema/virtual_bank_account.schema.js +71 -0
  80. package/cjs/schema/webhook_endpoint.schema.js +508 -0
  81. package/cjs/validationLoader.js +59 -0
  82. package/esm/RequestWrapper.js +27 -0
  83. package/esm/chargebee.esm.js +2 -0
  84. package/esm/chargebee.esm.worker.js +1 -0
  85. package/esm/chargebeeZodValidationError.js +14 -0
  86. package/esm/createChargebee.js +5 -0
  87. package/esm/environment.js +1 -1
  88. package/esm/schema/addon.schema.js +266 -0
  89. package/esm/schema/address.schema.js +32 -0
  90. package/esm/schema/alert.schema.js +71 -0
  91. package/esm/schema/alert_status.schema.js +28 -0
  92. package/esm/schema/attached_item.schema.js +141 -0
  93. package/esm/schema/business_entity.schema.js +43 -0
  94. package/esm/schema/card.schema.js +162 -0
  95. package/esm/schema/comment.schema.js +66 -0
  96. package/esm/schema/coupon.schema.js +320 -0
  97. package/esm/schema/coupon_code.schema.js +46 -0
  98. package/esm/schema/coupon_set.schema.js +85 -0
  99. package/esm/schema/credit_note.schema.js +499 -0
  100. package/esm/schema/currency.schema.js +29 -0
  101. package/esm/schema/customer.schema.js +1198 -0
  102. package/esm/schema/customer_entitlement.schema.js +11 -0
  103. package/esm/schema/differential_price.schema.js +103 -0
  104. package/esm/schema/entitlement.schema.js +51 -0
  105. package/esm/schema/entitlement_override.schema.js +32 -0
  106. package/esm/schema/estimate.schema.js +1532 -0
  107. package/esm/schema/event.schema.js +1057 -0
  108. package/esm/schema/export.schema.js +3382 -0
  109. package/esm/schema/feature.schema.js +75 -0
  110. package/esm/schema/gift.schema.js +290 -0
  111. package/esm/schema/grant_block.schema.js +44 -0
  112. package/esm/schema/hosted_page.schema.js +1774 -0
  113. package/esm/schema/in_app_subscription.schema.js +65 -0
  114. package/esm/schema/index.js +72 -0
  115. package/esm/schema/invoice.schema.js +1682 -0
  116. package/esm/schema/item.schema.js +192 -0
  117. package/esm/schema/item_entitlement.schema.js +42 -0
  118. package/esm/schema/item_family.schema.js +54 -0
  119. package/esm/schema/item_price.schema.js +332 -0
  120. package/esm/schema/ledger_account_balance.schema.js +18 -0
  121. package/esm/schema/ledger_operation.schema.js +101 -0
  122. package/esm/schema/meter.schema.js +10 -0
  123. package/esm/schema/metered_feature.schema.js +17 -0
  124. package/esm/schema/non_subscription.schema.js +25 -0
  125. package/esm/schema/offer_event.schema.js +10 -0
  126. package/esm/schema/offer_fulfillment.schema.js +17 -0
  127. package/esm/schema/omnichannel_one_time_order.schema.js +23 -0
  128. package/esm/schema/omnichannel_subscription.schema.js +119 -0
  129. package/esm/schema/omnichannel_subscription_item.schema.js +10 -0
  130. package/esm/schema/order.schema.js +438 -0
  131. package/esm/schema/payment_intent.schema.js +124 -0
  132. package/esm/schema/payment_schedule_scheme.schema.js +17 -0
  133. package/esm/schema/payment_source.schema.js +627 -0
  134. package/esm/schema/payment_voucher.schema.js +54 -0
  135. package/esm/schema/personalized_offer.schema.js +25 -0
  136. package/esm/schema/plan.schema.js +360 -0
  137. package/esm/schema/portal_session.schema.js +19 -0
  138. package/esm/schema/price_variant.schema.js +90 -0
  139. package/esm/schema/pricing_page_session.schema.js +132 -0
  140. package/esm/schema/promotional_credit.schema.js +75 -0
  141. package/esm/schema/promotional_grant.schema.js +14 -0
  142. package/esm/schema/purchase.schema.js +274 -0
  143. package/esm/schema/quote.schema.js +1664 -0
  144. package/esm/schema/ramp.schema.js +242 -0
  145. package/esm/schema/recorded_purchase.schema.js +29 -0
  146. package/esm/schema/resource_migration.schema.js +11 -0
  147. package/esm/schema/site_migration_detail.schema.js +78 -0
  148. package/esm/schema/subscription.schema.js +3341 -0
  149. package/esm/schema/subscription_entitlement.schema.js +22 -0
  150. package/esm/schema/time_machine.schema.js +14 -0
  151. package/esm/schema/transaction.schema.js +741 -0
  152. package/esm/schema/unbilled_charge.schema.js +136 -0
  153. package/esm/schema/usage.schema.js +90 -0
  154. package/esm/schema/usage_charge.schema.js +14 -0
  155. package/esm/schema/usage_event.schema.js +25 -0
  156. package/esm/schema/usage_file.schema.js +10 -0
  157. package/esm/schema/usage_summary.schema.js +14 -0
  158. package/esm/schema/virtual_bank_account.schema.js +68 -0
  159. package/esm/schema/webhook_endpoint.schema.js +505 -0
  160. package/esm/validationLoader.js +56 -0
  161. package/package.json +4 -1
  162. package/types/core.d.ts +2 -0
  163. package/types/index.d.ts +16 -0
@@ -0,0 +1,1682 @@
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, delete, updateDetails, applyPaymentScheduleScheme
3
+ // Do not edit manually – regenerate via sdk-generator
4
+ import { z } from 'zod';
5
+ //Invoice.create
6
+ const CreateInvoiceShippingAddressSchema = z.object({
7
+ first_name: z.string().max(150).optional(),
8
+ last_name: z.string().max(150).optional(),
9
+ email: z.string().email().max(70).optional(),
10
+ company: z.string().max(250).optional(),
11
+ phone: z.string().max(50).optional(),
12
+ line1: z.string().max(150).optional(),
13
+ line2: z.string().max(150).optional(),
14
+ line3: z.string().max(150).optional(),
15
+ city: z.string().max(50).optional(),
16
+ state_code: z.string().max(50).optional(),
17
+ state: z.string().max(50).optional(),
18
+ zip: z.string().max(20).optional(),
19
+ country: z.string().max(50).optional(),
20
+ validation_status: z
21
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
22
+ .optional(),
23
+ });
24
+ const CreateInvoiceStatementDescriptorSchema = z.object({
25
+ descriptor: z.string().max(65000).optional(),
26
+ });
27
+ const CreateInvoiceAdditionalInformationSchema = z.looseObject({});
28
+ const CreateInvoiceCardSchema = z.object({
29
+ gateway: z
30
+ .enum([
31
+ 'chargebee',
32
+ 'chargebee_payments',
33
+ 'adyen',
34
+ 'stripe',
35
+ 'wepay',
36
+ 'braintree',
37
+ 'authorize_net',
38
+ 'paypal_pro',
39
+ 'pin',
40
+ 'eway',
41
+ 'eway_rapid',
42
+ 'worldpay',
43
+ 'balanced_payments',
44
+ 'beanstream',
45
+ 'bluepay',
46
+ 'elavon',
47
+ 'first_data_global',
48
+ 'hdfc',
49
+ 'migs',
50
+ 'nmi',
51
+ 'ogone',
52
+ 'paymill',
53
+ 'paypal_payflow_pro',
54
+ 'sage_pay',
55
+ 'tco',
56
+ 'wirecard',
57
+ 'amazon_payments',
58
+ 'paypal_express_checkout',
59
+ 'orbital',
60
+ 'moneris_us',
61
+ 'moneris',
62
+ 'bluesnap',
63
+ 'cybersource',
64
+ 'vantiv',
65
+ 'checkout_com',
66
+ 'paypal',
67
+ 'ingenico_direct',
68
+ 'exact',
69
+ 'mollie',
70
+ 'quickbooks',
71
+ 'razorpay',
72
+ 'global_payments',
73
+ 'bank_of_america',
74
+ 'ecentric',
75
+ 'metrics_global',
76
+ 'windcave',
77
+ 'pay_com',
78
+ 'ebanx',
79
+ 'dlocal',
80
+ 'nuvei',
81
+ 'solidgate',
82
+ 'paystack',
83
+ 'jp_morgan',
84
+ 'deutsche_bank',
85
+ 'ezidebit',
86
+ 'twikey',
87
+ 'tempus',
88
+ 'moyasar',
89
+ 'payway',
90
+ ])
91
+ .optional(),
92
+ gateway_account_id: z.string().max(50).optional(),
93
+ tmp_token: z.string().max(300).optional(),
94
+ first_name: z.string().max(50).optional(),
95
+ last_name: z.string().max(50).optional(),
96
+ number: z.string().max(1500).optional(),
97
+ expiry_month: z.number().int().min(1).max(12).optional(),
98
+ expiry_year: z.number().int().optional(),
99
+ cvv: z.string().max(520).optional(),
100
+ preferred_scheme: z
101
+ .enum(['cartes_bancaires', 'mastercard', 'visa'])
102
+ .optional(),
103
+ billing_addr1: z.string().max(150).optional(),
104
+ billing_addr2: z.string().max(150).optional(),
105
+ billing_city: z.string().max(50).optional(),
106
+ billing_state_code: z.string().max(50).optional(),
107
+ billing_state: z.string().max(50).optional(),
108
+ billing_zip: z.string().max(20).optional(),
109
+ billing_country: z.string().max(50).optional(),
110
+ ip_address: z.string().max(50).optional(),
111
+ additional_information: CreateInvoiceAdditionalInformationSchema.optional(),
112
+ });
113
+ const CreateInvoiceBillingAddressSchema = z.looseObject({});
114
+ const CreateInvoiceBankAccountSchema = z.object({
115
+ gateway_account_id: z.string().max(50).optional(),
116
+ iban: z.string().max(50).min(10).optional(),
117
+ first_name: z.string().max(150).optional(),
118
+ last_name: z.string().max(150).optional(),
119
+ company: z.string().max(250).optional(),
120
+ email: z.string().email().max(70).optional(),
121
+ phone: z.string().max(50).optional(),
122
+ bank_name: z.string().max(100).optional(),
123
+ account_number: z.string().max(17).min(4).optional(),
124
+ routing_number: z.string().max(9).min(3).optional(),
125
+ bank_code: z.string().max(20).optional(),
126
+ account_type: z
127
+ .enum(['checking', 'savings', 'business_checking', 'current'])
128
+ .optional(),
129
+ account_holder_type: z.enum(['individual', 'company']).optional(),
130
+ echeck_type: z.enum(['web', 'ppd', 'ccd']).optional(),
131
+ issuing_country: z.string().max(50).optional(),
132
+ swedish_identity_number: z.string().max(12).min(10).optional(),
133
+ billing_address: CreateInvoiceBillingAddressSchema.optional(),
134
+ });
135
+ const CreateInvoicePaymentMethodSchema = z.object({
136
+ type: z
137
+ .enum([
138
+ 'card',
139
+ 'paypal_express_checkout',
140
+ 'amazon_payments',
141
+ 'direct_debit',
142
+ 'generic',
143
+ 'alipay',
144
+ 'unionpay',
145
+ 'apple_pay',
146
+ 'wechat_pay',
147
+ 'ideal',
148
+ 'google_pay',
149
+ 'sofort',
150
+ 'bancontact',
151
+ 'giropay',
152
+ 'dotpay',
153
+ 'upi',
154
+ 'netbanking_emandates',
155
+ 'venmo',
156
+ 'pay_to',
157
+ 'faster_payments',
158
+ 'sepa_instant_transfer',
159
+ 'automated_bank_transfer',
160
+ 'klarna_pay_now',
161
+ 'online_banking_poland',
162
+ 'payconiq_by_bancontact',
163
+ 'electronic_payment_standard',
164
+ 'kbc_payment_button',
165
+ 'pay_by_bank',
166
+ 'trustly',
167
+ 'stablecoin',
168
+ 'kakao_pay',
169
+ 'naver_pay',
170
+ 'revolut_pay',
171
+ 'cash_app_pay',
172
+ 'twint',
173
+ 'go_pay',
174
+ 'grab_pay',
175
+ 'pay_co',
176
+ 'after_pay',
177
+ 'swish',
178
+ 'payme',
179
+ 'pix',
180
+ 'klarna',
181
+ 'alipay_hk',
182
+ 'paypay',
183
+ 'gcash',
184
+ 'south_korean_cards',
185
+ ])
186
+ .optional(),
187
+ gateway: z
188
+ .enum([
189
+ 'chargebee_payments',
190
+ 'adyen',
191
+ 'stripe',
192
+ 'wepay',
193
+ 'braintree',
194
+ 'authorize_net',
195
+ 'paypal_pro',
196
+ 'pin',
197
+ 'eway',
198
+ 'eway_rapid',
199
+ 'worldpay',
200
+ 'balanced_payments',
201
+ 'beanstream',
202
+ 'bluepay',
203
+ 'elavon',
204
+ 'first_data_global',
205
+ 'hdfc',
206
+ 'migs',
207
+ 'nmi',
208
+ 'ogone',
209
+ 'paymill',
210
+ 'paypal_payflow_pro',
211
+ 'sage_pay',
212
+ 'tco',
213
+ 'wirecard',
214
+ 'amazon_payments',
215
+ 'paypal_express_checkout',
216
+ 'gocardless',
217
+ 'orbital',
218
+ 'moneris_us',
219
+ 'moneris',
220
+ 'bluesnap',
221
+ 'cybersource',
222
+ 'vantiv',
223
+ 'checkout_com',
224
+ 'paypal',
225
+ 'ingenico_direct',
226
+ 'exact',
227
+ 'mollie',
228
+ 'quickbooks',
229
+ 'razorpay',
230
+ 'global_payments',
231
+ 'bank_of_america',
232
+ 'ecentric',
233
+ 'metrics_global',
234
+ 'windcave',
235
+ 'pay_com',
236
+ 'ebanx',
237
+ 'dlocal',
238
+ 'nuvei',
239
+ 'solidgate',
240
+ 'paystack',
241
+ 'jp_morgan',
242
+ 'deutsche_bank',
243
+ 'ezidebit',
244
+ 'twikey',
245
+ 'tempus',
246
+ 'moyasar',
247
+ 'payway',
248
+ ])
249
+ .optional(),
250
+ gateway_account_id: z.string().max(50).optional(),
251
+ reference_id: z.string().max(200).optional(),
252
+ tmp_token: z.string().max(65000).optional(),
253
+ issuing_country: z.string().max(50).optional(),
254
+ additional_information: CreateInvoiceAdditionalInformationSchema.optional(),
255
+ });
256
+ const CreateInvoicePaymentIntentSchema = z.object({
257
+ id: z.string().max(150).optional(),
258
+ gateway_account_id: z.string().max(50).optional(),
259
+ gw_token: z.string().max(65000).optional(),
260
+ payment_method_type: z
261
+ .enum([
262
+ 'card',
263
+ 'ideal',
264
+ 'sofort',
265
+ 'bancontact',
266
+ 'google_pay',
267
+ 'dotpay',
268
+ 'giropay',
269
+ 'apple_pay',
270
+ 'upi',
271
+ 'netbanking_emandates',
272
+ 'paypal_express_checkout',
273
+ 'direct_debit',
274
+ 'boleto',
275
+ 'venmo',
276
+ 'amazon_payments',
277
+ 'pay_to',
278
+ 'faster_payments',
279
+ 'sepa_instant_transfer',
280
+ 'klarna_pay_now',
281
+ 'online_banking_poland',
282
+ 'payconiq_by_bancontact',
283
+ 'electronic_payment_standard',
284
+ 'kbc_payment_button',
285
+ 'pay_by_bank',
286
+ 'trustly',
287
+ 'stablecoin',
288
+ 'kakao_pay',
289
+ 'naver_pay',
290
+ 'revolut_pay',
291
+ 'cash_app_pay',
292
+ 'wechat_pay',
293
+ 'alipay',
294
+ 'twint',
295
+ 'go_pay',
296
+ 'grab_pay',
297
+ 'pay_co',
298
+ 'after_pay',
299
+ 'swish',
300
+ 'payme',
301
+ 'pix',
302
+ 'klarna',
303
+ 'alipay_hk',
304
+ 'paypay',
305
+ 'gcash',
306
+ 'south_korean_cards',
307
+ ])
308
+ .optional(),
309
+ reference_id: z.string().max(65000).optional(),
310
+ gw_payment_method_id: z.string().max(65000).optional(),
311
+ additional_information: CreateInvoiceAdditionalInformationSchema.optional(),
312
+ });
313
+ const CreateInvoiceAddonsSchema = z.object({
314
+ id: z.array(z.string().max(100).optional()).optional(),
315
+ quantity: z.array(z.number().int().min(1).optional()).optional(),
316
+ unit_price: z.array(z.number().int().min(0).optional()).optional(),
317
+ quantity_in_decimal: z.array(z.string().max(33).optional()).optional(),
318
+ unit_price_in_decimal: z.array(z.string().max(39).optional()).optional(),
319
+ date_from: z.array(z.number().int().optional()).optional(),
320
+ date_to: z.array(z.number().int().optional()).optional(),
321
+ });
322
+ const CreateInvoiceChargesSchema = z.object({
323
+ amount: z.array(z.number().int().min(1).optional()).optional(),
324
+ amount_in_decimal: z.array(z.string().max(39).optional()).optional(),
325
+ description: z.array(z.string().max(250).optional()).optional(),
326
+ taxable: z.array(z.boolean().default(true).optional()).optional(),
327
+ tax_profile_id: z.array(z.string().max(50).optional()).optional(),
328
+ avalara_tax_code: z.array(z.string().max(50).optional()).optional(),
329
+ hsn_code: z.array(z.string().max(50).optional()).optional(),
330
+ taxjar_product_code: z.array(z.string().max(50).optional()).optional(),
331
+ avalara_sale_type: z
332
+ .array(z.enum(['wholesale', 'retail', 'consumed', 'vendor_use']).optional())
333
+ .optional(),
334
+ avalara_transaction_type: z.array(z.number().int().optional()).optional(),
335
+ avalara_service_type: z.array(z.number().int().optional()).optional(),
336
+ date_from: z.array(z.number().int().optional()).optional(),
337
+ date_to: z.array(z.number().int().optional()).optional(),
338
+ });
339
+ const CreateInvoiceTaxProvidersFieldsSchema = z.object({
340
+ provider_name: z.array(z.string().max(50).optional()).optional(),
341
+ field_id: z.array(z.string().max(50).optional()).optional(),
342
+ field_value: z.array(z.string().max(50).optional()).optional(),
343
+ });
344
+ const CreateInvoiceNotesToRemoveSchema = z.object({
345
+ entity_type: z
346
+ .array(z
347
+ .enum(['plan', 'addon', 'customer', 'subscription', 'coupon'])
348
+ .optional())
349
+ .optional(),
350
+ entity_id: z.array(z.string().max(100).optional()).optional(),
351
+ });
352
+ const CreateInvoiceBodySchema = z.looseObject({
353
+ customer_id: z.string().max(50).optional(),
354
+ subscription_id: z.string().max(50).optional(),
355
+ currency_code: z.string().max(3).optional(),
356
+ invoice_date: z.number().int().optional(),
357
+ invoice_note: z.string().max(2000).optional(),
358
+ remove_general_note: z.boolean().default(false).optional(),
359
+ po_number: z.string().max(100).optional(),
360
+ coupon: z.string().max(100).optional(),
361
+ coupon_ids: z.array(z.string().max(100).optional()).optional(),
362
+ authorization_transaction_id: z.string().max(40).optional(),
363
+ payment_source_id: z.string().max(40).optional(),
364
+ auto_collection: z.enum(['on', 'off']).optional(),
365
+ token_id: z.string().max(40).optional(),
366
+ replace_primary_payment_source: z.boolean().default(false).optional(),
367
+ retain_payment_source: z.boolean().default(true).optional(),
368
+ payment_initiator: z.enum(['customer', 'merchant']).optional(),
369
+ shipping_address: CreateInvoiceShippingAddressSchema.optional(),
370
+ statement_descriptor: CreateInvoiceStatementDescriptorSchema.optional(),
371
+ card: CreateInvoiceCardSchema.optional(),
372
+ bank_account: CreateInvoiceBankAccountSchema.optional(),
373
+ payment_method: CreateInvoicePaymentMethodSchema.optional(),
374
+ payment_intent: CreateInvoicePaymentIntentSchema.optional(),
375
+ addons: CreateInvoiceAddonsSchema.optional(),
376
+ charges: CreateInvoiceChargesSchema.optional(),
377
+ tax_providers_fields: CreateInvoiceTaxProvidersFieldsSchema.optional(),
378
+ notes_to_remove: CreateInvoiceNotesToRemoveSchema.optional(),
379
+ });
380
+ export { CreateInvoiceBodySchema };
381
+ //Invoice.createForChargeItemsAndCharges
382
+ const CreateForChargeItemsAndChargesInvoiceShippingAddressSchema = z.object({
383
+ first_name: z.string().max(150).optional(),
384
+ last_name: z.string().max(150).optional(),
385
+ email: z.string().email().max(70).optional(),
386
+ company: z.string().max(250).optional(),
387
+ phone: z.string().max(50).optional(),
388
+ line1: z.string().max(150).optional(),
389
+ line2: z.string().max(150).optional(),
390
+ line3: z.string().max(150).optional(),
391
+ city: z.string().max(50).optional(),
392
+ state_code: z.string().max(50).optional(),
393
+ state: z.string().max(50).optional(),
394
+ zip: z.string().max(20).optional(),
395
+ country: z.string().max(50).optional(),
396
+ validation_status: z
397
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
398
+ .optional(),
399
+ });
400
+ const CreateForChargeItemsAndChargesInvoiceStatementDescriptorSchema = z.object({
401
+ descriptor: z.string().max(65000).optional(),
402
+ });
403
+ const CreateForChargeItemsAndChargesInvoiceAdditionalInformationSchema = z.looseObject({});
404
+ const CreateForChargeItemsAndChargesInvoiceCardSchema = z.object({
405
+ gateway: z
406
+ .enum([
407
+ 'chargebee',
408
+ 'chargebee_payments',
409
+ 'adyen',
410
+ 'stripe',
411
+ 'wepay',
412
+ 'braintree',
413
+ 'authorize_net',
414
+ 'paypal_pro',
415
+ 'pin',
416
+ 'eway',
417
+ 'eway_rapid',
418
+ 'worldpay',
419
+ 'balanced_payments',
420
+ 'beanstream',
421
+ 'bluepay',
422
+ 'elavon',
423
+ 'first_data_global',
424
+ 'hdfc',
425
+ 'migs',
426
+ 'nmi',
427
+ 'ogone',
428
+ 'paymill',
429
+ 'paypal_payflow_pro',
430
+ 'sage_pay',
431
+ 'tco',
432
+ 'wirecard',
433
+ 'amazon_payments',
434
+ 'paypal_express_checkout',
435
+ 'orbital',
436
+ 'moneris_us',
437
+ 'moneris',
438
+ 'bluesnap',
439
+ 'cybersource',
440
+ 'vantiv',
441
+ 'checkout_com',
442
+ 'paypal',
443
+ 'ingenico_direct',
444
+ 'exact',
445
+ 'mollie',
446
+ 'quickbooks',
447
+ 'razorpay',
448
+ 'global_payments',
449
+ 'bank_of_america',
450
+ 'ecentric',
451
+ 'metrics_global',
452
+ 'windcave',
453
+ 'pay_com',
454
+ 'ebanx',
455
+ 'dlocal',
456
+ 'nuvei',
457
+ 'solidgate',
458
+ 'paystack',
459
+ 'jp_morgan',
460
+ 'deutsche_bank',
461
+ 'ezidebit',
462
+ 'twikey',
463
+ 'tempus',
464
+ 'moyasar',
465
+ 'payway',
466
+ ])
467
+ .optional(),
468
+ gateway_account_id: z.string().max(50).optional(),
469
+ tmp_token: z.string().max(300).optional(),
470
+ first_name: z.string().max(50).optional(),
471
+ last_name: z.string().max(50).optional(),
472
+ number: z.string().max(1500).optional(),
473
+ expiry_month: z.number().int().min(1).max(12).optional(),
474
+ expiry_year: z.number().int().optional(),
475
+ cvv: z.string().max(520).optional(),
476
+ preferred_scheme: z
477
+ .enum(['cartes_bancaires', 'mastercard', 'visa'])
478
+ .optional(),
479
+ billing_addr1: z.string().max(150).optional(),
480
+ billing_addr2: z.string().max(150).optional(),
481
+ billing_city: z.string().max(50).optional(),
482
+ billing_state_code: z.string().max(50).optional(),
483
+ billing_state: z.string().max(50).optional(),
484
+ billing_zip: z.string().max(20).optional(),
485
+ billing_country: z.string().max(50).optional(),
486
+ ip_address: z.string().max(50).optional(),
487
+ additional_information: CreateForChargeItemsAndChargesInvoiceAdditionalInformationSchema.optional(),
488
+ });
489
+ const CreateForChargeItemsAndChargesInvoiceBillingAddressSchema = z.looseObject({});
490
+ const CreateForChargeItemsAndChargesInvoiceBankAccountSchema = z.object({
491
+ gateway_account_id: z.string().max(50).optional(),
492
+ iban: z.string().max(50).min(10).optional(),
493
+ first_name: z.string().max(150).optional(),
494
+ last_name: z.string().max(150).optional(),
495
+ company: z.string().max(250).optional(),
496
+ email: z.string().email().max(70).optional(),
497
+ phone: z.string().max(50).optional(),
498
+ bank_name: z.string().max(100).optional(),
499
+ account_number: z.string().max(17).min(4).optional(),
500
+ routing_number: z.string().max(9).min(3).optional(),
501
+ bank_code: z.string().max(20).optional(),
502
+ account_type: z
503
+ .enum(['checking', 'savings', 'business_checking', 'current'])
504
+ .optional(),
505
+ account_holder_type: z.enum(['individual', 'company']).optional(),
506
+ echeck_type: z.enum(['web', 'ppd', 'ccd']).optional(),
507
+ issuing_country: z.string().max(50).optional(),
508
+ swedish_identity_number: z.string().max(12).min(10).optional(),
509
+ billing_address: CreateForChargeItemsAndChargesInvoiceBillingAddressSchema.optional(),
510
+ });
511
+ const CreateForChargeItemsAndChargesInvoicePaymentMethodSchema = z.object({
512
+ type: z
513
+ .enum([
514
+ 'card',
515
+ 'paypal_express_checkout',
516
+ 'amazon_payments',
517
+ 'direct_debit',
518
+ 'generic',
519
+ 'alipay',
520
+ 'unionpay',
521
+ 'apple_pay',
522
+ 'wechat_pay',
523
+ 'ideal',
524
+ 'google_pay',
525
+ 'sofort',
526
+ 'bancontact',
527
+ 'giropay',
528
+ 'dotpay',
529
+ 'upi',
530
+ 'netbanking_emandates',
531
+ 'venmo',
532
+ 'pay_to',
533
+ 'faster_payments',
534
+ 'sepa_instant_transfer',
535
+ 'automated_bank_transfer',
536
+ 'klarna_pay_now',
537
+ 'online_banking_poland',
538
+ 'payconiq_by_bancontact',
539
+ 'electronic_payment_standard',
540
+ 'kbc_payment_button',
541
+ 'pay_by_bank',
542
+ 'trustly',
543
+ 'stablecoin',
544
+ 'kakao_pay',
545
+ 'naver_pay',
546
+ 'revolut_pay',
547
+ 'cash_app_pay',
548
+ 'twint',
549
+ 'go_pay',
550
+ 'grab_pay',
551
+ 'pay_co',
552
+ 'after_pay',
553
+ 'swish',
554
+ 'payme',
555
+ 'pix',
556
+ 'klarna',
557
+ 'alipay_hk',
558
+ 'paypay',
559
+ 'gcash',
560
+ 'south_korean_cards',
561
+ ])
562
+ .optional(),
563
+ gateway: z
564
+ .enum([
565
+ 'chargebee_payments',
566
+ 'adyen',
567
+ 'stripe',
568
+ 'wepay',
569
+ 'braintree',
570
+ 'authorize_net',
571
+ 'paypal_pro',
572
+ 'pin',
573
+ 'eway',
574
+ 'eway_rapid',
575
+ 'worldpay',
576
+ 'balanced_payments',
577
+ 'beanstream',
578
+ 'bluepay',
579
+ 'elavon',
580
+ 'first_data_global',
581
+ 'hdfc',
582
+ 'migs',
583
+ 'nmi',
584
+ 'ogone',
585
+ 'paymill',
586
+ 'paypal_payflow_pro',
587
+ 'sage_pay',
588
+ 'tco',
589
+ 'wirecard',
590
+ 'amazon_payments',
591
+ 'paypal_express_checkout',
592
+ 'gocardless',
593
+ 'orbital',
594
+ 'moneris_us',
595
+ 'moneris',
596
+ 'bluesnap',
597
+ 'cybersource',
598
+ 'vantiv',
599
+ 'checkout_com',
600
+ 'paypal',
601
+ 'ingenico_direct',
602
+ 'exact',
603
+ 'mollie',
604
+ 'quickbooks',
605
+ 'razorpay',
606
+ 'global_payments',
607
+ 'bank_of_america',
608
+ 'ecentric',
609
+ 'metrics_global',
610
+ 'windcave',
611
+ 'pay_com',
612
+ 'ebanx',
613
+ 'dlocal',
614
+ 'nuvei',
615
+ 'solidgate',
616
+ 'paystack',
617
+ 'jp_morgan',
618
+ 'deutsche_bank',
619
+ 'ezidebit',
620
+ 'twikey',
621
+ 'tempus',
622
+ 'moyasar',
623
+ 'payway',
624
+ ])
625
+ .optional(),
626
+ gateway_account_id: z.string().max(50).optional(),
627
+ reference_id: z.string().max(200).optional(),
628
+ tmp_token: z.string().max(65000).optional(),
629
+ issuing_country: z.string().max(50).optional(),
630
+ additional_information: CreateForChargeItemsAndChargesInvoiceAdditionalInformationSchema.optional(),
631
+ });
632
+ const CreateForChargeItemsAndChargesInvoicePaymentIntentSchema = z.object({
633
+ id: z.string().max(150).optional(),
634
+ gateway_account_id: z.string().max(50).optional(),
635
+ gw_token: z.string().max(65000).optional(),
636
+ payment_method_type: z
637
+ .enum([
638
+ 'card',
639
+ 'ideal',
640
+ 'sofort',
641
+ 'bancontact',
642
+ 'google_pay',
643
+ 'dotpay',
644
+ 'giropay',
645
+ 'apple_pay',
646
+ 'upi',
647
+ 'netbanking_emandates',
648
+ 'paypal_express_checkout',
649
+ 'direct_debit',
650
+ 'boleto',
651
+ 'venmo',
652
+ 'amazon_payments',
653
+ 'pay_to',
654
+ 'faster_payments',
655
+ 'sepa_instant_transfer',
656
+ 'klarna_pay_now',
657
+ 'online_banking_poland',
658
+ 'payconiq_by_bancontact',
659
+ 'electronic_payment_standard',
660
+ 'kbc_payment_button',
661
+ 'pay_by_bank',
662
+ 'trustly',
663
+ 'stablecoin',
664
+ 'kakao_pay',
665
+ 'naver_pay',
666
+ 'revolut_pay',
667
+ 'cash_app_pay',
668
+ 'wechat_pay',
669
+ 'alipay',
670
+ 'twint',
671
+ 'go_pay',
672
+ 'grab_pay',
673
+ 'pay_co',
674
+ 'after_pay',
675
+ 'swish',
676
+ 'payme',
677
+ 'pix',
678
+ 'klarna',
679
+ 'alipay_hk',
680
+ 'paypay',
681
+ 'gcash',
682
+ 'south_korean_cards',
683
+ ])
684
+ .optional(),
685
+ reference_id: z.string().max(65000).optional(),
686
+ gw_payment_method_id: z.string().max(65000).optional(),
687
+ additional_information: CreateForChargeItemsAndChargesInvoiceAdditionalInformationSchema.optional(),
688
+ });
689
+ const CreateForChargeItemsAndChargesInvoiceItemPricesSchema = z.object({
690
+ item_price_id: z.array(z.string().max(100).optional()).optional(),
691
+ quantity: z.array(z.number().int().min(1).optional()).optional(),
692
+ quantity_in_decimal: z.array(z.string().max(33).optional()).optional(),
693
+ unit_price: z.array(z.number().int().min(0).optional()).optional(),
694
+ unit_price_in_decimal: z.array(z.string().max(39).optional()).optional(),
695
+ date_from: z.array(z.number().int().optional()).optional(),
696
+ date_to: z.array(z.number().int().optional()).optional(),
697
+ });
698
+ const CreateForChargeItemsAndChargesInvoiceItemTiersSchema = z.object({
699
+ item_price_id: z.array(z.string().max(100).optional()).optional(),
700
+ starting_unit: z.array(z.number().int().min(1).optional()).optional(),
701
+ ending_unit: z.array(z.number().int().optional()).optional(),
702
+ price: z.array(z.number().int().min(0).optional()).optional(),
703
+ starting_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
704
+ ending_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
705
+ price_in_decimal: z.array(z.string().max(39).optional()).optional(),
706
+ pricing_type: z
707
+ .array(z.enum(['per_unit', 'flat_fee', 'package']).optional())
708
+ .optional(),
709
+ package_size: z.array(z.number().int().min(1).optional()).optional(),
710
+ });
711
+ const CreateForChargeItemsAndChargesInvoiceChargesSchema = z.object({
712
+ amount: z.array(z.number().int().min(1).optional()).optional(),
713
+ amount_in_decimal: z.array(z.string().max(39).optional()).optional(),
714
+ description: z.array(z.string().max(250).optional()).optional(),
715
+ taxable: z.array(z.boolean().default(true).optional()).optional(),
716
+ tax_profile_id: z.array(z.string().max(50).optional()).optional(),
717
+ avalara_tax_code: z.array(z.string().max(50).optional()).optional(),
718
+ hsn_code: z.array(z.string().max(50).optional()).optional(),
719
+ taxjar_product_code: z.array(z.string().max(50).optional()).optional(),
720
+ avalara_sale_type: z
721
+ .array(z.enum(['wholesale', 'retail', 'consumed', 'vendor_use']).optional())
722
+ .optional(),
723
+ avalara_transaction_type: z.array(z.number().int().optional()).optional(),
724
+ avalara_service_type: z.array(z.number().int().optional()).optional(),
725
+ date_from: z.array(z.number().int().optional()).optional(),
726
+ date_to: z.array(z.number().int().optional()).optional(),
727
+ });
728
+ const CreateForChargeItemsAndChargesInvoiceNotesToRemoveSchema = z.object({
729
+ entity_type: z
730
+ .array(z
731
+ .enum([
732
+ 'customer',
733
+ 'subscription',
734
+ 'coupon',
735
+ 'plan_item_price',
736
+ 'addon_item_price',
737
+ 'charge_item_price',
738
+ ])
739
+ .optional())
740
+ .optional(),
741
+ entity_id: z.array(z.string().max(100).optional()).optional(),
742
+ });
743
+ const CreateForChargeItemsAndChargesInvoiceTaxProvidersFieldsSchema = z.object({
744
+ provider_name: z.array(z.string().max(50).optional()).optional(),
745
+ field_id: z.array(z.string().max(50).optional()).optional(),
746
+ field_value: z.array(z.string().max(50).optional()).optional(),
747
+ });
748
+ const CreateForChargeItemsAndChargesInvoiceDiscountsSchema = z.object({
749
+ percentage: z.array(z.number().min(0.01).max(100).optional()).optional(),
750
+ amount: z.array(z.number().int().min(0).optional()).optional(),
751
+ quantity: z.array(z.number().int().min(1).optional()).optional(),
752
+ apply_on: z.array(z.enum(['invoice_amount', 'specific_item_price']).optional()),
753
+ item_price_id: z.array(z.string().max(100).optional()).optional(),
754
+ });
755
+ const CreateForChargeItemsAndChargesInvoiceBodySchema = z.looseObject({
756
+ customer_id: z.string().max(50).optional(),
757
+ subscription_id: z.string().max(50).optional(),
758
+ currency_code: z.string().max(3).optional(),
759
+ invoice_note: z.string().max(2000).optional(),
760
+ remove_general_note: z.boolean().default(false).optional(),
761
+ po_number: z.string().max(100).optional(),
762
+ coupon: z.string().max(100).optional(),
763
+ coupon_ids: z.array(z.string().max(100).optional()).optional(),
764
+ authorization_transaction_id: z.string().max(40).optional(),
765
+ payment_source_id: z.string().max(40).optional(),
766
+ auto_collection: z.enum(['on', 'off']).optional(),
767
+ net_term_days: z.number().int().optional(),
768
+ invoice_date: z.number().int().optional(),
769
+ token_id: z.string().max(40).optional(),
770
+ replace_primary_payment_source: z.boolean().default(false).optional(),
771
+ retain_payment_source: z.boolean().default(true).optional(),
772
+ payment_initiator: z.enum(['customer', 'merchant']).optional(),
773
+ shipping_address: CreateForChargeItemsAndChargesInvoiceShippingAddressSchema.optional(),
774
+ statement_descriptor: CreateForChargeItemsAndChargesInvoiceStatementDescriptorSchema.optional(),
775
+ card: CreateForChargeItemsAndChargesInvoiceCardSchema.optional(),
776
+ bank_account: CreateForChargeItemsAndChargesInvoiceBankAccountSchema.optional(),
777
+ payment_method: CreateForChargeItemsAndChargesInvoicePaymentMethodSchema.optional(),
778
+ payment_intent: CreateForChargeItemsAndChargesInvoicePaymentIntentSchema.optional(),
779
+ item_prices: CreateForChargeItemsAndChargesInvoiceItemPricesSchema.optional(),
780
+ item_tiers: CreateForChargeItemsAndChargesInvoiceItemTiersSchema.optional(),
781
+ charges: CreateForChargeItemsAndChargesInvoiceChargesSchema.optional(),
782
+ notes_to_remove: CreateForChargeItemsAndChargesInvoiceNotesToRemoveSchema.optional(),
783
+ tax_providers_fields: CreateForChargeItemsAndChargesInvoiceTaxProvidersFieldsSchema.optional(),
784
+ discounts: CreateForChargeItemsAndChargesInvoiceDiscountsSchema.optional(),
785
+ });
786
+ export { CreateForChargeItemsAndChargesInvoiceBodySchema };
787
+ //Invoice.charge
788
+ const ChargeInvoiceTaxProvidersFieldsSchema = z.object({
789
+ provider_name: z.array(z.string().max(50).optional()).optional(),
790
+ field_id: z.array(z.string().max(50).optional()).optional(),
791
+ field_value: z.array(z.string().max(50).optional()).optional(),
792
+ });
793
+ const ChargeInvoiceBodySchema = z.looseObject({
794
+ customer_id: z.string().max(50).optional(),
795
+ subscription_id: z.string().max(50).optional(),
796
+ currency_code: z.string().max(3).optional(),
797
+ amount: z.number().int().min(1).optional(),
798
+ amount_in_decimal: z.string().max(39).optional(),
799
+ description: z.string().max(250),
800
+ date_from: z.number().int().optional(),
801
+ date_to: z.number().int().optional(),
802
+ coupon_ids: z.array(z.string().max(100).optional()).optional(),
803
+ coupon: z.string().max(100).optional(),
804
+ avalara_sale_type: z
805
+ .enum(['wholesale', 'retail', 'consumed', 'vendor_use'])
806
+ .optional(),
807
+ avalara_transaction_type: z.number().int().optional(),
808
+ avalara_service_type: z.number().int().optional(),
809
+ po_number: z.string().max(100).optional(),
810
+ invoice_date: z.number().int().optional(),
811
+ payment_source_id: z.string().max(40).optional(),
812
+ payment_initiator: z.enum(['customer', 'merchant']).optional(),
813
+ tax_providers_fields: ChargeInvoiceTaxProvidersFieldsSchema.optional(),
814
+ });
815
+ export { ChargeInvoiceBodySchema };
816
+ //Invoice.chargeAddon
817
+ const ChargeAddonInvoiceBodySchema = z.looseObject({
818
+ customer_id: z.string().max(50).optional(),
819
+ subscription_id: z.string().max(50).optional(),
820
+ addon_id: z.string().max(100),
821
+ addon_quantity: z.number().int().min(1).optional(),
822
+ addon_unit_price: z.number().int().min(0).optional(),
823
+ addon_quantity_in_decimal: z.string().max(33).optional(),
824
+ addon_unit_price_in_decimal: z.string().max(39).optional(),
825
+ date_from: z.number().int().optional(),
826
+ date_to: z.number().int().optional(),
827
+ coupon_ids: z.array(z.string().max(100).optional()).optional(),
828
+ coupon: z.string().max(100).optional(),
829
+ po_number: z.string().max(100).optional(),
830
+ invoice_date: z.number().int().optional(),
831
+ payment_source_id: z.string().max(40).optional(),
832
+ payment_initiator: z.enum(['customer', 'merchant']).optional(),
833
+ });
834
+ export { ChargeAddonInvoiceBodySchema };
835
+ //Invoice.createForChargeItem
836
+ const CreateForChargeItemInvoiceItemPriceSchema = z.object({
837
+ item_price_id: z.string().max(100),
838
+ quantity: z.number().int().min(1).optional(),
839
+ quantity_in_decimal: z.string().max(33).optional(),
840
+ unit_price: z.number().int().min(0).optional(),
841
+ unit_price_in_decimal: z.string().max(39).optional(),
842
+ date_from: z.number().int().optional(),
843
+ date_to: z.number().int().optional(),
844
+ });
845
+ const CreateForChargeItemInvoiceItemTiersSchema = z.object({
846
+ starting_unit: z.array(z.number().int().min(1).optional()).optional(),
847
+ ending_unit: z.array(z.number().int().optional()).optional(),
848
+ price: z.array(z.number().int().min(0).optional()).optional(),
849
+ starting_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
850
+ ending_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
851
+ price_in_decimal: z.array(z.string().max(39).optional()).optional(),
852
+ pricing_type: z
853
+ .array(z.enum(['per_unit', 'flat_fee', 'package']).optional())
854
+ .optional(),
855
+ package_size: z.array(z.number().int().min(1).optional()).optional(),
856
+ });
857
+ const CreateForChargeItemInvoiceBodySchema = z.looseObject({
858
+ customer_id: z.string().max(50).optional(),
859
+ subscription_id: z.string().max(50).optional(),
860
+ po_number: z.string().max(100).optional(),
861
+ coupon: z.string().max(100).optional(),
862
+ payment_source_id: z.string().max(40).optional(),
863
+ payment_initiator: z.enum(['customer', 'merchant']).optional(),
864
+ invoice_date: z.number().int().optional(),
865
+ item_price: CreateForChargeItemInvoiceItemPriceSchema.optional(),
866
+ item_tiers: CreateForChargeItemInvoiceItemTiersSchema.optional(),
867
+ });
868
+ export { CreateForChargeItemInvoiceBodySchema };
869
+ //Invoice.stopDunning
870
+ const StopDunningInvoiceBodySchema = z.looseObject({
871
+ comment: z.string().max(300).optional(),
872
+ });
873
+ export { StopDunningInvoiceBodySchema };
874
+ //Invoice.pauseDunning
875
+ const PauseDunningInvoiceBodySchema = z.looseObject({
876
+ expected_payment_date: z.number().int(),
877
+ comment: z.string().max(300).optional(),
878
+ });
879
+ export { PauseDunningInvoiceBodySchema };
880
+ //Invoice.resumeDunning
881
+ const ResumeDunningInvoiceBodySchema = z.looseObject({
882
+ comment: z.string().max(300).optional(),
883
+ });
884
+ export { ResumeDunningInvoiceBodySchema };
885
+ //Invoice.importInvoice
886
+ const ImportInvoiceInvoiceCreditNoteSchema = z.object({
887
+ id: z.string().max(50).optional(),
888
+ });
889
+ const ImportInvoiceInvoiceBillingAddressSchema = z.object({
890
+ first_name: z.string().max(150).optional(),
891
+ last_name: z.string().max(150).optional(),
892
+ email: z.string().email().max(70).optional(),
893
+ company: z.string().max(250).optional(),
894
+ phone: z.string().max(50).optional(),
895
+ line1: z.string().max(150).optional(),
896
+ line2: z.string().max(150).optional(),
897
+ line3: z.string().max(150).optional(),
898
+ city: z.string().max(50).optional(),
899
+ state_code: z.string().max(50).optional(),
900
+ state: z.string().max(50).optional(),
901
+ zip: z.string().max(20).optional(),
902
+ country: z.string().max(50).optional(),
903
+ validation_status: z
904
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
905
+ .optional(),
906
+ });
907
+ const ImportInvoiceInvoiceShippingAddressSchema = z.object({
908
+ first_name: z.string().max(150).optional(),
909
+ last_name: z.string().max(150).optional(),
910
+ email: z.string().email().max(70).optional(),
911
+ company: z.string().max(250).optional(),
912
+ phone: z.string().max(50).optional(),
913
+ line1: z.string().max(150).optional(),
914
+ line2: z.string().max(150).optional(),
915
+ line3: z.string().max(150).optional(),
916
+ city: z.string().max(50).optional(),
917
+ state_code: z.string().max(50).optional(),
918
+ state: z.string().max(50).optional(),
919
+ zip: z.string().max(20).optional(),
920
+ country: z.string().max(50).optional(),
921
+ validation_status: z
922
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
923
+ .optional(),
924
+ });
925
+ const ImportInvoiceInvoiceLineItemsSchema = z.object({
926
+ id: z.array(z.string().max(40).optional()).optional(),
927
+ date_from: z.array(z.number().int().optional()).optional(),
928
+ date_to: z.array(z.number().int().optional()).optional(),
929
+ subscription_id: z.array(z.string().max(50).optional()).optional(),
930
+ description: z.array(z.string().max(250).optional()),
931
+ unit_amount: z.array(z.number().int().optional()).optional(),
932
+ quantity: z.array(z.number().int().optional()).optional(),
933
+ amount: z.array(z.number().int().optional()).optional(),
934
+ unit_amount_in_decimal: z.array(z.string().max(39).optional()).optional(),
935
+ quantity_in_decimal: z.array(z.string().max(33).optional()).optional(),
936
+ amount_in_decimal: z.array(z.string().max(39).optional()).optional(),
937
+ entity_type: z
938
+ .array(z
939
+ .enum([
940
+ 'adhoc',
941
+ 'plan_item_price',
942
+ 'addon_item_price',
943
+ 'charge_item_price',
944
+ 'plan_setup',
945
+ 'plan',
946
+ 'addon',
947
+ ])
948
+ .optional())
949
+ .optional(),
950
+ entity_id: z.array(z.string().max(100).optional()).optional(),
951
+ item_level_discount1_entity_id: z
952
+ .array(z.string().max(100).optional())
953
+ .optional(),
954
+ item_level_discount1_amount: z
955
+ .array(z.number().int().min(0).optional())
956
+ .optional(),
957
+ item_level_discount2_entity_id: z
958
+ .array(z.string().max(100).optional())
959
+ .optional(),
960
+ item_level_discount2_amount: z
961
+ .array(z.number().int().min(0).optional())
962
+ .optional(),
963
+ tax1_name: z.array(z.string().max(50).optional()).optional(),
964
+ tax1_amount: z.array(z.number().int().min(0).optional()).optional(),
965
+ tax2_name: z.array(z.string().max(50).optional()).optional(),
966
+ tax2_amount: z.array(z.number().int().min(0).optional()).optional(),
967
+ tax3_name: z.array(z.string().max(50).optional()).optional(),
968
+ tax3_amount: z.array(z.number().int().min(0).optional()).optional(),
969
+ tax4_name: z.array(z.string().max(50).optional()).optional(),
970
+ tax4_amount: z.array(z.number().int().min(0).optional()).optional(),
971
+ tax5_name: z.array(z.string().max(50).optional()).optional(),
972
+ tax5_amount: z.array(z.number().int().min(0).optional()).optional(),
973
+ tax6_name: z.array(z.string().max(50).optional()).optional(),
974
+ tax6_amount: z.array(z.number().int().min(0).optional()).optional(),
975
+ tax7_name: z.array(z.string().max(50).optional()).optional(),
976
+ tax7_amount: z.array(z.number().int().min(0).optional()).optional(),
977
+ tax8_name: z.array(z.string().max(50).optional()).optional(),
978
+ tax8_amount: z.array(z.number().int().min(0).optional()).optional(),
979
+ tax9_name: z.array(z.string().max(50).optional()).optional(),
980
+ tax9_amount: z.array(z.number().int().min(0).optional()).optional(),
981
+ tax10_name: z.array(z.string().max(50).optional()).optional(),
982
+ tax10_amount: z.array(z.number().int().min(0).optional()).optional(),
983
+ created_at: z.array(z.number().int().optional()).optional(),
984
+ });
985
+ const ImportInvoiceInvoicePaymentReferenceNumbersSchema = z.object({
986
+ id: z.array(z.string().max(40).optional()).optional(),
987
+ type: z.array(z.enum(['kid', 'ocr', 'frn', 'fik', 'swiss_reference']).optional()),
988
+ number: z.array(z.string().max(100).optional()),
989
+ });
990
+ const ImportInvoiceInvoiceLineItemTiersSchema = z.object({
991
+ line_item_id: z.array(z.string().max(40).optional()),
992
+ starting_unit: z.array(z.number().int().min(0).optional()).optional(),
993
+ ending_unit: z.array(z.number().int().optional()).optional(),
994
+ quantity_used: z.array(z.number().int().min(0).optional()).optional(),
995
+ unit_amount: z.array(z.number().int().min(0).optional()).optional(),
996
+ starting_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
997
+ ending_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
998
+ quantity_used_in_decimal: z.array(z.string().max(33).optional()).optional(),
999
+ unit_amount_in_decimal: z.array(z.string().max(40).optional()).optional(),
1000
+ });
1001
+ const ImportInvoiceInvoiceDiscountsSchema = z.object({
1002
+ line_item_id: z.array(z.string().max(40).optional()).optional(),
1003
+ entity_type: z.array(z
1004
+ .enum([
1005
+ 'item_level_coupon',
1006
+ 'document_level_coupon',
1007
+ 'promotional_credits',
1008
+ 'item_level_discount',
1009
+ 'document_level_discount',
1010
+ ])
1011
+ .optional()),
1012
+ entity_id: z.array(z.string().max(100).optional()).optional(),
1013
+ description: z.array(z.string().max(250).optional()).optional(),
1014
+ amount: z.array(z.number().int().min(0).optional()),
1015
+ });
1016
+ const ImportInvoiceInvoiceTaxesSchema = z.object({
1017
+ name: z.array(z.string().max(100).optional()),
1018
+ rate: z.array(z.number().min(0).max(100).optional()),
1019
+ amount: z.array(z.number().int().min(0).optional()).optional(),
1020
+ description: z.array(z.string().max(50).optional()).optional(),
1021
+ juris_type: z
1022
+ .array(z
1023
+ .enum([
1024
+ 'country',
1025
+ 'federal',
1026
+ 'state',
1027
+ 'county',
1028
+ 'city',
1029
+ 'special',
1030
+ 'unincorporated',
1031
+ 'other',
1032
+ ])
1033
+ .optional())
1034
+ .optional(),
1035
+ juris_name: z.array(z.string().max(250).optional()).optional(),
1036
+ juris_code: z.array(z.string().max(250).optional()).optional(),
1037
+ });
1038
+ const ImportInvoiceInvoicePaymentsSchema = z.object({
1039
+ id: z.array(z.string().max(40).optional()).optional(),
1040
+ amount: z.array(z.number().int().min(1).optional()),
1041
+ payment_method: z.array(z
1042
+ .enum([
1043
+ 'cash',
1044
+ 'check',
1045
+ 'bank_transfer',
1046
+ 'other',
1047
+ 'app_store',
1048
+ 'play_store',
1049
+ 'custom',
1050
+ ])
1051
+ .optional()),
1052
+ date: z.array(z.number().int().optional()).optional(),
1053
+ reference_number: z.array(z.string().max(100).min(1).optional()).optional(),
1054
+ });
1055
+ const ImportInvoiceInvoiceNotesSchema = z.object({
1056
+ entity_type: z
1057
+ .array(z
1058
+ .enum([
1059
+ 'coupon',
1060
+ 'plan_item_price',
1061
+ 'addon_item_price',
1062
+ 'charge_item_price',
1063
+ 'plan',
1064
+ 'addon',
1065
+ ])
1066
+ .optional())
1067
+ .optional(),
1068
+ entity_id: z.array(z.string().max(50).optional()).optional(),
1069
+ note: z.array(z.string().max(65000).optional()).optional(),
1070
+ });
1071
+ const ImportInvoiceInvoiceLineItemAddressesSchema = z.object({
1072
+ line_item_id: z.array(z.string().max(40).optional()).optional(),
1073
+ first_name: z.array(z.string().max(150).optional()).optional(),
1074
+ last_name: z.array(z.string().max(150).optional()).optional(),
1075
+ email: z.array(z.string().email().max(70).optional()).optional(),
1076
+ company: z.array(z.string().max(250).optional()).optional(),
1077
+ phone: z.array(z.string().max(50).optional()).optional(),
1078
+ line1: z.array(z.string().max(150).optional()).optional(),
1079
+ line2: z.array(z.string().max(150).optional()).optional(),
1080
+ line3: z.array(z.string().max(150).optional()).optional(),
1081
+ city: z.array(z.string().max(50).optional()).optional(),
1082
+ state_code: z.array(z.string().max(50).optional()).optional(),
1083
+ state: z.array(z.string().max(50).optional()).optional(),
1084
+ zip: z.array(z.string().max(20).optional()).optional(),
1085
+ country: z.array(z.string().max(50).optional()).optional(),
1086
+ validation_status: z
1087
+ .array(z
1088
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
1089
+ .optional())
1090
+ .optional(),
1091
+ });
1092
+ const ImportInvoiceInvoiceBodySchema = z.looseObject({
1093
+ id: z.string().max(50),
1094
+ currency_code: z.string().max(3).optional(),
1095
+ customer_id: z.string().max(50).optional(),
1096
+ subscription_id: z.string().max(50).optional(),
1097
+ po_number: z.string().max(100).optional(),
1098
+ price_type: z.enum(['tax_exclusive', 'tax_inclusive']).optional(),
1099
+ tax_override_reason: z
1100
+ .enum(['id_exempt', 'customer_exempt', 'export'])
1101
+ .optional(),
1102
+ vat_number: z.string().max(20).optional(),
1103
+ vat_number_prefix: z.string().max(10).optional(),
1104
+ date: z.number().int(),
1105
+ total: z.number().int().min(0),
1106
+ round_off: z.number().int().min(-99).max(99).optional(),
1107
+ status: z
1108
+ .enum(['paid', 'posted', 'payment_due', 'not_paid', 'voided', 'pending'])
1109
+ .optional(),
1110
+ voided_at: z.number().int().optional(),
1111
+ void_reason_code: z.string().max(100).optional(),
1112
+ is_written_off: z.boolean().default(false).optional(),
1113
+ write_off_amount: z.number().int().min(0).optional(),
1114
+ write_off_date: z.number().int().optional(),
1115
+ due_date: z.number().int().optional(),
1116
+ net_term_days: z.number().int().optional(),
1117
+ has_advance_charges: z.boolean().default(false).optional(),
1118
+ use_for_proration: z.boolean().default(false).optional(),
1119
+ credit_note: ImportInvoiceInvoiceCreditNoteSchema.optional(),
1120
+ billing_address: ImportInvoiceInvoiceBillingAddressSchema.optional(),
1121
+ shipping_address: ImportInvoiceInvoiceShippingAddressSchema.optional(),
1122
+ line_items: ImportInvoiceInvoiceLineItemsSchema.optional(),
1123
+ payment_reference_numbers: ImportInvoiceInvoicePaymentReferenceNumbersSchema.optional(),
1124
+ line_item_tiers: ImportInvoiceInvoiceLineItemTiersSchema.optional(),
1125
+ discounts: ImportInvoiceInvoiceDiscountsSchema.optional(),
1126
+ taxes: ImportInvoiceInvoiceTaxesSchema.optional(),
1127
+ payments: ImportInvoiceInvoicePaymentsSchema.optional(),
1128
+ notes: ImportInvoiceInvoiceNotesSchema.optional(),
1129
+ line_item_addresses: ImportInvoiceInvoiceLineItemAddressesSchema.optional(),
1130
+ });
1131
+ export { ImportInvoiceInvoiceBodySchema };
1132
+ //Invoice.applyPayments
1133
+ const ApplyPaymentsInvoiceTransactionsSchema = z.object({
1134
+ id: z.array(z.string().max(40).optional()).optional(),
1135
+ amount: z.array(z.number().int().min(0).optional()).optional(),
1136
+ });
1137
+ const ApplyPaymentsInvoiceBodySchema = z.looseObject({
1138
+ comment: z.string().max(300).optional(),
1139
+ transactions: ApplyPaymentsInvoiceTransactionsSchema.optional(),
1140
+ });
1141
+ export { ApplyPaymentsInvoiceBodySchema };
1142
+ //Invoice.deleteLineItems
1143
+ const DeleteLineItemsInvoiceLineItemsSchema = z.object({
1144
+ id: z.array(z.string().max(40).optional()).optional(),
1145
+ });
1146
+ const DeleteLineItemsInvoiceBodySchema = z.looseObject({
1147
+ line_items: DeleteLineItemsInvoiceLineItemsSchema.optional(),
1148
+ });
1149
+ export { DeleteLineItemsInvoiceBodySchema };
1150
+ //Invoice.applyCredits
1151
+ const ApplyCreditsInvoiceCreditNotesSchema = z.object({
1152
+ id: z.array(z.string().max(50).optional()).optional(),
1153
+ });
1154
+ const ApplyCreditsInvoiceBodySchema = z.looseObject({
1155
+ comment: z.string().max(300).optional(),
1156
+ credit_notes: ApplyCreditsInvoiceCreditNotesSchema.optional(),
1157
+ });
1158
+ export { ApplyCreditsInvoiceBodySchema };
1159
+ //Invoice.list
1160
+ const ListInvoiceIdSchema = z.object({
1161
+ is: z.string().min(1).optional(),
1162
+ is_not: z.string().min(1).optional(),
1163
+ starts_with: z.string().min(1).optional(),
1164
+ in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1165
+ not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1166
+ });
1167
+ const ListInvoiceSubscriptionIdSchema = z.object({
1168
+ is: z.string().min(1).optional(),
1169
+ is_not: z.string().min(1).optional(),
1170
+ starts_with: z.string().min(1).optional(),
1171
+ is_present: z.enum(['true', 'false']).optional(),
1172
+ in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1173
+ not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1174
+ });
1175
+ const ListInvoiceCustomerIdSchema = z.object({
1176
+ is: z.string().min(1).optional(),
1177
+ is_not: z.string().min(1).optional(),
1178
+ starts_with: z.string().min(1).optional(),
1179
+ in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1180
+ not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1181
+ });
1182
+ const ListInvoiceRecurringSchema = z.object({
1183
+ is: z.enum(['true', 'false']).optional(),
1184
+ });
1185
+ const ListInvoiceStatusSchema = z.object({
1186
+ is: z
1187
+ .enum(['paid', 'posted', 'payment_due', 'not_paid', 'voided', 'pending'])
1188
+ .optional(),
1189
+ is_not: z
1190
+ .enum(['paid', 'posted', 'payment_due', 'not_paid', 'voided', 'pending'])
1191
+ .optional(),
1192
+ in: z
1193
+ .enum(['paid', 'posted', 'payment_due', 'not_paid', 'voided', 'pending'])
1194
+ .optional(),
1195
+ not_in: z
1196
+ .enum(['paid', 'posted', 'payment_due', 'not_paid', 'voided', 'pending'])
1197
+ .optional(),
1198
+ });
1199
+ const ListInvoicePriceTypeSchema = z.object({
1200
+ is: z.enum(['tax_exclusive', 'tax_inclusive']).optional(),
1201
+ is_not: z.enum(['tax_exclusive', 'tax_inclusive']).optional(),
1202
+ in: z.enum(['tax_exclusive', 'tax_inclusive']).optional(),
1203
+ not_in: z.enum(['tax_exclusive', 'tax_inclusive']).optional(),
1204
+ });
1205
+ const ListInvoiceDateSchema = z.object({
1206
+ after: z.string().regex(RegExp('^\\d{10}$')).optional(),
1207
+ before: z.string().regex(RegExp('^\\d{10}$')).optional(),
1208
+ on: z.string().regex(RegExp('^\\d{10}$')).optional(),
1209
+ between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
1210
+ });
1211
+ const ListInvoicePaidAtSchema = z.object({
1212
+ after: z.string().regex(RegExp('^\\d{10}$')).optional(),
1213
+ before: z.string().regex(RegExp('^\\d{10}$')).optional(),
1214
+ on: z.string().regex(RegExp('^\\d{10}$')).optional(),
1215
+ between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
1216
+ });
1217
+ const ListInvoiceTotalSchema = z.object({
1218
+ is: z.string().regex(RegExp('^-?\\d+$')).optional(),
1219
+ is_not: z.string().regex(RegExp('^-?\\d+$')).optional(),
1220
+ lt: z.string().regex(RegExp('^-?\\d+$')).optional(),
1221
+ lte: z.string().regex(RegExp('^-?\\d+$')).optional(),
1222
+ gt: z.string().regex(RegExp('^-?\\d+$')).optional(),
1223
+ gte: z.string().regex(RegExp('^-?\\d+$')).optional(),
1224
+ between: z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')).optional(),
1225
+ });
1226
+ const ListInvoiceAmountPaidSchema = z.object({
1227
+ is: z.string().regex(RegExp('^-?\\d+$')).optional(),
1228
+ is_not: z.string().regex(RegExp('^-?\\d+$')).optional(),
1229
+ lt: z.string().regex(RegExp('^-?\\d+$')).optional(),
1230
+ lte: z.string().regex(RegExp('^-?\\d+$')).optional(),
1231
+ gt: z.string().regex(RegExp('^-?\\d+$')).optional(),
1232
+ gte: z.string().regex(RegExp('^-?\\d+$')).optional(),
1233
+ between: z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')).optional(),
1234
+ });
1235
+ const ListInvoiceAmountAdjustedSchema = z.object({
1236
+ is: z.string().regex(RegExp('^-?\\d+$')).optional(),
1237
+ is_not: z.string().regex(RegExp('^-?\\d+$')).optional(),
1238
+ lt: z.string().regex(RegExp('^-?\\d+$')).optional(),
1239
+ lte: z.string().regex(RegExp('^-?\\d+$')).optional(),
1240
+ gt: z.string().regex(RegExp('^-?\\d+$')).optional(),
1241
+ gte: z.string().regex(RegExp('^-?\\d+$')).optional(),
1242
+ between: z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')).optional(),
1243
+ });
1244
+ const ListInvoiceCreditsAppliedSchema = z.object({
1245
+ is: z.string().regex(RegExp('^-?\\d+$')).optional(),
1246
+ is_not: z.string().regex(RegExp('^-?\\d+$')).optional(),
1247
+ lt: z.string().regex(RegExp('^-?\\d+$')).optional(),
1248
+ lte: z.string().regex(RegExp('^-?\\d+$')).optional(),
1249
+ gt: z.string().regex(RegExp('^-?\\d+$')).optional(),
1250
+ gte: z.string().regex(RegExp('^-?\\d+$')).optional(),
1251
+ between: z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')).optional(),
1252
+ });
1253
+ const ListInvoiceAmountDueSchema = z.object({
1254
+ is: z.string().regex(RegExp('^-?\\d+$')).optional(),
1255
+ is_not: z.string().regex(RegExp('^-?\\d+$')).optional(),
1256
+ lt: z.string().regex(RegExp('^-?\\d+$')).optional(),
1257
+ lte: z.string().regex(RegExp('^-?\\d+$')).optional(),
1258
+ gt: z.string().regex(RegExp('^-?\\d+$')).optional(),
1259
+ gte: z.string().regex(RegExp('^-?\\d+$')).optional(),
1260
+ between: z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')).optional(),
1261
+ });
1262
+ const ListInvoiceDunningStatusSchema = z.object({
1263
+ is: z.enum(['in_progress', 'exhausted', 'stopped', 'success']).optional(),
1264
+ is_not: z.enum(['in_progress', 'exhausted', 'stopped', 'success']).optional(),
1265
+ in: z.enum(['in_progress', 'exhausted', 'stopped', 'success']).optional(),
1266
+ not_in: z.enum(['in_progress', 'exhausted', 'stopped', 'success']).optional(),
1267
+ is_present: z.enum(['true', 'false']).optional(),
1268
+ });
1269
+ const ListInvoicePaymentOwnerSchema = z.object({
1270
+ is: z.string().min(1).optional(),
1271
+ is_not: z.string().min(1).optional(),
1272
+ starts_with: z.string().min(1).optional(),
1273
+ in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1274
+ not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1275
+ });
1276
+ const ListInvoiceUpdatedAtSchema = z.object({
1277
+ after: z.string().regex(RegExp('^\\d{10}$')).optional(),
1278
+ before: z.string().regex(RegExp('^\\d{10}$')).optional(),
1279
+ on: z.string().regex(RegExp('^\\d{10}$')).optional(),
1280
+ between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
1281
+ });
1282
+ const ListInvoiceChannelSchema = z.object({
1283
+ is: z.enum(['web', 'app_store', 'play_store']).optional(),
1284
+ is_not: z.enum(['web', 'app_store', 'play_store']).optional(),
1285
+ in: z.enum(['web', 'app_store', 'play_store']).optional(),
1286
+ not_in: z.enum(['web', 'app_store', 'play_store']).optional(),
1287
+ });
1288
+ const ListInvoiceVoidedAtSchema = z.object({
1289
+ after: z.string().regex(RegExp('^\\d{10}$')).optional(),
1290
+ before: z.string().regex(RegExp('^\\d{10}$')).optional(),
1291
+ on: z.string().regex(RegExp('^\\d{10}$')).optional(),
1292
+ between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
1293
+ });
1294
+ const ListInvoiceVoidReasonCodeSchema = z.object({
1295
+ is: z.string().min(1).optional(),
1296
+ is_not: z.string().min(1).optional(),
1297
+ starts_with: z.string().min(1).optional(),
1298
+ in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1299
+ not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1300
+ });
1301
+ const ListInvoiceSortBySchema = z.looseObject({
1302
+ asc: z.enum(['date', 'updated_at']).optional(),
1303
+ desc: z.enum(['date', 'updated_at']).optional(),
1304
+ });
1305
+ const ListInvoiceEinvoiceSchema = z.object({
1306
+ status: ListInvoiceStatusSchema.optional(),
1307
+ });
1308
+ const ListInvoiceBodySchema = z.looseObject({
1309
+ limit: z.number().int().min(1).max(100).optional(),
1310
+ offset: z.string().max(1000).optional(),
1311
+ paid_on_after: z.number().int().optional(),
1312
+ include_deleted: z.boolean().default(false).optional(),
1313
+ id: ListInvoiceIdSchema.optional(),
1314
+ subscription_id: ListInvoiceSubscriptionIdSchema.optional(),
1315
+ customer_id: ListInvoiceCustomerIdSchema.optional(),
1316
+ recurring: ListInvoiceRecurringSchema.optional(),
1317
+ status: ListInvoiceStatusSchema.optional(),
1318
+ price_type: ListInvoicePriceTypeSchema.optional(),
1319
+ date: ListInvoiceDateSchema.optional(),
1320
+ paid_at: ListInvoicePaidAtSchema.optional(),
1321
+ total: ListInvoiceTotalSchema.optional(),
1322
+ amount_paid: ListInvoiceAmountPaidSchema.optional(),
1323
+ amount_adjusted: ListInvoiceAmountAdjustedSchema.optional(),
1324
+ credits_applied: ListInvoiceCreditsAppliedSchema.optional(),
1325
+ amount_due: ListInvoiceAmountDueSchema.optional(),
1326
+ dunning_status: ListInvoiceDunningStatusSchema.optional(),
1327
+ payment_owner: ListInvoicePaymentOwnerSchema.optional(),
1328
+ updated_at: ListInvoiceUpdatedAtSchema.optional(),
1329
+ channel: ListInvoiceChannelSchema.optional(),
1330
+ voided_at: ListInvoiceVoidedAtSchema.optional(),
1331
+ void_reason_code: ListInvoiceVoidReasonCodeSchema.optional(),
1332
+ sort_by: ListInvoiceSortBySchema.optional(),
1333
+ einvoice: ListInvoiceEinvoiceSchema.optional(),
1334
+ });
1335
+ export { ListInvoiceBodySchema };
1336
+ //Invoice.invoicesForCustomer
1337
+ const InvoicesForCustomerInvoiceBodySchema = z.looseObject({
1338
+ limit: z.number().int().min(1).max(100).optional(),
1339
+ offset: z.string().max(1000).optional(),
1340
+ });
1341
+ export { InvoicesForCustomerInvoiceBodySchema };
1342
+ //Invoice.invoicesForSubscription
1343
+ const InvoicesForSubscriptionInvoiceBodySchema = z.looseObject({
1344
+ limit: z.number().int().min(1).max(100).optional(),
1345
+ offset: z.string().max(1000).optional(),
1346
+ });
1347
+ export { InvoicesForSubscriptionInvoiceBodySchema };
1348
+ //Invoice.retrieve
1349
+ const RetrieveInvoiceSubscriptionIdSchema = z.object({
1350
+ is: z.string().min(1).optional(),
1351
+ });
1352
+ const RetrieveInvoiceCustomerIdSchema = z.object({
1353
+ is: z.string().min(1).optional(),
1354
+ });
1355
+ const RetrieveInvoiceLineItemSchema = z.object({
1356
+ subscription_id: RetrieveInvoiceSubscriptionIdSchema.optional(),
1357
+ customer_id: RetrieveInvoiceCustomerIdSchema.optional(),
1358
+ });
1359
+ const RetrieveInvoiceBodySchema = z.looseObject({
1360
+ line_items_limit: z.number().int().min(1).max(300).optional(),
1361
+ line_items_offset: z.string().max(1000).optional(),
1362
+ line_item: RetrieveInvoiceLineItemSchema.optional(),
1363
+ });
1364
+ export { RetrieveInvoiceBodySchema };
1365
+ //Invoice.pdf
1366
+ const PdfInvoiceBodySchema = z.looseObject({
1367
+ disposition_type: z.enum(['attachment', 'inline']).optional(),
1368
+ });
1369
+ export { PdfInvoiceBodySchema };
1370
+ //Invoice.listPaymentReferenceNumbers
1371
+ const ListPaymentReferenceNumbersInvoiceIdSchema = z.object({
1372
+ is: z.string().min(1).optional(),
1373
+ in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1374
+ });
1375
+ const ListPaymentReferenceNumbersInvoiceNumberSchema = z.object({
1376
+ is: z.string().min(1).optional(),
1377
+ in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1378
+ });
1379
+ const ListPaymentReferenceNumbersInvoicePaymentReferenceNumberItemSchema = z.object({
1380
+ number: ListPaymentReferenceNumbersInvoiceNumberSchema.optional(),
1381
+ });
1382
+ const ListPaymentReferenceNumbersInvoiceBodySchema = z.looseObject({
1383
+ limit: z.number().int().min(1).max(100).optional(),
1384
+ offset: z.string().max(1000).optional(),
1385
+ id: ListPaymentReferenceNumbersInvoiceIdSchema.optional(),
1386
+ payment_reference_number: z
1387
+ .array(ListPaymentReferenceNumbersInvoicePaymentReferenceNumberItemSchema.optional())
1388
+ .optional(),
1389
+ });
1390
+ export { ListPaymentReferenceNumbersInvoiceBodySchema };
1391
+ //Invoice.addCharge
1392
+ const AddChargeInvoiceLineItemSchema = z.object({
1393
+ date_from: z.number().int().optional(),
1394
+ date_to: z.number().int().optional(),
1395
+ });
1396
+ const AddChargeInvoiceBodySchema = z.looseObject({
1397
+ amount: z.number().int().min(1),
1398
+ description: z.string().max(250),
1399
+ avalara_sale_type: z
1400
+ .enum(['wholesale', 'retail', 'consumed', 'vendor_use'])
1401
+ .optional(),
1402
+ avalara_transaction_type: z.number().int().optional(),
1403
+ avalara_service_type: z.number().int().optional(),
1404
+ avalara_tax_code: z.string().max(50).optional(),
1405
+ hsn_code: z.string().max(50).optional(),
1406
+ taxjar_product_code: z.string().max(50).optional(),
1407
+ comment: z.string().max(300).optional(),
1408
+ subscription_id: z.string().max(50).optional(),
1409
+ line_item: AddChargeInvoiceLineItemSchema.optional(),
1410
+ });
1411
+ export { AddChargeInvoiceBodySchema };
1412
+ //Invoice.addAddonCharge
1413
+ const AddAddonChargeInvoiceLineItemSchema = z.object({
1414
+ date_from: z.number().int().optional(),
1415
+ date_to: z.number().int().optional(),
1416
+ });
1417
+ const AddAddonChargeInvoiceBodySchema = z.looseObject({
1418
+ addon_id: z.string().max(100),
1419
+ addon_quantity: z.number().int().min(1).optional(),
1420
+ addon_unit_price: z.number().int().min(0).optional(),
1421
+ addon_quantity_in_decimal: z.string().max(33).optional(),
1422
+ addon_unit_price_in_decimal: z.string().max(39).optional(),
1423
+ comment: z.string().max(300).optional(),
1424
+ subscription_id: z.string().max(50).optional(),
1425
+ line_item: AddAddonChargeInvoiceLineItemSchema.optional(),
1426
+ });
1427
+ export { AddAddonChargeInvoiceBodySchema };
1428
+ //Invoice.addChargeItem
1429
+ const AddChargeItemInvoiceItemPriceSchema = z.object({
1430
+ item_price_id: z.string().max(100),
1431
+ quantity: z.number().int().min(1).optional(),
1432
+ quantity_in_decimal: z.string().max(33).optional(),
1433
+ unit_price: z.number().int().min(0).optional(),
1434
+ unit_price_in_decimal: z.string().max(39).optional(),
1435
+ date_from: z.number().int().optional(),
1436
+ date_to: z.number().int().optional(),
1437
+ });
1438
+ const AddChargeItemInvoiceItemTiersSchema = z.object({
1439
+ starting_unit: z.array(z.number().int().min(1).optional()).optional(),
1440
+ ending_unit: z.array(z.number().int().optional()).optional(),
1441
+ price: z.array(z.number().int().min(0).optional()).optional(),
1442
+ starting_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
1443
+ ending_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
1444
+ price_in_decimal: z.array(z.string().max(39).optional()).optional(),
1445
+ pricing_type: z
1446
+ .array(z.enum(['per_unit', 'flat_fee', 'package']).optional())
1447
+ .optional(),
1448
+ package_size: z.array(z.number().int().min(1).optional()).optional(),
1449
+ });
1450
+ const AddChargeItemInvoiceBodySchema = z.looseObject({
1451
+ comment: z.string().max(300).optional(),
1452
+ subscription_id: z.string().max(50).optional(),
1453
+ item_price: AddChargeItemInvoiceItemPriceSchema.optional(),
1454
+ item_tiers: AddChargeItemInvoiceItemTiersSchema.optional(),
1455
+ });
1456
+ export { AddChargeItemInvoiceBodySchema };
1457
+ //Invoice.close
1458
+ const CloseInvoiceNotesToRemoveSchema = z.object({
1459
+ entity_type: z
1460
+ .array(z
1461
+ .enum([
1462
+ 'customer',
1463
+ 'subscription',
1464
+ 'coupon',
1465
+ 'plan_item_price',
1466
+ 'addon_item_price',
1467
+ 'charge_item_price',
1468
+ 'plan',
1469
+ 'addon',
1470
+ ])
1471
+ .optional())
1472
+ .optional(),
1473
+ entity_id: z.array(z.string().max(100).optional()).optional(),
1474
+ });
1475
+ const CloseInvoiceBodySchema = z.looseObject({
1476
+ comment: z.string().max(300).optional(),
1477
+ invoice_note: z.string().max(2000).optional(),
1478
+ remove_general_note: z.boolean().default(false).optional(),
1479
+ invoice_date: z.number().int().optional(),
1480
+ notes_to_remove: CloseInvoiceNotesToRemoveSchema.optional(),
1481
+ });
1482
+ export { CloseInvoiceBodySchema };
1483
+ //Invoice.collectPayment
1484
+ const CollectPaymentInvoiceBodySchema = z.looseObject({
1485
+ amount: z.number().int().min(1).optional(),
1486
+ authorization_transaction_id: z.string().max(40).optional(),
1487
+ payment_source_id: z.string().max(40).optional(),
1488
+ comment: z.string().max(300).optional(),
1489
+ payment_initiator: z.enum(['customer', 'merchant']).optional(),
1490
+ });
1491
+ export { CollectPaymentInvoiceBodySchema };
1492
+ //Invoice.recordPayment
1493
+ const RecordPaymentInvoiceTransactionSchema = z.object({
1494
+ amount: z.number().int().min(0).optional(),
1495
+ payment_method: z.enum([
1496
+ 'cash',
1497
+ 'check',
1498
+ 'bank_transfer',
1499
+ 'other',
1500
+ 'app_store',
1501
+ 'play_store',
1502
+ 'custom',
1503
+ ]),
1504
+ reference_number: z.string().max(100).optional(),
1505
+ custom_payment_method_id: z.string().max(50).optional(),
1506
+ id_at_gateway: z.string().max(100).optional(),
1507
+ status: z.enum(['success', 'failure', 'late_failure']).optional(),
1508
+ date: z.number().int().optional(),
1509
+ error_code: z.string().max(100).optional(),
1510
+ error_text: z.string().max(65000).optional(),
1511
+ });
1512
+ const RecordPaymentInvoiceBodySchema = z.looseObject({
1513
+ comment: z.string().max(300).optional(),
1514
+ transaction: RecordPaymentInvoiceTransactionSchema.optional(),
1515
+ });
1516
+ export { RecordPaymentInvoiceBodySchema };
1517
+ //Invoice.recordTaxWithheld
1518
+ const RecordTaxWithheldInvoiceTaxWithheldSchema = z.object({
1519
+ amount: z.number().int().min(1),
1520
+ reference_number: z.string().max(100).optional(),
1521
+ date: z.number().int().optional(),
1522
+ description: z.string().max(65000).optional(),
1523
+ });
1524
+ const RecordTaxWithheldInvoiceBodySchema = z.looseObject({
1525
+ tax_withheld: RecordTaxWithheldInvoiceTaxWithheldSchema.optional(),
1526
+ });
1527
+ export { RecordTaxWithheldInvoiceBodySchema };
1528
+ //Invoice.removeTaxWithheld
1529
+ const RemoveTaxWithheldInvoiceTaxWithheldSchema = z.object({
1530
+ id: z.string().max(40),
1531
+ });
1532
+ const RemoveTaxWithheldInvoiceBodySchema = z.looseObject({
1533
+ tax_withheld: RemoveTaxWithheldInvoiceTaxWithheldSchema.optional(),
1534
+ });
1535
+ export { RemoveTaxWithheldInvoiceBodySchema };
1536
+ //Invoice.refund
1537
+ const RefundInvoiceCreditNoteSchema = z.object({
1538
+ reason_code: z
1539
+ .enum([
1540
+ 'product_unsatisfactory',
1541
+ 'service_unsatisfactory',
1542
+ 'order_change',
1543
+ 'order_cancellation',
1544
+ 'waiver',
1545
+ 'other',
1546
+ ])
1547
+ .optional(),
1548
+ create_reason_code: z.string().max(100).optional(),
1549
+ });
1550
+ const RefundInvoiceBodySchema = z.looseObject({
1551
+ refund_amount: z.number().int().min(1).optional(),
1552
+ comment: z.string().max(300).optional(),
1553
+ customer_notes: z.string().max(2000).optional(),
1554
+ credit_note: RefundInvoiceCreditNoteSchema.optional(),
1555
+ });
1556
+ export { RefundInvoiceBodySchema };
1557
+ //Invoice.recordRefund
1558
+ const RecordRefundInvoiceTransactionSchema = z.object({
1559
+ amount: z.number().int().min(0).optional(),
1560
+ payment_method: z.enum([
1561
+ 'cash',
1562
+ 'check',
1563
+ 'chargeback',
1564
+ 'bank_transfer',
1565
+ 'other',
1566
+ 'app_store',
1567
+ 'play_store',
1568
+ 'custom',
1569
+ ]),
1570
+ reference_number: z.string().max(100).optional(),
1571
+ custom_payment_method_id: z.string().max(50).optional(),
1572
+ date: z.number().int(),
1573
+ });
1574
+ const RecordRefundInvoiceCreditNoteSchema = z.object({
1575
+ reason_code: z
1576
+ .enum([
1577
+ 'chargeback',
1578
+ 'product_unsatisfactory',
1579
+ 'service_unsatisfactory',
1580
+ 'order_change',
1581
+ 'order_cancellation',
1582
+ 'waiver',
1583
+ 'other',
1584
+ ])
1585
+ .optional(),
1586
+ create_reason_code: z.string().max(100).optional(),
1587
+ });
1588
+ const RecordRefundInvoiceBodySchema = z.looseObject({
1589
+ comment: z.string().max(65000).optional(),
1590
+ customer_notes: z.string().max(2000).optional(),
1591
+ transaction: RecordRefundInvoiceTransactionSchema.optional(),
1592
+ credit_note: RecordRefundInvoiceCreditNoteSchema.optional(),
1593
+ });
1594
+ export { RecordRefundInvoiceBodySchema };
1595
+ //Invoice.removePayment
1596
+ const RemovePaymentInvoiceTransactionSchema = z.object({
1597
+ id: z.string().max(40),
1598
+ });
1599
+ const RemovePaymentInvoiceBodySchema = z.looseObject({
1600
+ transaction: RemovePaymentInvoiceTransactionSchema.optional(),
1601
+ });
1602
+ export { RemovePaymentInvoiceBodySchema };
1603
+ //Invoice.removeCreditNote
1604
+ const RemoveCreditNoteInvoiceCreditNoteSchema = z.object({
1605
+ id: z.string().max(50),
1606
+ });
1607
+ const RemoveCreditNoteInvoiceBodySchema = z.looseObject({
1608
+ credit_note: RemoveCreditNoteInvoiceCreditNoteSchema.optional(),
1609
+ });
1610
+ export { RemoveCreditNoteInvoiceBodySchema };
1611
+ //Invoice.voidInvoice
1612
+ const VoidInvoiceInvoiceBodySchema = z.looseObject({
1613
+ comment: z.string().max(300).optional(),
1614
+ void_reason_code: z.string().max(100).optional(),
1615
+ });
1616
+ export { VoidInvoiceInvoiceBodySchema };
1617
+ //Invoice.writeOff
1618
+ const WriteOffInvoiceBodySchema = z.looseObject({
1619
+ comment: z.string().max(300).optional(),
1620
+ });
1621
+ export { WriteOffInvoiceBodySchema };
1622
+ //Invoice.delete
1623
+ const DeleteInvoiceBodySchema = z.looseObject({
1624
+ comment: z.string().max(300).optional(),
1625
+ });
1626
+ export { DeleteInvoiceBodySchema };
1627
+ //Invoice.updateDetails
1628
+ const UpdateDetailsInvoiceBillingAddressSchema = z.object({
1629
+ first_name: z.string().max(150).optional(),
1630
+ last_name: z.string().max(150).optional(),
1631
+ email: z.string().email().max(70).optional(),
1632
+ company: z.string().max(250).optional(),
1633
+ phone: z.string().max(50).optional(),
1634
+ line1: z.string().max(150).optional(),
1635
+ line2: z.string().max(150).optional(),
1636
+ line3: z.string().max(150).optional(),
1637
+ city: z.string().max(50).optional(),
1638
+ state_code: z.string().max(50).optional(),
1639
+ state: z.string().max(50).optional(),
1640
+ zip: z.string().max(20).optional(),
1641
+ country: z.string().max(50).optional(),
1642
+ validation_status: z
1643
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
1644
+ .optional(),
1645
+ });
1646
+ const UpdateDetailsInvoiceShippingAddressSchema = z.object({
1647
+ first_name: z.string().max(150).optional(),
1648
+ last_name: z.string().max(150).optional(),
1649
+ email: z.string().email().max(70).optional(),
1650
+ company: z.string().max(250).optional(),
1651
+ phone: z.string().max(50).optional(),
1652
+ line1: z.string().max(150).optional(),
1653
+ line2: z.string().max(150).optional(),
1654
+ line3: z.string().max(150).optional(),
1655
+ city: z.string().max(50).optional(),
1656
+ state_code: z.string().max(50).optional(),
1657
+ state: z.string().max(50).optional(),
1658
+ zip: z.string().max(20).optional(),
1659
+ country: z.string().max(50).optional(),
1660
+ validation_status: z
1661
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
1662
+ .optional(),
1663
+ });
1664
+ const UpdateDetailsInvoiceStatementDescriptorSchema = z.object({
1665
+ descriptor: z.string().max(65000).optional(),
1666
+ });
1667
+ const UpdateDetailsInvoiceBodySchema = z.looseObject({
1668
+ vat_number: z.string().max(20).optional(),
1669
+ vat_number_prefix: z.string().max(10).optional(),
1670
+ po_number: z.string().max(100).optional(),
1671
+ comment: z.string().max(300).optional(),
1672
+ billing_address: UpdateDetailsInvoiceBillingAddressSchema.optional(),
1673
+ shipping_address: UpdateDetailsInvoiceShippingAddressSchema.optional(),
1674
+ statement_descriptor: UpdateDetailsInvoiceStatementDescriptorSchema.optional(),
1675
+ });
1676
+ export { UpdateDetailsInvoiceBodySchema };
1677
+ //Invoice.applyPaymentScheduleScheme
1678
+ const ApplyPaymentScheduleSchemeInvoiceBodySchema = z.looseObject({
1679
+ scheme_id: z.string(),
1680
+ amount: z.number().int().min(0).optional(),
1681
+ });
1682
+ export { ApplyPaymentScheduleSchemeInvoiceBodySchema };