chargebee 3.24.0 → 3.25.0-beta.1

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