From 2f96ea072ddf0a286d2e49c26851493ebe18cec1 Mon Sep 17 00:00:00 2001 From: cb-alish Date: Fri, 12 Jun 2026 15:15:07 +0530 Subject: [PATCH] Releasing v3.26.0 --- CHANGELOG.md | 37 +++++ VERSION | 2 +- package-lock.json | 4 +- package.json | 2 +- src/environment.ts | 2 +- src/resources/api_endpoints.ts | 123 ++++++++++++++++ types/core.d.ts | 1 + types/index.d.ts | 8 ++ types/resources/Content.d.ts | 4 + types/resources/CreditNote.d.ts | 1 + types/resources/GrantBlock.d.ts | 59 ++++++++ types/resources/HostedPage.d.ts | 6 +- types/resources/LedgerAccountBalance.d.ts | 50 +++++++ types/resources/LedgerOperation.d.ts | 141 +++++++++++++++++++ types/resources/OmnichannelSubscription.d.ts | 2 + types/resources/PromotionalGrant.d.ts | 37 +++++ 16 files changed, 473 insertions(+), 6 deletions(-) create mode 100644 types/resources/GrantBlock.d.ts create mode 100644 types/resources/LedgerAccountBalance.d.ts create mode 100644 types/resources/LedgerOperation.d.ts create mode 100644 types/resources/PromotionalGrant.d.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index ac90924..9e421a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,40 @@ +### v3.26.0 (2026-06-12) +* * * +### New Resources: +- [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks) has been added. +- [`LedgerAccountBalance`](https://apidocs.chargebee.com/docs/api/ledger_account_balances) has been added. +- [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations) has been added. +- [`PromotionalGrant`](https://apidocs.chargebee.com/docs/api/promotional_grants) has been added. + + +### New Attributes: +- [`notes`](https://apidocs.chargebee.com/docs/api/credit_notes/credit-note-object#notes) has been added to [`CreditNote`](https://apidocs.chargebee.com/docs/api/credit_notes). +- [`layout`](https://apidocs.chargebee.com/docs/api/hosted_pages/hosted-page-object#layout) has been added to [`HostedPage`](https://apidocs.chargebee.com/docs/api/hosted_pages). + + +### New Parameters: +- [`sort_by`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions#sort_by) has been added as query parameter to [`list_omnichannel_subscriptions`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions) in [`OmnichannelSubscription`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions). + + +### New Enums: +- `available`, `exhausted`, `scheduled`, and `in_grace_period` have been added as new values enum `Status`. +- `subscription_created`, `subscription_changed`, `top_up`, `promotional_grants`, and `rollover` 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/grant_blocks/grant-block-object#account_type) in [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks). +- `credit_unit` has been added as a new value to enum attribute [`unit_type`](https://apidocs.chargebee.com/docs/api/grant_blocks/grant-block-object#unit_type) in [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks). +- `credit_unit` has been added as a new value to enum attribute [`unit_type`](https://apidocs.chargebee.com/docs/api/ledger_account_balances/ledger-account-balance-object#unit_type) in [`LedgerAccountBalance`](https://apidocs.chargebee.com/docs/api/ledger_account_balances). +- `allocation`, `capture`, `authorize`, `release_authorization`, `capture_authorization`, `expiry`, `void`, `rollover`, and `adjustment` have been added as new values to enum attribute [`type`](https://apidocs.chargebee.com/docs/api/ledger_operations/ledger-operation-object#type) in [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). +- `credit_unit` has been added as a new value to enum attribute [`unit_type`](https://apidocs.chargebee.com/docs/api/ledger_operations/ledger-operation-object#unit_type) in [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). +- `expires_at`, `created_at`, and `effective_from` have been added as new values to enum query parameter `sort_by.asc` 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). +- `expires_at`, `created_at`, and `effective_from` have been added as new values to enum query parameter `sort_by.desc` 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). +- `allocation`, `release_authorization`, `void`, `capture`, `rollover`, `adjustment`, `expiry`, `authorize`, and `capture_authorization` have been added as new values to enum query parameter `type.is` in [`list_ledger_operations`](https://apidocs.chargebee.com/docs/api/ledger_operations/list-ledger-operations) of [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). +- `allocation`, `release_authorization`, `void`, `capture`, `rollover`, `adjustment`, `expiry`, `authorize`, and `capture_authorization` have been added as new values to enum query parameter `type.in` in [`list_ledger_operations`](https://apidocs.chargebee.com/docs/api/ledger_operations/list-ledger-operations) of [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). +- `created_at` has been added as a new value to enum query parameter `sort_by.asc` in [`list_ledger_operations`](https://apidocs.chargebee.com/docs/api/ledger_operations/list-ledger-operations) of [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). +- `created_at` has been added as a new value to enum query parameter `sort_by.desc` in [`list_ledger_operations`](https://apidocs.chargebee.com/docs/api/ledger_operations/list-ledger-operations) of [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). +- `updated_at` and `created_at` have been added as new values to enum query parameter `sort_by.asc` in [`list_omnichannel_subscriptions`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions) of [`OmnichannelSubscription`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions). +- `updated_at` and `created_at` have been added as new values to enum query parameter `sort_by.desc` in [`list_omnichannel_subscriptions`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions) of [`OmnichannelSubscription`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions). + + + ### v3.25.0 (2026-06-08) * * * ### New Attributes: diff --git a/VERSION b/VERSION index 0914443..419ede3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.25.0 +3.26.0 diff --git a/package-lock.json b/package-lock.json index 3acbe7d..d265386 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "chargebee", - "version": "3.25.0", + "version": "3.26.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "chargebee", - "version": "3.25.0", + "version": "3.26.0", "devDependencies": { "@types/chai": "^4.3.5", "@types/mocha": "^10.0.10", diff --git a/package.json b/package.json index 8c1b042..72ed59a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "chargebee", - "version": "3.25.0", + "version": "3.26.0", "description": "A library for integrating with Chargebee.", "scripts": { "prepack": "npm install && npm run build", diff --git a/src/environment.ts b/src/environment.ts index 28c7efc..b7ce522 100644 --- a/src/environment.ts +++ b/src/environment.ts @@ -9,7 +9,7 @@ export const Environment = { hostSuffix: '.chargebee.com', apiPath: '/api/v2', timeout: DEFAULT_TIME_OUT, - clientVersion: 'v3.25.0', + clientVersion: 'v3.26.0', port: DEFAULT_PORT, timemachineWaitInMillis: DEFAULT_TIME_MACHINE_WAIT, exportWaitInMillis: DEFAULT_EXPORT_WAIT, diff --git a/src/resources/api_endpoints.ts b/src/resources/api_endpoints.ts index 3b16ec8..322b633 100644 --- a/src/resources/api_endpoints.ts +++ b/src/resources/api_endpoints.ts @@ -111,6 +111,10 @@ interface Endpoints { alert: EndpointTuple[]; filterCondition: EndpointTuple[]; alertStatus: EndpointTuple[]; + ledgerAccountBalance: EndpointTuple[]; + ledgerOperation: EndpointTuple[]; + grantBlock: EndpointTuple[]; + promotionalGrant: EndpointTuple[]; impactedCustomer: EndpointTuple[]; subscriptionEntitlementsUpdatedDetail: EndpointTuple[]; subscriptionEntitlementsCreatedDetail: EndpointTuple[]; @@ -5168,6 +5172,125 @@ export const Endpoints: Endpoints = { {}, ], ], + ledgerAccountBalance: [ + [ + 'listLedgerAccountBalances', + 'GET', + '/ledger_account_balances', + null, + false, + null, + true, + {}, + {}, + ], + ], + ledgerOperation: [ + [ + 'retrieveLedgerOperation', + 'GET', + '/ledger_operations', + null, + true, + null, + false, + {}, + {}, + ], + [ + 'listLedgerOperations', + 'GET', + '/ledger_operations', + null, + false, + null, + true, + {}, + {}, + ], + [ + 'capture', + 'POST', + '/ledger_operations', + '/capture', + false, + null, + true, + { + metadata: 0, + }, + {}, + ], + [ + 'authorize', + 'POST', + '/ledger_operations', + '/authorize', + false, + null, + true, + { + metadata: 0, + }, + {}, + ], + [ + 'captureAuthorization', + 'POST', + '/ledger_operations', + '/capture_authorization', + false, + null, + true, + { + metadata: 0, + }, + {}, + ], + [ + 'releaseAuthorization', + 'POST', + '/ledger_operations', + '/release_authorization', + false, + null, + true, + { + metadata: 0, + }, + {}, + ], + ], + grantBlock: [ + [ + 'listGrantBlocks', + 'GET', + '/grant_blocks', + null, + false, + null, + true, + {}, + {}, + ], + ], + promotionalGrant: [ + [ + 'promotionalGrants', + 'POST', + '/promotional_grants', + null, + false, + null, + true, + { + metadata: 0, + }, + { + isIdempotent: true, + }, + ], + ], impactedCustomer: [], subscriptionEntitlementsUpdatedDetail: [], subscriptionEntitlementsCreatedDetail: [], diff --git a/types/core.d.ts b/types/core.d.ts index 60350af..18f36ef 100644 --- a/types/core.d.ts +++ b/types/core.d.ts @@ -626,6 +626,7 @@ declare module 'chargebee' { | 'js_api' | 'migration' | 'external_service'; + type StatusEnum = 'available' | 'exhausted' | 'scheduled' | 'in_grace_period'; type TaxExemptReasonEnum = | 'tax_not_configured' | 'region_non_taxable' diff --git a/types/index.d.ts b/types/index.d.ts index b5eb5eb..cd584ef 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -36,6 +36,7 @@ /// /// /// +/// /// /// /// @@ -49,6 +50,8 @@ /// /// /// +/// +/// /// /// /// @@ -74,6 +77,7 @@ /// /// /// +/// /// /// /// @@ -209,6 +213,7 @@ declare module 'chargebee' { export: Export.ExportResource; feature: Feature.FeatureResource; gift: Gift.GiftResource; + grantBlock: GrantBlock.GrantBlockResource; hostedPage: HostedPage.HostedPageResource; inAppSubscription: InAppSubscription.InAppSubscriptionResource; invoice: Invoice.InvoiceResource; @@ -216,6 +221,8 @@ declare module 'chargebee' { itemEntitlement: ItemEntitlement.ItemEntitlementResource; itemFamily: ItemFamily.ItemFamilyResource; itemPrice: ItemPrice.ItemPriceResource; + ledgerAccountBalance: LedgerAccountBalance.LedgerAccountBalanceResource; + ledgerOperation: LedgerOperation.LedgerOperationResource; nonSubscription: NonSubscription.NonSubscriptionResource; offerEvent: OfferEvent.OfferEventResource; offerFulfillment: OfferFulfillment.OfferFulfillmentResource; @@ -233,6 +240,7 @@ declare module 'chargebee' { priceVariant: PriceVariant.PriceVariantResource; pricingPageSession: PricingPageSession.PricingPageSessionResource; promotionalCredit: PromotionalCredit.PromotionalCreditResource; + promotionalGrant: PromotionalGrant.PromotionalGrantResource; purchase: Purchase.PurchaseResource; quote: Quote.QuoteResource; ramp: Ramp.RampResource; diff --git a/types/resources/Content.d.ts b/types/resources/Content.d.ts index 36a64e8..c8b2a42 100644 --- a/types/resources/Content.d.ts +++ b/types/resources/Content.d.ts @@ -41,6 +41,7 @@ declare module 'chargebee' { filter_condition: FilterCondition; gateway_error_detail: GatewayErrorDetail; gift: Gift; + grant_block: GrantBlock; hierarchy: Hierarchy; hosted_page: HostedPage; impacted_customer: ImpactedCustomer; @@ -54,6 +55,8 @@ declare module 'chargebee' { item_entitlement: ItemEntitlement; item_family: ItemFamily; item_price: ItemPrice; + ledger_account_balance: LedgerAccountBalance; + ledger_operation: LedgerOperation; metadata: Metadata; non_subscription: NonSubscription; offer_event: OfferEvent; @@ -79,6 +82,7 @@ declare module 'chargebee' { price_variant: PriceVariant; pricing_page_session: PricingPageSession; promotional_credit: PromotionalCredit; + promotional_grant: PromotionalGrant; purchase: Purchase; quote: Quote; quote_line_group: QuoteLineGroup; diff --git a/types/resources/CreditNote.d.ts b/types/resources/CreditNote.d.ts index 7d5e341..90cf1b4 100644 --- a/types/resources/CreditNote.d.ts +++ b/types/resources/CreditNote.d.ts @@ -44,6 +44,7 @@ declare module 'chargebee' { local_currency_code?: string; round_off_amount?: number; fractional_correction?: number; + notes?: string[]; line_items?: CreditNote.LineItem[]; line_item_tiers?: CreditNote.LineItemTier[]; line_item_discounts?: CreditNote.LineItemDiscount[]; diff --git a/types/resources/GrantBlock.d.ts b/types/resources/GrantBlock.d.ts new file mode 100644 index 0000000..4ca6bb9 --- /dev/null +++ b/types/resources/GrantBlock.d.ts @@ -0,0 +1,59 @@ +/// +/// +/// +declare module 'chargebee' { + export interface GrantBlock { + id: string; + granted_amount: string; + effective_from: number; + expires_at: number; + balance: string; + hold_amount: string; + used_amount: string; + expired_amount: string; + rolled_over_amount: string; + voided_amount: string; + origin_grant_block_id?: string; + status: StatusEnum; + metadata?: string; + grant_source: + | 'subscription_created' + | 'subscription_changed' + | 'top_up' + | 'promotional_grants' + | 'rollover'; + created_at?: number; + account_type?: 'provisioned' | 'overdraft'; + unit_id?: string; + unit_type?: 'credit_unit'; + } + + export namespace GrantBlock { + export class GrantBlockResource { + listGrantBlocks( + input: ListGrantBlocksInputParam, + headers?: ChargebeeRequestHeader, + ): Promise>; + } + + export interface ListGrantBlocksResponse { + list: { grant_block: GrantBlock }[]; + next_offset?: string; + } + + // REQUEST PARAMS + //--------------- + + export interface ListGrantBlocksInputParam { + limit?: number; + offset?: string; + subscription_id: filter.String; + unit_id?: filter.String; + effective_from?: filter.Timestamp; + expires_at?: filter.Timestamp; + created_at?: filter.Timestamp; + 'sort_by[asc]'?: string; + 'sort_by[desc]'?: string; + } + } +} diff --git a/types/resources/HostedPage.d.ts b/types/resources/HostedPage.d.ts index 3c846f3..d94a367 100644 --- a/types/resources/HostedPage.d.ts +++ b/types/resources/HostedPage.d.ts @@ -7,7 +7,6 @@ declare module 'chargebee' { type?: | 'checkout_new' | 'checkout_existing' - | 'update_payment_method' | 'manage_payment_sources' | 'collect_now' | 'extend_subscription' @@ -29,6 +28,7 @@ declare module 'chargebee' { embed: boolean; created_at?: number; expires_at?: number; + layout?: LayoutEnum; content: Content; updated_at?: number; resource_version?: number; @@ -77,6 +77,10 @@ declare module 'chargebee' { headers?: ChargebeeRequestHeader, ): Promise>; + /** + * @deprecated This method is deprecated and will be removed in a future version. + */ + updatePaymentMethod( input: UpdatePaymentMethodInputParam, headers?: ChargebeeRequestHeader, diff --git a/types/resources/LedgerAccountBalance.d.ts b/types/resources/LedgerAccountBalance.d.ts new file mode 100644 index 0000000..0158bae --- /dev/null +++ b/types/resources/LedgerAccountBalance.d.ts @@ -0,0 +1,50 @@ +/// +/// +/// +declare module 'chargebee' { + export interface LedgerAccountBalance { + subscription_id: string; + unit_id: string; + unit_type: 'credit_unit'; + modified_at?: number; + provisioned_balance?: LedgerAccountBalance.ProvisionedBalance; + overdraft_balance?: LedgerAccountBalance.OverdraftBalance; + } + + export namespace LedgerAccountBalance { + export class LedgerAccountBalanceResource { + listLedgerAccountBalances( + input: ListLedgerAccountBalancesInputParam, + headers?: ChargebeeRequestHeader, + ): Promise>; + } + + export interface ListLedgerAccountBalancesResponse { + list: { ledger_account_balance: LedgerAccountBalance }[]; + next_offset?: string; + } + + export interface ProvisionedBalance { + total_balance: string; + usable_balance: string; + hold_amount: string; + } + export interface OverdraftBalance { + is_unlimited: boolean; + limit?: string; + total_balance?: string; + usable_balance?: string; + used_amount: string; + hold_amount: string; + } + // REQUEST PARAMS + //--------------- + + export interface ListLedgerAccountBalancesInputParam { + limit?: number; + offset?: string; + subscription_id: filter.String; + unit_id?: filter.String; + } + } +} diff --git a/types/resources/LedgerOperation.d.ts b/types/resources/LedgerOperation.d.ts new file mode 100644 index 0000000..251f0dc --- /dev/null +++ b/types/resources/LedgerOperation.d.ts @@ -0,0 +1,141 @@ +/// +/// +/// +declare module 'chargebee' { + export interface LedgerOperation { + id: string; + type: + | 'allocation' + | 'capture' + | 'authorize' + | 'release_authorization' + | 'capture_authorization' + | 'expiry' + | 'void' + | 'rollover' + | 'adjustment'; + amount: string; + start_balance: string; + end_balance: string; + provisioned_start_balance: string; + provisioned_end_balance: string; + overdraft_start_balance: string; + overdraft_end_balance: string; + parent_ledger_operation_id?: string; + ledger_operation_timestamp?: number; + auto_release_timestamp?: number; + metadata?: string; + created_at?: number; + modified_at?: number; + subscription_id?: string; + unit_id?: string; + unit_type?: 'credit_unit'; + } + + export namespace LedgerOperation { + export class LedgerOperationResource { + retrieveLedgerOperation( + ledger_operation_id: string, + headers?: ChargebeeRequestHeader, + ): Promise>; + + listLedgerOperations( + input: ListLedgerOperationsInputParam, + headers?: ChargebeeRequestHeader, + ): Promise>; + + capture( + input: CaptureInputParam, + headers?: ChargebeeRequestHeader, + ): Promise>; + + authorize( + input: AuthorizeInputParam, + headers?: ChargebeeRequestHeader, + ): Promise>; + + captureAuthorization( + input: CaptureAuthorizationInputParam, + headers?: ChargebeeRequestHeader, + ): Promise>; + + releaseAuthorization( + input: ReleaseAuthorizationInputParam, + headers?: ChargebeeRequestHeader, + ): Promise>; + } + + export interface RetrieveLedgerOperationResponse { + ledger_operation: LedgerOperation; + } + + export interface ListLedgerOperationsResponse { + list: { ledger_operation: LedgerOperation }[]; + next_offset?: string; + } + + export interface CaptureResponse { + ledger_operation: LedgerOperation; + ledger_account_balance: LedgerAccountBalance; + } + + export interface AuthorizeResponse { + ledger_operation: LedgerOperation; + ledger_account_balance: LedgerAccountBalance; + } + + export interface CaptureAuthorizationResponse { + ledger_operation: LedgerOperation; + ledger_account_balance: LedgerAccountBalance; + } + + export interface ReleaseAuthorizationResponse { + ledger_operation: LedgerOperation; + ledger_account_balance: LedgerAccountBalance; + } + + // REQUEST PARAMS + //--------------- + + export interface ListLedgerOperationsInputParam { + limit?: number; + offset?: string; + subscription_id: filter.String; + unit_id?: filter.String; + created_at?: filter.Timestamp; + type?: filter.Enum; + 'sort_by[asc]'?: string; + 'sort_by[desc]'?: string; + } + export interface CaptureInputParam { + id?: string; + subscription_id: string; + unit_id: string; + amount: string; + ledger_operation_timestamp: number; + metadata?: any; + } + export interface AuthorizeInputParam { + id?: string; + subscription_id: string; + unit_id: string; + amount: string; + ledger_operation_timestamp: number; + auto_release_timestamp?: number; + metadata?: any; + } + export interface CaptureAuthorizationInputParam { + authorization_id: string; + id?: string; + amount: string; + ledger_operation_timestamp: number; + metadata?: any; + } + export interface ReleaseAuthorizationInputParam { + authorization_id: string; + id?: string; + ledger_operation_timestamp: number; + metadata?: any; + } + } +} diff --git a/types/resources/OmnichannelSubscription.d.ts b/types/resources/OmnichannelSubscription.d.ts index a00209b..69505a7 100644 --- a/types/resources/OmnichannelSubscription.d.ts +++ b/types/resources/OmnichannelSubscription.d.ts @@ -74,6 +74,8 @@ declare module 'chargebee' { id_at_source?: filter.String; updated_at?: filter.Timestamp; purchased_at?: filter.Timestamp; + 'sort_by[asc]'?: string; + 'sort_by[desc]'?: string; } export interface OmnichannelTransactionsForOmnichannelSubscriptionInputParam { limit?: number; diff --git a/types/resources/PromotionalGrant.d.ts b/types/resources/PromotionalGrant.d.ts new file mode 100644 index 0000000..9d50f66 --- /dev/null +++ b/types/resources/PromotionalGrant.d.ts @@ -0,0 +1,37 @@ +/// +/// + +declare module 'chargebee' { + export interface PromotionalGrant { + subscription_id: string; + unit_id: string; + amount: string; + expires_at: number; + metadata?: string; + } + + export namespace PromotionalGrant { + export class PromotionalGrantResource { + promotionalGrants( + input: PromotionalGrantsInputParam, + headers?: ChargebeeRequestHeader, + ): Promise>; + } + + export interface PromotionalGrantsResponse { + ledger_operations: LedgerOperation[]; + grant_blocks: GrantBlock[]; + } + + // REQUEST PARAMS + //--------------- + + export interface PromotionalGrantsInputParam { + subscription_id: string; + unit_id: string; + amount: string; + expires_at: number; + metadata?: any; + } + } +}