chargebee 3.35.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 (152) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/cjs/environment.js +1 -1
  3. package/cjs/resources/api_endpoints.js +56 -0
  4. package/cjs/resources/webhook/eventType.js +2 -0
  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 +16 -5
  10. package/cjs/schema/business_rule.schema.js +2 -2
  11. package/cjs/schema/business_ruleset.schema.js +2 -2
  12. package/cjs/schema/comment.schema.js +15 -4
  13. package/cjs/schema/coupon.schema.js +218 -37
  14. package/cjs/schema/coupon_code.schema.js +36 -6
  15. package/cjs/schema/coupon_set.schema.js +108 -27
  16. package/cjs/schema/credit_note.schema.js +496 -105
  17. package/cjs/schema/credit_unit.schema.js +12 -2
  18. package/cjs/schema/customer.schema.js +212 -62
  19. package/cjs/schema/differential_price.schema.js +100 -12
  20. package/cjs/schema/dispute.schema.js +125 -33
  21. package/cjs/schema/einvoice.schema.js +27 -6
  22. package/cjs/schema/email_log.schema.js +15 -4
  23. package/cjs/schema/entitlement.schema.js +33 -4
  24. package/cjs/schema/entitlement_override.schema.js +17 -1
  25. package/cjs/schema/estimate.schema.js +581 -36
  26. package/cjs/schema/event.schema.js +1282 -633
  27. package/cjs/schema/export.schema.js +4459 -1412
  28. package/cjs/schema/feature.schema.js +73 -11
  29. package/cjs/schema/gateway_request_log.schema.js +309 -0
  30. package/cjs/schema/gateway_webhook_log.schema.js +257 -0
  31. package/cjs/schema/gift.schema.js +51 -5
  32. package/cjs/schema/grant_block.schema.js +45 -12
  33. package/cjs/schema/hosted_page.schema.js +562 -66
  34. package/cjs/schema/index.js +3 -0
  35. package/cjs/schema/invoice.schema.js +821 -121
  36. package/cjs/schema/item.schema.js +151 -28
  37. package/cjs/schema/item_entitlement.schema.js +23 -2
  38. package/cjs/schema/item_family.schema.js +29 -8
  39. package/cjs/schema/item_price.schema.js +263 -48
  40. package/cjs/schema/ledger_operation.schema.js +42 -15
  41. package/cjs/schema/metered_feature.schema.js +10 -1
  42. package/cjs/schema/omnichannel_one_time_order.schema.js +32 -2
  43. package/cjs/schema/omnichannel_subscription.schema.js +136 -30
  44. package/cjs/schema/order.schema.js +233 -61
  45. package/cjs/schema/organization_detail.schema.js +36 -0
  46. package/cjs/schema/payment_schedule.schema.js +39 -8
  47. package/cjs/schema/payment_schedule_scheme.schema.js +37 -7
  48. package/cjs/schema/payment_source.schema.js +360 -148
  49. package/cjs/schema/payment_voucher.schema.js +33 -5
  50. package/cjs/schema/plan.schema.js +345 -57
  51. package/cjs/schema/price_ramp.schema.js +79 -14
  52. package/cjs/schema/price_variant.schema.js +88 -18
  53. package/cjs/schema/pricing_page_session.schema.js +36 -2
  54. package/cjs/schema/promotional_credit.schema.js +27 -6
  55. package/cjs/schema/purchase.schema.js +204 -12
  56. package/cjs/schema/quote.schema.js +901 -81
  57. package/cjs/schema/quote_entitlement.schema.js +6 -2
  58. package/cjs/schema/ramp.schema.js +238 -24
  59. package/cjs/schema/site_migration_detail.schema.js +50 -16
  60. package/cjs/schema/subscription.schema.js +998 -169
  61. package/cjs/schema/subscription_entitlement.schema.js +9 -1
  62. package/cjs/schema/transaction.schema.js +780 -342
  63. package/cjs/schema/unbilled_charge.schema.js +141 -13
  64. package/cjs/schema/usage.schema.js +55 -12
  65. package/cjs/schema/usage_event.schema.js +13 -1
  66. package/cjs/schema/virtual_bank_account.schema.js +42 -10
  67. package/cjs/schema/webhook_endpoint.schema.js +4 -0
  68. package/esm/environment.js +1 -1
  69. package/esm/resources/api_endpoints.js +56 -0
  70. package/esm/resources/webhook/eventType.js +2 -0
  71. package/esm/schema/addon.schema.js +221 -40
  72. package/esm/schema/alert.schema.js +17 -2
  73. package/esm/schema/alert_status.schema.js +6 -1
  74. package/esm/schema/attached_item.schema.js +101 -26
  75. package/esm/schema/business_entity.schema.js +16 -5
  76. package/esm/schema/business_rule.schema.js +2 -2
  77. package/esm/schema/business_ruleset.schema.js +2 -2
  78. package/esm/schema/comment.schema.js +15 -4
  79. package/esm/schema/coupon.schema.js +218 -37
  80. package/esm/schema/coupon_code.schema.js +36 -6
  81. package/esm/schema/coupon_set.schema.js +108 -27
  82. package/esm/schema/credit_note.schema.js +496 -105
  83. package/esm/schema/credit_unit.schema.js +12 -2
  84. package/esm/schema/customer.schema.js +212 -62
  85. package/esm/schema/differential_price.schema.js +100 -12
  86. package/esm/schema/dispute.schema.js +125 -33
  87. package/esm/schema/einvoice.schema.js +27 -6
  88. package/esm/schema/email_log.schema.js +15 -4
  89. package/esm/schema/entitlement.schema.js +33 -4
  90. package/esm/schema/entitlement_override.schema.js +17 -1
  91. package/esm/schema/estimate.schema.js +581 -36
  92. package/esm/schema/event.schema.js +1282 -633
  93. package/esm/schema/export.schema.js +4459 -1412
  94. package/esm/schema/feature.schema.js +73 -11
  95. package/esm/schema/gateway_request_log.schema.js +306 -0
  96. package/esm/schema/gateway_webhook_log.schema.js +254 -0
  97. package/esm/schema/gift.schema.js +51 -5
  98. package/esm/schema/grant_block.schema.js +45 -12
  99. package/esm/schema/hosted_page.schema.js +562 -66
  100. package/esm/schema/index.js +3 -0
  101. package/esm/schema/invoice.schema.js +821 -121
  102. package/esm/schema/item.schema.js +151 -28
  103. package/esm/schema/item_entitlement.schema.js +23 -2
  104. package/esm/schema/item_family.schema.js +29 -8
  105. package/esm/schema/item_price.schema.js +263 -48
  106. package/esm/schema/ledger_operation.schema.js +42 -15
  107. package/esm/schema/metered_feature.schema.js +10 -1
  108. package/esm/schema/omnichannel_one_time_order.schema.js +32 -2
  109. package/esm/schema/omnichannel_subscription.schema.js +136 -30
  110. package/esm/schema/order.schema.js +233 -61
  111. package/esm/schema/organization_detail.schema.js +33 -0
  112. package/esm/schema/payment_schedule.schema.js +39 -8
  113. package/esm/schema/payment_schedule_scheme.schema.js +37 -7
  114. package/esm/schema/payment_source.schema.js +360 -148
  115. package/esm/schema/payment_voucher.schema.js +33 -5
  116. package/esm/schema/plan.schema.js +345 -57
  117. package/esm/schema/price_ramp.schema.js +79 -14
  118. package/esm/schema/price_variant.schema.js +88 -18
  119. package/esm/schema/pricing_page_session.schema.js +36 -2
  120. package/esm/schema/promotional_credit.schema.js +27 -6
  121. package/esm/schema/purchase.schema.js +204 -12
  122. package/esm/schema/quote.schema.js +901 -81
  123. package/esm/schema/quote_entitlement.schema.js +6 -2
  124. package/esm/schema/ramp.schema.js +238 -24
  125. package/esm/schema/site_migration_detail.schema.js +50 -16
  126. package/esm/schema/subscription.schema.js +998 -169
  127. package/esm/schema/subscription_entitlement.schema.js +9 -1
  128. package/esm/schema/transaction.schema.js +780 -342
  129. package/esm/schema/unbilled_charge.schema.js +141 -13
  130. package/esm/schema/usage.schema.js +55 -12
  131. package/esm/schema/usage_event.schema.js +13 -1
  132. package/esm/schema/virtual_bank_account.schema.js +42 -10
  133. package/esm/schema/webhook_endpoint.schema.js +4 -0
  134. package/package.json +1 -1
  135. package/types/core.d.ts +10 -6
  136. package/types/index.d.ts +8 -1
  137. package/types/resources/BillingLineItem.d.ts +10 -0
  138. package/types/resources/BillingMetadata.d.ts +9 -0
  139. package/types/resources/Content.d.ts +5 -0
  140. package/types/resources/Discount.d.ts +1 -0
  141. package/types/resources/DraftRequest.d.ts +1 -1
  142. package/types/resources/Estimate.d.ts +3 -0
  143. package/types/resources/Event.d.ts +2 -0
  144. package/types/resources/GatewayRequestLog.d.ts +82 -0
  145. package/types/resources/GatewayWebhookLog.d.ts +74 -0
  146. package/types/resources/GrantBlock.d.ts +5 -0
  147. package/types/resources/HostedPage.d.ts +18 -0
  148. package/types/resources/Invoice.d.ts +4 -0
  149. package/types/resources/OrganizationDetail.d.ts +84 -0
  150. package/types/resources/Subscription.d.ts +3 -0
  151. package/types/resources/Usage.d.ts +1 -0
  152. package/types/resources/WebhookEvent.d.ts +10 -0
@@ -3,6 +3,15 @@
3
3
  // Do not edit manually – regenerate via sdk-generator
4
4
  import { z } from 'zod';
5
5
  //UnbilledCharge.createUnbilledCharge
6
+ const CreateUnbilledChargeUnbilledChargeAddonsItemSchema = z.object({
7
+ id: z.string().max(100).optional(),
8
+ quantity: z.number().int().min(1).optional(),
9
+ unit_price: z.number().int().min(0).optional(),
10
+ quantity_in_decimal: z.string().max(33).optional(),
11
+ unit_price_in_decimal: z.string().max(39).optional(),
12
+ date_from: z.number().int().optional(),
13
+ date_to: z.number().int().optional(),
14
+ });
6
15
  const CreateUnbilledChargeUnbilledChargeAddonsSchema = z.object({
7
16
  id: z.array(z.string().max(100).optional()).optional(),
8
17
  quantity: z.array(z.number().int().min(1).optional()).optional(),
@@ -12,6 +21,23 @@ const CreateUnbilledChargeUnbilledChargeAddonsSchema = z.object({
12
21
  date_from: z.array(z.number().int().optional()).optional(),
13
22
  date_to: z.array(z.number().int().optional()).optional(),
14
23
  });
24
+ const CreateUnbilledChargeUnbilledChargeChargesItemSchema = z.object({
25
+ amount: z.number().int().min(1).optional(),
26
+ amount_in_decimal: z.string().max(39).optional(),
27
+ description: z.string().max(250).optional(),
28
+ taxable: z.boolean().default(true).optional(),
29
+ tax_profile_id: z.string().max(50).optional(),
30
+ avalara_tax_code: z.string().max(50).optional(),
31
+ hsn_code: z.string().max(50).optional(),
32
+ taxjar_product_code: z.string().max(50).optional(),
33
+ avalara_sale_type: z
34
+ .enum(['wholesale', 'retail', 'consumed', 'vendor_use'])
35
+ .optional(),
36
+ avalara_transaction_type: z.number().int().optional(),
37
+ avalara_service_type: z.number().int().optional(),
38
+ date_from: z.number().int().optional(),
39
+ date_to: z.number().int().optional(),
40
+ });
15
41
  const CreateUnbilledChargeUnbilledChargeChargesSchema = z.object({
16
42
  amount: z.array(z.number().int().min(1).optional()).optional(),
17
43
  amount_in_decimal: z.array(z.string().max(39).optional()).optional(),
@@ -29,6 +55,11 @@ const CreateUnbilledChargeUnbilledChargeChargesSchema = z.object({
29
55
  date_from: z.array(z.number().int().optional()).optional(),
30
56
  date_to: z.array(z.number().int().optional()).optional(),
31
57
  });
58
+ const CreateUnbilledChargeUnbilledChargeTaxProvidersFieldsItemSchema = z.object({
59
+ provider_name: z.string().max(50).optional(),
60
+ field_id: z.string().max(50).optional(),
61
+ field_value: z.string().max(50).optional(),
62
+ });
32
63
  const CreateUnbilledChargeUnbilledChargeTaxProvidersFieldsSchema = z.object({
33
64
  provider_name: z.array(z.string().max(50).optional()).optional(),
34
65
  field_id: z.array(z.string().max(50).optional()).optional(),
@@ -37,12 +68,36 @@ const CreateUnbilledChargeUnbilledChargeTaxProvidersFieldsSchema = z.object({
37
68
  const CreateUnbilledChargeUnbilledChargeBodySchema = z.looseObject({
38
69
  subscription_id: z.string().max(50),
39
70
  currency_code: z.string().max(3).optional(),
40
- addons: CreateUnbilledChargeUnbilledChargeAddonsSchema.optional(),
41
- charges: CreateUnbilledChargeUnbilledChargeChargesSchema.optional(),
42
- tax_providers_fields: CreateUnbilledChargeUnbilledChargeTaxProvidersFieldsSchema.optional(),
71
+ addons: z
72
+ .union([
73
+ z.array(CreateUnbilledChargeUnbilledChargeAddonsItemSchema.optional()),
74
+ CreateUnbilledChargeUnbilledChargeAddonsSchema,
75
+ ])
76
+ .optional(),
77
+ charges: z
78
+ .union([
79
+ z.array(CreateUnbilledChargeUnbilledChargeChargesItemSchema.optional()),
80
+ CreateUnbilledChargeUnbilledChargeChargesSchema,
81
+ ])
82
+ .optional(),
83
+ tax_providers_fields: z
84
+ .union([
85
+ z.array(CreateUnbilledChargeUnbilledChargeTaxProvidersFieldsItemSchema.optional()),
86
+ CreateUnbilledChargeUnbilledChargeTaxProvidersFieldsSchema,
87
+ ])
88
+ .optional(),
43
89
  });
44
90
  export { CreateUnbilledChargeUnbilledChargeBodySchema };
45
91
  //UnbilledCharge.create
92
+ const CreateUnbilledChargeItemPricesItemSchema = z.object({
93
+ item_price_id: z.string().max(100).optional(),
94
+ quantity: z.number().int().min(1).optional(),
95
+ quantity_in_decimal: z.string().max(33).optional(),
96
+ unit_price: z.number().int().min(0).optional(),
97
+ unit_price_in_decimal: z.string().max(39).optional(),
98
+ date_from: z.number().int().optional(),
99
+ date_to: z.number().int().optional(),
100
+ });
46
101
  const CreateUnbilledChargeItemPricesSchema = z.object({
47
102
  item_price_id: z.array(z.string().max(100).optional()).optional(),
48
103
  quantity: z.array(z.number().int().min(1).optional()).optional(),
@@ -52,6 +107,17 @@ const CreateUnbilledChargeItemPricesSchema = z.object({
52
107
  date_from: z.array(z.number().int().optional()).optional(),
53
108
  date_to: z.array(z.number().int().optional()).optional(),
54
109
  });
110
+ const CreateUnbilledChargeItemTiersItemSchema = z.object({
111
+ item_price_id: z.string().max(100).optional(),
112
+ starting_unit: z.number().int().min(1).optional(),
113
+ ending_unit: z.number().int().optional(),
114
+ price: z.number().int().min(0).optional(),
115
+ starting_unit_in_decimal: z.string().max(33).optional(),
116
+ ending_unit_in_decimal: z.string().max(33).optional(),
117
+ price_in_decimal: z.string().max(39).optional(),
118
+ pricing_type: z.enum(['per_unit', 'flat_fee', 'package']).optional(),
119
+ package_size: z.number().int().min(1).optional(),
120
+ });
55
121
  const CreateUnbilledChargeItemTiersSchema = z.object({
56
122
  item_price_id: z.array(z.string().max(100).optional()).optional(),
57
123
  starting_unit: z.array(z.number().int().min(1).optional()).optional(),
@@ -65,6 +131,23 @@ const CreateUnbilledChargeItemTiersSchema = z.object({
65
131
  .optional(),
66
132
  package_size: z.array(z.number().int().min(1).optional()).optional(),
67
133
  });
134
+ const CreateUnbilledChargeChargesItemSchema = z.object({
135
+ amount: z.number().int().min(1).optional(),
136
+ amount_in_decimal: z.string().max(39).optional(),
137
+ description: z.string().max(250).optional(),
138
+ taxable: z.boolean().default(true).optional(),
139
+ tax_profile_id: z.string().max(50).optional(),
140
+ avalara_tax_code: z.string().max(50).optional(),
141
+ hsn_code: z.string().max(50).optional(),
142
+ taxjar_product_code: z.string().max(50).optional(),
143
+ avalara_sale_type: z
144
+ .enum(['wholesale', 'retail', 'consumed', 'vendor_use'])
145
+ .optional(),
146
+ avalara_transaction_type: z.number().int().optional(),
147
+ avalara_service_type: z.number().int().optional(),
148
+ date_from: z.number().int().optional(),
149
+ date_to: z.number().int().optional(),
150
+ });
68
151
  const CreateUnbilledChargeChargesSchema = z.object({
69
152
  amount: z.array(z.number().int().min(1).optional()).optional(),
70
153
  amount_in_decimal: z.array(z.string().max(39).optional()).optional(),
@@ -82,6 +165,11 @@ const CreateUnbilledChargeChargesSchema = z.object({
82
165
  date_from: z.array(z.number().int().optional()).optional(),
83
166
  date_to: z.array(z.number().int().optional()).optional(),
84
167
  });
168
+ const CreateUnbilledChargeTaxProvidersFieldsItemSchema = z.object({
169
+ provider_name: z.string().max(50).optional(),
170
+ field_id: z.string().max(50).optional(),
171
+ field_value: z.string().max(50).optional(),
172
+ });
85
173
  const CreateUnbilledChargeTaxProvidersFieldsSchema = z.object({
86
174
  provider_name: z.array(z.string().max(50).optional()).optional(),
87
175
  field_id: z.array(z.string().max(50).optional()).optional(),
@@ -90,10 +178,30 @@ const CreateUnbilledChargeTaxProvidersFieldsSchema = z.object({
90
178
  const CreateUnbilledChargeBodySchema = z.looseObject({
91
179
  subscription_id: z.string().max(50),
92
180
  currency_code: z.string().max(3).optional(),
93
- item_prices: CreateUnbilledChargeItemPricesSchema.optional(),
94
- item_tiers: CreateUnbilledChargeItemTiersSchema.optional(),
95
- charges: CreateUnbilledChargeChargesSchema.optional(),
96
- tax_providers_fields: CreateUnbilledChargeTaxProvidersFieldsSchema.optional(),
181
+ item_prices: z
182
+ .union([
183
+ z.array(CreateUnbilledChargeItemPricesItemSchema.optional()),
184
+ CreateUnbilledChargeItemPricesSchema,
185
+ ])
186
+ .optional(),
187
+ item_tiers: z
188
+ .union([
189
+ z.array(CreateUnbilledChargeItemTiersItemSchema.optional()),
190
+ CreateUnbilledChargeItemTiersSchema,
191
+ ])
192
+ .optional(),
193
+ charges: z
194
+ .union([
195
+ z.array(CreateUnbilledChargeChargesItemSchema.optional()),
196
+ CreateUnbilledChargeChargesSchema,
197
+ ])
198
+ .optional(),
199
+ tax_providers_fields: z
200
+ .union([
201
+ z.array(CreateUnbilledChargeTaxProvidersFieldsItemSchema.optional()),
202
+ CreateUnbilledChargeTaxProvidersFieldsSchema,
203
+ ])
204
+ .optional(),
97
205
  });
98
206
  export { CreateUnbilledChargeBodySchema };
99
207
  //UnbilledCharge.invoiceUnbilledCharges
@@ -107,17 +215,37 @@ const ListUnbilledChargeSubscriptionIdSchema = z.object({
107
215
  is: z.string().min(1).optional(),
108
216
  is_not: z.string().min(1).optional(),
109
217
  starts_with: z.string().min(1).optional(),
110
- is_present: z.enum(['true', 'false']).optional(),
111
- in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
112
- not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
218
+ is_present: z.union([z.boolean(), z.enum(['true', 'false'])]).optional(),
219
+ in: z
220
+ .union([
221
+ z.array(z.string().optional()),
222
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
223
+ ])
224
+ .optional(),
225
+ not_in: z
226
+ .union([
227
+ z.array(z.string().optional()),
228
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
229
+ ])
230
+ .optional(),
113
231
  });
114
232
  const ListUnbilledChargeCustomerIdSchema = z.object({
115
233
  is: z.string().min(1).optional(),
116
234
  is_not: z.string().min(1).optional(),
117
235
  starts_with: z.string().min(1).optional(),
118
- is_present: z.enum(['true', 'false']).optional(),
119
- in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
120
- not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
236
+ is_present: z.union([z.boolean(), z.enum(['true', 'false'])]).optional(),
237
+ in: z
238
+ .union([
239
+ z.array(z.string().optional()),
240
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
241
+ ])
242
+ .optional(),
243
+ not_in: z
244
+ .union([
245
+ z.array(z.string().optional()),
246
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
247
+ ])
248
+ .optional(),
121
249
  });
122
250
  const ListUnbilledChargeBodySchema = z.looseObject({
123
251
  limit: z.number().int().min(1).max(100).optional(),
@@ -34,16 +34,38 @@ const ListUsageSubscriptionIdSchema = z.object({
34
34
  starts_with: z.string().min(1).optional(),
35
35
  });
36
36
  const ListUsageUsageDateSchema = z.object({
37
- after: z.string().regex(RegExp('^\\d{10}$')).optional(),
38
- before: z.string().regex(RegExp('^\\d{10}$')).optional(),
39
- on: z.string().regex(RegExp('^\\d{10}$')).optional(),
40
- between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
37
+ after: z
38
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
39
+ .optional(),
40
+ before: z
41
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
42
+ .optional(),
43
+ on: z
44
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
45
+ .optional(),
46
+ between: z
47
+ .union([
48
+ z.array(z.number().int().optional()).min(2).max(2),
49
+ z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
50
+ ])
51
+ .optional(),
41
52
  });
42
53
  const ListUsageUpdatedAtSchema = z.object({
43
- after: z.string().regex(RegExp('^\\d{10}$')).optional(),
44
- before: z.string().regex(RegExp('^\\d{10}$')).optional(),
45
- on: z.string().regex(RegExp('^\\d{10}$')).optional(),
46
- between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
54
+ after: z
55
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
56
+ .optional(),
57
+ before: z
58
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
59
+ .optional(),
60
+ on: z
61
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
62
+ .optional(),
63
+ between: z
64
+ .union([
65
+ z.array(z.number().int().optional()).min(2).max(2),
66
+ z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
67
+ ])
68
+ .optional(),
47
69
  });
48
70
  const ListUsageItemPriceIdSchema = z.object({
49
71
  is: z.string().min(1).optional(),
@@ -54,13 +76,23 @@ const ListUsageInvoiceIdSchema = z.object({
54
76
  is: z.string().min(1).optional(),
55
77
  is_not: z.string().min(1).optional(),
56
78
  starts_with: z.string().min(1).optional(),
57
- is_present: z.enum(['true', 'false']).optional(),
79
+ is_present: z.union([z.boolean(), z.enum(['true', 'false'])]).optional(),
58
80
  });
59
81
  const ListUsageSourceSchema = z.object({
60
82
  is: z.enum(['admin_console', 'api', 'bulk_operation']).optional(),
61
83
  is_not: z.enum(['admin_console', 'api', 'bulk_operation']).optional(),
62
- in: z.enum(['admin_console', 'api', 'bulk_operation']).optional(),
63
- not_in: z.enum(['admin_console', 'api', 'bulk_operation']).optional(),
84
+ in: z
85
+ .union([
86
+ z.array(z.enum(['admin_console', 'api', 'bulk_operation']).optional()),
87
+ z.enum(['admin_console', 'api', 'bulk_operation']),
88
+ ])
89
+ .optional(),
90
+ not_in: z
91
+ .union([
92
+ z.array(z.enum(['admin_console', 'api', 'bulk_operation']).optional()),
93
+ z.enum(['admin_console', 'api', 'bulk_operation']),
94
+ ])
95
+ .optional(),
64
96
  });
65
97
  const ListUsageSortBySchema = z.looseObject({
66
98
  asc: z.enum(['usage_date', 'updated_at']).optional(),
@@ -83,13 +115,24 @@ export { ListUsageBodySchema };
83
115
  const PdfUsageInvoiceSchema = z.object({
84
116
  id: z.string().max(50),
85
117
  });
118
+ const PdfUsageGroupByItemSchema = z.object({
119
+ feature_id: z.string().max(100).optional(),
120
+ attributes: z.array(z.string().optional()).optional(),
121
+ window_size: z.enum(['day', 'none']).optional(),
122
+ });
86
123
  const PdfUsageGroupBySchema = z.object({
87
124
  feature_id: z.array(z.string().max(100).optional()).optional(),
88
125
  attributes: z.array(z.array(z.string().optional()).optional()).optional(),
126
+ window_size: z.array(z.enum(['day', 'none']).optional()).optional(),
89
127
  });
90
128
  const PdfUsageBodySchema = z.looseObject({
91
129
  disposition_type: z.enum(['attachment', 'inline']).optional(),
92
130
  invoice: PdfUsageInvoiceSchema.optional(),
93
- group_by: PdfUsageGroupBySchema.optional(),
131
+ group_by: z
132
+ .union([
133
+ z.array(PdfUsageGroupByItemSchema.optional()),
134
+ PdfUsageGroupBySchema,
135
+ ])
136
+ .optional(),
94
137
  });
95
138
  export { PdfUsageBodySchema };
@@ -12,6 +12,13 @@ const CreateUsageEventBodySchema = z.looseObject({
12
12
  });
13
13
  export { CreateUsageEventBodySchema };
14
14
  //UsageEvent.batchIngest
15
+ const BatchIngestUsageEventPropertiesSchema = z.looseObject({});
16
+ const BatchIngestUsageEventEventsItemSchema = z.object({
17
+ deduplication_id: z.string().max(36),
18
+ subscription_id: z.string().max(50),
19
+ usage_timestamp: z.number().int(),
20
+ properties: BatchIngestUsageEventPropertiesSchema,
21
+ });
15
22
  const BatchIngestUsageEventPropertiesItemSchema = z.looseObject({});
16
23
  const BatchIngestUsageEventEventsSchema = z.object({
17
24
  deduplication_id: z.array(z.string().max(36).optional()),
@@ -20,6 +27,11 @@ const BatchIngestUsageEventEventsSchema = z.object({
20
27
  properties: z.array(BatchIngestUsageEventPropertiesItemSchema.optional()),
21
28
  });
22
29
  const BatchIngestUsageEventBodySchema = z.looseObject({
23
- events: BatchIngestUsageEventEventsSchema.optional(),
30
+ events: z
31
+ .union([
32
+ z.array(BatchIngestUsageEventEventsItemSchema.optional()),
33
+ BatchIngestUsageEventEventsSchema,
34
+ ])
35
+ .optional(),
24
36
  });
25
37
  export { BatchIngestUsageEventBodySchema };
@@ -43,20 +43,52 @@ const ListVirtualBankAccountCustomerIdSchema = z.object({
43
43
  is: z.string().min(1).optional(),
44
44
  is_not: z.string().min(1).optional(),
45
45
  starts_with: z.string().min(1).optional(),
46
- in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
47
- not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
46
+ in: z
47
+ .union([
48
+ z.array(z.string().optional()),
49
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
50
+ ])
51
+ .optional(),
52
+ not_in: z
53
+ .union([
54
+ z.array(z.string().optional()),
55
+ z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
56
+ ])
57
+ .optional(),
48
58
  });
49
59
  const ListVirtualBankAccountUpdatedAtSchema = z.object({
50
- after: z.string().regex(RegExp('^\\d{10}$')).optional(),
51
- before: z.string().regex(RegExp('^\\d{10}$')).optional(),
52
- on: z.string().regex(RegExp('^\\d{10}$')).optional(),
53
- between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
60
+ after: z
61
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
62
+ .optional(),
63
+ before: z
64
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
65
+ .optional(),
66
+ on: z
67
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
68
+ .optional(),
69
+ between: z
70
+ .union([
71
+ z.array(z.number().int().optional()).min(2).max(2),
72
+ z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
73
+ ])
74
+ .optional(),
54
75
  });
55
76
  const ListVirtualBankAccountCreatedAtSchema = z.object({
56
- after: z.string().regex(RegExp('^\\d{10}$')).optional(),
57
- before: z.string().regex(RegExp('^\\d{10}$')).optional(),
58
- on: z.string().regex(RegExp('^\\d{10}$')).optional(),
59
- between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
77
+ after: z
78
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
79
+ .optional(),
80
+ before: z
81
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
82
+ .optional(),
83
+ on: z
84
+ .union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
85
+ .optional(),
86
+ between: z
87
+ .union([
88
+ z.array(z.number().int().optional()).min(2).max(2),
89
+ z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
90
+ ])
91
+ .optional(),
60
92
  });
61
93
  const ListVirtualBankAccountBodySchema = z.looseObject({
62
94
  limit: z.number().int().min(1).max(100).optional(),
@@ -184,6 +184,8 @@ const CreateWebhookEndpointBodySchema = z.looseObject({
184
184
  'customer_business_entity_changed',
185
185
  'subscription_business_entity_changed',
186
186
  'payment_source_business_entity_changed',
187
+ 'organization_details_created',
188
+ 'organization_details_updated',
187
189
  'purchase_created',
188
190
  'voucher_created',
189
191
  'voucher_expired',
@@ -475,6 +477,8 @@ const UpdateWebhookEndpointBodySchema = z.looseObject({
475
477
  'customer_business_entity_changed',
476
478
  'subscription_business_entity_changed',
477
479
  'payment_source_business_entity_changed',
480
+ 'organization_details_created',
481
+ 'organization_details_updated',
478
482
  'purchase_created',
479
483
  'voucher_created',
480
484
  'voucher_expired',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chargebee",
3
- "version": "3.35.0",
3
+ "version": "3.36.0",
4
4
  "description": "A library for integrating with Chargebee.",
5
5
  "scripts": {
6
6
  "prepack": "npm ci && npm run build",
package/types/core.d.ts CHANGED
@@ -334,6 +334,8 @@ declare module 'chargebee' {
334
334
  | 'customer_business_entity_changed'
335
335
  | 'subscription_business_entity_changed'
336
336
  | 'payment_source_business_entity_changed'
337
+ | 'organization_details_created'
338
+ | 'organization_details_updated'
337
339
  | 'purchase_created'
338
340
  | 'voucher_created'
339
341
  | 'voucher_expired'
@@ -547,12 +549,6 @@ declare module 'chargebee' {
547
549
  | 'bank_transfer'
548
550
  | 'other'
549
551
  | 'custom'
550
- | 'tamara'
551
- | 'qpay'
552
- | 'blik'
553
- | 'fpx'
554
- | 'wero'
555
- | 'p24'
556
552
  | 'chargeback'
557
553
  | 'card'
558
554
  | 'amazon_payments'
@@ -608,6 +604,8 @@ declare module 'chargebee' {
608
604
  | 'promptpay'
609
605
  | 'dana'
610
606
  | 'touch_n_go'
607
+ | 'tamara'
608
+ | 'qpay'
611
609
  | 'ovo'
612
610
  | 'momo'
613
611
  | 'mercado_pago'
@@ -615,6 +613,10 @@ declare module 'chargebee' {
615
613
  | 'nupay'
616
614
  | 'picpay'
617
615
  | 'thai_qr'
616
+ | 'blik'
617
+ | 'fpx'
618
+ | 'wero'
619
+ | 'p24'
618
620
  | 'affirm_pay'
619
621
  | 'rakuten_pay';
620
622
  type PaymentMethodSavePolicyEnum = 'always' | 'ask' | 'never';
@@ -1041,6 +1043,8 @@ declare module 'chargebee' {
1041
1043
  | 'customer_business_entity_changed'
1042
1044
  | 'subscription_business_entity_changed'
1043
1045
  | 'payment_source_business_entity_changed'
1046
+ | 'organization_details_created'
1047
+ | 'organization_details_updated'
1044
1048
  | 'purchase_created'
1045
1049
  | 'voucher_created'
1046
1050
  | 'voucher_expired'
package/types/index.d.ts CHANGED
@@ -10,6 +10,8 @@
10
10
  ///<reference path='./resources/AttachedItem.d.ts' />
11
11
  ///<reference path='./resources/Attribute.d.ts' />
12
12
  ///<reference path='./resources/BillingConfiguration.d.ts' />
13
+ ///<reference path='./resources/BillingLineItem.d.ts' />
14
+ ///<reference path='./resources/BillingMetadata.d.ts' />
13
15
  ///<reference path='./resources/Brand.d.ts' />
14
16
  ///<reference path='./resources/BusinessEntity.d.ts' />
15
17
  ///<reference path='./resources/BusinessEntityTransfer.d.ts' />
@@ -59,6 +61,8 @@
59
61
  ///<reference path='./resources/FilterCondition.d.ts' />
60
62
  ///<reference path='./resources/GatewayErrorDetail.d.ts' />
61
63
  ///<reference path='./resources/GatewayPaymentMethodToken.d.ts' />
64
+ ///<reference path='./resources/GatewayRequestLog.d.ts' />
65
+ ///<reference path='./resources/GatewayWebhookLog.d.ts' />
62
66
  ///<reference path='./resources/Gift.d.ts' />
63
67
  ///<reference path='./resources/GrantBlock.d.ts' />
64
68
  ///<reference path='./resources/GroupByAttribute.d.ts' />
@@ -94,6 +98,7 @@
94
98
  ///<reference path='./resources/OmnichannelSubscriptionItemScheduledChange.d.ts' />
95
99
  ///<reference path='./resources/OmnichannelTransaction.d.ts' />
96
100
  ///<reference path='./resources/Order.d.ts' />
101
+ ///<reference path='./resources/OrganizationDetail.d.ts' />
97
102
  ///<reference path='./resources/PaymentIntent.d.ts' />
98
103
  ///<reference path='./resources/PaymentReferenceNumber.d.ts' />
99
104
  ///<reference path='./resources/PaymentSchedule.d.ts' />
@@ -326,7 +331,6 @@ declare module 'chargebee' {
326
331
  customerEntitlement: CustomerEntitlement.CustomerEntitlementResource;
327
332
  differentialPrice: DifferentialPrice.DifferentialPriceResource;
328
333
  dispute: Dispute.DisputeResource;
329
- draftRequest: DraftRequest.DraftRequestResource;
330
334
  einvoice: Einvoice.EinvoiceResource;
331
335
  emailLog: EmailLog.EmailLogResource;
332
336
  entitlement: Entitlement.EntitlementResource;
@@ -335,6 +339,8 @@ declare module 'chargebee' {
335
339
  event: Event.EventResource;
336
340
  export: Export.ExportResource;
337
341
  feature: Feature.FeatureResource;
342
+ gatewayRequestLog: GatewayRequestLog.GatewayRequestLogResource;
343
+ gatewayWebhookLog: GatewayWebhookLog.GatewayWebhookLogResource;
338
344
  gift: Gift.GiftResource;
339
345
  grantBlock: GrantBlock.GrantBlockResource;
340
346
  hostedPage: HostedPage.HostedPageResource;
@@ -355,6 +361,7 @@ declare module 'chargebee' {
355
361
  omnichannelSubscription: OmnichannelSubscription.OmnichannelSubscriptionResource;
356
362
  omnichannelSubscriptionItem: OmnichannelSubscriptionItem.OmnichannelSubscriptionItemResource;
357
363
  order: Order.OrderResource;
364
+ organizationDetail: OrganizationDetail.OrganizationDetailResource;
358
365
  paymentIntent: PaymentIntent.PaymentIntentResource;
359
366
  paymentSchedule: PaymentSchedule.PaymentScheduleResource;
360
367
  paymentScheduleScheme: PaymentScheduleScheme.PaymentScheduleSchemeResource;
@@ -0,0 +1,10 @@
1
+ ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+
4
+ declare module 'chargebee' {
5
+ export interface BillingLineItem {
6
+ id?: string;
7
+ invoice_number?: string;
8
+ quantity?: number;
9
+ }
10
+ }
@@ -0,0 +1,9 @@
1
+ ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+
4
+ declare module 'chargebee' {
5
+ export interface BillingMetadata {
6
+ item_price_id?: string;
7
+ line_items?: BillingLineItem[];
8
+ }
9
+ }
@@ -15,6 +15,8 @@ declare module 'chargebee' {
15
15
  attached_item: AttachedItem;
16
16
  attribute: Attribute;
17
17
  billing_configuration: BillingConfiguration;
18
+ billing_line_item: BillingLineItem;
19
+ billing_metadata: BillingMetadata;
18
20
  brand: Brand;
19
21
  business_entity: BusinessEntity;
20
22
  business_entity_transfer: BusinessEntityTransfer;
@@ -64,6 +66,8 @@ declare module 'chargebee' {
64
66
  filter_condition: FilterCondition;
65
67
  gateway_error_detail: GatewayErrorDetail;
66
68
  gateway_payment_method_token: GatewayPaymentMethodToken;
69
+ gateway_request_log: GatewayRequestLog;
70
+ gateway_webhook_log: GatewayWebhookLog;
67
71
  gift: Gift;
68
72
  grant_block: GrantBlock;
69
73
  group_by_attribute: GroupByAttribute;
@@ -99,6 +103,7 @@ declare module 'chargebee' {
99
103
  omnichannel_subscription_item_scheduled_change: OmnichannelSubscriptionItemScheduledChange;
100
104
  omnichannel_transaction: OmnichannelTransaction;
101
105
  order: Order;
106
+ organization_detail: OrganizationDetail;
102
107
  payment_intent: PaymentIntent;
103
108
  payment_reference_number: PaymentReferenceNumber;
104
109
  payment_schedule: PaymentSchedule;
@@ -5,6 +5,7 @@ declare module 'chargebee' {
5
5
  export interface Discount {
6
6
  id: string;
7
7
  invoice_name?: string;
8
+ description?: string;
8
9
  type: 'fixed_amount' | 'percentage' | 'offer_quantity';
9
10
  percentage?: number;
10
11
  amount?: number;
@@ -1,6 +1,6 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
2
  ///<reference path='./../index.d.ts'/>
3
- ///<reference path='./filter.d.ts'/>
3
+
4
4
  declare module 'chargebee' {
5
5
  export interface DraftRequest {
6
6
  id: string;
@@ -635,6 +635,7 @@ declare module 'chargebee' {
635
635
  included_in_mrr?: boolean;
636
636
  item_price_id?: string;
637
637
  quantity?: number;
638
+ description?: string;
638
639
  }
639
640
  export interface ItemTiersCreateSubItemEstimateInputParam {
640
641
  item_price_id?: string;
@@ -778,6 +779,7 @@ declare module 'chargebee' {
778
779
  included_in_mrr?: boolean;
779
780
  item_price_id?: string;
780
781
  quantity?: number;
782
+ description?: string;
781
783
  }
782
784
  export interface ItemTiersCreateSubItemForCustomerEstimateInputParam {
783
785
  item_price_id?: string;
@@ -944,6 +946,7 @@ declare module 'chargebee' {
944
946
  quantity?: number;
945
947
  operation_type: OperationTypeEnum;
946
948
  id?: string;
949
+ description?: string;
947
950
  }
948
951
  export interface ItemTiersUpdateSubscriptionForItemsInputParam {
949
952
  item_price_id?: string;
@@ -217,6 +217,7 @@ declare module 'chargebee' {
217
217
  SalesOrderCreatedContent &
218
218
  CustomerChangedContent &
219
219
  SubscriptionStartedContent &
220
+ OrganizationDetailsUpdatedContent &
220
221
  SubscriptionActivatedContent &
221
222
  PaymentSourceExpiringContent &
222
223
  SubscriptionReactivatedContent &
@@ -258,6 +259,7 @@ declare module 'chargebee' {
258
259
  OmnichannelSubscriptionCreatedContent &
259
260
  TaxWithheldRecordedContent &
260
261
  PriceVariantCreatedContent &
262
+ OrganizationDetailsCreatedContent &
261
263
  DifferentialPriceDeletedContent &
262
264
  BusinessRuleActivatedContent &
263
265
  SubscriptionItemsRenewedContent &