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
@@ -6,6 +6,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.InvoiceNowEstimateUnbilledChargeBodySchema = exports.ListUnbilledChargeBodySchema = exports.InvoiceUnbilledChargesUnbilledChargeBodySchema = exports.CreateUnbilledChargeBodySchema = exports.CreateUnbilledChargeUnbilledChargeBodySchema = void 0;
7
7
  const zod_1 = require("zod");
8
8
  //UnbilledCharge.createUnbilledCharge
9
+ const CreateUnbilledChargeUnbilledChargeAddonsItemSchema = zod_1.z.object({
10
+ id: zod_1.z.string().max(100).optional(),
11
+ quantity: zod_1.z.number().int().min(1).optional(),
12
+ unit_price: zod_1.z.number().int().min(0).optional(),
13
+ quantity_in_decimal: zod_1.z.string().max(33).optional(),
14
+ unit_price_in_decimal: zod_1.z.string().max(39).optional(),
15
+ date_from: zod_1.z.number().int().optional(),
16
+ date_to: zod_1.z.number().int().optional(),
17
+ });
9
18
  const CreateUnbilledChargeUnbilledChargeAddonsSchema = zod_1.z.object({
10
19
  id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
11
20
  quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
@@ -15,6 +24,23 @@ const CreateUnbilledChargeUnbilledChargeAddonsSchema = zod_1.z.object({
15
24
  date_from: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
16
25
  date_to: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
17
26
  });
27
+ const CreateUnbilledChargeUnbilledChargeChargesItemSchema = zod_1.z.object({
28
+ amount: zod_1.z.number().int().min(1).optional(),
29
+ amount_in_decimal: zod_1.z.string().max(39).optional(),
30
+ description: zod_1.z.string().max(250).optional(),
31
+ taxable: zod_1.z.boolean().default(true).optional(),
32
+ tax_profile_id: zod_1.z.string().max(50).optional(),
33
+ avalara_tax_code: zod_1.z.string().max(50).optional(),
34
+ hsn_code: zod_1.z.string().max(50).optional(),
35
+ taxjar_product_code: zod_1.z.string().max(50).optional(),
36
+ avalara_sale_type: zod_1.z
37
+ .enum(['wholesale', 'retail', 'consumed', 'vendor_use'])
38
+ .optional(),
39
+ avalara_transaction_type: zod_1.z.number().int().optional(),
40
+ avalara_service_type: zod_1.z.number().int().optional(),
41
+ date_from: zod_1.z.number().int().optional(),
42
+ date_to: zod_1.z.number().int().optional(),
43
+ });
18
44
  const CreateUnbilledChargeUnbilledChargeChargesSchema = zod_1.z.object({
19
45
  amount: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
20
46
  amount_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
@@ -32,6 +58,11 @@ const CreateUnbilledChargeUnbilledChargeChargesSchema = zod_1.z.object({
32
58
  date_from: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
33
59
  date_to: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
34
60
  });
61
+ const CreateUnbilledChargeUnbilledChargeTaxProvidersFieldsItemSchema = zod_1.z.object({
62
+ provider_name: zod_1.z.string().max(50).optional(),
63
+ field_id: zod_1.z.string().max(50).optional(),
64
+ field_value: zod_1.z.string().max(50).optional(),
65
+ });
35
66
  const CreateUnbilledChargeUnbilledChargeTaxProvidersFieldsSchema = zod_1.z.object({
36
67
  provider_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
37
68
  field_id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
@@ -40,12 +71,36 @@ const CreateUnbilledChargeUnbilledChargeTaxProvidersFieldsSchema = zod_1.z.objec
40
71
  const CreateUnbilledChargeUnbilledChargeBodySchema = zod_1.z.looseObject({
41
72
  subscription_id: zod_1.z.string().max(50),
42
73
  currency_code: zod_1.z.string().max(3).optional(),
43
- addons: CreateUnbilledChargeUnbilledChargeAddonsSchema.optional(),
44
- charges: CreateUnbilledChargeUnbilledChargeChargesSchema.optional(),
45
- tax_providers_fields: CreateUnbilledChargeUnbilledChargeTaxProvidersFieldsSchema.optional(),
74
+ addons: zod_1.z
75
+ .union([
76
+ zod_1.z.array(CreateUnbilledChargeUnbilledChargeAddonsItemSchema.optional()),
77
+ CreateUnbilledChargeUnbilledChargeAddonsSchema,
78
+ ])
79
+ .optional(),
80
+ charges: zod_1.z
81
+ .union([
82
+ zod_1.z.array(CreateUnbilledChargeUnbilledChargeChargesItemSchema.optional()),
83
+ CreateUnbilledChargeUnbilledChargeChargesSchema,
84
+ ])
85
+ .optional(),
86
+ tax_providers_fields: zod_1.z
87
+ .union([
88
+ zod_1.z.array(CreateUnbilledChargeUnbilledChargeTaxProvidersFieldsItemSchema.optional()),
89
+ CreateUnbilledChargeUnbilledChargeTaxProvidersFieldsSchema,
90
+ ])
91
+ .optional(),
46
92
  });
47
93
  exports.CreateUnbilledChargeUnbilledChargeBodySchema = CreateUnbilledChargeUnbilledChargeBodySchema;
48
94
  //UnbilledCharge.create
95
+ const CreateUnbilledChargeItemPricesItemSchema = zod_1.z.object({
96
+ item_price_id: zod_1.z.string().max(100).optional(),
97
+ quantity: zod_1.z.number().int().min(1).optional(),
98
+ quantity_in_decimal: zod_1.z.string().max(33).optional(),
99
+ unit_price: zod_1.z.number().int().min(0).optional(),
100
+ unit_price_in_decimal: zod_1.z.string().max(39).optional(),
101
+ date_from: zod_1.z.number().int().optional(),
102
+ date_to: zod_1.z.number().int().optional(),
103
+ });
49
104
  const CreateUnbilledChargeItemPricesSchema = zod_1.z.object({
50
105
  item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
51
106
  quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
@@ -55,6 +110,17 @@ const CreateUnbilledChargeItemPricesSchema = zod_1.z.object({
55
110
  date_from: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
56
111
  date_to: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
57
112
  });
113
+ const CreateUnbilledChargeItemTiersItemSchema = zod_1.z.object({
114
+ item_price_id: zod_1.z.string().max(100).optional(),
115
+ starting_unit: zod_1.z.number().int().min(1).optional(),
116
+ ending_unit: zod_1.z.number().int().optional(),
117
+ price: zod_1.z.number().int().min(0).optional(),
118
+ starting_unit_in_decimal: zod_1.z.string().max(33).optional(),
119
+ ending_unit_in_decimal: zod_1.z.string().max(33).optional(),
120
+ price_in_decimal: zod_1.z.string().max(39).optional(),
121
+ pricing_type: zod_1.z.enum(['per_unit', 'flat_fee', 'package']).optional(),
122
+ package_size: zod_1.z.number().int().min(1).optional(),
123
+ });
58
124
  const CreateUnbilledChargeItemTiersSchema = zod_1.z.object({
59
125
  item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
60
126
  starting_unit: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
@@ -68,6 +134,23 @@ const CreateUnbilledChargeItemTiersSchema = zod_1.z.object({
68
134
  .optional(),
69
135
  package_size: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
70
136
  });
137
+ const CreateUnbilledChargeChargesItemSchema = zod_1.z.object({
138
+ amount: zod_1.z.number().int().min(1).optional(),
139
+ amount_in_decimal: zod_1.z.string().max(39).optional(),
140
+ description: zod_1.z.string().max(250).optional(),
141
+ taxable: zod_1.z.boolean().default(true).optional(),
142
+ tax_profile_id: zod_1.z.string().max(50).optional(),
143
+ avalara_tax_code: zod_1.z.string().max(50).optional(),
144
+ hsn_code: zod_1.z.string().max(50).optional(),
145
+ taxjar_product_code: zod_1.z.string().max(50).optional(),
146
+ avalara_sale_type: zod_1.z
147
+ .enum(['wholesale', 'retail', 'consumed', 'vendor_use'])
148
+ .optional(),
149
+ avalara_transaction_type: zod_1.z.number().int().optional(),
150
+ avalara_service_type: zod_1.z.number().int().optional(),
151
+ date_from: zod_1.z.number().int().optional(),
152
+ date_to: zod_1.z.number().int().optional(),
153
+ });
71
154
  const CreateUnbilledChargeChargesSchema = zod_1.z.object({
72
155
  amount: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
73
156
  amount_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
@@ -85,6 +168,11 @@ const CreateUnbilledChargeChargesSchema = zod_1.z.object({
85
168
  date_from: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
86
169
  date_to: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
87
170
  });
171
+ const CreateUnbilledChargeTaxProvidersFieldsItemSchema = zod_1.z.object({
172
+ provider_name: zod_1.z.string().max(50).optional(),
173
+ field_id: zod_1.z.string().max(50).optional(),
174
+ field_value: zod_1.z.string().max(50).optional(),
175
+ });
88
176
  const CreateUnbilledChargeTaxProvidersFieldsSchema = zod_1.z.object({
89
177
  provider_name: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
90
178
  field_id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
@@ -93,10 +181,30 @@ const CreateUnbilledChargeTaxProvidersFieldsSchema = zod_1.z.object({
93
181
  const CreateUnbilledChargeBodySchema = zod_1.z.looseObject({
94
182
  subscription_id: zod_1.z.string().max(50),
95
183
  currency_code: zod_1.z.string().max(3).optional(),
96
- item_prices: CreateUnbilledChargeItemPricesSchema.optional(),
97
- item_tiers: CreateUnbilledChargeItemTiersSchema.optional(),
98
- charges: CreateUnbilledChargeChargesSchema.optional(),
99
- tax_providers_fields: CreateUnbilledChargeTaxProvidersFieldsSchema.optional(),
184
+ item_prices: zod_1.z
185
+ .union([
186
+ zod_1.z.array(CreateUnbilledChargeItemPricesItemSchema.optional()),
187
+ CreateUnbilledChargeItemPricesSchema,
188
+ ])
189
+ .optional(),
190
+ item_tiers: zod_1.z
191
+ .union([
192
+ zod_1.z.array(CreateUnbilledChargeItemTiersItemSchema.optional()),
193
+ CreateUnbilledChargeItemTiersSchema,
194
+ ])
195
+ .optional(),
196
+ charges: zod_1.z
197
+ .union([
198
+ zod_1.z.array(CreateUnbilledChargeChargesItemSchema.optional()),
199
+ CreateUnbilledChargeChargesSchema,
200
+ ])
201
+ .optional(),
202
+ tax_providers_fields: zod_1.z
203
+ .union([
204
+ zod_1.z.array(CreateUnbilledChargeTaxProvidersFieldsItemSchema.optional()),
205
+ CreateUnbilledChargeTaxProvidersFieldsSchema,
206
+ ])
207
+ .optional(),
100
208
  });
101
209
  exports.CreateUnbilledChargeBodySchema = CreateUnbilledChargeBodySchema;
102
210
  //UnbilledCharge.invoiceUnbilledCharges
@@ -110,17 +218,37 @@ const ListUnbilledChargeSubscriptionIdSchema = zod_1.z.object({
110
218
  is: zod_1.z.string().min(1).optional(),
111
219
  is_not: zod_1.z.string().min(1).optional(),
112
220
  starts_with: zod_1.z.string().min(1).optional(),
113
- is_present: zod_1.z.enum(['true', 'false']).optional(),
114
- in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
115
- not_in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
221
+ is_present: zod_1.z.union([zod_1.z.boolean(), zod_1.z.enum(['true', 'false'])]).optional(),
222
+ in: zod_1.z
223
+ .union([
224
+ zod_1.z.array(zod_1.z.string().optional()),
225
+ zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
226
+ ])
227
+ .optional(),
228
+ not_in: zod_1.z
229
+ .union([
230
+ zod_1.z.array(zod_1.z.string().optional()),
231
+ zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
232
+ ])
233
+ .optional(),
116
234
  });
117
235
  const ListUnbilledChargeCustomerIdSchema = zod_1.z.object({
118
236
  is: zod_1.z.string().min(1).optional(),
119
237
  is_not: zod_1.z.string().min(1).optional(),
120
238
  starts_with: zod_1.z.string().min(1).optional(),
121
- is_present: zod_1.z.enum(['true', 'false']).optional(),
122
- in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
123
- not_in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
239
+ is_present: zod_1.z.union([zod_1.z.boolean(), zod_1.z.enum(['true', 'false'])]).optional(),
240
+ in: zod_1.z
241
+ .union([
242
+ zod_1.z.array(zod_1.z.string().optional()),
243
+ zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
244
+ ])
245
+ .optional(),
246
+ not_in: zod_1.z
247
+ .union([
248
+ zod_1.z.array(zod_1.z.string().optional()),
249
+ zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
250
+ ])
251
+ .optional(),
124
252
  });
125
253
  const ListUnbilledChargeBodySchema = zod_1.z.looseObject({
126
254
  limit: zod_1.z.number().int().min(1).max(100).optional(),
@@ -37,16 +37,38 @@ const ListUsageSubscriptionIdSchema = zod_1.z.object({
37
37
  starts_with: zod_1.z.string().min(1).optional(),
38
38
  });
39
39
  const ListUsageUsageDateSchema = zod_1.z.object({
40
- after: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
41
- before: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
42
- on: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
43
- between: zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
40
+ after: zod_1.z
41
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
42
+ .optional(),
43
+ before: zod_1.z
44
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
45
+ .optional(),
46
+ on: zod_1.z
47
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
48
+ .optional(),
49
+ between: zod_1.z
50
+ .union([
51
+ zod_1.z.array(zod_1.z.number().int().optional()).min(2).max(2),
52
+ zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
53
+ ])
54
+ .optional(),
44
55
  });
45
56
  const ListUsageUpdatedAtSchema = zod_1.z.object({
46
- after: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
47
- before: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
48
- on: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
49
- between: zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
57
+ after: zod_1.z
58
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
59
+ .optional(),
60
+ before: zod_1.z
61
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
62
+ .optional(),
63
+ on: zod_1.z
64
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
65
+ .optional(),
66
+ between: zod_1.z
67
+ .union([
68
+ zod_1.z.array(zod_1.z.number().int().optional()).min(2).max(2),
69
+ zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
70
+ ])
71
+ .optional(),
50
72
  });
51
73
  const ListUsageItemPriceIdSchema = zod_1.z.object({
52
74
  is: zod_1.z.string().min(1).optional(),
@@ -57,13 +79,23 @@ const ListUsageInvoiceIdSchema = zod_1.z.object({
57
79
  is: zod_1.z.string().min(1).optional(),
58
80
  is_not: zod_1.z.string().min(1).optional(),
59
81
  starts_with: zod_1.z.string().min(1).optional(),
60
- is_present: zod_1.z.enum(['true', 'false']).optional(),
82
+ is_present: zod_1.z.union([zod_1.z.boolean(), zod_1.z.enum(['true', 'false'])]).optional(),
61
83
  });
62
84
  const ListUsageSourceSchema = zod_1.z.object({
63
85
  is: zod_1.z.enum(['admin_console', 'api', 'bulk_operation']).optional(),
64
86
  is_not: zod_1.z.enum(['admin_console', 'api', 'bulk_operation']).optional(),
65
- in: zod_1.z.enum(['admin_console', 'api', 'bulk_operation']).optional(),
66
- not_in: zod_1.z.enum(['admin_console', 'api', 'bulk_operation']).optional(),
87
+ in: zod_1.z
88
+ .union([
89
+ zod_1.z.array(zod_1.z.enum(['admin_console', 'api', 'bulk_operation']).optional()),
90
+ zod_1.z.enum(['admin_console', 'api', 'bulk_operation']),
91
+ ])
92
+ .optional(),
93
+ not_in: zod_1.z
94
+ .union([
95
+ zod_1.z.array(zod_1.z.enum(['admin_console', 'api', 'bulk_operation']).optional()),
96
+ zod_1.z.enum(['admin_console', 'api', 'bulk_operation']),
97
+ ])
98
+ .optional(),
67
99
  });
68
100
  const ListUsageSortBySchema = zod_1.z.looseObject({
69
101
  asc: zod_1.z.enum(['usage_date', 'updated_at']).optional(),
@@ -86,8 +118,24 @@ exports.ListUsageBodySchema = ListUsageBodySchema;
86
118
  const PdfUsageInvoiceSchema = zod_1.z.object({
87
119
  id: zod_1.z.string().max(50),
88
120
  });
121
+ const PdfUsageGroupByItemSchema = zod_1.z.object({
122
+ feature_id: zod_1.z.string().max(100).optional(),
123
+ attributes: zod_1.z.array(zod_1.z.string().optional()).optional(),
124
+ window_size: zod_1.z.enum(['day', 'none']).optional(),
125
+ });
126
+ const PdfUsageGroupBySchema = zod_1.z.object({
127
+ feature_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
128
+ attributes: zod_1.z.array(zod_1.z.array(zod_1.z.string().optional()).optional()).optional(),
129
+ window_size: zod_1.z.array(zod_1.z.enum(['day', 'none']).optional()).optional(),
130
+ });
89
131
  const PdfUsageBodySchema = zod_1.z.looseObject({
90
132
  disposition_type: zod_1.z.enum(['attachment', 'inline']).optional(),
91
133
  invoice: PdfUsageInvoiceSchema.optional(),
134
+ group_by: zod_1.z
135
+ .union([
136
+ zod_1.z.array(PdfUsageGroupByItemSchema.optional()),
137
+ PdfUsageGroupBySchema,
138
+ ])
139
+ .optional(),
92
140
  });
93
141
  exports.PdfUsageBodySchema = PdfUsageBodySchema;
@@ -15,6 +15,13 @@ const CreateUsageEventBodySchema = zod_1.z.looseObject({
15
15
  });
16
16
  exports.CreateUsageEventBodySchema = CreateUsageEventBodySchema;
17
17
  //UsageEvent.batchIngest
18
+ const BatchIngestUsageEventPropertiesSchema = zod_1.z.looseObject({});
19
+ const BatchIngestUsageEventEventsItemSchema = zod_1.z.object({
20
+ deduplication_id: zod_1.z.string().max(36),
21
+ subscription_id: zod_1.z.string().max(50),
22
+ usage_timestamp: zod_1.z.number().int(),
23
+ properties: BatchIngestUsageEventPropertiesSchema,
24
+ });
18
25
  const BatchIngestUsageEventPropertiesItemSchema = zod_1.z.looseObject({});
19
26
  const BatchIngestUsageEventEventsSchema = zod_1.z.object({
20
27
  deduplication_id: zod_1.z.array(zod_1.z.string().max(36).optional()),
@@ -23,6 +30,11 @@ const BatchIngestUsageEventEventsSchema = zod_1.z.object({
23
30
  properties: zod_1.z.array(BatchIngestUsageEventPropertiesItemSchema.optional()),
24
31
  });
25
32
  const BatchIngestUsageEventBodySchema = zod_1.z.looseObject({
26
- events: BatchIngestUsageEventEventsSchema.optional(),
33
+ events: zod_1.z
34
+ .union([
35
+ zod_1.z.array(BatchIngestUsageEventEventsItemSchema.optional()),
36
+ BatchIngestUsageEventEventsSchema,
37
+ ])
38
+ .optional(),
27
39
  });
28
40
  exports.BatchIngestUsageEventBodySchema = BatchIngestUsageEventBodySchema;
@@ -13,5 +13,6 @@ const RetrieveUsageSummaryForSubscriptionUsageSummaryBodySchema = zod_1.z.looseO
13
13
  window_size: zod_1.z.enum(['month', 'week', 'day', 'hour', 'minute']).optional(),
14
14
  timeframe_start: zod_1.z.number().int().optional(),
15
15
  timeframe_end: zod_1.z.number().int().optional(),
16
+ group_by: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
16
17
  });
17
18
  exports.RetrieveUsageSummaryForSubscriptionUsageSummaryBodySchema = RetrieveUsageSummaryForSubscriptionUsageSummaryBodySchema;
@@ -46,20 +46,52 @@ const ListVirtualBankAccountCustomerIdSchema = zod_1.z.object({
46
46
  is: zod_1.z.string().min(1).optional(),
47
47
  is_not: zod_1.z.string().min(1).optional(),
48
48
  starts_with: zod_1.z.string().min(1).optional(),
49
- in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
50
- not_in: zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
49
+ in: zod_1.z
50
+ .union([
51
+ zod_1.z.array(zod_1.z.string().optional()),
52
+ zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
53
+ ])
54
+ .optional(),
55
+ not_in: zod_1.z
56
+ .union([
57
+ zod_1.z.array(zod_1.z.string().optional()),
58
+ zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
59
+ ])
60
+ .optional(),
51
61
  });
52
62
  const ListVirtualBankAccountUpdatedAtSchema = zod_1.z.object({
53
- after: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
54
- before: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
55
- on: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
56
- between: zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
63
+ after: zod_1.z
64
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
65
+ .optional(),
66
+ before: zod_1.z
67
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
68
+ .optional(),
69
+ on: zod_1.z
70
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
71
+ .optional(),
72
+ between: zod_1.z
73
+ .union([
74
+ zod_1.z.array(zod_1.z.number().int().optional()).min(2).max(2),
75
+ zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
76
+ ])
77
+ .optional(),
57
78
  });
58
79
  const ListVirtualBankAccountCreatedAtSchema = zod_1.z.object({
59
- after: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
60
- before: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
61
- on: zod_1.z.string().regex(RegExp('^\\d{10}$')).optional(),
62
- between: zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
80
+ after: zod_1.z
81
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
82
+ .optional(),
83
+ before: zod_1.z
84
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
85
+ .optional(),
86
+ on: zod_1.z
87
+ .union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
88
+ .optional(),
89
+ between: zod_1.z
90
+ .union([
91
+ zod_1.z.array(zod_1.z.number().int().optional()).min(2).max(2),
92
+ zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
93
+ ])
94
+ .optional(),
63
95
  });
64
96
  const ListVirtualBankAccountBodySchema = zod_1.z.looseObject({
65
97
  limit: zod_1.z.number().int().min(1).max(100).optional(),
@@ -85,6 +85,7 @@ const CreateWebhookEndpointBodySchema = zod_1.z.looseObject({
85
85
  'payment_schedules_updated',
86
86
  'payment_schedule_scheme_created',
87
87
  'payment_schedule_scheme_deleted',
88
+ 'payment_schedules_cancelled',
88
89
  'subscription_renewal_reminder',
89
90
  'add_usages_reminder',
90
91
  'payment_due_reminder',
@@ -95,6 +96,7 @@ const CreateWebhookEndpointBodySchema = zod_1.z.looseObject({
95
96
  'payment_failed',
96
97
  'dunning_updated',
97
98
  'payment_refunded',
99
+ 'refund_failed',
98
100
  'payment_initiated',
99
101
  'refund_initiated',
100
102
  'netd_payment_due_reminder',
@@ -185,6 +187,8 @@ const CreateWebhookEndpointBodySchema = zod_1.z.looseObject({
185
187
  'customer_business_entity_changed',
186
188
  'subscription_business_entity_changed',
187
189
  'payment_source_business_entity_changed',
190
+ 'organization_details_created',
191
+ 'organization_details_updated',
188
192
  'purchase_created',
189
193
  'voucher_created',
190
194
  'voucher_expired',
@@ -246,6 +250,9 @@ const CreateWebhookEndpointBodySchema = zod_1.z.looseObject({
246
250
  'alert_status_changed',
247
251
  'omnichannel_subscription_item_updated',
248
252
  'omnichannel_subscription_item_recovered',
253
+ 'price_ramp_created',
254
+ 'price_ramp_updated',
255
+ 'price_ramp_deleted',
249
256
  'omnichannel_subscription_item_mrr_updated',
250
257
  'ledger_account_balance_updated',
251
258
  'grant_blocks_created',
@@ -260,12 +267,29 @@ const CreateWebhookEndpointBodySchema = zod_1.z.looseObject({
260
267
  'vault_token_created',
261
268
  'vault_token_updated',
262
269
  'vault_token_deleted',
263
- 'business_rules_applied',
270
+ 'chargeback_initiated',
271
+ 'chargeback_won',
272
+ 'chargeback_lost',
264
273
  'business_ruleset_created',
265
274
  'business_ruleset_updated',
266
275
  'business_ruleset_activated',
267
276
  'business_ruleset_deactivated',
268
277
  'business_ruleset_deleted',
278
+ 'collections_reminder_sequence_created',
279
+ 'collections_reminder_sequence_paused',
280
+ 'collections_reminder_sequence_resumed',
281
+ 'collections_reminder_sequence_completed',
282
+ 'collections_payment_promise_created',
283
+ 'collections_payment_promise_updated',
284
+ 'collections_payment_promise_fulfilled',
285
+ 'collections_payment_promise_cancelled',
286
+ 'collections_payment_promise_broken',
287
+ 'collections_dispute_created',
288
+ 'collections_dispute_updated',
289
+ 'collections_dispute_resolved',
290
+ 'collections_dispute_withdrawn',
291
+ 'email_message_received',
292
+ 'private_note_added',
269
293
  'plan_created',
270
294
  'plan_updated',
271
295
  'plan_deleted',
@@ -354,6 +378,7 @@ const UpdateWebhookEndpointBodySchema = zod_1.z.looseObject({
354
378
  'payment_schedules_updated',
355
379
  'payment_schedule_scheme_created',
356
380
  'payment_schedule_scheme_deleted',
381
+ 'payment_schedules_cancelled',
357
382
  'subscription_renewal_reminder',
358
383
  'add_usages_reminder',
359
384
  'payment_due_reminder',
@@ -364,6 +389,7 @@ const UpdateWebhookEndpointBodySchema = zod_1.z.looseObject({
364
389
  'payment_failed',
365
390
  'dunning_updated',
366
391
  'payment_refunded',
392
+ 'refund_failed',
367
393
  'payment_initiated',
368
394
  'refund_initiated',
369
395
  'netd_payment_due_reminder',
@@ -454,6 +480,8 @@ const UpdateWebhookEndpointBodySchema = zod_1.z.looseObject({
454
480
  'customer_business_entity_changed',
455
481
  'subscription_business_entity_changed',
456
482
  'payment_source_business_entity_changed',
483
+ 'organization_details_created',
484
+ 'organization_details_updated',
457
485
  'purchase_created',
458
486
  'voucher_created',
459
487
  'voucher_expired',
@@ -515,6 +543,9 @@ const UpdateWebhookEndpointBodySchema = zod_1.z.looseObject({
515
543
  'alert_status_changed',
516
544
  'omnichannel_subscription_item_updated',
517
545
  'omnichannel_subscription_item_recovered',
546
+ 'price_ramp_created',
547
+ 'price_ramp_updated',
548
+ 'price_ramp_deleted',
518
549
  'omnichannel_subscription_item_mrr_updated',
519
550
  'ledger_account_balance_updated',
520
551
  'grant_blocks_created',
@@ -529,12 +560,29 @@ const UpdateWebhookEndpointBodySchema = zod_1.z.looseObject({
529
560
  'vault_token_created',
530
561
  'vault_token_updated',
531
562
  'vault_token_deleted',
532
- 'business_rules_applied',
563
+ 'chargeback_initiated',
564
+ 'chargeback_won',
565
+ 'chargeback_lost',
533
566
  'business_ruleset_created',
534
567
  'business_ruleset_updated',
535
568
  'business_ruleset_activated',
536
569
  'business_ruleset_deactivated',
537
570
  'business_ruleset_deleted',
571
+ 'collections_reminder_sequence_created',
572
+ 'collections_reminder_sequence_paused',
573
+ 'collections_reminder_sequence_resumed',
574
+ 'collections_reminder_sequence_completed',
575
+ 'collections_payment_promise_created',
576
+ 'collections_payment_promise_updated',
577
+ 'collections_payment_promise_fulfilled',
578
+ 'collections_payment_promise_cancelled',
579
+ 'collections_payment_promise_broken',
580
+ 'collections_dispute_created',
581
+ 'collections_dispute_updated',
582
+ 'collections_dispute_resolved',
583
+ 'collections_dispute_withdrawn',
584
+ 'email_message_received',
585
+ 'private_note_added',
538
586
  'plan_created',
539
587
  'plan_updated',
540
588
  'plan_deleted',
@@ -8,7 +8,7 @@ export const Environment = {
8
8
  hostSuffix: '.chargebee.com',
9
9
  apiPath: '/api/v2',
10
10
  timeout: DEFAULT_TIME_OUT,
11
- clientVersion: 'v3.34.0',
11
+ clientVersion: 'v3.36.0',
12
12
  port: DEFAULT_PORT,
13
13
  timemachineWaitInMillis: DEFAULT_TIME_MACHINE_WAIT,
14
14
  exportWaitInMillis: DEFAULT_EXPORT_WAIT,