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 @@
### v2.78.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).



### v2.77.0 (2026-07-21)
* * *
### New Resources:
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.77.0)
chargebee (2.78.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.77.0
2.78.0
6 changes: 4 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.77.0'
s.date = '2026-07-21'
s.version = '2.78.0'
s.date = '2026-07-30'
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 @@ -67,6 +67,7 @@ Gem::Specification.new do |s|
lib/chargebee/models/cpq_quote_signature.rb
lib/chargebee/models/credit_note.rb
lib/chargebee/models/credit_note_estimate.rb
lib/chargebee/models/credit_unit.rb
lib/chargebee/models/csv_tax_rule.rb
lib/chargebee/models/currency.rb
lib/chargebee/models/customer.rb
Expand Down Expand Up @@ -99,6 +100,7 @@ Gem::Specification.new do |s|
lib/chargebee/models/item_family.rb
lib/chargebee/models/item_price.rb
lib/chargebee/models/ledger_account_balance.rb
lib/chargebee/models/ledger_entry.rb
lib/chargebee/models/ledger_operation.rb
lib/chargebee/models/metadata.rb
lib/chargebee/models/meter.rb
Expand Down
4 changes: 3 additions & 1 deletion lib/chargebee.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
require File.dirname(__FILE__) + '/chargebee/models/cpq_quote_signature'
require File.dirname(__FILE__) + '/chargebee/models/credit_note'
require File.dirname(__FILE__) + '/chargebee/models/credit_note_estimate'
require File.dirname(__FILE__) + '/chargebee/models/credit_unit'
require File.dirname(__FILE__) + '/chargebee/models/currency'
require File.dirname(__FILE__) + '/chargebee/models/customer'
require File.dirname(__FILE__) + '/chargebee/models/customer_entitlement'
Expand Down Expand Up @@ -72,6 +73,7 @@
require File.dirname(__FILE__) + '/chargebee/models/item_family'
require File.dirname(__FILE__) + '/chargebee/models/item_price'
require File.dirname(__FILE__) + '/chargebee/models/ledger_account_balance'
require File.dirname(__FILE__) + '/chargebee/models/ledger_entry'
require File.dirname(__FILE__) + '/chargebee/models/ledger_operation'
require File.dirname(__FILE__) + '/chargebee/models/metadata'
require File.dirname(__FILE__) + '/chargebee/models/meter'
Expand Down Expand Up @@ -134,7 +136,7 @@

module ChargeBee

VERSION = '2.77.0'
VERSION = '2.78.0'

@@default_env = nil
@@verify_ca_certs = true
Expand Down
4 changes: 2 additions & 2 deletions lib/chargebee/models/alert.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ class FilterCondition < Model
attr_accessor :field, :operator, :value
end

attr_accessor :id, :type, :name, :description, :metered_feature_id, :currency_code, :subscription_id,
:status, :meta, :created_at, :updated_at, :threshold, :filter_conditions
attr_accessor :id, :type, :name, :description, :metered_feature_id, :currency_code, :unit_id,
:subscription_id, :status, :meta, :created_at, :updated_at, :threshold, :filter_conditions

# OPERATIONS
#-----------
Expand Down
54 changes: 54 additions & 0 deletions lib/chargebee/models/credit_unit.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
module ChargeBee
class CreditUnit < Model

attr_accessor :id, :name, :external_name, :status, :resource_version, :updated_at, :created_at,
:created_by, :updated_by, :is_unlimited, :overdraft_amount

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

def self.list(params={}, env=nil, headers={})
jsonKeys = {
}
options = {}
Request.send_list_request('get', uri_path("credit_units"), params, env, headers,nil, false, jsonKeys, options, "creditUnit", "list")
end

def self.create(params, env=nil, headers={})
jsonKeys = {
}
options = {
:isIdempotent => true
}
Request.send('post', uri_path("credit_units"), params, env, headers,nil, false, jsonKeys, options, "creditUnit", "create")
end

def self.update(id, params={}, env=nil, headers={})
jsonKeys = {
}
options = {
:isIdempotent => true
}
Request.send('post', uri_path("credit_units",id.to_s), params, env, headers,nil, false, jsonKeys, options, "creditUnit", "update")
end

def self.archive(id, env=nil, headers={})
jsonKeys = {
}
options = {
:isIdempotent => true
}
Request.send('post', uri_path("credit_units",id.to_s,"archive_command"), {}, env, headers,nil, false, jsonKeys, options, "creditUnit", "archive")
end

def self.reactivate(id, env=nil, headers={})
jsonKeys = {
}
options = {
:isIdempotent => true
}
Request.send('post', uri_path("credit_units",id.to_s,"reactivate_command"), {}, env, headers,nil, false, jsonKeys, options, "creditUnit", "reactivate")
end

end # ~CreditUnit
end # ~ChargeBee
7 changes: 4 additions & 3 deletions lib/chargebee/models/grant_block.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
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, :grant_source,
:created_at, :account_type, :unit_id, :unit_type, :metadata
attr_accessor :id, :subscription_id, :account_type, :unit_id, :unit_type, :granted_amount, :effective_from,
:expires_at, :balance, :hold_amount, :used_amount, :expired_amount, :rolled_over_amount, :voided_amount,
:origin_grant_block_id, :status, :grant_source, :created_at, :modified_at, :resource_version,
:metadata

# OPERATIONS
#-----------
Expand Down
3 changes: 2 additions & 1 deletion lib/chargebee/models/ledger_account_balance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ 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
attr_accessor :subscription_id, :unit_id, :unit_type, :created_at, :modified_at, :resource_version,
:provisioned_balance, :overdraft_balance

# OPERATIONS
#-----------
Expand Down
12 changes: 12 additions & 0 deletions lib/chargebee/models/ledger_entry.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module ChargeBee
class LedgerEntry < Model

attr_accessor :id, :subscription_id, :account_type, :unit_id, :unit_type, :amount, :grant_block_start_balance,
:grant_block_end_balance, :account_start_balance, :account_end_balance, :type, :ledger_operation_id,
:grant_block_id, :created_at, :modified_at

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

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

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

# OPERATIONS
#-----------
Expand Down Expand Up @@ -54,5 +54,13 @@ def self.release_authorization(params, env=nil, headers={})
Request.send('post', uri_path("ledger_operations","release_authorization"), params, env, headers,nil, true, jsonKeys, options, "ledgerOperation", "releaseAuthorization")
end

def self.allocate(params, env=nil, headers={})
jsonKeys = {
:metadata => 0,
}
options = {}
Request.send('post', uri_path("ledger_operations","allocate"), params, env, headers,nil, true, jsonKeys, options, "ledgerOperation", "allocate")
end
Comment thread
cb-alish marked this conversation as resolved.

end # ~LedgerOperation
end # ~ChargeBee
16 changes: 16 additions & 0 deletions lib/chargebee/result.rb
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,11 @@ def metadata()
return metadata;
end

def credit_unit()
credit_unit = get(:credit_unit, CreditUnit);
return credit_unit;
end

def subscription_entitlement()
subscription_entitlement = get(:subscription_entitlement, SubscriptionEntitlement,
{:component => SubscriptionEntitlement::Component});
Expand Down Expand Up @@ -644,6 +649,11 @@ def grant_block()
return grant_block;
end

def ledger_entry()
ledger_entry = get(:ledger_entry, LedgerEntry);
return ledger_entry;
end

def promotional_grant()
promotional_grant = get(:promotional_grant, PromotionalGrant);
return promotional_grant;
Expand Down Expand Up @@ -737,6 +747,12 @@ def grant_blocks()
return grant_blocks;
end

def ledger_entries()
ledger_entries = get_list(:ledger_entries, LedgerEntry,
{});
return ledger_entries;
end


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