Skip to content
Open
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
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
### v2.73.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).



### v2.72.0 (2026-06-08)
* * *
### New Attributes:
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
chargebee (2.72.0)
chargebee (2.73.0)
cgi (>= 0.1.0, < 1.0.0)

GEM
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.72.0
2.73.0
8 changes: 6 additions & 2 deletions chargebee.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Gem::Specification.new do |s|
s.rubygems_version = '1.3.5'
s.required_ruby_version = '>= 1.9.3'
s.name = 'chargebee'
s.version = '2.72.0'
s.date = '2026-06-08'
s.version = '2.73.0'
s.date = '2026-06-12'
s.summary = "Ruby client for Chargebee API."
s.description = "Subscription Billing - Simple. Secure. Affordable. More details at www.chargebee.com."
s.metadata = {
Expand Down Expand Up @@ -81,6 +81,7 @@ Gem::Specification.new do |s|
lib/chargebee/models/filter_condition.rb
lib/chargebee/models/gateway_error_detail.rb
lib/chargebee/models/gift.rb
lib/chargebee/models/grant_block.rb
lib/chargebee/models/hierarchy.rb
lib/chargebee/models/hosted_page.rb
lib/chargebee/models/impacted_customer.rb
Expand All @@ -94,6 +95,8 @@ Gem::Specification.new do |s|
lib/chargebee/models/item_entitlement.rb
lib/chargebee/models/item_family.rb
lib/chargebee/models/item_price.rb
lib/chargebee/models/ledger_account_balance.rb
lib/chargebee/models/ledger_operation.rb
lib/chargebee/models/metadata.rb
lib/chargebee/models/model.rb
lib/chargebee/models/non_subscription.rb
Expand All @@ -120,6 +123,7 @@ Gem::Specification.new do |s|
lib/chargebee/models/price_variant.rb
lib/chargebee/models/pricing_page_session.rb
lib/chargebee/models/promotional_credit.rb
lib/chargebee/models/promotional_grant.rb
lib/chargebee/models/purchase.rb
lib/chargebee/models/quote.rb
lib/chargebee/models/quote_entitlement.rb
Expand Down
2 changes: 1 addition & 1 deletion lib/chargebee.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@

module ChargeBee

VERSION = '2.72.0'
VERSION = '2.73.0'

@@default_env = nil
@@verify_ca_certs = true
Expand Down
2 changes: 1 addition & 1 deletion lib/chargebee/models/credit_note.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class SiteDetailsAtCreation < Model
:status, :vat_number, :date, :price_type, :currency_code, :total, :amount_allocated, :amount_refunded,
:amount_available, :refunded_at, :voided_at, :generated_at, :resource_version, :updated_at,
:channel, :line_items_next_offset, :sub_total, :sub_total_in_local_currency, :total_in_local_currency,
:local_currency_code, :round_off_amount, :fractional_correction, :line_items, :line_item_tiers,
:local_currency_code, :round_off_amount, :fractional_correction, :notes, :line_items, :line_item_tiers,
:line_item_discounts, :line_item_taxes, :line_item_addresses, :discounts, :taxes, :tax_origin,
:linked_refunds, :allocations, :deleted, :tax_category, :local_currency_exchange_rate, :create_reason_code,
:vat_number_prefix, :business_entity_id, :shipping_address, :billing_address, :einvoice, :site_details_at_creation
Expand Down
19 changes: 19 additions & 0 deletions lib/chargebee/models/grant_block.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module ChargeBee
class GrantBlock < Model

attr_accessor :id, :granted_amount, :effective_from, :expires_at, :balance, :hold_amount, :used_amount,
:expired_amount, :rolled_over_amount, :voided_amount, :origin_grant_block_id, :status, :metadata,
:grant_source, :created_at, :account_type, :unit_id, :unit_type

# OPERATIONS
#-----------

def self.list_grant_blocks(params, env=nil, headers={})
jsonKeys = {
}
options = {}
Request.send('get', uri_path("grant_blocks"), params, env, headers,nil, true, jsonKeys, options)
end

end # ~GrantBlock
end # ~ChargeBee
3 changes: 2 additions & 1 deletion lib/chargebee/models/hosted_page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module ChargeBee
class HostedPage < Model

attr_accessor :id, :type, :url, :state, :failure_reason, :pass_thru_content, :embed, :created_at,
:expires_at, :updated_at, :resource_version, :checkout_info, :business_entity_id
:expires_at, :layout, :updated_at, :resource_version, :checkout_info, :business_entity_id

class Content < Result
end
Expand Down Expand Up @@ -82,6 +82,7 @@ def self.update_card(params, env=nil, headers={})
Request.send('post', uri_path("hosted_pages","update_card"), params, env, headers,nil, false, jsonKeys, options)
end

# @deprecated This method is deprecated and will be removed in a future version.
def self.update_payment_method(params, env=nil, headers={})
jsonKeys = {
}
Expand Down
25 changes: 25 additions & 0 deletions lib/chargebee/models/ledger_account_balance.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module ChargeBee
class LedgerAccountBalance < Model

class ProvisionedBalance < Model
attr_accessor :total_balance, :usable_balance, :hold_amount
end

class OverdraftBalance < Model
attr_accessor :is_unlimited, :limit, :total_balance, :usable_balance, :used_amount, :hold_amount
end

attr_accessor :subscription_id, :unit_id, :unit_type, :modified_at, :provisioned_balance, :overdraft_balance

# OPERATIONS
#-----------

def self.list_ledger_account_balances(params, env=nil, headers={})
jsonKeys = {
}
options = {}
Request.send('get', uri_path("ledger_account_balances"), params, env, headers,nil, true, jsonKeys, options)
end

end # ~LedgerAccountBalance
end # ~ChargeBee
59 changes: 59 additions & 0 deletions lib/chargebee/models/ledger_operation.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
module ChargeBee
class LedgerOperation < Model

attr_accessor :id, :type, :amount, :start_balance, :end_balance, :provisioned_start_balance,
:provisioned_end_balance, :overdraft_start_balance, :overdraft_end_balance, :parent_ledger_operation_id,
:ledger_operation_timestamp, :auto_release_timestamp, :metadata, :created_at, :modified_at,
:subscription_id, :unit_id, :unit_type

# OPERATIONS
#-----------

def self.retrieve_ledger_operation(id, env=nil, headers={})
jsonKeys = {
}
options = {}
Request.send('get', uri_path("ledger_operations",id.to_s), {}, env, headers,nil, false, jsonKeys, options)
end

def self.list_ledger_operations(params, env=nil, headers={})
jsonKeys = {
}
options = {}
Request.send('get', uri_path("ledger_operations"), params, env, headers,nil, true, jsonKeys, options)
end

def self.capture(params, env=nil, headers={})
jsonKeys = {
:metadata => 0,
}
options = {}
Request.send('post', uri_path("ledger_operations","capture"), params, env, headers,nil, true, jsonKeys, options)
end

def self.authorize(params, env=nil, headers={})
jsonKeys = {
:metadata => 0,
}
options = {}
Request.send('post', uri_path("ledger_operations","authorize"), params, env, headers,nil, true, jsonKeys, options)
end

def self.capture_authorization(params, env=nil, headers={})
jsonKeys = {
:metadata => 0,
}
options = {}
Request.send('post', uri_path("ledger_operations","capture_authorization"), params, env, headers,nil, true, jsonKeys, options)
end

def self.release_authorization(params, env=nil, headers={})
jsonKeys = {
:metadata => 0,
}
options = {}
Request.send('post', uri_path("ledger_operations","release_authorization"), params, env, headers,nil, true, jsonKeys, options)
end
Comment on lines +19 to +56

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Priority: 🟠 HIGH

Problem: The capture, authorize, capture_authorization, and release_authorization methods pass true for the boolean argument to Request.send, which is used to indicate a list response in the same file (list_ledger_operations), causing these single-operation endpoints to be treated as list endpoints.

Why: Treating a single-resource response as a list can break result parsing, e.g., callers expecting Result#ledger_operation may not work correctly if the internal Result is configured for list semantics, leading to runtime errors or incorrect data handling.

How to Fix: Change the boolean argument in these four Request.send calls from true to false so that these methods are handled as single-resource operations, consistent with retrieve_ledger_operation.

Suggested change
def self.list_ledger_operations(params, env=nil, headers={})
jsonKeys = {
}
options = {}
Request.send('get', uri_path("ledger_operations"), params, env, headers,nil, true, jsonKeys, options)
end
def self.capture(params, env=nil, headers={})
jsonKeys = {
:metadata => 0,
}
options = {}
Request.send('post', uri_path("ledger_operations","capture"), params, env, headers,nil, true, jsonKeys, options)
end
def self.authorize(params, env=nil, headers={})
jsonKeys = {
:metadata => 0,
}
options = {}
Request.send('post', uri_path("ledger_operations","authorize"), params, env, headers,nil, true, jsonKeys, options)
end
def self.capture_authorization(params, env=nil, headers={})
jsonKeys = {
:metadata => 0,
}
options = {}
Request.send('post', uri_path("ledger_operations","capture_authorization"), params, env, headers,nil, true, jsonKeys, options)
end
def self.release_authorization(params, env=nil, headers={})
jsonKeys = {
:metadata => 0,
}
options = {}
Request.send('post', uri_path("ledger_operations","release_authorization"), params, env, headers,nil, true, jsonKeys, options)
end
def self.list_ledger_operations(params, env=nil, headers={})
jsonKeys = {
}
options = {}
Request.send('get', uri_path("ledger_operations"), params, env, headers,nil, true, jsonKeys, options)
end
def self.capture(params, env=nil, headers={})
jsonKeys = {
:metadata => 0,
}
options = {}
Request.send('post', uri_path("ledger_operations","capture"), params, env, headers,nil, false, jsonKeys, options)
end
def self.authorize(params, env=nil, headers={})
jsonKeys = {
:metadata => 0,
}
options = {}
Request.send('post', uri_path("ledger_operations","authorize"), params, env, headers,nil, false, jsonKeys, options)
end
def self.capture_authorization(params, env=nil, headers={})
jsonKeys = {
:metadata => 0,
}
options = {}
Request.send('post', uri_path("ledger_operations","capture_authorization"), params, env, headers,nil, false, jsonKeys, options)
end
def self.release_authorization(params, env=nil, headers={})
jsonKeys = {
:metadata => 0,
}
options = {}
Request.send('post', uri_path("ledger_operations","release_authorization"), params, env, headers,nil, false, jsonKeys, options)
end


end # ~LedgerOperation
end # ~ChargeBee
20 changes: 20 additions & 0 deletions lib/chargebee/models/promotional_grant.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module ChargeBee
class PromotionalGrant < Model

attr_accessor :subscription_id, :unit_id, :amount, :expires_at, :metadata

# OPERATIONS
#-----------

def self.promotional_grants(params, env=nil, headers={})
jsonKeys = {
:metadata => 0,
}
options = {
:isIdempotent => true
}
Request.send('post', uri_path("promotional_grants"), params, env, headers,nil, true, jsonKeys, options)
end

end # ~PromotionalGrant
end # ~ChargeBee
33 changes: 33 additions & 0 deletions lib/chargebee/result.rb
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,27 @@ def alert_status()
return alert_status;
end

def ledger_account_balance()
ledger_account_balance = get(:ledger_account_balance, LedgerAccountBalance,
{:provisioned_balance => LedgerAccountBalance::ProvisionedBalance, :overdraft_balance => LedgerAccountBalance::OverdraftBalance});
return ledger_account_balance;
end

def ledger_operation()
ledger_operation = get(:ledger_operation, LedgerOperation);
return ledger_operation;
end

def grant_block()
grant_block = get(:grant_block, GrantBlock);
return grant_block;
end

def promotional_grant()
promotional_grant = get(:promotional_grant, PromotionalGrant);
return promotional_grant;
end

def impacted_customer()
impacted_customer = get(:impacted_customer, ImpactedCustomer,
{:download => ImpactedCustomer::Download});
Expand Down Expand Up @@ -669,6 +690,18 @@ def personalized_offers()
return personalized_offers;
end

def ledger_operations()
ledger_operations = get_list(:ledger_operations, LedgerOperation,
{});
return ledger_operations;
end

def grant_blocks()
grant_blocks = get_list(:grant_blocks, GrantBlock,
{});
return grant_blocks;
end


def to_s(*args)
JSON.pretty_generate(@response)
Expand Down
Loading