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 @@
### v4.14.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).



### v4.13.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 @@
4.13.0
4.14.0
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
}

group = "com.chargebee"
version = "4.13.0"
version = "4.14.0"
description = "Java client library for ChargeBee"

// Project metadata
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/com/chargebee/v4/client/ClientMethods.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@

import com.chargebee.v4.services.ItemPriceService;

import com.chargebee.v4.services.CreditUnitService;

import com.chargebee.v4.services.OfferFulfillmentService;

import com.chargebee.v4.services.HostedPageService;
Expand Down Expand Up @@ -706,6 +708,13 @@ public interface ClientMethods {
*/
ItemPriceService itemPrices();

/**
* Access credit_unit-related operations.
*
* @return CreditUnitService instance for fluent API access
*/
CreditUnitService creditUnits();

/**
* Access offer_fulfillment-related operations.
*
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/com/chargebee/v4/client/ClientMethodsImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@

import com.chargebee.v4.services.ItemPriceService;

import com.chargebee.v4.services.CreditUnitService;

import com.chargebee.v4.services.OfferFulfillmentService;

import com.chargebee.v4.services.HostedPageService;
Expand Down Expand Up @@ -560,6 +562,11 @@ public ItemPriceService itemPrices() {
return getServiceRegistry().itemPrices();
}

@Override
public CreditUnitService creditUnits() {
return getServiceRegistry().creditUnits();
}

@Override
public OfferFulfillmentService offerFulfillments() {
return getServiceRegistry().offerFulfillments();
Expand Down
19 changes: 19 additions & 0 deletions src/main/java/com/chargebee/v4/client/ServiceRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@

import com.chargebee.v4.services.ItemPriceService;

import com.chargebee.v4.services.CreditUnitService;

import com.chargebee.v4.services.OfferFulfillmentService;

import com.chargebee.v4.services.HostedPageService;
Expand Down Expand Up @@ -337,6 +339,8 @@ final class ServiceRegistry {

private volatile ItemPriceService itemPriceService;

private volatile CreditUnitService creditUnitService;

private volatile OfferFulfillmentService offerFulfillmentService;

private volatile HostedPageService hostedPageService;
Expand Down Expand Up @@ -1485,6 +1489,21 @@ ItemPriceService itemPrices() {
return itemPriceService;
}

/**
* Get or create the CreditUnitService instance. Thread-safe lazy initialization using
* double-checked locking.
*/
CreditUnitService creditUnits() {
if (creditUnitService == null) {
synchronized (this) {
if (creditUnitService == null) {
creditUnitService = new CreditUnitService(client);
}
}
}
return creditUnitService;
}

/**
* Get or create the OfferFulfillmentService instance. Thread-safe lazy initialization using
* double-checked locking.
Expand Down
23 changes: 19 additions & 4 deletions src/main/java/com/chargebee/v4/models/alert/Alert.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ public class Alert {
private String description;
private String meteredFeatureId;
private String currencyCode;
private String unitId;
private String subscriptionId;
private Status status;
private String meta;
private Timestamp createdAt;
private Timestamp updatedAt;
private List<Threshold> threshold;
private Threshold threshold;
private List<FilterConditions> filterConditions;

public String getId() {
Expand All @@ -52,6 +53,10 @@ public String getCurrencyCode() {
return currencyCode;
}

public String getUnitId() {
return unitId;
}

public String getSubscriptionId() {
return subscriptionId;
}
Expand All @@ -72,7 +77,7 @@ public Timestamp getUpdatedAt() {
return updatedAt;
}

public List<Threshold> getThreshold() {
public Threshold getThreshold() {
return threshold;
}

Expand All @@ -85,6 +90,8 @@ public enum Type {

SPEND_EXCEEDED("spend_exceeded"),

CREDIT_BALANCE_DROPPED("credit_balance_dropped"),

/** An enum member indicating that Type was instantiated with an unknown value. */
_UNKNOWN(null);
private final String value;
Expand Down Expand Up @@ -159,6 +166,8 @@ public static Alert fromJson(JsonObject jsonObj) {

obj.currencyCode = JsonUtil.getString(jsonObj, "currency_code");

obj.unitId = JsonUtil.getString(jsonObj, "unit_id");

obj.subscriptionId = JsonUtil.getString(jsonObj, "subscription_id");

obj.status = Status.fromString(JsonUtil.getString(jsonObj, "status"));
Expand All @@ -169,8 +178,10 @@ public static Alert fromJson(JsonObject jsonObj) {

obj.updatedAt = JsonUtil.getTimestamp(jsonObj, "updated_at");

obj.threshold =
JsonUtil.mapArray(JsonUtil.getJsonArray(jsonObj, "threshold"), Threshold::fromJson);
JsonObject __thresholdObj = JsonUtil.getJsonObject(jsonObj, "threshold");
if (__thresholdObj != null) {
obj.threshold = Threshold.fromJson(__thresholdObj);
}

obj.filterConditions =
JsonUtil.mapArray(
Expand All @@ -194,6 +205,8 @@ public String toString() {
+ meteredFeatureId
+ ", currencyCode="
+ currencyCode
+ ", unitId="
+ unitId
+ ", subscriptionId="
+ subscriptionId
+ ", status="
Expand Down Expand Up @@ -223,6 +236,7 @@ public boolean equals(Object o) {
&& java.util.Objects.equals(description, that.description)
&& java.util.Objects.equals(meteredFeatureId, that.meteredFeatureId)
&& java.util.Objects.equals(currencyCode, that.currencyCode)
&& java.util.Objects.equals(unitId, that.unitId)
&& java.util.Objects.equals(subscriptionId, that.subscriptionId)
&& java.util.Objects.equals(status, that.status)
&& java.util.Objects.equals(meta, that.meta)
Expand All @@ -242,6 +256,7 @@ public int hashCode() {
description,
meteredFeatureId,
currencyCode,
unitId,
subscriptionId,
status,
meta,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public final class AlertCreateParams {

private final String currencyCode;

private final String unitId;

private final String subscriptionId;

private final String meta;
Expand All @@ -44,6 +46,8 @@ private AlertCreateParams(AlertCreateBuilder builder) {

this.currencyCode = builder.currencyCode;

this.unitId = builder.unitId;

this.subscriptionId = builder.subscriptionId;

this.meta = builder.meta;
Expand Down Expand Up @@ -73,6 +77,10 @@ public String getCurrencyCode() {
return currencyCode;
}

public String getUnitId() {
return unitId;
}

public String getSubscriptionId() {
return subscriptionId;
}
Expand Down Expand Up @@ -118,6 +126,11 @@ public Map<String, Object> toFormData() {
formData.put("currency_code", this.currencyCode);
}

if (this.unitId != null) {

formData.put("unit_id", this.unitId);
}

if (this.subscriptionId != null) {

formData.put("subscription_id", this.subscriptionId);
Expand Down Expand Up @@ -174,6 +187,8 @@ public static final class AlertCreateBuilder {

private String currencyCode;

private String unitId;

private String subscriptionId;

private String meta;
Expand Down Expand Up @@ -209,6 +224,11 @@ public AlertCreateBuilder currencyCode(String value) {
return this;
}

public AlertCreateBuilder unitId(String value) {
this.unitId = value;
return this;
}

public AlertCreateBuilder subscriptionId(String value) {
this.subscriptionId = value;
return this;
Expand Down Expand Up @@ -239,6 +259,8 @@ public enum Type {

SPEND_EXCEEDED("spend_exceeded"),

CREDIT_BALANCE_DROPPED("credit_balance_dropped"),

/** An enum member indicating that Type was instantiated with an unknown value. */
_UNKNOWN(null);
private final String value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ public enum TypeIs {

SPEND_EXCEEDED("spend_exceeded"),

CREDIT_BALANCE_DROPPED("credit_balance_dropped"),

/** An enum member indicating that TypeIs was instantiated with an unknown value. */
_UNKNOWN(null);
private final String value;
Expand Down Expand Up @@ -265,6 +267,8 @@ public enum Type {

SPEND_EXCEEDED("spend_exceeded"),

CREDIT_BALANCE_DROPPED("credit_balance_dropped"),

/** An enum member indicating that Type was instantiated with an unknown value. */
_UNKNOWN(null);
private final String value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ public enum TypeIs {

SPEND_EXCEEDED("spend_exceeded"),

CREDIT_BALANCE_DROPPED("credit_balance_dropped"),

/** An enum member indicating that TypeIs was instantiated with an unknown value. */
_UNKNOWN(null);
private final String value;
Expand Down Expand Up @@ -280,6 +282,8 @@ public enum Type {

SPEND_EXCEEDED("spend_exceeded"),

CREDIT_BALANCE_DROPPED("credit_balance_dropped"),

/** An enum member indicating that Type was instantiated with an unknown value. */
_UNKNOWN(null);
private final String value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,14 @@ public enum PaymentMethod {

CUSTOM("custom"),

DANA("dana"),

TOUCH_N_GO("touch_n_go"),

TAMARA("tamara"),

QPAY("qpay"),

/** An enum member indicating that PaymentMethod was instantiated with an unknown value. */
_UNKNOWN(null);
private final String value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2340,6 +2340,14 @@ public enum PaymentMethod {

CUSTOM("custom"),

DANA("dana"),

TOUCH_N_GO("touch_n_go"),

TAMARA("tamara"),

QPAY("qpay"),

/** An enum member indicating that PaymentMethod was instantiated with an unknown value. */
_UNKNOWN(null);
private final String value;
Expand Down
Loading
Loading