chargebee 3.34.0 → 3.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. package/CHANGELOG.md +237 -0
  2. package/cjs/environment.js +1 -1
  3. package/cjs/resources/api_endpoints.js +230 -2
  4. package/cjs/resources/webhook/eventType.js +25 -1
  5. package/cjs/schema/addon.schema.js +221 -40
  6. package/cjs/schema/alert.schema.js +17 -2
  7. package/cjs/schema/alert_status.schema.js +6 -1
  8. package/cjs/schema/attached_item.schema.js +101 -26
  9. package/cjs/schema/business_entity.schema.js +43 -6
  10. package/cjs/schema/business_rule.schema.js +2 -2
  11. package/cjs/schema/business_ruleset.schema.js +2 -2
  12. package/cjs/schema/collections_payment_promise.schema.js +43 -0
  13. package/cjs/schema/comment.schema.js +17 -4
  14. package/cjs/schema/coupon.schema.js +218 -37
  15. package/cjs/schema/coupon_code.schema.js +36 -6
  16. package/cjs/schema/coupon_set.schema.js +108 -27
  17. package/cjs/schema/credit_note.schema.js +497 -105
  18. package/cjs/schema/credit_unit.schema.js +12 -2
  19. package/cjs/schema/customer.schema.js +212 -62
  20. package/cjs/schema/differential_price.schema.js +100 -12
  21. package/cjs/schema/dispute.schema.js +125 -33
  22. package/cjs/schema/einvoice.schema.js +27 -6
  23. package/cjs/schema/email_log.schema.js +15 -4
  24. package/cjs/schema/entitlement.schema.js +35 -6
  25. package/cjs/schema/entitlement_override.schema.js +17 -1
  26. package/cjs/schema/estimate.schema.js +585 -40
  27. package/cjs/schema/event.schema.js +1334 -585
  28. package/cjs/schema/export.schema.js +4459 -1412
  29. package/cjs/schema/feature.schema.js +73 -11
  30. package/cjs/schema/gateway_request_log.schema.js +309 -0
  31. package/cjs/schema/gateway_webhook_log.schema.js +257 -0
  32. package/cjs/schema/gift.schema.js +51 -5
  33. package/cjs/schema/grant_block.schema.js +45 -12
  34. package/cjs/schema/hosted_page.schema.js +564 -68
  35. package/cjs/schema/index.js +6 -0
  36. package/cjs/schema/invoice.schema.js +843 -123
  37. package/cjs/schema/item.schema.js +151 -28
  38. package/cjs/schema/item_entitlement.schema.js +23 -2
  39. package/cjs/schema/item_family.schema.js +29 -8
  40. package/cjs/schema/item_price.schema.js +263 -48
  41. package/cjs/schema/ledger_account_balance.schema.js +11 -2
  42. package/cjs/schema/ledger_operation.schema.js +44 -17
  43. package/cjs/schema/metered_feature.schema.js +10 -1
  44. package/cjs/schema/omnichannel_one_time_order.schema.js +42 -4
  45. package/cjs/schema/omnichannel_subscription.schema.js +146 -32
  46. package/cjs/schema/order.schema.js +233 -61
  47. package/cjs/schema/organization_detail.schema.js +36 -0
  48. package/cjs/schema/payment_schedule.schema.js +39 -8
  49. package/cjs/schema/payment_schedule_scheme.schema.js +37 -7
  50. package/cjs/schema/payment_source.schema.js +375 -148
  51. package/cjs/schema/payment_voucher.schema.js +33 -5
  52. package/cjs/schema/plan.schema.js +345 -57
  53. package/cjs/schema/price_ramp.schema.js +153 -0
  54. package/cjs/schema/price_variant.schema.js +88 -18
  55. package/cjs/schema/pricing_page_session.schema.js +36 -2
  56. package/cjs/schema/promotional_credit.schema.js +27 -6
  57. package/cjs/schema/purchase.schema.js +210 -12
  58. package/cjs/schema/quote.schema.js +907 -87
  59. package/cjs/schema/quote_entitlement.schema.js +6 -2
  60. package/cjs/schema/ramp.schema.js +242 -24
  61. package/cjs/schema/retry_segment.schema.js +12 -0
  62. package/cjs/schema/site_migration_detail.schema.js +50 -16
  63. package/cjs/schema/subscription.schema.js +1002 -173
  64. package/cjs/schema/subscription_entitlement.schema.js +9 -1
  65. package/cjs/schema/transaction.schema.js +780 -342
  66. package/cjs/schema/unbilled_charge.schema.js +141 -13
  67. package/cjs/schema/usage.schema.js +59 -11
  68. package/cjs/schema/usage_event.schema.js +13 -1
  69. package/cjs/schema/usage_summary.schema.js +1 -0
  70. package/cjs/schema/virtual_bank_account.schema.js +42 -10
  71. package/cjs/schema/webhook_endpoint.schema.js +50 -2
  72. package/esm/environment.js +1 -1
  73. package/esm/resources/api_endpoints.js +230 -2
  74. package/esm/resources/webhook/eventType.js +25 -1
  75. package/esm/schema/addon.schema.js +221 -40
  76. package/esm/schema/alert.schema.js +17 -2
  77. package/esm/schema/alert_status.schema.js +6 -1
  78. package/esm/schema/attached_item.schema.js +101 -26
  79. package/esm/schema/business_entity.schema.js +42 -5
  80. package/esm/schema/business_rule.schema.js +2 -2
  81. package/esm/schema/business_ruleset.schema.js +2 -2
  82. package/esm/schema/collections_payment_promise.schema.js +40 -0
  83. package/esm/schema/comment.schema.js +17 -4
  84. package/esm/schema/coupon.schema.js +218 -37
  85. package/esm/schema/coupon_code.schema.js +36 -6
  86. package/esm/schema/coupon_set.schema.js +108 -27
  87. package/esm/schema/credit_note.schema.js +497 -105
  88. package/esm/schema/credit_unit.schema.js +12 -2
  89. package/esm/schema/customer.schema.js +212 -62
  90. package/esm/schema/differential_price.schema.js +100 -12
  91. package/esm/schema/dispute.schema.js +125 -33
  92. package/esm/schema/einvoice.schema.js +27 -6
  93. package/esm/schema/email_log.schema.js +15 -4
  94. package/esm/schema/entitlement.schema.js +35 -6
  95. package/esm/schema/entitlement_override.schema.js +17 -1
  96. package/esm/schema/estimate.schema.js +585 -40
  97. package/esm/schema/event.schema.js +1334 -585
  98. package/esm/schema/export.schema.js +4459 -1412
  99. package/esm/schema/feature.schema.js +73 -11
  100. package/esm/schema/gateway_request_log.schema.js +306 -0
  101. package/esm/schema/gateway_webhook_log.schema.js +254 -0
  102. package/esm/schema/gift.schema.js +51 -5
  103. package/esm/schema/grant_block.schema.js +45 -12
  104. package/esm/schema/hosted_page.schema.js +564 -68
  105. package/esm/schema/index.js +6 -0
  106. package/esm/schema/invoice.schema.js +842 -122
  107. package/esm/schema/item.schema.js +151 -28
  108. package/esm/schema/item_entitlement.schema.js +23 -2
  109. package/esm/schema/item_family.schema.js +29 -8
  110. package/esm/schema/item_price.schema.js +263 -48
  111. package/esm/schema/ledger_account_balance.schema.js +10 -1
  112. package/esm/schema/ledger_operation.schema.js +44 -17
  113. package/esm/schema/metered_feature.schema.js +10 -1
  114. package/esm/schema/omnichannel_one_time_order.schema.js +42 -4
  115. package/esm/schema/omnichannel_subscription.schema.js +146 -32
  116. package/esm/schema/order.schema.js +233 -61
  117. package/esm/schema/organization_detail.schema.js +33 -0
  118. package/esm/schema/payment_schedule.schema.js +39 -8
  119. package/esm/schema/payment_schedule_scheme.schema.js +37 -7
  120. package/esm/schema/payment_source.schema.js +375 -148
  121. package/esm/schema/payment_voucher.schema.js +33 -5
  122. package/esm/schema/plan.schema.js +345 -57
  123. package/esm/schema/price_ramp.schema.js +150 -0
  124. package/esm/schema/price_variant.schema.js +88 -18
  125. package/esm/schema/pricing_page_session.schema.js +36 -2
  126. package/esm/schema/promotional_credit.schema.js +27 -6
  127. package/esm/schema/purchase.schema.js +210 -12
  128. package/esm/schema/quote.schema.js +907 -87
  129. package/esm/schema/quote_entitlement.schema.js +6 -2
  130. package/esm/schema/ramp.schema.js +242 -24
  131. package/esm/schema/retry_segment.schema.js +9 -0
  132. package/esm/schema/site_migration_detail.schema.js +50 -16
  133. package/esm/schema/subscription.schema.js +1002 -173
  134. package/esm/schema/subscription_entitlement.schema.js +9 -1
  135. package/esm/schema/transaction.schema.js +780 -342
  136. package/esm/schema/unbilled_charge.schema.js +141 -13
  137. package/esm/schema/usage.schema.js +59 -11
  138. package/esm/schema/usage_event.schema.js +13 -1
  139. package/esm/schema/usage_summary.schema.js +1 -0
  140. package/esm/schema/virtual_bank_account.schema.js +42 -10
  141. package/esm/schema/webhook_endpoint.schema.js +50 -2
  142. package/package.json +1 -1
  143. package/types/core.d.ts +63 -74
  144. package/types/index.d.ts +29 -1
  145. package/types/resources/BillingLineItem.d.ts +10 -0
  146. package/types/resources/BillingMetadata.d.ts +9 -0
  147. package/types/resources/BusinessEntity.d.ts +52 -0
  148. package/types/resources/Citation.d.ts +13 -0
  149. package/types/resources/CollectionsDispute.d.ts +24 -0
  150. package/types/resources/CollectionsPaymentPromise.d.ts +93 -0
  151. package/types/resources/CollectionsReminderSequence.d.ts +35 -0
  152. package/types/resources/Comment.d.ts +2 -1
  153. package/types/resources/Content.d.ts +23 -1
  154. package/types/resources/CreditNote.d.ts +1 -0
  155. package/types/resources/CustomData.d.ts +14 -0
  156. package/types/resources/Discount.d.ts +1 -0
  157. package/types/resources/DraftEstimate.d.ts +13 -0
  158. package/types/resources/DraftRequest.d.ts +45 -0
  159. package/types/resources/EmailAttachment.d.ts +16 -0
  160. package/types/resources/EmailConversation.d.ts +18 -0
  161. package/types/resources/EmailLog.d.ts +1 -0
  162. package/types/resources/EmailMessage.d.ts +40 -0
  163. package/types/resources/Estimate.d.ts +3 -0
  164. package/types/resources/Event.d.ts +25 -1
  165. package/types/resources/Execution.d.ts +12 -0
  166. package/types/resources/GatewayPaymentMethodToken.d.ts +2 -2
  167. package/types/resources/GatewayRequestLog.d.ts +82 -0
  168. package/types/resources/GatewayWebhookLog.d.ts +74 -0
  169. package/types/resources/GrantBlock.d.ts +5 -0
  170. package/types/resources/GroupByAttribute.d.ts +15 -0
  171. package/types/resources/GroupByRecommendation.d.ts +10 -0
  172. package/types/resources/HostedPage.d.ts +18 -0
  173. package/types/resources/Invoice.d.ts +19 -0
  174. package/types/resources/ItemPrice.d.ts +1 -0
  175. package/types/resources/LedgerAccountBalance.d.ts +19 -0
  176. package/types/resources/Meter.d.ts +1 -0
  177. package/types/resources/MeteredFeature.d.ts +1 -0
  178. package/types/resources/OmnichannelOneTimeOrder.d.ts +5 -1
  179. package/types/resources/OmnichannelSubscription.d.ts +6 -1
  180. package/types/resources/OmnichannelSubscriptionItem.d.ts +4 -1
  181. package/types/resources/OrganizationDetail.d.ts +84 -0
  182. package/types/resources/PaymentSchedule.d.ts +1 -1
  183. package/types/resources/PaymentScheduleEstimate.d.ts +1 -1
  184. package/types/resources/PaymentSource.d.ts +19 -0
  185. package/types/resources/PreferenceVariant.d.ts +10 -0
  186. package/types/resources/PriceRamp.d.ts +113 -0
  187. package/types/resources/PrivateNote.d.ts +18 -0
  188. package/types/resources/Purchase.d.ts +6 -0
  189. package/types/resources/Ramp.d.ts +6 -0
  190. package/types/resources/RampInterval.d.ts +12 -0
  191. package/types/resources/RecordedPurchase.d.ts +5 -1
  192. package/types/resources/RetrySegment.d.ts +36 -0
  193. package/types/resources/Subscription.d.ts +3 -0
  194. package/types/resources/Transaction.d.ts +4 -0
  195. package/types/resources/Usage.d.ts +7 -0
  196. package/types/resources/UsageSummary.d.ts +2 -0
  197. package/types/resources/WebhookEvent.d.ts +159 -5
  198. package/types/resources/AppliedBusinessRule.d.ts +0 -15
@@ -95,6 +95,15 @@ const CreatePurchasePaymentIntentSchema = zod_1.z.object({
95
95
  gw_payment_method_id: zod_1.z.string().max(65000).optional(),
96
96
  additional_information: CreatePurchaseAdditionalInformationSchema.optional(),
97
97
  });
98
+ const CreatePurchasePurchaseItemsItemSchema = zod_1.z.object({
99
+ index: zod_1.z.number().int().min(0),
100
+ item_price_id: zod_1.z.string().max(100),
101
+ quantity: zod_1.z.number().int().min(1).optional(),
102
+ unit_amount: zod_1.z.number().int().min(0).optional(),
103
+ unit_amount_in_decimal: zod_1.z.string().max(39).optional(),
104
+ quantity_in_decimal: zod_1.z.string().max(33).optional(),
105
+ trial_end: zod_1.z.number().int().optional(),
106
+ });
98
107
  const CreatePurchasePurchaseItemsSchema = zod_1.z.object({
99
108
  index: zod_1.z.array(zod_1.z.number().int().min(0).optional()),
100
109
  item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()),
@@ -102,6 +111,17 @@ const CreatePurchasePurchaseItemsSchema = zod_1.z.object({
102
111
  unit_amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
103
112
  unit_amount_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
104
113
  quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
114
+ trial_end: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
115
+ });
116
+ const CreatePurchaseItemTiersItemSchema = zod_1.z.object({
117
+ index: zod_1.z.number().int().min(0),
118
+ item_price_id: zod_1.z.string().max(100).optional(),
119
+ starting_unit: zod_1.z.number().int().min(1).optional(),
120
+ ending_unit: zod_1.z.number().int().optional(),
121
+ price: zod_1.z.number().int().min(0).optional(),
122
+ starting_unit_in_decimal: zod_1.z.string().max(33).optional(),
123
+ ending_unit_in_decimal: zod_1.z.string().max(33).optional(),
124
+ price_in_decimal: zod_1.z.string().max(39).optional(),
105
125
  });
106
126
  const CreatePurchaseItemTiersSchema = zod_1.z.object({
107
127
  index: zod_1.z.array(zod_1.z.number().int().min(0).optional()),
@@ -113,6 +133,24 @@ const CreatePurchaseItemTiersSchema = zod_1.z.object({
113
133
  ending_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
114
134
  price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
115
135
  });
136
+ const CreatePurchaseShippingAddressesItemSchema = zod_1.z.object({
137
+ first_name: zod_1.z.string().max(150).optional(),
138
+ last_name: zod_1.z.string().max(150).optional(),
139
+ email: zod_1.z.string().email().max(70).optional(),
140
+ company: zod_1.z.string().max(250).optional(),
141
+ phone: zod_1.z.string().max(50).optional(),
142
+ line1: zod_1.z.string().max(150).optional(),
143
+ line2: zod_1.z.string().max(150).optional(),
144
+ line3: zod_1.z.string().max(150).optional(),
145
+ city: zod_1.z.string().max(50).optional(),
146
+ state: zod_1.z.string().max(50).optional(),
147
+ state_code: zod_1.z.string().max(50).optional(),
148
+ country: zod_1.z.string().max(50).optional(),
149
+ zip: zod_1.z.string().max(20).optional(),
150
+ validation_status: zod_1.z
151
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
152
+ .optional(),
153
+ });
116
154
  const CreatePurchaseShippingAddressesSchema = zod_1.z.object({
117
155
  first_name: zod_1.z.array(zod_1.z.string().max(150).optional()).optional(),
118
156
  last_name: zod_1.z.array(zod_1.z.string().max(150).optional()).optional(),
@@ -133,6 +171,14 @@ const CreatePurchaseShippingAddressesSchema = zod_1.z.object({
133
171
  .optional())
134
172
  .optional(),
135
173
  });
174
+ const CreatePurchaseDiscountsItemSchema = zod_1.z.object({
175
+ index: zod_1.z.number().int().min(0).optional(),
176
+ coupon_id: zod_1.z.string().max(100).optional(),
177
+ percentage: zod_1.z.number().min(0.01).max(100).optional(),
178
+ quantity: zod_1.z.number().int().min(1).optional(),
179
+ amount: zod_1.z.number().int().min(0).optional(),
180
+ included_in_mrr: zod_1.z.boolean().optional(),
181
+ });
136
182
  const CreatePurchaseDiscountsSchema = zod_1.z.object({
137
183
  index: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
138
184
  coupon_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
@@ -141,6 +187,21 @@ const CreatePurchaseDiscountsSchema = zod_1.z.object({
141
187
  amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
142
188
  included_in_mrr: zod_1.z.array(zod_1.z.boolean().optional()).optional(),
143
189
  });
190
+ const CreatePurchaseMetaDataSchema = zod_1.z.looseObject({});
191
+ const CreatePurchaseSubscriptionInfoItemSchema = zod_1.z.object({
192
+ index: zod_1.z.number().int().min(0),
193
+ subscription_id: zod_1.z.string().max(50).optional(),
194
+ billing_cycles: zod_1.z.number().int().min(0).optional(),
195
+ contract_term_billing_cycle_on_renewal: zod_1.z
196
+ .number()
197
+ .int()
198
+ .min(1)
199
+ .max(100)
200
+ .optional(),
201
+ trial_end: zod_1.z.number().int().optional(),
202
+ start_date: zod_1.z.number().int().optional(),
203
+ meta_data: CreatePurchaseMetaDataSchema.optional(),
204
+ });
144
205
  const CreatePurchaseMetaDataItemSchema = zod_1.z.looseObject({});
145
206
  const CreatePurchaseSubscriptionInfoSchema = zod_1.z.object({
146
207
  index: zod_1.z.array(zod_1.z.number().int().min(0).optional()),
@@ -149,8 +210,17 @@ const CreatePurchaseSubscriptionInfoSchema = zod_1.z.object({
149
210
  contract_term_billing_cycle_on_renewal: zod_1.z
150
211
  .array(zod_1.z.number().int().min(1).max(100).optional())
151
212
  .optional(),
213
+ trial_end: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
214
+ start_date: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
152
215
  meta_data: zod_1.z.array(CreatePurchaseMetaDataItemSchema.optional()).optional(),
153
216
  });
217
+ const CreatePurchaseContractTermsItemSchema = zod_1.z.object({
218
+ index: zod_1.z.number().int().min(0),
219
+ action_at_term_end: zod_1.z
220
+ .enum(['renew', 'evergreen', 'cancel', 'renew_once'])
221
+ .optional(),
222
+ cancellation_cutoff_period: zod_1.z.number().int().optional(),
223
+ });
154
224
  const CreatePurchaseContractTermsSchema = zod_1.z.object({
155
225
  index: zod_1.z.array(zod_1.z.number().int().min(0).optional()),
156
226
  action_at_term_end: zod_1.z
@@ -166,12 +236,42 @@ const CreatePurchaseBodySchema = zod_1.z.looseObject({
166
236
  payment_schedule: CreatePurchasePaymentScheduleSchema.optional(),
167
237
  statement_descriptor: CreatePurchaseStatementDescriptorSchema.optional(),
168
238
  payment_intent: CreatePurchasePaymentIntentSchema.optional(),
169
- purchase_items: CreatePurchasePurchaseItemsSchema.optional(),
170
- item_tiers: CreatePurchaseItemTiersSchema.optional(),
171
- shipping_addresses: CreatePurchaseShippingAddressesSchema.optional(),
172
- discounts: CreatePurchaseDiscountsSchema.optional(),
173
- subscription_info: CreatePurchaseSubscriptionInfoSchema.optional(),
174
- contract_terms: CreatePurchaseContractTermsSchema.optional(),
239
+ purchase_items: zod_1.z
240
+ .union([
241
+ zod_1.z.array(CreatePurchasePurchaseItemsItemSchema.optional()),
242
+ CreatePurchasePurchaseItemsSchema,
243
+ ])
244
+ .optional(),
245
+ item_tiers: zod_1.z
246
+ .union([
247
+ zod_1.z.array(CreatePurchaseItemTiersItemSchema.optional()),
248
+ CreatePurchaseItemTiersSchema,
249
+ ])
250
+ .optional(),
251
+ shipping_addresses: zod_1.z
252
+ .union([
253
+ zod_1.z.array(CreatePurchaseShippingAddressesItemSchema.optional()),
254
+ CreatePurchaseShippingAddressesSchema,
255
+ ])
256
+ .optional(),
257
+ discounts: zod_1.z
258
+ .union([
259
+ zod_1.z.array(CreatePurchaseDiscountsItemSchema.optional()),
260
+ CreatePurchaseDiscountsSchema,
261
+ ])
262
+ .optional(),
263
+ subscription_info: zod_1.z
264
+ .union([
265
+ zod_1.z.array(CreatePurchaseSubscriptionInfoItemSchema.optional()),
266
+ CreatePurchaseSubscriptionInfoSchema,
267
+ ])
268
+ .optional(),
269
+ contract_terms: zod_1.z
270
+ .union([
271
+ zod_1.z.array(CreatePurchaseContractTermsItemSchema.optional()),
272
+ CreatePurchaseContractTermsSchema,
273
+ ])
274
+ .optional(),
175
275
  });
176
276
  exports.CreatePurchaseBodySchema = CreatePurchaseBodySchema;
177
277
  //Purchase.estimate
@@ -221,6 +321,15 @@ const EstimatePurchaseBillingAddressSchema = zod_1.z.object({
221
321
  .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
222
322
  .optional(),
223
323
  });
324
+ const EstimatePurchasePurchaseItemsItemSchema = zod_1.z.object({
325
+ index: zod_1.z.number().int().min(0),
326
+ item_price_id: zod_1.z.string().max(100),
327
+ quantity: zod_1.z.number().int().min(1).optional(),
328
+ unit_amount: zod_1.z.number().int().min(0).optional(),
329
+ unit_amount_in_decimal: zod_1.z.string().max(39).optional(),
330
+ quantity_in_decimal: zod_1.z.string().max(33).optional(),
331
+ trial_end: zod_1.z.number().int().optional(),
332
+ });
224
333
  const EstimatePurchasePurchaseItemsSchema = zod_1.z.object({
225
334
  index: zod_1.z.array(zod_1.z.number().int().min(0).optional()),
226
335
  item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()),
@@ -228,6 +337,17 @@ const EstimatePurchasePurchaseItemsSchema = zod_1.z.object({
228
337
  unit_amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
229
338
  unit_amount_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
230
339
  quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
340
+ trial_end: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
341
+ });
342
+ const EstimatePurchaseItemTiersItemSchema = zod_1.z.object({
343
+ index: zod_1.z.number().int().min(0),
344
+ item_price_id: zod_1.z.string().max(100).optional(),
345
+ starting_unit: zod_1.z.number().int().min(1).optional(),
346
+ ending_unit: zod_1.z.number().int().optional(),
347
+ price: zod_1.z.number().int().min(0).optional(),
348
+ starting_unit_in_decimal: zod_1.z.string().max(33).optional(),
349
+ ending_unit_in_decimal: zod_1.z.string().max(33).optional(),
350
+ price_in_decimal: zod_1.z.string().max(39).optional(),
231
351
  });
232
352
  const EstimatePurchaseItemTiersSchema = zod_1.z.object({
233
353
  index: zod_1.z.array(zod_1.z.number().int().min(0).optional()),
@@ -239,6 +359,24 @@ const EstimatePurchaseItemTiersSchema = zod_1.z.object({
239
359
  ending_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
240
360
  price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
241
361
  });
362
+ const EstimatePurchaseShippingAddressesItemSchema = zod_1.z.object({
363
+ first_name: zod_1.z.string().max(150).optional(),
364
+ last_name: zod_1.z.string().max(150).optional(),
365
+ email: zod_1.z.string().email().max(70).optional(),
366
+ company: zod_1.z.string().max(250).optional(),
367
+ phone: zod_1.z.string().max(50).optional(),
368
+ line1: zod_1.z.string().max(150).optional(),
369
+ line2: zod_1.z.string().max(150).optional(),
370
+ line3: zod_1.z.string().max(150).optional(),
371
+ city: zod_1.z.string().max(50).optional(),
372
+ state: zod_1.z.string().max(50).optional(),
373
+ state_code: zod_1.z.string().max(50).optional(),
374
+ country: zod_1.z.string().max(50).optional(),
375
+ zip: zod_1.z.string().max(20).optional(),
376
+ validation_status: zod_1.z
377
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
378
+ .optional(),
379
+ });
242
380
  const EstimatePurchaseShippingAddressesSchema = zod_1.z.object({
243
381
  first_name: zod_1.z.array(zod_1.z.string().max(150).optional()).optional(),
244
382
  last_name: zod_1.z.array(zod_1.z.string().max(150).optional()).optional(),
@@ -259,6 +397,14 @@ const EstimatePurchaseShippingAddressesSchema = zod_1.z.object({
259
397
  .optional())
260
398
  .optional(),
261
399
  });
400
+ const EstimatePurchaseDiscountsItemSchema = zod_1.z.object({
401
+ index: zod_1.z.number().int().min(0).optional(),
402
+ coupon_id: zod_1.z.string().max(100).optional(),
403
+ percentage: zod_1.z.number().min(0.01).max(100).optional(),
404
+ quantity: zod_1.z.number().int().min(1).optional(),
405
+ amount: zod_1.z.number().int().min(0).optional(),
406
+ included_in_mrr: zod_1.z.boolean().optional(),
407
+ });
262
408
  const EstimatePurchaseDiscountsSchema = zod_1.z.object({
263
409
  index: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
264
410
  coupon_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
@@ -267,6 +413,19 @@ const EstimatePurchaseDiscountsSchema = zod_1.z.object({
267
413
  amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
268
414
  included_in_mrr: zod_1.z.array(zod_1.z.boolean().optional()).optional(),
269
415
  });
416
+ const EstimatePurchaseSubscriptionInfoItemSchema = zod_1.z.object({
417
+ index: zod_1.z.number().int().min(0),
418
+ subscription_id: zod_1.z.string().max(50).optional(),
419
+ billing_cycles: zod_1.z.number().int().min(0).optional(),
420
+ contract_term_billing_cycle_on_renewal: zod_1.z
421
+ .number()
422
+ .int()
423
+ .min(1)
424
+ .max(100)
425
+ .optional(),
426
+ trial_end: zod_1.z.number().int().optional(),
427
+ start_date: zod_1.z.number().int().optional(),
428
+ });
270
429
  const EstimatePurchaseSubscriptionInfoSchema = zod_1.z.object({
271
430
  index: zod_1.z.array(zod_1.z.number().int().min(0).optional()),
272
431
  subscription_id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
@@ -274,6 +433,15 @@ const EstimatePurchaseSubscriptionInfoSchema = zod_1.z.object({
274
433
  contract_term_billing_cycle_on_renewal: zod_1.z
275
434
  .array(zod_1.z.number().int().min(1).max(100).optional())
276
435
  .optional(),
436
+ trial_end: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
437
+ start_date: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
438
+ });
439
+ const EstimatePurchaseContractTermsItemSchema = zod_1.z.object({
440
+ index: zod_1.z.number().int().min(0),
441
+ action_at_term_end: zod_1.z
442
+ .enum(['renew', 'evergreen', 'cancel', 'renew_once'])
443
+ .optional(),
444
+ cancellation_cutoff_period: zod_1.z.number().int().optional(),
277
445
  });
278
446
  const EstimatePurchaseContractTermsSchema = zod_1.z.object({
279
447
  index: zod_1.z.array(zod_1.z.number().int().min(0).optional()),
@@ -287,11 +455,41 @@ const EstimatePurchaseBodySchema = zod_1.z.looseObject({
287
455
  customer_id: zod_1.z.string().max(50).optional(),
288
456
  customer: EstimatePurchaseCustomerSchema.optional(),
289
457
  billing_address: EstimatePurchaseBillingAddressSchema.optional(),
290
- purchase_items: EstimatePurchasePurchaseItemsSchema.optional(),
291
- item_tiers: EstimatePurchaseItemTiersSchema.optional(),
292
- shipping_addresses: EstimatePurchaseShippingAddressesSchema.optional(),
293
- discounts: EstimatePurchaseDiscountsSchema.optional(),
294
- subscription_info: EstimatePurchaseSubscriptionInfoSchema.optional(),
295
- contract_terms: EstimatePurchaseContractTermsSchema.optional(),
458
+ purchase_items: zod_1.z
459
+ .union([
460
+ zod_1.z.array(EstimatePurchasePurchaseItemsItemSchema.optional()),
461
+ EstimatePurchasePurchaseItemsSchema,
462
+ ])
463
+ .optional(),
464
+ item_tiers: zod_1.z
465
+ .union([
466
+ zod_1.z.array(EstimatePurchaseItemTiersItemSchema.optional()),
467
+ EstimatePurchaseItemTiersSchema,
468
+ ])
469
+ .optional(),
470
+ shipping_addresses: zod_1.z
471
+ .union([
472
+ zod_1.z.array(EstimatePurchaseShippingAddressesItemSchema.optional()),
473
+ EstimatePurchaseShippingAddressesSchema,
474
+ ])
475
+ .optional(),
476
+ discounts: zod_1.z
477
+ .union([
478
+ zod_1.z.array(EstimatePurchaseDiscountsItemSchema.optional()),
479
+ EstimatePurchaseDiscountsSchema,
480
+ ])
481
+ .optional(),
482
+ subscription_info: zod_1.z
483
+ .union([
484
+ zod_1.z.array(EstimatePurchaseSubscriptionInfoItemSchema.optional()),
485
+ EstimatePurchaseSubscriptionInfoSchema,
486
+ ])
487
+ .optional(),
488
+ contract_terms: zod_1.z
489
+ .union([
490
+ zod_1.z.array(EstimatePurchaseContractTermsItemSchema.optional()),
491
+ EstimatePurchaseContractTermsSchema,
492
+ ])
493
+ .optional(),
296
494
  });
297
495
  exports.EstimatePurchaseBodySchema = EstimatePurchaseBodySchema;