chargebee 3.17.0-beta.1 → 3.17.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 (35) hide show
  1. package/CHANGELOG.md +33 -4
  2. package/README.md +25 -173
  3. package/cjs/chargebee.cjs.js +4 -7
  4. package/cjs/environment.js +1 -1
  5. package/cjs/resources/api_endpoints.js +6 -2
  6. package/cjs/resources/webhook/eventType.js +238 -0
  7. package/esm/chargebee.esm.js +2 -4
  8. package/esm/environment.js +1 -1
  9. package/esm/resources/api_endpoints.js +6 -2
  10. package/esm/resources/webhook/eventType.js +235 -0
  11. package/package.json +6 -11
  12. package/types/core.d.ts +19 -2
  13. package/types/index.d.ts +0 -65
  14. package/types/resources/CouponCode.d.ts +4 -0
  15. package/types/resources/CreditNote.d.ts +4 -0
  16. package/types/resources/Customer.d.ts +24 -2
  17. package/types/resources/Estimate.d.ts +13 -2
  18. package/types/resources/Gift.d.ts +12 -2
  19. package/types/resources/HostedPage.d.ts +4 -0
  20. package/types/resources/Invoice.d.ts +25 -2
  21. package/types/resources/ItemPrice.d.ts +5 -0
  22. package/types/resources/Order.d.ts +4 -0
  23. package/types/resources/PaymentIntent.d.ts +30 -5
  24. package/types/resources/PaymentSource.d.ts +6 -1
  25. package/types/resources/PricingPageSession.d.ts +2 -0
  26. package/types/resources/Purchase.d.ts +6 -1
  27. package/types/resources/Subscription.d.ts +46 -7
  28. package/types/resources/Transaction.d.ts +8 -0
  29. package/types/resources/WebhookEvent.d.ts +1 -0
  30. package/cjs/resources/webhook/auth.js +0 -27
  31. package/cjs/resources/webhook/content.js +0 -3
  32. package/cjs/resources/webhook/handler.js +0 -37
  33. package/esm/resources/webhook/auth.js +0 -23
  34. package/esm/resources/webhook/content.js +0 -2
  35. package/esm/resources/webhook/handler.js +0 -33
package/CHANGELOG.md CHANGED
@@ -1,8 +1,37 @@
1
- ### v3.17.0-beta.1 (2025-12-10)
1
+ ### v3.17.0 (2025-12-30)
2
+ * * *
2
3
 
3
- ### Enhancements
4
- * add webhook event handler to process chargebee-events.
5
- * deprecated `WebhookContentType` class, added `WebhookEventType` class.
4
+ ### New Attributes:
5
+ * retry_engine has been added to Invoice#DunningAttempt.
6
+
7
+ ### New Endpoint:
8
+ * move action has been added to ItemPrice.
9
+
10
+ ### New Parameters:
11
+ * exclude_tax_type has been added to Estimate#RenewalEstimateInputParam.
12
+ * variant_id has been added to ItemPrice#MoveInputParam.
13
+ * custom has been added to PricingPageSession#CreateForNewSubscriptionInputParam.
14
+ * custom has been added to PricingPageSession#CreateForExistingSubscriptionInputParam.
15
+
16
+ ### New Enums:
17
+ * ELECTRONIC_PAYMENT_STANDARD has been added to PaymentMethodTypeEnum.
18
+ * KBC_PAYMENT_BUTTON has been added to PaymentMethodTypeEnum.
19
+ * PAY_BY_BANK has been added to PaymentMethodTypeEnum.
20
+ * TRUSTLY has been added to PaymentMethodTypeEnum.
21
+ * STABLECOIN has been added to PaymentMethodTypeEnum.
22
+
23
+ ### v3.16.2 (2025-12-17)
24
+ * * *
25
+
26
+ ### Improvements:
27
+ * `WebhookContentType` is now deprecated but still available for backward compatibility.
28
+
29
+ ### v3.16.1 (2025-12-17)
30
+ * * *
31
+
32
+ ### Improvements:
33
+ * Renamed `WebhookContentType` to `WebhookEventType` for better clarity. `WebhookContentType` is now deprecated but still available for backward compatibility.
34
+ * Added runtime export of `WebhookEventType` enum.
6
35
 
7
36
  ### v3.16.0 (2025-12-01)
8
37
  * * *
package/README.md CHANGED
@@ -148,174 +148,6 @@ const chargebeeSiteEU = new Chargebee({
148
148
  });
149
149
  ```
150
150
 
151
- ### Handle webhooks
152
-
153
- Use the webhook handlers to parse and route webhook payloads from Chargebee with full TypeScript support.
154
-
155
- #### Quick Start: Using the default `webhook` instance
156
-
157
- The simplest way to handle webhooks is using the pre-configured `webhook` instance:
158
-
159
- ```typescript
160
- import express from 'express';
161
- import { webhook, type WebhookEvent } from 'chargebee';
162
-
163
- const app = express();
164
- app.use(express.json());
165
-
166
- webhook.on('subscription_created', async (event: WebhookEvent) => {
167
- console.log(`Subscription created: ${event.id}`);
168
- const subscription = event.content.subscription;
169
- console.log(`Customer: ${subscription.customer_id}`);
170
- });
171
-
172
- webhook.on('error', (err: Error) => {
173
- console.error('Webhook error:', err.message);
174
- });
175
-
176
- app.post('/chargebee/webhooks', (req, res) => {
177
- webhook.handle(req.body, req.headers);
178
- res.status(200).send('OK');
179
- });
180
-
181
- app.listen(8080);
182
- ```
183
-
184
- **Auto-configured Basic Auth:** The default `webhook` instance automatically configures Basic Auth validation if the following environment variables are set:
185
-
186
- - `CHARGEBEE_WEBHOOK_USERNAME` - The expected username
187
- - `CHARGEBEE_WEBHOOK_PASSWORD` - The expected password
188
-
189
- When both are present, incoming webhook requests will be validated against these credentials. If not set, no authentication is applied.
190
-
191
- #### Creating custom `WebhookHandler` instances
192
-
193
- For more control or multiple webhook endpoints, create your own instances:
194
-
195
- ```typescript
196
- import express from 'express';
197
- import { WebhookHandler, basicAuthValidator } from 'chargebee';
198
-
199
- const app = express();
200
- app.use(express.json());
201
-
202
- const handler = new WebhookHandler();
203
-
204
- // Register event listeners using .on() - events are fully typed
205
- handler.on('subscription_created', async (event) => {
206
- console.log(`Subscription created: ${event.id}`);
207
- const subscription = event.content.subscription;
208
- console.log(`Customer: ${subscription.customer_id}`);
209
- console.log(`Plan: ${subscription.plan_id}`);
210
- });
211
-
212
- handler.on('payment_succeeded', async (event) => {
213
- console.log(`Payment succeeded: ${event.id}`);
214
- const transaction = event.content.transaction;
215
- const customer = event.content.customer;
216
- console.log(`Amount: ${transaction.amount}, Customer: ${customer.email}`);
217
- });
218
-
219
- // Optional: Add request validator (e.g., Basic Auth)
220
- handler.requestValidator = basicAuthValidator((username, password) => {
221
- return username === 'admin' && password === 'secret';
222
- });
223
-
224
- app.post('/chargebee/webhooks', (req, res) => {
225
- handler.handle(req.body, req.headers);
226
- res.status(200).send('OK');
227
- });
228
-
229
- app.listen(8080);
230
- ```
231
-
232
- #### Low-level: Parse and handle events manually
233
-
234
- For more control, you can parse webhook events manually:
235
-
236
- ```typescript
237
- import express from 'express';
238
- import Chargebee, { type WebhookEvent } from 'chargebee';
239
-
240
- const app = express();
241
- app.use(express.json());
242
-
243
- app.post('/chargebee/webhooks', async (req, res) => {
244
- try {
245
- const event = req.body as WebhookEvent;
246
-
247
- switch (event.event_type) {
248
- case 'subscription_created':
249
- // Access event content with proper typing
250
- const subscription = event.content.subscription;
251
- console.log('Subscription created:', subscription.id);
252
- break;
253
-
254
- case 'payment_succeeded':
255
- const transaction = event.content.transaction;
256
- console.log('Payment succeeded:', transaction.amount);
257
- break;
258
-
259
- default:
260
- console.log('Unhandled event type:', event.event_type);
261
- }
262
-
263
- res.status(200).send('OK');
264
- } catch (err) {
265
- console.error('Error processing webhook:', err);
266
- res.status(500).send('Error processing webhook');
267
- }
268
- });
269
-
270
- app.listen(8080);
271
- ```
272
-
273
- #### Handling Unhandled Events
274
-
275
- By default, if an incoming webhook event type is not recognized or you haven't registered a corresponding callback handler, the SDK provides flexible options to handle these scenarios:
276
-
277
- **Using the `unhandled_event` listener:**
278
-
279
- ```typescript
280
- import { WebhookHandler } from 'chargebee';
281
-
282
- const handler = new WebhookHandler();
283
-
284
- handler.on('subscription_created', async (event) => {
285
- // Handle subscription created
286
- });
287
-
288
- // Gracefully handle events without registered listeners
289
- handler.on('unhandled_event', async (event) => {
290
- console.log(`Received unhandled event: ${event.event_type}`);
291
- // Log for monitoring or store for later processing
292
- });
293
- ```
294
-
295
- **Using the `error` listener for error handling:**
296
-
297
- If an error occurs during webhook processing (e.g., invalid JSON, validator failure), the SDK will emit an `error` event:
298
-
299
- ```typescript
300
- const handler = new WebhookHandler();
301
-
302
- handler.on('subscription_created', async (event) => {
303
- // Handle subscription created
304
- });
305
-
306
- // Catch any errors during webhook processing
307
- handler.on('error', (err) => {
308
- console.error('Webhook processing error:', err);
309
- // Log to monitoring service, alert team, etc.
310
- });
311
- ```
312
-
313
- **Best Practices:**
314
-
315
- - Use `unhandled_event` listener to acknowledge unknown events (return 200 OK) and log them
316
- - Use `error` listener to catch and handle exceptions thrown during event processing
317
- - Both listeners help ensure your webhook endpoint remains stable even when new event types are introduced by Chargebee
318
-
319
151
  ### Processing Webhooks - API Version Check
320
152
 
321
153
  An attribute `api_version` is added to the [Event](https://apidocs.chargebee.com/docs/api/events) resource, which indicates the API version based on which the event content is structured. In your webhook servers, ensure this `api_version` is the same as the [API version](https://apidocs.chargebee.com/docs/api#versions) used by your webhook server's client library.
@@ -392,18 +224,38 @@ To improve type safety and gain better autocompletion when working with webhooks
392
224
  #### Example
393
225
 
394
226
  ```ts
395
- import Chargebee, { type WebhookContentType, WebhookEvent } from "chargebee";
227
+ import Chargebee, { WebhookEventType, WebhookEvent } from "chargebee";
396
228
 
397
229
  const result = await chargebeeInstance.event.retrieve("{event-id}");
398
- const subscripitonActivatedEvent: WebhookEvent<WebhookContentType.SubscriptionActivated> = result.event;
399
- const subscription = subscripitonActivatedEvent.content.subscription;
230
+ const subscriptionActivatedEvent: WebhookEvent<typeof WebhookEventType.SubscriptionActivated> = result.event;
231
+ const subscription = subscriptionActivatedEvent.content.subscription;
232
+ ```
233
+
234
+ You can also use `WebhookEventType` in switch statements for runtime event handling:
235
+
236
+ ```ts
237
+ import { WebhookEventType, WebhookEvent } from "chargebee";
238
+
239
+ function handleWebhook(event: WebhookEvent) {
240
+ switch (event.event_type) {
241
+ case WebhookEventType.SubscriptionCreated:
242
+ console.log("Subscription created:", event.content.subscription?.id);
243
+ break;
244
+ case WebhookEventType.PaymentSucceeded:
245
+ console.log("Payment succeeded:", event.content.transaction?.id);
246
+ break;
247
+ default:
248
+ console.log("Unhandled event:", event.event_type);
249
+ }
250
+ }
400
251
  ```
401
252
 
402
253
  #### Notes
403
254
 
404
255
  * `WebhookEvent<T>` provides type hinting for the event payload, making it easier to work with specific event structures.
405
- * Use the `WebhookContentType` to specify the exact event type (e.g., `SubscriptionCreated`, `InvoiceGenerated`, etc.).
406
- * This approach ensures you get proper IntelliSense and compile-time checks when accessing event fields.
256
+ * Use `WebhookEventType` to specify the exact event type (e.g., `SubscriptionCreated`, `InvoiceGenerated`, etc.).
257
+ * `WebhookEventType` is available at runtime, so you can use it in switch statements and comparisons.
258
+ * `WebhookContentType` is deprecated but still available for backward compatibility.
407
259
 
408
260
  ### Custom HTTP Client
409
261
 
@@ -2,15 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const createChargebee_js_1 = require("./createChargebee.js");
4
4
  const FetchClient_js_1 = require("./net/FetchClient.js");
5
- const handler_js_1 = require("./resources/webhook/handler.js");
6
- const handler_js_2 = require("./resources/webhook/handler.js");
7
- const auth_js_1 = require("./resources/webhook/auth.js");
5
+ const eventType_js_1 = require("./resources/webhook/eventType.js");
8
6
  const httpClient = new FetchClient_js_1.FetchHttpClient();
9
7
  const Chargebee = (0, createChargebee_js_1.CreateChargebee)(httpClient);
10
8
  module.exports = Chargebee;
11
9
  module.exports.Chargebee = Chargebee;
12
10
  module.exports.default = Chargebee;
13
- // Export webhook modules
14
- module.exports.WebhookHandler = handler_js_1.WebhookHandler;
15
- module.exports.webhook = handler_js_2.default;
16
- module.exports.basicAuthValidator = auth_js_1.basicAuthValidator;
11
+ // Export webhook event types
12
+ module.exports.WebhookEventType = eventType_js_1.WebhookEventType;
13
+ module.exports.WebhookContentType = eventType_js_1.WebhookContentType;
@@ -11,7 +11,7 @@ exports.Environment = {
11
11
  hostSuffix: '.chargebee.com',
12
12
  apiPath: '/api/v2',
13
13
  timeout: DEFAULT_TIME_OUT,
14
- clientVersion: 'v3.16.0',
14
+ clientVersion: 'v3.17.0',
15
15
  port: DEFAULT_PORT,
16
16
  timemachineWaitInMillis: DEFAULT_TIME_MACHINE_WAIT,
17
17
  exportWaitInMillis: DEFAULT_EXPORT_WAIT,
@@ -4608,7 +4608,9 @@ exports.Endpoints = {
4608
4608
  false,
4609
4609
  null,
4610
4610
  false,
4611
- {},
4611
+ {
4612
+ custom: 0,
4613
+ },
4612
4614
  {
4613
4615
  isIdempotent: true,
4614
4616
  },
@@ -4621,7 +4623,9 @@ exports.Endpoints = {
4621
4623
  false,
4622
4624
  null,
4623
4625
  false,
4624
- {},
4626
+ {
4627
+ custom: 0,
4628
+ },
4625
4629
  {
4626
4630
  isIdempotent: true,
4627
4631
  },
@@ -0,0 +1,238 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WebhookContentType = exports.WebhookEventType = void 0;
4
+ /**
5
+ * Enum representing all possible webhook event types from Chargebee.
6
+ * This enum provides both compile-time type safety and runtime values.
7
+ */
8
+ var WebhookEventType;
9
+ (function (WebhookEventType) {
10
+ WebhookEventType["AddUsagesReminder"] = "add_usages_reminder";
11
+ WebhookEventType["AddonCreated"] = "addon_created";
12
+ WebhookEventType["AddonDeleted"] = "addon_deleted";
13
+ WebhookEventType["AddonUpdated"] = "addon_updated";
14
+ WebhookEventType["AttachedItemCreated"] = "attached_item_created";
15
+ WebhookEventType["AttachedItemDeleted"] = "attached_item_deleted";
16
+ WebhookEventType["AttachedItemUpdated"] = "attached_item_updated";
17
+ WebhookEventType["AuthorizationSucceeded"] = "authorization_succeeded";
18
+ WebhookEventType["AuthorizationVoided"] = "authorization_voided";
19
+ WebhookEventType["BusinessEntityCreated"] = "business_entity_created";
20
+ WebhookEventType["BusinessEntityDeleted"] = "business_entity_deleted";
21
+ WebhookEventType["BusinessEntityUpdated"] = "business_entity_updated";
22
+ WebhookEventType["CardAdded"] = "card_added";
23
+ WebhookEventType["CardDeleted"] = "card_deleted";
24
+ WebhookEventType["CardExpired"] = "card_expired";
25
+ WebhookEventType["CardExpiryReminder"] = "card_expiry_reminder";
26
+ WebhookEventType["CardUpdated"] = "card_updated";
27
+ WebhookEventType["ContractTermCancelled"] = "contract_term_cancelled";
28
+ WebhookEventType["ContractTermCompleted"] = "contract_term_completed";
29
+ WebhookEventType["ContractTermCreated"] = "contract_term_created";
30
+ WebhookEventType["ContractTermRenewed"] = "contract_term_renewed";
31
+ WebhookEventType["ContractTermTerminated"] = "contract_term_terminated";
32
+ WebhookEventType["CouponCodesAdded"] = "coupon_codes_added";
33
+ WebhookEventType["CouponCodesDeleted"] = "coupon_codes_deleted";
34
+ WebhookEventType["CouponCodesUpdated"] = "coupon_codes_updated";
35
+ WebhookEventType["CouponCreated"] = "coupon_created";
36
+ WebhookEventType["CouponDeleted"] = "coupon_deleted";
37
+ WebhookEventType["CouponSetCreated"] = "coupon_set_created";
38
+ WebhookEventType["CouponSetDeleted"] = "coupon_set_deleted";
39
+ WebhookEventType["CouponSetUpdated"] = "coupon_set_updated";
40
+ WebhookEventType["CouponUpdated"] = "coupon_updated";
41
+ WebhookEventType["CreditNoteCreated"] = "credit_note_created";
42
+ WebhookEventType["CreditNoteCreatedWithBackdating"] = "credit_note_created_with_backdating";
43
+ WebhookEventType["CreditNoteDeleted"] = "credit_note_deleted";
44
+ WebhookEventType["CreditNoteUpdated"] = "credit_note_updated";
45
+ WebhookEventType["CustomerBusinessEntityChanged"] = "customer_business_entity_changed";
46
+ WebhookEventType["CustomerChanged"] = "customer_changed";
47
+ WebhookEventType["CustomerCreated"] = "customer_created";
48
+ WebhookEventType["CustomerDeleted"] = "customer_deleted";
49
+ WebhookEventType["CustomerEntitlementsUpdated"] = "customer_entitlements_updated";
50
+ WebhookEventType["CustomerMovedIn"] = "customer_moved_in";
51
+ WebhookEventType["CustomerMovedOut"] = "customer_moved_out";
52
+ WebhookEventType["DifferentialPriceCreated"] = "differential_price_created";
53
+ WebhookEventType["DifferentialPriceDeleted"] = "differential_price_deleted";
54
+ WebhookEventType["DifferentialPriceUpdated"] = "differential_price_updated";
55
+ WebhookEventType["DunningUpdated"] = "dunning_updated";
56
+ WebhookEventType["EntitlementOverridesAutoRemoved"] = "entitlement_overrides_auto_removed";
57
+ WebhookEventType["EntitlementOverridesRemoved"] = "entitlement_overrides_removed";
58
+ WebhookEventType["EntitlementOverridesUpdated"] = "entitlement_overrides_updated";
59
+ WebhookEventType["FeatureActivated"] = "feature_activated";
60
+ WebhookEventType["FeatureArchived"] = "feature_archived";
61
+ WebhookEventType["FeatureCreated"] = "feature_created";
62
+ WebhookEventType["FeatureDeleted"] = "feature_deleted";
63
+ WebhookEventType["FeatureReactivated"] = "feature_reactivated";
64
+ WebhookEventType["FeatureUpdated"] = "feature_updated";
65
+ WebhookEventType["GiftCancelled"] = "gift_cancelled";
66
+ WebhookEventType["GiftClaimed"] = "gift_claimed";
67
+ WebhookEventType["GiftExpired"] = "gift_expired";
68
+ WebhookEventType["GiftScheduled"] = "gift_scheduled";
69
+ WebhookEventType["GiftUnclaimed"] = "gift_unclaimed";
70
+ WebhookEventType["GiftUpdated"] = "gift_updated";
71
+ WebhookEventType["HierarchyCreated"] = "hierarchy_created";
72
+ WebhookEventType["HierarchyDeleted"] = "hierarchy_deleted";
73
+ WebhookEventType["InvoiceDeleted"] = "invoice_deleted";
74
+ WebhookEventType["InvoiceGenerated"] = "invoice_generated";
75
+ WebhookEventType["InvoiceGeneratedWithBackdating"] = "invoice_generated_with_backdating";
76
+ WebhookEventType["InvoiceUpdated"] = "invoice_updated";
77
+ WebhookEventType["ItemCreated"] = "item_created";
78
+ WebhookEventType["ItemDeleted"] = "item_deleted";
79
+ WebhookEventType["ItemEntitlementsRemoved"] = "item_entitlements_removed";
80
+ WebhookEventType["ItemEntitlementsUpdated"] = "item_entitlements_updated";
81
+ WebhookEventType["ItemFamilyCreated"] = "item_family_created";
82
+ WebhookEventType["ItemFamilyDeleted"] = "item_family_deleted";
83
+ WebhookEventType["ItemFamilyUpdated"] = "item_family_updated";
84
+ WebhookEventType["ItemPriceCreated"] = "item_price_created";
85
+ WebhookEventType["ItemPriceDeleted"] = "item_price_deleted";
86
+ WebhookEventType["ItemPriceEntitlementsRemoved"] = "item_price_entitlements_removed";
87
+ WebhookEventType["ItemPriceEntitlementsUpdated"] = "item_price_entitlements_updated";
88
+ WebhookEventType["ItemPriceUpdated"] = "item_price_updated";
89
+ WebhookEventType["ItemUpdated"] = "item_updated";
90
+ WebhookEventType["MrrUpdated"] = "mrr_updated";
91
+ WebhookEventType["NetdPaymentDueReminder"] = "netd_payment_due_reminder";
92
+ WebhookEventType["OmnichannelOneTimeOrderCreated"] = "omnichannel_one_time_order_created";
93
+ WebhookEventType["OmnichannelOneTimeOrderItemCancelled"] = "omnichannel_one_time_order_item_cancelled";
94
+ WebhookEventType["OmnichannelSubscriptionCreated"] = "omnichannel_subscription_created";
95
+ WebhookEventType["OmnichannelSubscriptionImported"] = "omnichannel_subscription_imported";
96
+ WebhookEventType["OmnichannelSubscriptionItemCancellationScheduled"] = "omnichannel_subscription_item_cancellation_scheduled";
97
+ WebhookEventType["OmnichannelSubscriptionItemCancelled"] = "omnichannel_subscription_item_cancelled";
98
+ WebhookEventType["OmnichannelSubscriptionItemChangeScheduled"] = "omnichannel_subscription_item_change_scheduled";
99
+ WebhookEventType["OmnichannelSubscriptionItemChanged"] = "omnichannel_subscription_item_changed";
100
+ WebhookEventType["OmnichannelSubscriptionItemDowngradeScheduled"] = "omnichannel_subscription_item_downgrade_scheduled";
101
+ WebhookEventType["OmnichannelSubscriptionItemDowngraded"] = "omnichannel_subscription_item_downgraded";
102
+ WebhookEventType["OmnichannelSubscriptionItemDunningExpired"] = "omnichannel_subscription_item_dunning_expired";
103
+ WebhookEventType["OmnichannelSubscriptionItemDunningStarted"] = "omnichannel_subscription_item_dunning_started";
104
+ WebhookEventType["OmnichannelSubscriptionItemExpired"] = "omnichannel_subscription_item_expired";
105
+ WebhookEventType["OmnichannelSubscriptionItemGracePeriodExpired"] = "omnichannel_subscription_item_grace_period_expired";
106
+ WebhookEventType["OmnichannelSubscriptionItemGracePeriodStarted"] = "omnichannel_subscription_item_grace_period_started";
107
+ WebhookEventType["OmnichannelSubscriptionItemPauseScheduled"] = "omnichannel_subscription_item_pause_scheduled";
108
+ WebhookEventType["OmnichannelSubscriptionItemPaused"] = "omnichannel_subscription_item_paused";
109
+ WebhookEventType["OmnichannelSubscriptionItemReactivated"] = "omnichannel_subscription_item_reactivated";
110
+ WebhookEventType["OmnichannelSubscriptionItemRenewed"] = "omnichannel_subscription_item_renewed";
111
+ WebhookEventType["OmnichannelSubscriptionItemResubscribed"] = "omnichannel_subscription_item_resubscribed";
112
+ WebhookEventType["OmnichannelSubscriptionItemResumed"] = "omnichannel_subscription_item_resumed";
113
+ WebhookEventType["OmnichannelSubscriptionItemScheduledCancellationRemoved"] = "omnichannel_subscription_item_scheduled_cancellation_removed";
114
+ WebhookEventType["OmnichannelSubscriptionItemScheduledChangeRemoved"] = "omnichannel_subscription_item_scheduled_change_removed";
115
+ WebhookEventType["OmnichannelSubscriptionItemScheduledDowngradeRemoved"] = "omnichannel_subscription_item_scheduled_downgrade_removed";
116
+ WebhookEventType["OmnichannelSubscriptionItemUpgraded"] = "omnichannel_subscription_item_upgraded";
117
+ WebhookEventType["OmnichannelSubscriptionMovedIn"] = "omnichannel_subscription_moved_in";
118
+ WebhookEventType["OmnichannelTransactionCreated"] = "omnichannel_transaction_created";
119
+ WebhookEventType["OrderCancelled"] = "order_cancelled";
120
+ WebhookEventType["OrderCreated"] = "order_created";
121
+ WebhookEventType["OrderDeleted"] = "order_deleted";
122
+ WebhookEventType["OrderDelivered"] = "order_delivered";
123
+ WebhookEventType["OrderReadyToProcess"] = "order_ready_to_process";
124
+ WebhookEventType["OrderReadyToShip"] = "order_ready_to_ship";
125
+ WebhookEventType["OrderResent"] = "order_resent";
126
+ WebhookEventType["OrderReturned"] = "order_returned";
127
+ WebhookEventType["OrderUpdated"] = "order_updated";
128
+ WebhookEventType["PaymentFailed"] = "payment_failed";
129
+ WebhookEventType["PaymentInitiated"] = "payment_initiated";
130
+ WebhookEventType["PaymentIntentCreated"] = "payment_intent_created";
131
+ WebhookEventType["PaymentIntentUpdated"] = "payment_intent_updated";
132
+ WebhookEventType["PaymentRefunded"] = "payment_refunded";
133
+ WebhookEventType["PaymentScheduleSchemeCreated"] = "payment_schedule_scheme_created";
134
+ WebhookEventType["PaymentScheduleSchemeDeleted"] = "payment_schedule_scheme_deleted";
135
+ WebhookEventType["PaymentSchedulesCreated"] = "payment_schedules_created";
136
+ WebhookEventType["PaymentSchedulesUpdated"] = "payment_schedules_updated";
137
+ WebhookEventType["PaymentSourceAdded"] = "payment_source_added";
138
+ WebhookEventType["PaymentSourceDeleted"] = "payment_source_deleted";
139
+ WebhookEventType["PaymentSourceExpired"] = "payment_source_expired";
140
+ WebhookEventType["PaymentSourceExpiring"] = "payment_source_expiring";
141
+ WebhookEventType["PaymentSourceLocallyDeleted"] = "payment_source_locally_deleted";
142
+ WebhookEventType["PaymentSourceUpdated"] = "payment_source_updated";
143
+ WebhookEventType["PaymentSucceeded"] = "payment_succeeded";
144
+ WebhookEventType["PendingInvoiceCreated"] = "pending_invoice_created";
145
+ WebhookEventType["PendingInvoiceUpdated"] = "pending_invoice_updated";
146
+ WebhookEventType["PlanCreated"] = "plan_created";
147
+ WebhookEventType["PlanDeleted"] = "plan_deleted";
148
+ WebhookEventType["PlanUpdated"] = "plan_updated";
149
+ WebhookEventType["PriceVariantCreated"] = "price_variant_created";
150
+ WebhookEventType["PriceVariantDeleted"] = "price_variant_deleted";
151
+ WebhookEventType["PriceVariantUpdated"] = "price_variant_updated";
152
+ WebhookEventType["ProductCreated"] = "product_created";
153
+ WebhookEventType["ProductDeleted"] = "product_deleted";
154
+ WebhookEventType["ProductUpdated"] = "product_updated";
155
+ WebhookEventType["PromotionalCreditsAdded"] = "promotional_credits_added";
156
+ WebhookEventType["PromotionalCreditsDeducted"] = "promotional_credits_deducted";
157
+ WebhookEventType["PurchaseCreated"] = "purchase_created";
158
+ WebhookEventType["QuoteCreated"] = "quote_created";
159
+ WebhookEventType["QuoteDeleted"] = "quote_deleted";
160
+ WebhookEventType["QuoteUpdated"] = "quote_updated";
161
+ WebhookEventType["RecordPurchaseFailed"] = "record_purchase_failed";
162
+ WebhookEventType["RefundInitiated"] = "refund_initiated";
163
+ WebhookEventType["RuleCreated"] = "rule_created";
164
+ WebhookEventType["RuleDeleted"] = "rule_deleted";
165
+ WebhookEventType["RuleUpdated"] = "rule_updated";
166
+ WebhookEventType["SalesOrderCreated"] = "sales_order_created";
167
+ WebhookEventType["SalesOrderUpdated"] = "sales_order_updated";
168
+ WebhookEventType["SubscriptionActivated"] = "subscription_activated";
169
+ WebhookEventType["SubscriptionActivatedWithBackdating"] = "subscription_activated_with_backdating";
170
+ WebhookEventType["SubscriptionAdvanceInvoiceScheduleAdded"] = "subscription_advance_invoice_schedule_added";
171
+ WebhookEventType["SubscriptionAdvanceInvoiceScheduleRemoved"] = "subscription_advance_invoice_schedule_removed";
172
+ WebhookEventType["SubscriptionAdvanceInvoiceScheduleUpdated"] = "subscription_advance_invoice_schedule_updated";
173
+ WebhookEventType["SubscriptionBusinessEntityChanged"] = "subscription_business_entity_changed";
174
+ WebhookEventType["SubscriptionCanceledWithBackdating"] = "subscription_canceled_with_backdating";
175
+ WebhookEventType["SubscriptionCancellationReminder"] = "subscription_cancellation_reminder";
176
+ WebhookEventType["SubscriptionCancellationScheduled"] = "subscription_cancellation_scheduled";
177
+ WebhookEventType["SubscriptionCancelled"] = "subscription_cancelled";
178
+ WebhookEventType["SubscriptionChanged"] = "subscription_changed";
179
+ WebhookEventType["SubscriptionChangedWithBackdating"] = "subscription_changed_with_backdating";
180
+ WebhookEventType["SubscriptionChangesScheduled"] = "subscription_changes_scheduled";
181
+ WebhookEventType["SubscriptionCreated"] = "subscription_created";
182
+ WebhookEventType["SubscriptionCreatedWithBackdating"] = "subscription_created_with_backdating";
183
+ WebhookEventType["SubscriptionDeleted"] = "subscription_deleted";
184
+ WebhookEventType["SubscriptionEntitlementsCreated"] = "subscription_entitlements_created";
185
+ WebhookEventType["SubscriptionEntitlementsUpdated"] = "subscription_entitlements_updated";
186
+ WebhookEventType["SubscriptionItemsRenewed"] = "subscription_items_renewed";
187
+ WebhookEventType["SubscriptionMovedIn"] = "subscription_moved_in";
188
+ WebhookEventType["SubscriptionMovedOut"] = "subscription_moved_out";
189
+ WebhookEventType["SubscriptionMovementFailed"] = "subscription_movement_failed";
190
+ WebhookEventType["SubscriptionPauseScheduled"] = "subscription_pause_scheduled";
191
+ WebhookEventType["SubscriptionPaused"] = "subscription_paused";
192
+ WebhookEventType["SubscriptionRampApplied"] = "subscription_ramp_applied";
193
+ WebhookEventType["SubscriptionRampCreated"] = "subscription_ramp_created";
194
+ WebhookEventType["SubscriptionRampDeleted"] = "subscription_ramp_deleted";
195
+ WebhookEventType["SubscriptionRampDrafted"] = "subscription_ramp_drafted";
196
+ WebhookEventType["SubscriptionRampUpdated"] = "subscription_ramp_updated";
197
+ WebhookEventType["SubscriptionReactivated"] = "subscription_reactivated";
198
+ WebhookEventType["SubscriptionReactivatedWithBackdating"] = "subscription_reactivated_with_backdating";
199
+ WebhookEventType["SubscriptionRenewalReminder"] = "subscription_renewal_reminder";
200
+ WebhookEventType["SubscriptionRenewed"] = "subscription_renewed";
201
+ WebhookEventType["SubscriptionResumed"] = "subscription_resumed";
202
+ WebhookEventType["SubscriptionResumptionScheduled"] = "subscription_resumption_scheduled";
203
+ WebhookEventType["SubscriptionScheduledCancellationRemoved"] = "subscription_scheduled_cancellation_removed";
204
+ WebhookEventType["SubscriptionScheduledChangesRemoved"] = "subscription_scheduled_changes_removed";
205
+ WebhookEventType["SubscriptionScheduledPauseRemoved"] = "subscription_scheduled_pause_removed";
206
+ WebhookEventType["SubscriptionScheduledResumptionRemoved"] = "subscription_scheduled_resumption_removed";
207
+ WebhookEventType["SubscriptionShippingAddressUpdated"] = "subscription_shipping_address_updated";
208
+ WebhookEventType["SubscriptionStarted"] = "subscription_started";
209
+ WebhookEventType["SubscriptionTrialEndReminder"] = "subscription_trial_end_reminder";
210
+ WebhookEventType["SubscriptionTrialExtended"] = "subscription_trial_extended";
211
+ WebhookEventType["TaxWithheldDeleted"] = "tax_withheld_deleted";
212
+ WebhookEventType["TaxWithheldRecorded"] = "tax_withheld_recorded";
213
+ WebhookEventType["TaxWithheldRefunded"] = "tax_withheld_refunded";
214
+ WebhookEventType["TokenConsumed"] = "token_consumed";
215
+ WebhookEventType["TokenCreated"] = "token_created";
216
+ WebhookEventType["TokenExpired"] = "token_expired";
217
+ WebhookEventType["TransactionCreated"] = "transaction_created";
218
+ WebhookEventType["TransactionDeleted"] = "transaction_deleted";
219
+ WebhookEventType["TransactionUpdated"] = "transaction_updated";
220
+ WebhookEventType["UnbilledChargesCreated"] = "unbilled_charges_created";
221
+ WebhookEventType["UnbilledChargesDeleted"] = "unbilled_charges_deleted";
222
+ WebhookEventType["UnbilledChargesInvoiced"] = "unbilled_charges_invoiced";
223
+ WebhookEventType["UnbilledChargesVoided"] = "unbilled_charges_voided";
224
+ WebhookEventType["UsageFileIngested"] = "usage_file_ingested";
225
+ WebhookEventType["VariantCreated"] = "variant_created";
226
+ WebhookEventType["VariantDeleted"] = "variant_deleted";
227
+ WebhookEventType["VariantUpdated"] = "variant_updated";
228
+ WebhookEventType["VirtualBankAccountAdded"] = "virtual_bank_account_added";
229
+ WebhookEventType["VirtualBankAccountDeleted"] = "virtual_bank_account_deleted";
230
+ WebhookEventType["VirtualBankAccountUpdated"] = "virtual_bank_account_updated";
231
+ WebhookEventType["VoucherCreateFailed"] = "voucher_create_failed";
232
+ WebhookEventType["VoucherCreated"] = "voucher_created";
233
+ WebhookEventType["VoucherExpired"] = "voucher_expired";
234
+ })(WebhookEventType || (exports.WebhookEventType = WebhookEventType = {}));
235
+ /**
236
+ * @deprecated Use WebhookEventType instead.
237
+ */
238
+ exports.WebhookContentType = WebhookEventType;
@@ -3,7 +3,5 @@ import { FetchHttpClient } from './net/FetchClient.js';
3
3
  const httpClient = new FetchHttpClient();
4
4
  const Chargebee = CreateChargebee(httpClient);
5
5
  export default Chargebee;
6
- // Export webhook modules
7
- export { WebhookHandler } from './resources/webhook/handler.js';
8
- export { default as webhook } from './resources/webhook/handler.js';
9
- export { basicAuthValidator } from './resources/webhook/auth.js';
6
+ // Export webhook event types
7
+ export { WebhookEventType, WebhookContentType, } from './resources/webhook/eventType.js';
@@ -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.16.0',
11
+ clientVersion: 'v3.17.0',
12
12
  port: DEFAULT_PORT,
13
13
  timemachineWaitInMillis: DEFAULT_TIME_MACHINE_WAIT,
14
14
  exportWaitInMillis: DEFAULT_EXPORT_WAIT,
@@ -4605,7 +4605,9 @@ export const Endpoints = {
4605
4605
  false,
4606
4606
  null,
4607
4607
  false,
4608
- {},
4608
+ {
4609
+ custom: 0,
4610
+ },
4609
4611
  {
4610
4612
  isIdempotent: true,
4611
4613
  },
@@ -4618,7 +4620,9 @@ export const Endpoints = {
4618
4620
  false,
4619
4621
  null,
4620
4622
  false,
4621
- {},
4623
+ {
4624
+ custom: 0,
4625
+ },
4622
4626
  {
4623
4627
  isIdempotent: true,
4624
4628
  },