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,1525 @@
1
+ "use strict";
2
+ // Generated Zod schemas: Estimate
3
+ // Actions: createSubscription, createSubItemEstimate, createSubForCustomerEstimate, createSubItemForCustomerEstimate, updateSubscription, updateSubscriptionForItems, renewalEstimate, advanceInvoiceEstimate, regenerateInvoiceEstimate, upcomingInvoicesEstimate, changeTermEnd, cancelSubscription, cancelSubscriptionForItems, pauseSubscription, resumeSubscription, giftSubscription, giftSubscriptionForItems, createInvoice, createInvoiceForItems, paymentSchedules
4
+ // Do not edit manually – regenerate via sdk-generator
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.PaymentSchedulesEstimateBodySchema = exports.CreateInvoiceForItemsEstimateBodySchema = exports.CreateInvoiceEstimateBodySchema = exports.GiftSubscriptionForItemsEstimateBodySchema = exports.GiftSubscriptionEstimateBodySchema = exports.ResumeSubscriptionEstimateBodySchema = exports.PauseSubscriptionEstimateBodySchema = exports.CancelSubscriptionForItemsEstimateBodySchema = exports.CancelSubscriptionEstimateBodySchema = exports.ChangeTermEndEstimateBodySchema = exports.UpcomingInvoicesEstimateEstimateBodySchema = exports.RegenerateInvoiceEstimateEstimateBodySchema = exports.AdvanceInvoiceEstimateEstimateBodySchema = exports.RenewalEstimateEstimateBodySchema = exports.UpdateSubscriptionForItemsEstimateBodySchema = exports.UpdateSubscriptionEstimateBodySchema = exports.CreateSubItemForCustomerEstimateEstimateBodySchema = exports.CreateSubForCustomerEstimateEstimateBodySchema = exports.CreateSubItemEstimateEstimateBodySchema = exports.CreateSubscriptionEstimateBodySchema = void 0;
7
+ const zod_1 = require("zod");
8
+ //Estimate.createSubscription
9
+ const CreateSubscriptionEstimateSubscriptionSchema = zod_1.z.object({
10
+ id: zod_1.z.string().max(50).optional(),
11
+ plan_id: zod_1.z.string().max(100),
12
+ plan_quantity: zod_1.z.number().int().min(1).optional(),
13
+ plan_quantity_in_decimal: zod_1.z.string().max(33).optional(),
14
+ plan_unit_price: zod_1.z.number().int().min(0).optional(),
15
+ plan_unit_price_in_decimal: zod_1.z.string().max(39).optional(),
16
+ setup_fee: zod_1.z.number().int().min(0).optional(),
17
+ trial_end: zod_1.z.number().int().optional(),
18
+ start_date: zod_1.z.number().int().optional(),
19
+ coupon: zod_1.z.string().max(100).optional(),
20
+ offline_payment_method: zod_1.z
21
+ .enum([
22
+ 'no_preference',
23
+ 'cash',
24
+ 'check',
25
+ 'bank_transfer',
26
+ 'ach_credit',
27
+ 'sepa_credit',
28
+ 'boleto',
29
+ 'us_automated_bank_transfer',
30
+ 'eu_automated_bank_transfer',
31
+ 'uk_automated_bank_transfer',
32
+ 'jp_automated_bank_transfer',
33
+ 'mx_automated_bank_transfer',
34
+ 'custom',
35
+ ])
36
+ .optional(),
37
+ free_period: zod_1.z.number().int().min(1).optional(),
38
+ free_period_unit: zod_1.z.enum(['day', 'week', 'month', 'year']).optional(),
39
+ contract_term_billing_cycle_on_renewal: zod_1.z
40
+ .number()
41
+ .int()
42
+ .min(1)
43
+ .max(100)
44
+ .optional(),
45
+ trial_end_action: zod_1.z
46
+ .enum([
47
+ 'site_default',
48
+ 'plan_default',
49
+ 'activate_subscription',
50
+ 'cancel_subscription',
51
+ ])
52
+ .optional(),
53
+ });
54
+ const CreateSubscriptionEstimateBillingAddressSchema = zod_1.z.object({
55
+ line1: zod_1.z.string().max(150).optional(),
56
+ line2: zod_1.z.string().max(150).optional(),
57
+ line3: zod_1.z.string().max(150).optional(),
58
+ city: zod_1.z.string().max(50).optional(),
59
+ state_code: zod_1.z.string().max(50).optional(),
60
+ zip: zod_1.z.string().max(20).optional(),
61
+ country: zod_1.z.string().max(50).optional(),
62
+ validation_status: zod_1.z
63
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
64
+ .optional(),
65
+ });
66
+ const CreateSubscriptionEstimateShippingAddressSchema = zod_1.z.object({
67
+ line1: zod_1.z.string().max(150).optional(),
68
+ line2: zod_1.z.string().max(150).optional(),
69
+ line3: zod_1.z.string().max(150).optional(),
70
+ city: zod_1.z.string().max(50).optional(),
71
+ state_code: zod_1.z.string().max(50).optional(),
72
+ zip: zod_1.z.string().max(20).optional(),
73
+ country: zod_1.z.string().max(50).optional(),
74
+ validation_status: zod_1.z
75
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
76
+ .optional(),
77
+ });
78
+ const CreateSubscriptionEstimateCustomerSchema = zod_1.z.object({
79
+ vat_number: zod_1.z.string().max(20).optional(),
80
+ vat_number_prefix: zod_1.z.string().max(10).optional(),
81
+ registered_for_gst: zod_1.z.boolean().optional(),
82
+ taxability: zod_1.z.enum(['taxable', 'exempt']).optional(),
83
+ entity_code: zod_1.z
84
+ .enum([
85
+ 'a',
86
+ 'b',
87
+ 'c',
88
+ 'd',
89
+ 'e',
90
+ 'f',
91
+ 'g',
92
+ 'h',
93
+ 'i',
94
+ 'j',
95
+ 'k',
96
+ 'l',
97
+ 'm',
98
+ 'n',
99
+ 'p',
100
+ 'q',
101
+ 'r',
102
+ 'med1',
103
+ 'med2',
104
+ ])
105
+ .optional(),
106
+ exempt_number: zod_1.z.string().max(100).optional(),
107
+ exemption_details: zod_1.z.array(zod_1.z.string().optional()).optional(),
108
+ customer_type: zod_1.z
109
+ .enum(['residential', 'business', 'senior_citizen', 'industrial'])
110
+ .optional(),
111
+ });
112
+ const CreateSubscriptionEstimateContractTermSchema = zod_1.z.object({
113
+ action_at_term_end: zod_1.z.enum(['renew', 'evergreen', 'cancel']).optional(),
114
+ cancellation_cutoff_period: zod_1.z.number().int().optional(),
115
+ });
116
+ const CreateSubscriptionEstimateAddonsSchema = zod_1.z.object({
117
+ id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
118
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
119
+ quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
120
+ unit_price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
121
+ unit_price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
122
+ billing_cycles: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
123
+ trial_end: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
124
+ });
125
+ const CreateSubscriptionEstimateEventBasedAddonsSchema = zod_1.z.object({
126
+ id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
127
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
128
+ unit_price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
129
+ quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
130
+ unit_price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
131
+ service_period_in_days: zod_1.z
132
+ .array(zod_1.z.number().int().min(1).max(4000).optional())
133
+ .optional(),
134
+ on_event: zod_1.z
135
+ .array(zod_1.z
136
+ .enum([
137
+ 'subscription_creation',
138
+ 'subscription_trial_start',
139
+ 'plan_activation',
140
+ 'subscription_activation',
141
+ 'contract_termination',
142
+ ])
143
+ .optional())
144
+ .optional(),
145
+ charge_once: zod_1.z.array(zod_1.z.boolean().default(true).optional()).optional(),
146
+ charge_on: zod_1.z.array(zod_1.z.enum(['immediately', 'on_event']).optional()).optional(),
147
+ });
148
+ const CreateSubscriptionEstimateTaxProvidersFieldsSchema = zod_1.z.object({
149
+ provider_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
150
+ field_id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
151
+ field_value: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
152
+ });
153
+ const CreateSubscriptionEstimateBodySchema = zod_1.z.looseObject({
154
+ billing_cycles: zod_1.z.number().int().min(0).optional(),
155
+ mandatory_addons_to_remove: zod_1.z
156
+ .array(zod_1.z.string().max(100).optional())
157
+ .optional(),
158
+ terms_to_charge: zod_1.z.number().int().min(1).optional(),
159
+ billing_alignment_mode: zod_1.z.enum(['immediate', 'delayed']).optional(),
160
+ coupon_ids: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
161
+ invoice_immediately: zod_1.z.boolean().optional(),
162
+ invoice_date: zod_1.z.number().int().optional(),
163
+ client_profile_id: zod_1.z.string().max(50).optional(),
164
+ subscription: CreateSubscriptionEstimateSubscriptionSchema.optional(),
165
+ billing_address: CreateSubscriptionEstimateBillingAddressSchema.optional(),
166
+ shipping_address: CreateSubscriptionEstimateShippingAddressSchema.optional(),
167
+ customer: CreateSubscriptionEstimateCustomerSchema.optional(),
168
+ contract_term: CreateSubscriptionEstimateContractTermSchema.optional(),
169
+ addons: CreateSubscriptionEstimateAddonsSchema.optional(),
170
+ event_based_addons: CreateSubscriptionEstimateEventBasedAddonsSchema.optional(),
171
+ tax_providers_fields: CreateSubscriptionEstimateTaxProvidersFieldsSchema.optional(),
172
+ });
173
+ exports.CreateSubscriptionEstimateBodySchema = CreateSubscriptionEstimateBodySchema;
174
+ //Estimate.createSubItemEstimate
175
+ const CreateSubItemEstimateEstimateSubscriptionSchema = zod_1.z.object({
176
+ id: zod_1.z.string().max(50).optional(),
177
+ trial_end: zod_1.z.number().int().optional(),
178
+ setup_fee: zod_1.z.number().int().min(0).optional(),
179
+ start_date: zod_1.z.number().int().optional(),
180
+ coupon: zod_1.z.string().max(100).optional(),
181
+ offline_payment_method: zod_1.z
182
+ .enum([
183
+ 'no_preference',
184
+ 'cash',
185
+ 'check',
186
+ 'bank_transfer',
187
+ 'ach_credit',
188
+ 'sepa_credit',
189
+ 'boleto',
190
+ 'us_automated_bank_transfer',
191
+ 'eu_automated_bank_transfer',
192
+ 'uk_automated_bank_transfer',
193
+ 'jp_automated_bank_transfer',
194
+ 'mx_automated_bank_transfer',
195
+ 'custom',
196
+ ])
197
+ .optional(),
198
+ free_period: zod_1.z.number().int().min(1).optional(),
199
+ free_period_unit: zod_1.z.enum(['day', 'week', 'month', 'year']).optional(),
200
+ contract_term_billing_cycle_on_renewal: zod_1.z
201
+ .number()
202
+ .int()
203
+ .min(1)
204
+ .max(100)
205
+ .optional(),
206
+ trial_end_action: zod_1.z
207
+ .enum([
208
+ 'site_default',
209
+ 'plan_default',
210
+ 'activate_subscription',
211
+ 'cancel_subscription',
212
+ ])
213
+ .optional(),
214
+ });
215
+ const CreateSubItemEstimateEstimateBillingAddressSchema = zod_1.z.object({
216
+ line1: zod_1.z.string().max(150).optional(),
217
+ line2: zod_1.z.string().max(150).optional(),
218
+ line3: zod_1.z.string().max(150).optional(),
219
+ city: zod_1.z.string().max(50).optional(),
220
+ state_code: zod_1.z.string().max(50).optional(),
221
+ zip: zod_1.z.string().max(20).optional(),
222
+ country: zod_1.z.string().max(50).optional(),
223
+ validation_status: zod_1.z
224
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
225
+ .optional(),
226
+ });
227
+ const CreateSubItemEstimateEstimateShippingAddressSchema = zod_1.z.object({
228
+ line1: zod_1.z.string().max(150).optional(),
229
+ line2: zod_1.z.string().max(150).optional(),
230
+ line3: zod_1.z.string().max(150).optional(),
231
+ city: zod_1.z.string().max(50).optional(),
232
+ state_code: zod_1.z.string().max(50).optional(),
233
+ zip: zod_1.z.string().max(20).optional(),
234
+ country: zod_1.z.string().max(50).optional(),
235
+ validation_status: zod_1.z
236
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
237
+ .optional(),
238
+ });
239
+ const CreateSubItemEstimateEstimateCustomerSchema = zod_1.z.object({
240
+ vat_number: zod_1.z.string().max(20).optional(),
241
+ vat_number_prefix: zod_1.z.string().max(10).optional(),
242
+ registered_for_gst: zod_1.z.boolean().optional(),
243
+ taxability: zod_1.z.enum(['taxable', 'exempt']).optional(),
244
+ entity_code: zod_1.z
245
+ .enum([
246
+ 'a',
247
+ 'b',
248
+ 'c',
249
+ 'd',
250
+ 'e',
251
+ 'f',
252
+ 'g',
253
+ 'h',
254
+ 'i',
255
+ 'j',
256
+ 'k',
257
+ 'l',
258
+ 'm',
259
+ 'n',
260
+ 'p',
261
+ 'q',
262
+ 'r',
263
+ 'med1',
264
+ 'med2',
265
+ ])
266
+ .optional(),
267
+ exempt_number: zod_1.z.string().max(100).optional(),
268
+ exemption_details: zod_1.z.array(zod_1.z.string().optional()).optional(),
269
+ customer_type: zod_1.z
270
+ .enum(['residential', 'business', 'senior_citizen', 'industrial'])
271
+ .optional(),
272
+ });
273
+ const CreateSubItemEstimateEstimateContractTermSchema = zod_1.z.object({
274
+ action_at_term_end: zod_1.z.enum(['renew', 'evergreen', 'cancel']).optional(),
275
+ contract_start: zod_1.z.number().int().optional(),
276
+ cancellation_cutoff_period: zod_1.z.number().int().optional(),
277
+ });
278
+ const CreateSubItemEstimateEstimateSubscriptionItemsSchema = zod_1.z.object({
279
+ item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()),
280
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
281
+ quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
282
+ unit_price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
283
+ unit_price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
284
+ billing_cycles: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
285
+ trial_end: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
286
+ service_period_days: zod_1.z
287
+ .array(zod_1.z.number().int().min(1).max(730).optional())
288
+ .optional(),
289
+ charge_on_event: zod_1.z
290
+ .array(zod_1.z
291
+ .enum([
292
+ 'subscription_creation',
293
+ 'subscription_trial_start',
294
+ 'plan_activation',
295
+ 'subscription_activation',
296
+ 'contract_termination',
297
+ ])
298
+ .optional())
299
+ .optional(),
300
+ charge_once: zod_1.z.array(zod_1.z.boolean().optional()).optional(),
301
+ item_type: zod_1.z.array(zod_1.z.enum(['plan', 'addon', 'charge']).optional()).optional(),
302
+ charge_on_option: zod_1.z
303
+ .array(zod_1.z.enum(['immediately', 'on_event']).optional())
304
+ .optional(),
305
+ });
306
+ const CreateSubItemEstimateEstimateDiscountsSchema = zod_1.z.object({
307
+ apply_on: zod_1.z
308
+ .array(zod_1.z.enum(['invoice_amount', 'specific_item_price']).optional())
309
+ .optional(),
310
+ duration_type: zod_1.z.array(zod_1.z.enum(['one_time', 'forever', 'limited_period']).optional()),
311
+ percentage: zod_1.z.array(zod_1.z.number().min(0.01).max(100).optional()).optional(),
312
+ amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
313
+ period: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
314
+ period_unit: zod_1.z
315
+ .array(zod_1.z.enum(['day', 'week', 'month', 'year']).optional())
316
+ .optional(),
317
+ included_in_mrr: zod_1.z.array(zod_1.z.boolean().optional()).optional(),
318
+ item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
319
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
320
+ });
321
+ const CreateSubItemEstimateEstimateItemTiersSchema = zod_1.z.object({
322
+ item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
323
+ starting_unit: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
324
+ ending_unit: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
325
+ price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
326
+ starting_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
327
+ ending_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
328
+ price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
329
+ pricing_type: zod_1.z
330
+ .array(zod_1.z.enum(['per_unit', 'flat_fee', 'package']).optional())
331
+ .optional(),
332
+ package_size: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
333
+ });
334
+ const CreateSubItemEstimateEstimateTaxProvidersFieldsSchema = zod_1.z.object({
335
+ provider_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
336
+ field_id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
337
+ field_value: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
338
+ });
339
+ const CreateSubItemEstimateEstimateBodySchema = zod_1.z.looseObject({
340
+ billing_cycles: zod_1.z.number().int().min(0).optional(),
341
+ mandatory_items_to_remove: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
342
+ terms_to_charge: zod_1.z.number().int().min(1).optional(),
343
+ billing_alignment_mode: zod_1.z.enum(['immediate', 'delayed']).optional(),
344
+ coupon_ids: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
345
+ invoice_immediately: zod_1.z.boolean().optional(),
346
+ invoice_date: zod_1.z.number().int().optional(),
347
+ client_profile_id: zod_1.z.string().max(50).optional(),
348
+ subscription: CreateSubItemEstimateEstimateSubscriptionSchema.optional(),
349
+ billing_address: CreateSubItemEstimateEstimateBillingAddressSchema.optional(),
350
+ shipping_address: CreateSubItemEstimateEstimateShippingAddressSchema.optional(),
351
+ customer: CreateSubItemEstimateEstimateCustomerSchema.optional(),
352
+ contract_term: CreateSubItemEstimateEstimateContractTermSchema.optional(),
353
+ subscription_items: CreateSubItemEstimateEstimateSubscriptionItemsSchema.optional(),
354
+ discounts: CreateSubItemEstimateEstimateDiscountsSchema.optional(),
355
+ item_tiers: CreateSubItemEstimateEstimateItemTiersSchema.optional(),
356
+ tax_providers_fields: CreateSubItemEstimateEstimateTaxProvidersFieldsSchema.optional(),
357
+ });
358
+ exports.CreateSubItemEstimateEstimateBodySchema = CreateSubItemEstimateEstimateBodySchema;
359
+ //Estimate.createSubForCustomerEstimate
360
+ const CreateSubForCustomerEstimateEstimateSubscriptionSchema = zod_1.z.object({
361
+ id: zod_1.z.string().max(50).optional(),
362
+ plan_id: zod_1.z.string().max(100),
363
+ plan_quantity: zod_1.z.number().int().min(1).optional(),
364
+ plan_quantity_in_decimal: zod_1.z.string().max(33).optional(),
365
+ plan_unit_price: zod_1.z.number().int().min(0).optional(),
366
+ plan_unit_price_in_decimal: zod_1.z.string().max(39).optional(),
367
+ setup_fee: zod_1.z.number().int().min(0).optional(),
368
+ trial_end: zod_1.z.number().int().optional(),
369
+ start_date: zod_1.z.number().int().optional(),
370
+ offline_payment_method: zod_1.z
371
+ .enum([
372
+ 'no_preference',
373
+ 'cash',
374
+ 'check',
375
+ 'bank_transfer',
376
+ 'ach_credit',
377
+ 'sepa_credit',
378
+ 'boleto',
379
+ 'us_automated_bank_transfer',
380
+ 'eu_automated_bank_transfer',
381
+ 'uk_automated_bank_transfer',
382
+ 'jp_automated_bank_transfer',
383
+ 'mx_automated_bank_transfer',
384
+ 'custom',
385
+ ])
386
+ .optional(),
387
+ free_period: zod_1.z.number().int().min(1).optional(),
388
+ free_period_unit: zod_1.z.enum(['day', 'week', 'month', 'year']).optional(),
389
+ contract_term_billing_cycle_on_renewal: zod_1.z
390
+ .number()
391
+ .int()
392
+ .min(1)
393
+ .max(100)
394
+ .optional(),
395
+ trial_end_action: zod_1.z
396
+ .enum([
397
+ 'site_default',
398
+ 'plan_default',
399
+ 'activate_subscription',
400
+ 'cancel_subscription',
401
+ ])
402
+ .optional(),
403
+ });
404
+ const CreateSubForCustomerEstimateEstimateShippingAddressSchema = zod_1.z.object({
405
+ line1: zod_1.z.string().max(150).optional(),
406
+ line2: zod_1.z.string().max(150).optional(),
407
+ line3: zod_1.z.string().max(150).optional(),
408
+ city: zod_1.z.string().max(50).optional(),
409
+ state_code: zod_1.z.string().max(50).optional(),
410
+ zip: zod_1.z.string().max(20).optional(),
411
+ country: zod_1.z.string().max(50).optional(),
412
+ validation_status: zod_1.z
413
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
414
+ .optional(),
415
+ });
416
+ const CreateSubForCustomerEstimateEstimateContractTermSchema = zod_1.z.object({
417
+ action_at_term_end: zod_1.z.enum(['renew', 'evergreen', 'cancel']).optional(),
418
+ cancellation_cutoff_period: zod_1.z.number().int().optional(),
419
+ });
420
+ const CreateSubForCustomerEstimateEstimateAddonsSchema = zod_1.z.object({
421
+ id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
422
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
423
+ quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
424
+ unit_price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
425
+ unit_price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
426
+ billing_cycles: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
427
+ trial_end: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
428
+ });
429
+ const CreateSubForCustomerEstimateEstimateEventBasedAddonsSchema = zod_1.z.object({
430
+ id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
431
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
432
+ unit_price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
433
+ quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
434
+ unit_price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
435
+ service_period_in_days: zod_1.z
436
+ .array(zod_1.z.number().int().min(1).max(4000).optional())
437
+ .optional(),
438
+ on_event: zod_1.z
439
+ .array(zod_1.z
440
+ .enum([
441
+ 'subscription_creation',
442
+ 'subscription_trial_start',
443
+ 'plan_activation',
444
+ 'subscription_activation',
445
+ 'contract_termination',
446
+ ])
447
+ .optional())
448
+ .optional(),
449
+ charge_once: zod_1.z.array(zod_1.z.boolean().default(true).optional()).optional(),
450
+ charge_on: zod_1.z.array(zod_1.z.enum(['immediately', 'on_event']).optional()).optional(),
451
+ });
452
+ const CreateSubForCustomerEstimateEstimateBodySchema = zod_1.z.looseObject({
453
+ use_existing_balances: zod_1.z.boolean().default(true).optional(),
454
+ invoice_immediately: zod_1.z.boolean().optional(),
455
+ billing_cycles: zod_1.z.number().int().min(0).optional(),
456
+ mandatory_addons_to_remove: zod_1.z
457
+ .array(zod_1.z.string().max(100).optional())
458
+ .optional(),
459
+ terms_to_charge: zod_1.z.number().int().min(1).optional(),
460
+ billing_alignment_mode: zod_1.z.enum(['immediate', 'delayed']).optional(),
461
+ invoice_date: zod_1.z.number().int().optional(),
462
+ coupon_ids: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
463
+ subscription: CreateSubForCustomerEstimateEstimateSubscriptionSchema.optional(),
464
+ shipping_address: CreateSubForCustomerEstimateEstimateShippingAddressSchema.optional(),
465
+ contract_term: CreateSubForCustomerEstimateEstimateContractTermSchema.optional(),
466
+ addons: CreateSubForCustomerEstimateEstimateAddonsSchema.optional(),
467
+ event_based_addons: CreateSubForCustomerEstimateEstimateEventBasedAddonsSchema.optional(),
468
+ });
469
+ exports.CreateSubForCustomerEstimateEstimateBodySchema = CreateSubForCustomerEstimateEstimateBodySchema;
470
+ //Estimate.createSubItemForCustomerEstimate
471
+ const CreateSubItemForCustomerEstimateEstimateSubscriptionSchema = zod_1.z.object({
472
+ id: zod_1.z.string().max(50).optional(),
473
+ trial_end: zod_1.z.number().int().optional(),
474
+ setup_fee: zod_1.z.number().int().min(0).optional(),
475
+ start_date: zod_1.z.number().int().optional(),
476
+ offline_payment_method: zod_1.z
477
+ .enum([
478
+ 'no_preference',
479
+ 'cash',
480
+ 'check',
481
+ 'bank_transfer',
482
+ 'ach_credit',
483
+ 'sepa_credit',
484
+ 'boleto',
485
+ 'us_automated_bank_transfer',
486
+ 'eu_automated_bank_transfer',
487
+ 'uk_automated_bank_transfer',
488
+ 'jp_automated_bank_transfer',
489
+ 'mx_automated_bank_transfer',
490
+ 'custom',
491
+ ])
492
+ .optional(),
493
+ free_period: zod_1.z.number().int().min(1).optional(),
494
+ free_period_unit: zod_1.z.enum(['day', 'week', 'month', 'year']).optional(),
495
+ contract_term_billing_cycle_on_renewal: zod_1.z
496
+ .number()
497
+ .int()
498
+ .min(1)
499
+ .max(100)
500
+ .optional(),
501
+ trial_end_action: zod_1.z
502
+ .enum([
503
+ 'site_default',
504
+ 'plan_default',
505
+ 'activate_subscription',
506
+ 'cancel_subscription',
507
+ ])
508
+ .optional(),
509
+ });
510
+ const CreateSubItemForCustomerEstimateEstimateShippingAddressSchema = zod_1.z.object({
511
+ line1: zod_1.z.string().max(150).optional(),
512
+ line2: zod_1.z.string().max(150).optional(),
513
+ line3: zod_1.z.string().max(150).optional(),
514
+ city: zod_1.z.string().max(50).optional(),
515
+ state_code: zod_1.z.string().max(50).optional(),
516
+ zip: zod_1.z.string().max(20).optional(),
517
+ country: zod_1.z.string().max(50).optional(),
518
+ validation_status: zod_1.z
519
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
520
+ .optional(),
521
+ });
522
+ const CreateSubItemForCustomerEstimateEstimateBillingAddressSchema = zod_1.z.object({
523
+ line1: zod_1.z.string().max(150).optional(),
524
+ line2: zod_1.z.string().max(150).optional(),
525
+ line3: zod_1.z.string().max(150).optional(),
526
+ city: zod_1.z.string().max(50).optional(),
527
+ state_code: zod_1.z.string().max(50).optional(),
528
+ zip: zod_1.z.string().max(20).optional(),
529
+ country: zod_1.z.string().max(50).optional(),
530
+ validation_status: zod_1.z
531
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
532
+ .optional(),
533
+ });
534
+ const CreateSubItemForCustomerEstimateEstimateContractTermSchema = zod_1.z.object({
535
+ action_at_term_end: zod_1.z.enum(['renew', 'evergreen', 'cancel']).optional(),
536
+ contract_start: zod_1.z.number().int().optional(),
537
+ cancellation_cutoff_period: zod_1.z.number().int().optional(),
538
+ });
539
+ const CreateSubItemForCustomerEstimateEstimateBillingOverrideSchema = zod_1.z.object({
540
+ max_excess_payment_usage: zod_1.z.number().int().min(-1).optional(),
541
+ max_refundable_credits_usage: zod_1.z.number().int().min(-1).optional(),
542
+ });
543
+ const CreateSubItemForCustomerEstimateEstimateSubscriptionItemsSchema = zod_1.z.object({
544
+ item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()),
545
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
546
+ quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
547
+ unit_price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
548
+ unit_price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
549
+ billing_cycles: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
550
+ trial_end: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
551
+ service_period_days: zod_1.z
552
+ .array(zod_1.z.number().int().min(1).max(730).optional())
553
+ .optional(),
554
+ charge_on_event: zod_1.z
555
+ .array(zod_1.z
556
+ .enum([
557
+ 'subscription_creation',
558
+ 'subscription_trial_start',
559
+ 'plan_activation',
560
+ 'subscription_activation',
561
+ 'contract_termination',
562
+ ])
563
+ .optional())
564
+ .optional(),
565
+ charge_once: zod_1.z.array(zod_1.z.boolean().optional()).optional(),
566
+ item_type: zod_1.z
567
+ .array(zod_1.z.enum(['plan', 'addon', 'charge']).optional())
568
+ .optional(),
569
+ charge_on_option: zod_1.z
570
+ .array(zod_1.z.enum(['immediately', 'on_event']).optional())
571
+ .optional(),
572
+ });
573
+ const CreateSubItemForCustomerEstimateEstimateDiscountsSchema = zod_1.z.object({
574
+ apply_on: zod_1.z
575
+ .array(zod_1.z.enum(['invoice_amount', 'specific_item_price']).optional())
576
+ .optional(),
577
+ duration_type: zod_1.z.array(zod_1.z.enum(['one_time', 'forever', 'limited_period']).optional()),
578
+ percentage: zod_1.z.array(zod_1.z.number().min(0.01).max(100).optional()).optional(),
579
+ amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
580
+ period: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
581
+ period_unit: zod_1.z
582
+ .array(zod_1.z.enum(['day', 'week', 'month', 'year']).optional())
583
+ .optional(),
584
+ included_in_mrr: zod_1.z.array(zod_1.z.boolean().optional()).optional(),
585
+ item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
586
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
587
+ });
588
+ const CreateSubItemForCustomerEstimateEstimateItemTiersSchema = zod_1.z.object({
589
+ item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
590
+ starting_unit: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
591
+ ending_unit: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
592
+ price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
593
+ starting_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
594
+ ending_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
595
+ price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
596
+ pricing_type: zod_1.z
597
+ .array(zod_1.z.enum(['per_unit', 'flat_fee', 'package']).optional())
598
+ .optional(),
599
+ package_size: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
600
+ });
601
+ const CreateSubItemForCustomerEstimateEstimateBodySchema = zod_1.z.looseObject({
602
+ use_existing_balances: zod_1.z.boolean().default(true).optional(),
603
+ invoice_immediately: zod_1.z.boolean().optional(),
604
+ billing_cycles: zod_1.z.number().int().min(0).optional(),
605
+ mandatory_items_to_remove: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
606
+ terms_to_charge: zod_1.z.number().int().min(1).optional(),
607
+ billing_alignment_mode: zod_1.z.enum(['immediate', 'delayed']).optional(),
608
+ invoice_date: zod_1.z.number().int().optional(),
609
+ coupon_ids: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
610
+ subscription: CreateSubItemForCustomerEstimateEstimateSubscriptionSchema.optional(),
611
+ shipping_address: CreateSubItemForCustomerEstimateEstimateShippingAddressSchema.optional(),
612
+ billing_address: CreateSubItemForCustomerEstimateEstimateBillingAddressSchema.optional(),
613
+ contract_term: CreateSubItemForCustomerEstimateEstimateContractTermSchema.optional(),
614
+ billing_override: CreateSubItemForCustomerEstimateEstimateBillingOverrideSchema.optional(),
615
+ subscription_items: CreateSubItemForCustomerEstimateEstimateSubscriptionItemsSchema.optional(),
616
+ discounts: CreateSubItemForCustomerEstimateEstimateDiscountsSchema.optional(),
617
+ item_tiers: CreateSubItemForCustomerEstimateEstimateItemTiersSchema.optional(),
618
+ });
619
+ exports.CreateSubItemForCustomerEstimateEstimateBodySchema = CreateSubItemForCustomerEstimateEstimateBodySchema;
620
+ //Estimate.updateSubscription
621
+ const UpdateSubscriptionEstimateSubscriptionSchema = zod_1.z.object({
622
+ id: zod_1.z.string().max(50),
623
+ plan_id: zod_1.z.string().max(100).optional(),
624
+ plan_quantity: zod_1.z.number().int().min(1).optional(),
625
+ plan_unit_price: zod_1.z.number().int().min(0).optional(),
626
+ setup_fee: zod_1.z.number().int().min(0).optional(),
627
+ plan_quantity_in_decimal: zod_1.z.string().max(33).optional(),
628
+ plan_unit_price_in_decimal: zod_1.z.string().max(39).optional(),
629
+ start_date: zod_1.z.number().int().optional(),
630
+ trial_end: zod_1.z.number().int().optional(),
631
+ coupon: zod_1.z.string().max(100).optional(),
632
+ auto_collection: zod_1.z.enum(['on', 'off']).optional(),
633
+ offline_payment_method: zod_1.z
634
+ .enum([
635
+ 'no_preference',
636
+ 'cash',
637
+ 'check',
638
+ 'bank_transfer',
639
+ 'ach_credit',
640
+ 'sepa_credit',
641
+ 'boleto',
642
+ 'us_automated_bank_transfer',
643
+ 'eu_automated_bank_transfer',
644
+ 'uk_automated_bank_transfer',
645
+ 'jp_automated_bank_transfer',
646
+ 'mx_automated_bank_transfer',
647
+ 'custom',
648
+ ])
649
+ .optional(),
650
+ free_period: zod_1.z.number().int().min(1).optional(),
651
+ free_period_unit: zod_1.z.enum(['day', 'week', 'month', 'year']).optional(),
652
+ trial_end_action: zod_1.z
653
+ .enum([
654
+ 'site_default',
655
+ 'plan_default',
656
+ 'activate_subscription',
657
+ 'cancel_subscription',
658
+ ])
659
+ .optional(),
660
+ });
661
+ const UpdateSubscriptionEstimateBillingAddressSchema = zod_1.z.object({
662
+ line1: zod_1.z.string().max(150).optional(),
663
+ line2: zod_1.z.string().max(150).optional(),
664
+ line3: zod_1.z.string().max(150).optional(),
665
+ city: zod_1.z.string().max(50).optional(),
666
+ state_code: zod_1.z.string().max(50).optional(),
667
+ zip: zod_1.z.string().max(20).optional(),
668
+ country: zod_1.z.string().max(50).optional(),
669
+ validation_status: zod_1.z
670
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
671
+ .optional(),
672
+ });
673
+ const UpdateSubscriptionEstimateShippingAddressSchema = zod_1.z.object({
674
+ line1: zod_1.z.string().max(150).optional(),
675
+ line2: zod_1.z.string().max(150).optional(),
676
+ line3: zod_1.z.string().max(150).optional(),
677
+ city: zod_1.z.string().max(50).optional(),
678
+ state_code: zod_1.z.string().max(50).optional(),
679
+ zip: zod_1.z.string().max(20).optional(),
680
+ country: zod_1.z.string().max(50).optional(),
681
+ validation_status: zod_1.z
682
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
683
+ .optional(),
684
+ });
685
+ const UpdateSubscriptionEstimateCustomerSchema = zod_1.z.object({
686
+ vat_number: zod_1.z.string().max(20).optional(),
687
+ vat_number_prefix: zod_1.z.string().max(10).optional(),
688
+ registered_for_gst: zod_1.z.boolean().optional(),
689
+ taxability: zod_1.z.enum(['taxable', 'exempt']).optional(),
690
+ });
691
+ const UpdateSubscriptionEstimateAddonsSchema = zod_1.z.object({
692
+ id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
693
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
694
+ unit_price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
695
+ billing_cycles: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
696
+ quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
697
+ unit_price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
698
+ trial_end: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
699
+ proration_type: zod_1.z
700
+ .array(zod_1.z.enum(['full_term', 'partial_term', 'none']).optional())
701
+ .optional(),
702
+ });
703
+ const UpdateSubscriptionEstimateEventBasedAddonsSchema = zod_1.z.object({
704
+ id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
705
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
706
+ unit_price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
707
+ service_period_in_days: zod_1.z
708
+ .array(zod_1.z.number().int().min(1).max(4000).optional())
709
+ .optional(),
710
+ charge_on: zod_1.z.array(zod_1.z.enum(['immediately', 'on_event']).optional()).optional(),
711
+ on_event: zod_1.z
712
+ .array(zod_1.z
713
+ .enum([
714
+ 'subscription_creation',
715
+ 'subscription_trial_start',
716
+ 'plan_activation',
717
+ 'subscription_activation',
718
+ 'contract_termination',
719
+ ])
720
+ .optional())
721
+ .optional(),
722
+ charge_once: zod_1.z.array(zod_1.z.boolean().default(true).optional()).optional(),
723
+ quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
724
+ unit_price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
725
+ });
726
+ const UpdateSubscriptionEstimateBodySchema = zod_1.z.looseObject({
727
+ changes_scheduled_at: zod_1.z.number().int().optional(),
728
+ change_option: zod_1.z
729
+ .enum(['immediately', 'end_of_term', 'specific_date'])
730
+ .optional(),
731
+ replace_addon_list: zod_1.z.boolean().default(false).optional(),
732
+ mandatory_addons_to_remove: zod_1.z
733
+ .array(zod_1.z.string().max(100).optional())
734
+ .optional(),
735
+ invoice_date: zod_1.z.number().int().optional(),
736
+ billing_cycles: zod_1.z.number().int().min(0).optional(),
737
+ terms_to_charge: zod_1.z.number().int().min(1).optional(),
738
+ reactivate_from: zod_1.z.number().int().optional(),
739
+ billing_alignment_mode: zod_1.z.enum(['immediate', 'delayed']).optional(),
740
+ coupon_ids: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
741
+ replace_coupon_list: zod_1.z.boolean().default(false).optional(),
742
+ prorate: zod_1.z.boolean().optional(),
743
+ end_of_term: zod_1.z.boolean().default(false).optional(),
744
+ force_term_reset: zod_1.z.boolean().default(false).optional(),
745
+ reactivate: zod_1.z.boolean().optional(),
746
+ include_delayed_charges: zod_1.z.boolean().default(false).optional(),
747
+ use_existing_balances: zod_1.z.boolean().default(true).optional(),
748
+ invoice_immediately: zod_1.z.boolean().optional(),
749
+ subscription: UpdateSubscriptionEstimateSubscriptionSchema.optional(),
750
+ billing_address: UpdateSubscriptionEstimateBillingAddressSchema.optional(),
751
+ shipping_address: UpdateSubscriptionEstimateShippingAddressSchema.optional(),
752
+ customer: UpdateSubscriptionEstimateCustomerSchema.optional(),
753
+ addons: UpdateSubscriptionEstimateAddonsSchema.optional(),
754
+ event_based_addons: UpdateSubscriptionEstimateEventBasedAddonsSchema.optional(),
755
+ });
756
+ exports.UpdateSubscriptionEstimateBodySchema = UpdateSubscriptionEstimateBodySchema;
757
+ //Estimate.updateSubscriptionForItems
758
+ const UpdateSubscriptionForItemsEstimateSubscriptionSchema = zod_1.z.object({
759
+ id: zod_1.z.string().max(50),
760
+ setup_fee: zod_1.z.number().int().min(0).optional(),
761
+ start_date: zod_1.z.number().int().optional(),
762
+ trial_end: zod_1.z.number().int().optional(),
763
+ coupon: zod_1.z.string().max(100).optional(),
764
+ auto_collection: zod_1.z.enum(['on', 'off']).optional(),
765
+ offline_payment_method: zod_1.z
766
+ .enum([
767
+ 'no_preference',
768
+ 'cash',
769
+ 'check',
770
+ 'bank_transfer',
771
+ 'ach_credit',
772
+ 'sepa_credit',
773
+ 'boleto',
774
+ 'us_automated_bank_transfer',
775
+ 'eu_automated_bank_transfer',
776
+ 'uk_automated_bank_transfer',
777
+ 'jp_automated_bank_transfer',
778
+ 'mx_automated_bank_transfer',
779
+ 'custom',
780
+ ])
781
+ .optional(),
782
+ free_period: zod_1.z.number().int().min(1).optional(),
783
+ free_period_unit: zod_1.z.enum(['day', 'week', 'month', 'year']).optional(),
784
+ trial_end_action: zod_1.z
785
+ .enum([
786
+ 'site_default',
787
+ 'plan_default',
788
+ 'activate_subscription',
789
+ 'cancel_subscription',
790
+ ])
791
+ .optional(),
792
+ });
793
+ const UpdateSubscriptionForItemsEstimateBillingAddressSchema = zod_1.z.object({
794
+ line1: zod_1.z.string().max(150).optional(),
795
+ line2: zod_1.z.string().max(150).optional(),
796
+ line3: zod_1.z.string().max(150).optional(),
797
+ city: zod_1.z.string().max(50).optional(),
798
+ state_code: zod_1.z.string().max(50).optional(),
799
+ zip: zod_1.z.string().max(20).optional(),
800
+ country: zod_1.z.string().max(50).optional(),
801
+ validation_status: zod_1.z
802
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
803
+ .optional(),
804
+ });
805
+ const UpdateSubscriptionForItemsEstimateShippingAddressSchema = zod_1.z.object({
806
+ line1: zod_1.z.string().max(150).optional(),
807
+ line2: zod_1.z.string().max(150).optional(),
808
+ line3: zod_1.z.string().max(150).optional(),
809
+ city: zod_1.z.string().max(50).optional(),
810
+ state_code: zod_1.z.string().max(50).optional(),
811
+ zip: zod_1.z.string().max(20).optional(),
812
+ country: zod_1.z.string().max(50).optional(),
813
+ validation_status: zod_1.z
814
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
815
+ .optional(),
816
+ });
817
+ const UpdateSubscriptionForItemsEstimateCustomerSchema = zod_1.z.object({
818
+ vat_number: zod_1.z.string().max(20).optional(),
819
+ vat_number_prefix: zod_1.z.string().max(10).optional(),
820
+ registered_for_gst: zod_1.z.boolean().optional(),
821
+ taxability: zod_1.z.enum(['taxable', 'exempt']).optional(),
822
+ });
823
+ const UpdateSubscriptionForItemsEstimateBillingOverrideSchema = zod_1.z.object({
824
+ max_excess_payment_usage: zod_1.z.number().int().min(-1).optional(),
825
+ max_refundable_credits_usage: zod_1.z.number().int().min(-1).optional(),
826
+ });
827
+ const UpdateSubscriptionForItemsEstimateSubscriptionItemsSchema = zod_1.z.object({
828
+ item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()),
829
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
830
+ quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
831
+ unit_price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
832
+ unit_price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
833
+ billing_cycles: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
834
+ trial_end: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
835
+ service_period_days: zod_1.z
836
+ .array(zod_1.z.number().int().min(1).max(730).optional())
837
+ .optional(),
838
+ charge_on_event: zod_1.z
839
+ .array(zod_1.z
840
+ .enum([
841
+ 'subscription_creation',
842
+ 'subscription_trial_start',
843
+ 'plan_activation',
844
+ 'subscription_activation',
845
+ 'contract_termination',
846
+ ])
847
+ .optional())
848
+ .optional(),
849
+ charge_once: zod_1.z.array(zod_1.z.boolean().optional()).optional(),
850
+ charge_on_option: zod_1.z
851
+ .array(zod_1.z.enum(['immediately', 'on_event']).optional())
852
+ .optional(),
853
+ item_type: zod_1.z.array(zod_1.z.enum(['plan', 'addon', 'charge']).optional()).optional(),
854
+ proration_type: zod_1.z
855
+ .array(zod_1.z.enum(['full_term', 'partial_term', 'none']).optional())
856
+ .optional(),
857
+ });
858
+ const UpdateSubscriptionForItemsEstimateDiscountsSchema = zod_1.z.object({
859
+ apply_on: zod_1.z
860
+ .array(zod_1.z.enum(['invoice_amount', 'specific_item_price']).optional())
861
+ .optional(),
862
+ duration_type: zod_1.z.array(zod_1.z.enum(['one_time', 'forever', 'limited_period']).optional()),
863
+ percentage: zod_1.z.array(zod_1.z.number().min(0.01).max(100).optional()).optional(),
864
+ amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
865
+ period: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
866
+ period_unit: zod_1.z
867
+ .array(zod_1.z.enum(['day', 'week', 'month', 'year']).optional())
868
+ .optional(),
869
+ included_in_mrr: zod_1.z.array(zod_1.z.boolean().optional()).optional(),
870
+ item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
871
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
872
+ operation_type: zod_1.z.array(zod_1.z.enum(['add', 'remove']).optional()),
873
+ id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
874
+ });
875
+ const UpdateSubscriptionForItemsEstimateItemTiersSchema = zod_1.z.object({
876
+ item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
877
+ starting_unit: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
878
+ ending_unit: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
879
+ price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
880
+ starting_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
881
+ ending_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
882
+ price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
883
+ pricing_type: zod_1.z
884
+ .array(zod_1.z.enum(['per_unit', 'flat_fee', 'package']).optional())
885
+ .optional(),
886
+ package_size: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
887
+ });
888
+ const UpdateSubscriptionForItemsEstimateBodySchema = zod_1.z.looseObject({
889
+ changes_scheduled_at: zod_1.z.number().int().optional(),
890
+ change_option: zod_1.z
891
+ .enum(['immediately', 'end_of_term', 'specific_date'])
892
+ .optional(),
893
+ mandatory_items_to_remove: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
894
+ replace_items_list: zod_1.z.boolean().default(false).optional(),
895
+ invoice_date: zod_1.z.number().int().optional(),
896
+ billing_cycles: zod_1.z.number().int().min(0).optional(),
897
+ terms_to_charge: zod_1.z.number().int().min(1).optional(),
898
+ reactivate_from: zod_1.z.number().int().optional(),
899
+ billing_alignment_mode: zod_1.z.enum(['immediate', 'delayed']).optional(),
900
+ coupon_ids: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
901
+ replace_coupon_list: zod_1.z.boolean().default(false).optional(),
902
+ prorate: zod_1.z.boolean().optional(),
903
+ end_of_term: zod_1.z.boolean().default(false).optional(),
904
+ force_term_reset: zod_1.z.boolean().default(false).optional(),
905
+ reactivate: zod_1.z.boolean().optional(),
906
+ include_delayed_charges: zod_1.z.boolean().default(false).optional(),
907
+ use_existing_balances: zod_1.z.boolean().default(true).optional(),
908
+ invoice_immediately: zod_1.z.boolean().optional(),
909
+ invoice_usages: zod_1.z.boolean().default(false).optional(),
910
+ subscription: UpdateSubscriptionForItemsEstimateSubscriptionSchema.optional(),
911
+ billing_address: UpdateSubscriptionForItemsEstimateBillingAddressSchema.optional(),
912
+ shipping_address: UpdateSubscriptionForItemsEstimateShippingAddressSchema.optional(),
913
+ customer: UpdateSubscriptionForItemsEstimateCustomerSchema.optional(),
914
+ billing_override: UpdateSubscriptionForItemsEstimateBillingOverrideSchema.optional(),
915
+ subscription_items: UpdateSubscriptionForItemsEstimateSubscriptionItemsSchema.optional(),
916
+ discounts: UpdateSubscriptionForItemsEstimateDiscountsSchema.optional(),
917
+ item_tiers: UpdateSubscriptionForItemsEstimateItemTiersSchema.optional(),
918
+ });
919
+ exports.UpdateSubscriptionForItemsEstimateBodySchema = UpdateSubscriptionForItemsEstimateBodySchema;
920
+ //Estimate.renewalEstimate
921
+ const RenewalEstimateEstimateBodySchema = zod_1.z.looseObject({
922
+ include_delayed_charges: zod_1.z.boolean().default(true).optional(),
923
+ use_existing_balances: zod_1.z.boolean().default(true).optional(),
924
+ ignore_scheduled_cancellation: zod_1.z.boolean().default(false).optional(),
925
+ ignore_scheduled_changes: zod_1.z.boolean().default(false).optional(),
926
+ exclude_tax_type: zod_1.z.enum(['exclusive', 'none']).optional(),
927
+ });
928
+ exports.RenewalEstimateEstimateBodySchema = RenewalEstimateEstimateBodySchema;
929
+ //Estimate.advanceInvoiceEstimate
930
+ const AdvanceInvoiceEstimateEstimateFixedIntervalScheduleSchema = zod_1.z.object({
931
+ number_of_occurrences: zod_1.z.number().int().min(1).optional(),
932
+ days_before_renewal: zod_1.z.number().int().min(1).optional(),
933
+ end_schedule_on: zod_1.z
934
+ .enum(['after_number_of_intervals', 'specific_date', 'subscription_end'])
935
+ .optional(),
936
+ end_date: zod_1.z.number().int().optional(),
937
+ });
938
+ const AdvanceInvoiceEstimateEstimateSpecificDatesScheduleSchema = zod_1.z.object({
939
+ terms_to_charge: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
940
+ date: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
941
+ });
942
+ const AdvanceInvoiceEstimateEstimateBodySchema = zod_1.z.looseObject({
943
+ terms_to_charge: zod_1.z.number().int().min(1).optional(),
944
+ invoice_immediately: zod_1.z.boolean().optional(),
945
+ schedule_type: zod_1.z
946
+ .enum(['immediate', 'specific_dates', 'fixed_intervals'])
947
+ .optional(),
948
+ fixed_interval_schedule: AdvanceInvoiceEstimateEstimateFixedIntervalScheduleSchema.optional(),
949
+ specific_dates_schedule: AdvanceInvoiceEstimateEstimateSpecificDatesScheduleSchema.optional(),
950
+ });
951
+ exports.AdvanceInvoiceEstimateEstimateBodySchema = AdvanceInvoiceEstimateEstimateBodySchema;
952
+ //Estimate.regenerateInvoiceEstimate
953
+ const RegenerateInvoiceEstimateEstimateBodySchema = zod_1.z.looseObject({
954
+ date_from: zod_1.z.number().int().optional(),
955
+ date_to: zod_1.z.number().int().optional(),
956
+ prorate: zod_1.z.boolean().optional(),
957
+ invoice_immediately: zod_1.z.boolean().optional(),
958
+ });
959
+ exports.RegenerateInvoiceEstimateEstimateBodySchema = RegenerateInvoiceEstimateEstimateBodySchema;
960
+ //Estimate.upcomingInvoicesEstimate
961
+ const UpcomingInvoicesEstimateEstimateBodySchema = zod_1.z.looseObject({
962
+ include_usage_charges: zod_1.z.boolean().default(false).optional(),
963
+ });
964
+ exports.UpcomingInvoicesEstimateEstimateBodySchema = UpcomingInvoicesEstimateEstimateBodySchema;
965
+ //Estimate.changeTermEnd
966
+ const ChangeTermEndEstimateBodySchema = zod_1.z.looseObject({
967
+ term_ends_at: zod_1.z.number().int(),
968
+ prorate: zod_1.z.boolean().optional(),
969
+ invoice_immediately: zod_1.z.boolean().optional(),
970
+ });
971
+ exports.ChangeTermEndEstimateBodySchema = ChangeTermEndEstimateBodySchema;
972
+ //Estimate.cancelSubscription
973
+ const CancelSubscriptionEstimateEventBasedAddonsSchema = zod_1.z.object({
974
+ id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
975
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
976
+ unit_price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
977
+ service_period_in_days: zod_1.z
978
+ .array(zod_1.z.number().int().min(1).max(4000).optional())
979
+ .optional(),
980
+ });
981
+ const CancelSubscriptionEstimateBodySchema = zod_1.z.looseObject({
982
+ cancel_option: zod_1.z
983
+ .enum([
984
+ 'immediately',
985
+ 'end_of_term',
986
+ 'specific_date',
987
+ 'end_of_billing_term',
988
+ ])
989
+ .optional(),
990
+ end_of_term: zod_1.z.boolean().default(false).optional(),
991
+ cancel_at: zod_1.z.number().int().optional(),
992
+ credit_option_for_current_term_charges: zod_1.z
993
+ .enum(['none', 'prorate', 'full'])
994
+ .optional(),
995
+ unbilled_charges_option: zod_1.z.enum(['invoice', 'delete']).optional(),
996
+ account_receivables_handling: zod_1.z
997
+ .enum(['no_action', 'schedule_payment_collection', 'write_off'])
998
+ .optional(),
999
+ refundable_credits_handling: zod_1.z
1000
+ .enum(['no_action', 'schedule_refund'])
1001
+ .optional(),
1002
+ contract_term_cancel_option: zod_1.z
1003
+ .enum([
1004
+ 'terminate_immediately',
1005
+ 'end_of_contract_term',
1006
+ 'specific_date',
1007
+ 'end_of_subscription_billing_term',
1008
+ ])
1009
+ .optional(),
1010
+ invoice_date: zod_1.z.number().int().optional(),
1011
+ cancel_reason_code: zod_1.z.string().max(100).optional(),
1012
+ event_based_addons: CancelSubscriptionEstimateEventBasedAddonsSchema.optional(),
1013
+ });
1014
+ exports.CancelSubscriptionEstimateBodySchema = CancelSubscriptionEstimateBodySchema;
1015
+ //Estimate.cancelSubscriptionForItems
1016
+ const CancelSubscriptionForItemsEstimateSubscriptionItemsSchema = zod_1.z.object({
1017
+ item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
1018
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
1019
+ quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
1020
+ unit_price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
1021
+ unit_price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
1022
+ service_period_days: zod_1.z
1023
+ .array(zod_1.z.number().int().min(1).max(730).optional())
1024
+ .optional(),
1025
+ });
1026
+ const CancelSubscriptionForItemsEstimateBodySchema = zod_1.z.looseObject({
1027
+ cancel_option: zod_1.z
1028
+ .enum([
1029
+ 'immediately',
1030
+ 'end_of_term',
1031
+ 'specific_date',
1032
+ 'end_of_billing_term',
1033
+ ])
1034
+ .optional(),
1035
+ end_of_term: zod_1.z.boolean().default(false).optional(),
1036
+ cancel_at: zod_1.z.number().int().optional(),
1037
+ credit_option_for_current_term_charges: zod_1.z
1038
+ .enum(['none', 'prorate', 'full'])
1039
+ .optional(),
1040
+ unbilled_charges_option: zod_1.z.enum(['invoice', 'delete']).optional(),
1041
+ account_receivables_handling: zod_1.z
1042
+ .enum(['no_action', 'schedule_payment_collection', 'write_off'])
1043
+ .optional(),
1044
+ refundable_credits_handling: zod_1.z
1045
+ .enum(['no_action', 'schedule_refund'])
1046
+ .optional(),
1047
+ contract_term_cancel_option: zod_1.z
1048
+ .enum([
1049
+ 'terminate_immediately',
1050
+ 'end_of_contract_term',
1051
+ 'specific_date',
1052
+ 'end_of_subscription_billing_term',
1053
+ ])
1054
+ .optional(),
1055
+ invoice_date: zod_1.z.number().int().optional(),
1056
+ cancel_reason_code: zod_1.z.string().max(100).optional(),
1057
+ subscription_items: CancelSubscriptionForItemsEstimateSubscriptionItemsSchema.optional(),
1058
+ });
1059
+ exports.CancelSubscriptionForItemsEstimateBodySchema = CancelSubscriptionForItemsEstimateBodySchema;
1060
+ //Estimate.pauseSubscription
1061
+ const PauseSubscriptionEstimateSubscriptionSchema = zod_1.z.object({
1062
+ pause_date: zod_1.z.number().int().optional(),
1063
+ resume_date: zod_1.z.number().int().optional(),
1064
+ skip_billing_cycles: zod_1.z.number().int().min(1).optional(),
1065
+ });
1066
+ const PauseSubscriptionEstimateBodySchema = zod_1.z.looseObject({
1067
+ pause_option: zod_1.z
1068
+ .enum(['immediately', 'end_of_term', 'specific_date', 'billing_cycles'])
1069
+ .optional(),
1070
+ unbilled_charges_handling: zod_1.z.enum(['no_action', 'invoice']).optional(),
1071
+ subscription: PauseSubscriptionEstimateSubscriptionSchema.optional(),
1072
+ });
1073
+ exports.PauseSubscriptionEstimateBodySchema = PauseSubscriptionEstimateBodySchema;
1074
+ //Estimate.resumeSubscription
1075
+ const ResumeSubscriptionEstimateSubscriptionSchema = zod_1.z.object({
1076
+ resume_date: zod_1.z.number().int().optional(),
1077
+ });
1078
+ const ResumeSubscriptionEstimateBodySchema = zod_1.z.looseObject({
1079
+ resume_option: zod_1.z.enum(['immediately', 'specific_date']).optional(),
1080
+ charges_handling: zod_1.z
1081
+ .enum(['invoice_immediately', 'add_to_unbilled_charges'])
1082
+ .optional(),
1083
+ subscription: ResumeSubscriptionEstimateSubscriptionSchema.optional(),
1084
+ });
1085
+ exports.ResumeSubscriptionEstimateBodySchema = ResumeSubscriptionEstimateBodySchema;
1086
+ //Estimate.giftSubscription
1087
+ const GiftSubscriptionEstimateGiftSchema = zod_1.z.object({
1088
+ scheduled_at: zod_1.z.number().int().optional(),
1089
+ auto_claim: zod_1.z.boolean().default(false).optional(),
1090
+ no_expiry: zod_1.z.boolean().optional(),
1091
+ claim_expiry_date: zod_1.z.number().int().optional(),
1092
+ });
1093
+ const GiftSubscriptionEstimateGifterSchema = zod_1.z.object({
1094
+ customer_id: zod_1.z.string().max(50),
1095
+ signature: zod_1.z.string().max(50),
1096
+ note: zod_1.z.string().max(500).optional(),
1097
+ payment_src_id: zod_1.z.string().max(40).optional(),
1098
+ });
1099
+ const GiftSubscriptionEstimateGiftReceiverSchema = zod_1.z.object({
1100
+ customer_id: zod_1.z.string().max(50),
1101
+ first_name: zod_1.z.string().max(150),
1102
+ last_name: zod_1.z.string().max(150),
1103
+ email: zod_1.z.string().email().max(70),
1104
+ });
1105
+ const GiftSubscriptionEstimateAdditionalInformationSchema = zod_1.z.looseObject({});
1106
+ const GiftSubscriptionEstimatePaymentIntentSchema = zod_1.z.object({
1107
+ id: zod_1.z.string().max(150).optional(),
1108
+ gateway_account_id: zod_1.z.string().max(50).optional(),
1109
+ gw_token: zod_1.z.string().max(65000).optional(),
1110
+ payment_method_type: zod_1.z
1111
+ .enum([
1112
+ 'card',
1113
+ 'ideal',
1114
+ 'sofort',
1115
+ 'bancontact',
1116
+ 'google_pay',
1117
+ 'dotpay',
1118
+ 'giropay',
1119
+ 'apple_pay',
1120
+ 'upi',
1121
+ 'netbanking_emandates',
1122
+ 'paypal_express_checkout',
1123
+ 'direct_debit',
1124
+ 'boleto',
1125
+ 'venmo',
1126
+ 'amazon_payments',
1127
+ 'pay_to',
1128
+ 'faster_payments',
1129
+ 'sepa_instant_transfer',
1130
+ 'klarna_pay_now',
1131
+ 'online_banking_poland',
1132
+ 'payconiq_by_bancontact',
1133
+ 'electronic_payment_standard',
1134
+ 'kbc_payment_button',
1135
+ 'pay_by_bank',
1136
+ 'trustly',
1137
+ 'stablecoin',
1138
+ 'kakao_pay',
1139
+ 'naver_pay',
1140
+ 'revolut_pay',
1141
+ 'cash_app_pay',
1142
+ 'wechat_pay',
1143
+ 'alipay',
1144
+ 'pix',
1145
+ 'twint',
1146
+ 'go_pay',
1147
+ 'grab_pay',
1148
+ 'pay_co',
1149
+ 'after_pay',
1150
+ 'swish',
1151
+ 'payme',
1152
+ ])
1153
+ .optional(),
1154
+ reference_id: zod_1.z.string().max(65000).optional(),
1155
+ gw_payment_method_id: zod_1.z.string().max(65000).optional(),
1156
+ additional_information: GiftSubscriptionEstimateAdditionalInformationSchema.optional(),
1157
+ });
1158
+ const GiftSubscriptionEstimateShippingAddressSchema = zod_1.z.object({
1159
+ first_name: zod_1.z.string().max(150).optional(),
1160
+ last_name: zod_1.z.string().max(150).optional(),
1161
+ email: zod_1.z.string().email().max(70).optional(),
1162
+ company: zod_1.z.string().max(250).optional(),
1163
+ phone: zod_1.z.string().max(50).optional(),
1164
+ line1: zod_1.z.string().max(150).optional(),
1165
+ line2: zod_1.z.string().max(150).optional(),
1166
+ line3: zod_1.z.string().max(150).optional(),
1167
+ city: zod_1.z.string().max(50).optional(),
1168
+ state_code: zod_1.z.string().max(50).optional(),
1169
+ state: zod_1.z.string().max(50).optional(),
1170
+ zip: zod_1.z.string().max(20).optional(),
1171
+ country: zod_1.z.string().max(50).optional(),
1172
+ validation_status: zod_1.z
1173
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
1174
+ .optional(),
1175
+ });
1176
+ const GiftSubscriptionEstimateSubscriptionSchema = zod_1.z.object({
1177
+ plan_id: zod_1.z.string().max(100),
1178
+ plan_quantity: zod_1.z.number().int().min(1).optional(),
1179
+ plan_quantity_in_decimal: zod_1.z.string().max(33).optional(),
1180
+ });
1181
+ const GiftSubscriptionEstimateAddonsSchema = zod_1.z.object({
1182
+ id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
1183
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
1184
+ quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
1185
+ });
1186
+ const GiftSubscriptionEstimateBodySchema = zod_1.z.looseObject({
1187
+ coupon_ids: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
1188
+ gift: GiftSubscriptionEstimateGiftSchema.optional(),
1189
+ gifter: GiftSubscriptionEstimateGifterSchema.optional(),
1190
+ gift_receiver: GiftSubscriptionEstimateGiftReceiverSchema.optional(),
1191
+ payment_intent: GiftSubscriptionEstimatePaymentIntentSchema.optional(),
1192
+ shipping_address: GiftSubscriptionEstimateShippingAddressSchema.optional(),
1193
+ subscription: GiftSubscriptionEstimateSubscriptionSchema.optional(),
1194
+ addons: GiftSubscriptionEstimateAddonsSchema.optional(),
1195
+ });
1196
+ exports.GiftSubscriptionEstimateBodySchema = GiftSubscriptionEstimateBodySchema;
1197
+ //Estimate.giftSubscriptionForItems
1198
+ const GiftSubscriptionForItemsEstimateGiftSchema = zod_1.z.object({
1199
+ scheduled_at: zod_1.z.number().int().optional(),
1200
+ auto_claim: zod_1.z.boolean().default(false).optional(),
1201
+ no_expiry: zod_1.z.boolean().optional(),
1202
+ claim_expiry_date: zod_1.z.number().int().optional(),
1203
+ });
1204
+ const GiftSubscriptionForItemsEstimateGifterSchema = zod_1.z.object({
1205
+ customer_id: zod_1.z.string().max(50),
1206
+ signature: zod_1.z.string().max(50),
1207
+ note: zod_1.z.string().max(500).optional(),
1208
+ payment_src_id: zod_1.z.string().max(40).optional(),
1209
+ });
1210
+ const GiftSubscriptionForItemsEstimateGiftReceiverSchema = zod_1.z.object({
1211
+ customer_id: zod_1.z.string().max(50),
1212
+ first_name: zod_1.z.string().max(150),
1213
+ last_name: zod_1.z.string().max(150),
1214
+ email: zod_1.z.string().email().max(70),
1215
+ });
1216
+ const GiftSubscriptionForItemsEstimateAdditionalInformationSchema = zod_1.z.looseObject({});
1217
+ const GiftSubscriptionForItemsEstimatePaymentIntentSchema = zod_1.z.object({
1218
+ id: zod_1.z.string().max(150).optional(),
1219
+ gateway_account_id: zod_1.z.string().max(50).optional(),
1220
+ gw_token: zod_1.z.string().max(65000).optional(),
1221
+ payment_method_type: zod_1.z
1222
+ .enum([
1223
+ 'card',
1224
+ 'ideal',
1225
+ 'sofort',
1226
+ 'bancontact',
1227
+ 'google_pay',
1228
+ 'dotpay',
1229
+ 'giropay',
1230
+ 'apple_pay',
1231
+ 'upi',
1232
+ 'netbanking_emandates',
1233
+ 'paypal_express_checkout',
1234
+ 'direct_debit',
1235
+ 'boleto',
1236
+ 'venmo',
1237
+ 'amazon_payments',
1238
+ 'pay_to',
1239
+ 'faster_payments',
1240
+ 'sepa_instant_transfer',
1241
+ 'klarna_pay_now',
1242
+ 'online_banking_poland',
1243
+ 'payconiq_by_bancontact',
1244
+ 'electronic_payment_standard',
1245
+ 'kbc_payment_button',
1246
+ 'pay_by_bank',
1247
+ 'trustly',
1248
+ 'stablecoin',
1249
+ 'kakao_pay',
1250
+ 'naver_pay',
1251
+ 'revolut_pay',
1252
+ 'cash_app_pay',
1253
+ 'wechat_pay',
1254
+ 'alipay',
1255
+ 'pix',
1256
+ 'twint',
1257
+ 'go_pay',
1258
+ 'grab_pay',
1259
+ 'pay_co',
1260
+ 'after_pay',
1261
+ 'swish',
1262
+ 'payme',
1263
+ ])
1264
+ .optional(),
1265
+ reference_id: zod_1.z.string().max(65000).optional(),
1266
+ gw_payment_method_id: zod_1.z.string().max(65000).optional(),
1267
+ additional_information: GiftSubscriptionForItemsEstimateAdditionalInformationSchema.optional(),
1268
+ });
1269
+ const GiftSubscriptionForItemsEstimateShippingAddressSchema = zod_1.z.object({
1270
+ first_name: zod_1.z.string().max(150).optional(),
1271
+ last_name: zod_1.z.string().max(150).optional(),
1272
+ email: zod_1.z.string().email().max(70).optional(),
1273
+ company: zod_1.z.string().max(250).optional(),
1274
+ phone: zod_1.z.string().max(50).optional(),
1275
+ line1: zod_1.z.string().max(150).optional(),
1276
+ line2: zod_1.z.string().max(150).optional(),
1277
+ line3: zod_1.z.string().max(150).optional(),
1278
+ city: zod_1.z.string().max(50).optional(),
1279
+ state_code: zod_1.z.string().max(50).optional(),
1280
+ state: zod_1.z.string().max(50).optional(),
1281
+ zip: zod_1.z.string().max(20).optional(),
1282
+ country: zod_1.z.string().max(50).optional(),
1283
+ validation_status: zod_1.z
1284
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
1285
+ .optional(),
1286
+ });
1287
+ const GiftSubscriptionForItemsEstimateSubscriptionItemsSchema = zod_1.z.object({
1288
+ item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
1289
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
1290
+ quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
1291
+ unit_price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
1292
+ unit_price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
1293
+ });
1294
+ const GiftSubscriptionForItemsEstimateItemTiersSchema = zod_1.z.object({
1295
+ item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
1296
+ starting_unit: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
1297
+ ending_unit: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
1298
+ price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
1299
+ starting_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
1300
+ ending_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
1301
+ price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
1302
+ });
1303
+ const GiftSubscriptionForItemsEstimateBodySchema = zod_1.z.looseObject({
1304
+ coupon_ids: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
1305
+ gift: GiftSubscriptionForItemsEstimateGiftSchema.optional(),
1306
+ gifter: GiftSubscriptionForItemsEstimateGifterSchema.optional(),
1307
+ gift_receiver: GiftSubscriptionForItemsEstimateGiftReceiverSchema.optional(),
1308
+ payment_intent: GiftSubscriptionForItemsEstimatePaymentIntentSchema.optional(),
1309
+ shipping_address: GiftSubscriptionForItemsEstimateShippingAddressSchema.optional(),
1310
+ subscription_items: GiftSubscriptionForItemsEstimateSubscriptionItemsSchema.optional(),
1311
+ item_tiers: GiftSubscriptionForItemsEstimateItemTiersSchema.optional(),
1312
+ });
1313
+ exports.GiftSubscriptionForItemsEstimateBodySchema = GiftSubscriptionForItemsEstimateBodySchema;
1314
+ //Estimate.createInvoice
1315
+ const CreateInvoiceEstimateInvoiceSchema = zod_1.z.object({
1316
+ customer_id: zod_1.z.string().max(50).optional(),
1317
+ subscription_id: zod_1.z.string().max(50).optional(),
1318
+ po_number: zod_1.z.string().max(100).optional(),
1319
+ });
1320
+ const CreateInvoiceEstimateShippingAddressSchema = zod_1.z.object({
1321
+ first_name: zod_1.z.string().max(150).optional(),
1322
+ last_name: zod_1.z.string().max(150).optional(),
1323
+ email: zod_1.z.string().email().max(70).optional(),
1324
+ company: zod_1.z.string().max(250).optional(),
1325
+ phone: zod_1.z.string().max(50).optional(),
1326
+ line1: zod_1.z.string().max(150).optional(),
1327
+ line2: zod_1.z.string().max(150).optional(),
1328
+ line3: zod_1.z.string().max(150).optional(),
1329
+ city: zod_1.z.string().max(50).optional(),
1330
+ state_code: zod_1.z.string().max(50).optional(),
1331
+ state: zod_1.z.string().max(50).optional(),
1332
+ zip: zod_1.z.string().max(20).optional(),
1333
+ country: zod_1.z.string().max(50).optional(),
1334
+ validation_status: zod_1.z
1335
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
1336
+ .optional(),
1337
+ });
1338
+ const CreateInvoiceEstimateAddonsSchema = zod_1.z.object({
1339
+ id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
1340
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
1341
+ quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
1342
+ unit_price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
1343
+ unit_price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
1344
+ date_from: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
1345
+ date_to: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
1346
+ });
1347
+ const CreateInvoiceEstimateChargesSchema = zod_1.z.object({
1348
+ amount: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
1349
+ amount_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
1350
+ description: zod_1.z.array(zod_1.z.string().max(250).optional()).optional(),
1351
+ taxable: zod_1.z.array(zod_1.z.boolean().default(true).optional()).optional(),
1352
+ tax_profile_id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
1353
+ avalara_tax_code: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
1354
+ hsn_code: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
1355
+ taxjar_product_code: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
1356
+ avalara_sale_type: zod_1.z
1357
+ .array(zod_1.z.enum(['wholesale', 'retail', 'consumed', 'vendor_use']).optional())
1358
+ .optional(),
1359
+ avalara_transaction_type: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
1360
+ avalara_service_type: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
1361
+ date_from: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
1362
+ date_to: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
1363
+ });
1364
+ const CreateInvoiceEstimateNotesToRemoveSchema = zod_1.z.object({
1365
+ entity_type: zod_1.z
1366
+ .array(zod_1.z
1367
+ .enum(['plan', 'addon', 'customer', 'subscription', 'coupon'])
1368
+ .optional())
1369
+ .optional(),
1370
+ entity_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
1371
+ });
1372
+ const CreateInvoiceEstimateTaxProvidersFieldsSchema = zod_1.z.object({
1373
+ provider_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
1374
+ field_id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
1375
+ field_value: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
1376
+ });
1377
+ const CreateInvoiceEstimateBodySchema = zod_1.z.looseObject({
1378
+ currency_code: zod_1.z.string().max(3).optional(),
1379
+ invoice_note: zod_1.z.string().max(2000).optional(),
1380
+ remove_general_note: zod_1.z.boolean().default(false).optional(),
1381
+ coupon: zod_1.z.string().max(100).optional(),
1382
+ coupon_ids: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
1383
+ authorization_transaction_id: zod_1.z.string().max(40).optional(),
1384
+ payment_source_id: zod_1.z.string().max(40).optional(),
1385
+ auto_collection: zod_1.z.enum(['on', 'off']).optional(),
1386
+ invoice_date: zod_1.z.number().int().optional(),
1387
+ invoice: CreateInvoiceEstimateInvoiceSchema.optional(),
1388
+ shipping_address: CreateInvoiceEstimateShippingAddressSchema.optional(),
1389
+ addons: CreateInvoiceEstimateAddonsSchema.optional(),
1390
+ charges: CreateInvoiceEstimateChargesSchema.optional(),
1391
+ notes_to_remove: CreateInvoiceEstimateNotesToRemoveSchema.optional(),
1392
+ tax_providers_fields: CreateInvoiceEstimateTaxProvidersFieldsSchema.optional(),
1393
+ });
1394
+ exports.CreateInvoiceEstimateBodySchema = CreateInvoiceEstimateBodySchema;
1395
+ //Estimate.createInvoiceForItems
1396
+ const CreateInvoiceForItemsEstimateInvoiceSchema = zod_1.z.object({
1397
+ customer_id: zod_1.z.string().max(50).optional(),
1398
+ subscription_id: zod_1.z.string().max(50).optional(),
1399
+ po_number: zod_1.z.string().max(100).optional(),
1400
+ });
1401
+ const CreateInvoiceForItemsEstimateShippingAddressSchema = zod_1.z.object({
1402
+ first_name: zod_1.z.string().max(150).optional(),
1403
+ last_name: zod_1.z.string().max(150).optional(),
1404
+ email: zod_1.z.string().email().max(70).optional(),
1405
+ company: zod_1.z.string().max(250).optional(),
1406
+ phone: zod_1.z.string().max(50).optional(),
1407
+ line1: zod_1.z.string().max(150).optional(),
1408
+ line2: zod_1.z.string().max(150).optional(),
1409
+ line3: zod_1.z.string().max(150).optional(),
1410
+ city: zod_1.z.string().max(50).optional(),
1411
+ state_code: zod_1.z.string().max(50).optional(),
1412
+ state: zod_1.z.string().max(50).optional(),
1413
+ zip: zod_1.z.string().max(20).optional(),
1414
+ country: zod_1.z.string().max(50).optional(),
1415
+ validation_status: zod_1.z
1416
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
1417
+ .optional(),
1418
+ });
1419
+ const CreateInvoiceForItemsEstimateBillingAddressSchema = zod_1.z.object({
1420
+ line1: zod_1.z.string().max(150).optional(),
1421
+ line2: zod_1.z.string().max(150).optional(),
1422
+ line3: zod_1.z.string().max(150).optional(),
1423
+ city: zod_1.z.string().max(50).optional(),
1424
+ state_code: 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 CreateInvoiceForItemsEstimateItemPricesSchema = zod_1.z.object({
1432
+ item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
1433
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
1434
+ quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
1435
+ unit_price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
1436
+ unit_price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
1437
+ date_from: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
1438
+ date_to: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
1439
+ });
1440
+ const CreateInvoiceForItemsEstimateItemTiersSchema = zod_1.z.object({
1441
+ item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
1442
+ starting_unit: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
1443
+ ending_unit: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
1444
+ price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
1445
+ starting_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
1446
+ ending_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
1447
+ price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
1448
+ pricing_type: zod_1.z
1449
+ .array(zod_1.z.enum(['per_unit', 'flat_fee', 'package']).optional())
1450
+ .optional(),
1451
+ package_size: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
1452
+ });
1453
+ const CreateInvoiceForItemsEstimateChargesSchema = zod_1.z.object({
1454
+ amount: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
1455
+ amount_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
1456
+ description: zod_1.z.array(zod_1.z.string().max(250).optional()).optional(),
1457
+ taxable: zod_1.z.array(zod_1.z.boolean().default(true).optional()).optional(),
1458
+ tax_profile_id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
1459
+ avalara_tax_code: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
1460
+ hsn_code: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
1461
+ taxjar_product_code: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
1462
+ avalara_sale_type: zod_1.z
1463
+ .array(zod_1.z.enum(['wholesale', 'retail', 'consumed', 'vendor_use']).optional())
1464
+ .optional(),
1465
+ avalara_transaction_type: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
1466
+ avalara_service_type: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
1467
+ date_from: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
1468
+ date_to: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
1469
+ });
1470
+ const CreateInvoiceForItemsEstimateNotesToRemoveSchema = zod_1.z.object({
1471
+ entity_type: zod_1.z
1472
+ .array(zod_1.z
1473
+ .enum([
1474
+ 'customer',
1475
+ 'subscription',
1476
+ 'coupon',
1477
+ 'plan_item_price',
1478
+ 'addon_item_price',
1479
+ 'charge_item_price',
1480
+ ])
1481
+ .optional())
1482
+ .optional(),
1483
+ entity_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
1484
+ });
1485
+ const CreateInvoiceForItemsEstimateDiscountsSchema = zod_1.z.object({
1486
+ percentage: zod_1.z.array(zod_1.z.number().min(0.01).max(100).optional()).optional(),
1487
+ amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
1488
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
1489
+ apply_on: zod_1.z.array(zod_1.z.enum(['invoice_amount', 'specific_item_price']).optional()),
1490
+ item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
1491
+ });
1492
+ const CreateInvoiceForItemsEstimateTaxProvidersFieldsSchema = zod_1.z.object({
1493
+ provider_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
1494
+ field_id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
1495
+ field_value: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
1496
+ });
1497
+ const CreateInvoiceForItemsEstimateBodySchema = zod_1.z.looseObject({
1498
+ currency_code: zod_1.z.string().max(3).optional(),
1499
+ invoice_note: zod_1.z.string().max(2000).optional(),
1500
+ remove_general_note: zod_1.z.boolean().default(false).optional(),
1501
+ coupon: zod_1.z.string().max(100).optional(),
1502
+ coupon_ids: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
1503
+ authorization_transaction_id: zod_1.z.string().max(40).optional(),
1504
+ payment_source_id: zod_1.z.string().max(40).optional(),
1505
+ auto_collection: zod_1.z.enum(['on', 'off']).optional(),
1506
+ invoice_date: zod_1.z.number().int().optional(),
1507
+ invoice: CreateInvoiceForItemsEstimateInvoiceSchema.optional(),
1508
+ shipping_address: CreateInvoiceForItemsEstimateShippingAddressSchema.optional(),
1509
+ billing_address: CreateInvoiceForItemsEstimateBillingAddressSchema.optional(),
1510
+ item_prices: CreateInvoiceForItemsEstimateItemPricesSchema.optional(),
1511
+ item_tiers: CreateInvoiceForItemsEstimateItemTiersSchema.optional(),
1512
+ charges: CreateInvoiceForItemsEstimateChargesSchema.optional(),
1513
+ notes_to_remove: CreateInvoiceForItemsEstimateNotesToRemoveSchema.optional(),
1514
+ discounts: CreateInvoiceForItemsEstimateDiscountsSchema.optional(),
1515
+ tax_providers_fields: CreateInvoiceForItemsEstimateTaxProvidersFieldsSchema.optional(),
1516
+ });
1517
+ exports.CreateInvoiceForItemsEstimateBodySchema = CreateInvoiceForItemsEstimateBodySchema;
1518
+ //Estimate.paymentSchedules
1519
+ const PaymentSchedulesEstimateBodySchema = zod_1.z.looseObject({
1520
+ scheme_id: zod_1.z.string(),
1521
+ amount: zod_1.z.number().int().min(0).optional(),
1522
+ invoice_id: zod_1.z.string().optional(),
1523
+ payment_schedule_start_date: zod_1.z.number().int().optional(),
1524
+ });
1525
+ exports.PaymentSchedulesEstimateBodySchema = PaymentSchedulesEstimateBodySchema;