Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,61 @@
### v3.30.0 (2026-07-30)
* * *
### New Resources:
- [`CreditUnit`](https://apidocs.chargebee.com/docs/api/credit_units) has been added.
- [`LedgerEntry`](https://apidocs.chargebee.com/docs/api/ledger_entries) has been added.


### New Actions:
- [`allocate`](https://apidocs.chargebee.com/docs/api/ledger_operations/allocate) has been added to [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations).


### New Attributes:
- [`unit_id`](https://apidocs.chargebee.com/docs/api/alerts/alert-object#unit_id) has been added to [`Alert`](https://apidocs.chargebee.com/docs/api/alerts).
- [`subscription_id`](https://apidocs.chargebee.com/docs/api/grant_blocks/grant-block-object#subscription_id) has been added to [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks).
- [`modified_at`](https://apidocs.chargebee.com/docs/api/grant_blocks/grant-block-object#modified_at) has been added to [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks).
- [`resource_version`](https://apidocs.chargebee.com/docs/api/grant_blocks/grant-block-object#resource_version) has been added to [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks).
- [`created_at`](https://apidocs.chargebee.com/docs/api/ledger_account_balances/ledger-account-balance-object#created_at) has been added to [`LedgerAccountBalance`](https://apidocs.chargebee.com/docs/api/ledger_account_balances).
- [`resource_version`](https://apidocs.chargebee.com/docs/api/ledger_account_balances/ledger-account-balance-object#resource_version) has been added to [`LedgerAccountBalance`](https://apidocs.chargebee.com/docs/api/ledger_account_balances).


### New Parameters:
- [`account_type`](https://apidocs.chargebee.com/docs/api/grant_blocks/list-grant-blocks#account_type) has been added as query parameter to [`list_grant_blocks`](https://apidocs.chargebee.com/docs/api/grant_blocks/list-grant-blocks) in [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks).
- [`unit_id`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert#unit_id) has been added as request body parameter to [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts).
- [`include_cancellation_day_in_billing`](https://apidocs.chargebee.com/docs/api/estimates/cancel-subscription-for-items-estimate#include_cancellation_day_in_billing) has been added as request body parameter to [`cancel_subscription_for_items_estimate`](https://apidocs.chargebee.com/docs/api/estimates/cancel-subscription-for-items-estimate) in [`Estimate`](https://apidocs.chargebee.com/docs/api/estimates).
- [`subscription_id`](https://apidocs.chargebee.com/docs/api/ledger_operations/allocate#subscription_id) has been added as request body parameter to [`allocate`](https://apidocs.chargebee.com/docs/api/ledger_operations/allocate) in [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations).
- [`unit_id`](https://apidocs.chargebee.com/docs/api/ledger_operations/allocate#unit_id) has been added as request body parameter to [`allocate`](https://apidocs.chargebee.com/docs/api/ledger_operations/allocate) in [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations).
- [`amount`](https://apidocs.chargebee.com/docs/api/ledger_operations/allocate#amount) has been added as request body parameter to [`allocate`](https://apidocs.chargebee.com/docs/api/ledger_operations/allocate) in [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations).
- [`expires_at`](https://apidocs.chargebee.com/docs/api/ledger_operations/allocate#expires_at) has been added as request body parameter to [`allocate`](https://apidocs.chargebee.com/docs/api/ledger_operations/allocate) in [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations).
- [`metadata`](https://apidocs.chargebee.com/docs/api/ledger_operations/allocate#metadata) has been added as request body parameter to [`allocate`](https://apidocs.chargebee.com/docs/api/ledger_operations/allocate) in [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations).
- [`include_cancellation_day_in_billing`](https://apidocs.chargebee.com/docs/api/subscriptions/cancel-subscription-for-items#include_cancellation_day_in_billing) has been added as request body parameter to [`cancel_subscription_for_items`](https://apidocs.chargebee.com/docs/api/subscriptions/cancel-subscription-for-items) in [`Subscription`](https://apidocs.chargebee.com/docs/api/subscriptions).


### New Events:
- [`grant_blocks_created`](https://apidocs.chargebee.com/docs/api/events/webhook/grant_blocks_created) has been added.
- [`ledger_updated`](https://apidocs.chargebee.com/docs/api/events/webhook/ledger_updated) has been added.
- [`ledger_account_balance_updated`](https://apidocs.chargebee.com/docs/api/events/webhook/ledger_account_balance_updated) has been added.
- [`grant_blocks_updated`](https://apidocs.chargebee.com/docs/api/events/webhook/grant_blocks_updated) has been added.


### New Enums:
- `ledger_account_balance_updated`, `grant_blocks_created`, `grant_blocks_updated`, and `ledger_updated` have been added as new values enum `EventType`.
- `dana`, `touch_n_go`, `tamara`, and `qpay` have been added as new values enum `PaymentMethod`.
- `dana`, `touch_n_go`, `tamara`, and `qpay` have been added as new values enum `PaymentMethodType`.
- `dana`, `touch_n_go`, `tamara`, `qpay`, `credit_balance_dropped`, `credit`, `debit`, `hold`, and `unhold` have been added as new values enum `Type`.
- `active` and `archived` have been added as new values to enum attribute [`status`](https://apidocs.chargebee.com/docs/api/credit_units/credit-unit-object#status) in [`CreditUnit`](https://apidocs.chargebee.com/docs/api/credit_units).
- `grant_renewal` and `subscription_renewed` have been added as new values to enum attribute [`grant_source`](https://apidocs.chargebee.com/docs/api/grant_blocks/grant-block-object#grant_source) in [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks).
- `provisioned` and `overdraft` have been added as new values to enum attribute [`account_type`](https://apidocs.chargebee.com/docs/api/ledger_entries/ledger-entry-object#account_type) in [`LedgerEntry`](https://apidocs.chargebee.com/docs/api/ledger_entries).
- `credit_unit` has been added as a new value to enum attribute [`unit_type`](https://apidocs.chargebee.com/docs/api/ledger_entries/ledger-entry-object#unit_type) in [`LedgerEntry`](https://apidocs.chargebee.com/docs/api/ledger_entries).
- `dana`, `touch_n_go`, `tamara`, and `qpay` have been added as new values to enum attribute [`payment_method_type`](https://apidocs.chargebee.com/docs/api/payment_intents/payment-intent-object#payment_method_type) in [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents).
- `dana`, `touch_n_go`, `tamara`, and `qpay` have been added as new values to enum attribute [`active_payment_attempt.payment_method_type`](https://apidocs.chargebee.com/docs/api/payment_intents/payment-intent-object#active_payment_attempt_payment_method_type) in [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents).
- `archived` and `active` have been added as new values to enum query parameter `status.in` in [`list_credit_units`](https://apidocs.chargebee.com/docs/api/credit_units/list-credit-units) of [`CreditUnit`](https://apidocs.chargebee.com/docs/api/credit_units).
- `archived` and `active` have been added as new values to enum query parameter `status.is` in [`list_credit_units`](https://apidocs.chargebee.com/docs/api/credit_units/list-credit-units) of [`CreditUnit`](https://apidocs.chargebee.com/docs/api/credit_units).
- `provisioned` and `overdraft` have been added as new values to enum query parameter `account_type.is` in [`list_grant_blocks`](https://apidocs.chargebee.com/docs/api/grant_blocks/list-grant-blocks) of [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks).
- `dana`, `touch_n_go`, `tamara`, and `qpay` have been added as new values to enum request body parameter `payment_method_type` in [`update_a_payment_intent`](https://apidocs.chargebee.com/docs/api/payment_intents/update-a-payment-intent) of [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents).
- `dana`, `touch_n_go`, `tamara`, and `qpay` have been added as new values to enum request body parameter `payment_method_type` in [`create_a_payment_intent`](https://apidocs.chargebee.com/docs/api/payment_intents/create-a-payment-intent) of [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents).



### v3.29.0 (2026-07-21)
* * *
### New Resources:
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.29.0
3.30.0
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chargebee",
"version": "3.29.0",
"version": "3.30.0",
"description": "A library for integrating with Chargebee.",
"scripts": {
"prepack": "npm install && npm run build",
Expand Down
2 changes: 1 addition & 1 deletion src/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const Environment = {
hostSuffix: '.chargebee.com',
apiPath: '/api/v2',
timeout: DEFAULT_TIME_OUT,
clientVersion: 'v3.29.0',
clientVersion: 'v3.30.0',
port: DEFAULT_PORT,
timemachineWaitInMillis: DEFAULT_TIME_MACHINE_WAIT,
exportWaitInMillis: DEFAULT_EXPORT_WAIT,
Expand Down
71 changes: 71 additions & 0 deletions src/resources/api_endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ interface Endpoints {
impactedItem: EndpointTuple[];
impactedItemPrice: EndpointTuple[];
metadata: EndpointTuple[];
creditUnit: EndpointTuple[];
subscriptionEntitlement: EndpointTuple[];
customerEntitlement: EndpointTuple[];
itemEntitlement: EndpointTuple[];
Expand Down Expand Up @@ -118,6 +119,7 @@ interface Endpoints {
ledgerAccountBalance: EndpointTuple[];
ledgerOperation: EndpointTuple[];
grantBlock: EndpointTuple[];
ledgerEntry: EndpointTuple[];
promotionalGrant: EndpointTuple[];
impactedCustomer: EndpointTuple[];
subscriptionEntitlementsUpdatedDetail: EndpointTuple[];
Expand Down Expand Up @@ -4354,6 +4356,61 @@ export const Endpoints: Endpoints = {
impactedItem: [],
impactedItemPrice: [],
metadata: [],
creditUnit: [
['list', 'GET', '/credit_units', null, false, null, false, {}, {}],
[
'create',
'POST',
'/credit_units',
null,
false,
null,
false,
{},
{
isIdempotent: true,
},
],
[
'update',
'POST',
'/credit_units',
null,
true,
null,
false,
{},
{
isIdempotent: true,
},
],
[
'archive',
'POST',
'/credit_units',
'/archive_command',
true,
null,
false,
{},
{
isIdempotent: true,
},
],
[
'reactivate',
'POST',
'/credit_units',
'/reactivate_command',
true,
null,
false,
{},
{
isIdempotent: true,
},
],
],
subscriptionEntitlement: [
[
'subscriptionEntitlementsForSubscription',
Expand Down Expand Up @@ -5321,6 +5378,19 @@ export const Endpoints: Endpoints = {
},
{},
],
[
'allocate',
'POST',
'/ledger_operations',
'/allocate',
false,
null,
true,
{
metadata: 0,
},
{},
],
],
grantBlock: [
[
Expand All @@ -5335,6 +5405,7 @@ export const Endpoints: Endpoints = {
{},
],
],
ledgerEntry: [],
promotionalGrant: [
[
'promotionalGrants',
Expand Down
30 changes: 30 additions & 0 deletions src/resources/webhook/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,14 @@ export interface GiftUpdatedContent {
Gift: import('chargebee').Gift;
}

export interface GrantBlocksCreatedContent {
GrantBlock: import('chargebee').GrantBlock[];
}

export interface GrantBlocksUpdatedContent {
GrantBlock: import('chargebee').GrantBlock[];
}

export interface HierarchyCreatedContent {
Customer: import('chargebee').Customer;
}
Expand Down Expand Up @@ -424,6 +432,20 @@ export interface ItemUpdatedContent {
Item: import('chargebee').Item;
}

export interface LedgerAccountBalanceUpdatedContent {
LedgerAccountBalance: import('chargebee').LedgerAccountBalance;
}

export interface LedgerUpdatedContent {
LedgerOperation: import('chargebee').LedgerOperation[];

LedgerAccountBalance: import('chargebee').LedgerAccountBalance;

GrantBlock: import('chargebee').GrantBlock[];

LedgerEntry: import('chargebee').LedgerEntry[];
}

export interface MrrUpdatedContent {
Subscription: import('chargebee').Subscription;
}
Expand Down Expand Up @@ -1589,6 +1611,10 @@ export type WebhookContentMap = {

[WebhookEventType.GiftUpdated]: GiftUpdatedContent;

[WebhookEventType.GrantBlocksCreated]: GrantBlocksCreatedContent;

[WebhookEventType.GrantBlocksUpdated]: GrantBlocksUpdatedContent;

[WebhookEventType.HierarchyCreated]: HierarchyCreatedContent;

[WebhookEventType.HierarchyDeleted]: HierarchyDeletedContent;
Expand Down Expand Up @@ -1627,6 +1653,10 @@ export type WebhookContentMap = {

[WebhookEventType.ItemUpdated]: ItemUpdatedContent;

[WebhookEventType.LedgerAccountBalanceUpdated]: LedgerAccountBalanceUpdatedContent;

[WebhookEventType.LedgerUpdated]: LedgerUpdatedContent;

[WebhookEventType.MrrUpdated]: MrrUpdatedContent;

[WebhookEventType.NetdPaymentDueReminder]: NetdPaymentDueReminderContent;
Expand Down
8 changes: 8 additions & 0 deletions src/resources/webhook/eventType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ export enum WebhookEventType {

GiftUpdated = 'gift_updated',

GrantBlocksCreated = 'grant_blocks_created',

GrantBlocksUpdated = 'grant_blocks_updated',

HierarchyCreated = 'hierarchy_created',

HierarchyDeleted = 'hierarchy_deleted',
Expand Down Expand Up @@ -165,6 +169,10 @@ export enum WebhookEventType {

ItemUpdated = 'item_updated',

LedgerAccountBalanceUpdated = 'ledger_account_balance_updated',

LedgerUpdated = 'ledger_updated',

MrrUpdated = 'mrr_updated',

NetdPaymentDueReminder = 'netd_payment_due_reminder',
Expand Down
11 changes: 8 additions & 3 deletions src/schema/alert.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ const CreateAlertFilterConditionsSchema = z.object({
value: z.array(z.string().max(50).optional()).optional(),
});
const CreateAlertBodySchema = z.looseObject({
type: z.enum(['usage_exceeded', 'spend_exceeded']),
type: z.enum(['usage_exceeded', 'spend_exceeded', 'credit_balance_dropped']),
name: z.string().max(50),
description: z.string().max(65000).optional(),
metered_feature_id: z.string().max(50).optional(),
currency_code: z.string().max(3).optional(),
unit_id: z.string().max(50).optional(),
subscription_id: z.string().max(50).optional(),
meta: z.string().max(65000).optional(),
threshold: CreateAlertThresholdSchema.optional(),
Expand All @@ -35,7 +36,9 @@ const ListAlertIdSchema = z.object({
in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
});
const ListAlertTypeSchema = z.object({
is: z.enum(['usage_exceeded', 'spend_exceeded']).optional(),
is: z
.enum(['usage_exceeded', 'spend_exceeded', 'credit_balance_dropped'])
.optional(),
});
const ListAlertSubscriptionIdSchema = z.object({
is: z.string().min(1).optional(),
Expand Down Expand Up @@ -73,7 +76,9 @@ const ApplicationAlertsforsubscriptionAlertStatusSchema = z.object({
is: z.enum(['enabled', 'disabled']).optional(),
});
const ApplicationAlertsforsubscriptionAlertTypeSchema = z.object({
is: z.enum(['usage_exceeded', 'spend_exceeded']).optional(),
is: z
.enum(['usage_exceeded', 'spend_exceeded', 'credit_balance_dropped'])
.optional(),
});
const ApplicationAlertsforsubscriptionAlertBodySchema = z.looseObject({
limit: z.number().int().min(1).max(100).optional(),
Expand Down
2 changes: 1 addition & 1 deletion src/schema/coupon.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,8 @@ const ListCouponCurrencyCodeSchema = z.object({
not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
});
const ListCouponApplicableItemPriceIdsSchema = z.object({
is: z.string().min(1).optional(),
in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
is: z.string().min(1).optional(),
});
const ListCouponBodySchema = z.looseObject({
limit: z.number().int().min(1).max(100).optional(),
Expand Down
8 changes: 8 additions & 0 deletions src/schema/credit_note.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ const RecordRefundCreditNoteTransactionSchema = z.object({
'app_store',
'play_store',
'custom',
'dana',
'touch_n_go',
'tamara',
'qpay',
]),
reference_number: z.string().max(100).optional(),
custom_payment_method_id: z.string().max(50).optional(),
Expand Down Expand Up @@ -526,6 +530,10 @@ const ImportCreditNoteCreditNoteLinkedRefundsSchema = z.object({
'app_store',
'play_store',
'custom',
'dana',
'touch_n_go',
'tamara',
'qpay',
])
.optional(),
),
Expand Down
45 changes: 45 additions & 0 deletions src/schema/credit_unit.schema.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Generated Zod schemas: CreditUnit
// Actions: list, create, update
// Do not edit manually – regenerate via sdk-generator

import { z } from 'zod';

//CreditUnit.list

const ListCreditUnitStatusSchema = z.object({
in: z.enum(['active', 'archived']).optional(),
is: z.enum(['active', 'archived']).optional(),
});
const ListCreditUnitIdSchema = z.object({
in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
is: z.string().min(1).optional(),
});
const ListCreditUnitBodySchema = z.looseObject({
limit: z.number().int().min(1).max(100).optional(),
offset: z.string().max(1000).optional(),
status: ListCreditUnitStatusSchema.optional(),
id: ListCreditUnitIdSchema.optional(),
});
export { ListCreditUnitBodySchema };
export type ListCreditUnitBody = z.infer<typeof ListCreditUnitBodySchema>;

//CreditUnit.create

const CreateCreditUnitBodySchema = z.looseObject({
id: z.string().max(50),
name: z.string().max(50),
is_unlimited: z.boolean(),
overdraft_amount: z.string().max(50).optional(),
external_name: z.string().max(50).optional(),
});
export { CreateCreditUnitBodySchema };
export type CreateCreditUnitBody = z.infer<typeof CreateCreditUnitBodySchema>;

//CreditUnit.update

const UpdateCreditUnitBodySchema = z.looseObject({
name: z.string().max(50).optional(),
external_name: z.string().max(50).optional(),
});
export { UpdateCreditUnitBodySchema };
export type UpdateCreditUnitBody = z.infer<typeof UpdateCreditUnitBodySchema>;
Loading
Loading