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.52.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.51.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.51.0
3.52.0
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.chargebee</groupId>
<artifactId>chargebee-java</artifactId>
<version>3.51.0</version>
<version>3.52.0</version>


<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/chargebee/Environment.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class Environment {

public static final String API_VERSION = "v2";

public static final String LIBRARY_VERSION = "3.51.0";
public static final String LIBRARY_VERSION = "3.52.0";

private final String apiBaseUrl;

Expand Down
12 changes: 12 additions & 0 deletions src/main/java/com/chargebee/internal/ResultBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,10 @@ public Metadata metadata() {
return (Metadata)get("metadata");
}

public CreditUnit creditUnit() {
return (CreditUnit)get("credit_unit");
}

public SubscriptionEntitlement subscriptionEntitlement() {
return (SubscriptionEntitlement)get("subscription_entitlement");
}
Expand Down Expand Up @@ -432,6 +436,10 @@ public GrantBlock grantBlock() {
return (GrantBlock)get("grant_block");
}

public LedgerEntry ledgerEntry() {
return (LedgerEntry)get("ledger_entry");
}

public PromotionalGrant promotionalGrant() {
return (PromotionalGrant)get("promotional_grant");
}
Expand Down Expand Up @@ -496,6 +504,10 @@ public List<GrantBlock> grantBlocks() {
return (List<GrantBlock>) getList("grant_blocks", "grant_block");
}

public List<LedgerEntry> ledgerEntries() {
return (List<LedgerEntry>) getList("ledger_entries", "ledger_entry");
}


private List<? extends Resource> getList(String pluralName, String singularName) {
JSONArray listModels = jsonObj.optJSONArray(pluralName);
Expand Down
14 changes: 12 additions & 2 deletions src/main/java/com/chargebee/models/Alert.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ public String currencyCode() {
return optString("currency_code");
}

public String unitId() {
return optString("unit_id");
}

public String subscriptionId() {
return optString("subscription_id");
}
Expand All @@ -124,8 +128,8 @@ public Timestamp updatedAt() {
return reqTimestamp("updated_at");
}

public List<Alert.Threshold> threshold() {
return optList("threshold", Alert.Threshold.class);
public Alert.Threshold threshold() {
return optSubResource("threshold", Alert.Threshold.class);
}

public List<Alert.FilterCondition> filterConditions() {
Expand Down Expand Up @@ -205,6 +209,12 @@ public CreateRequest currencyCode(String currencyCode) {
}


public CreateRequest unitId(String unitId) {
params.addOpt("unit_id", unitId);
return this;
}


public CreateRequest subscriptionId(String subscriptionId) {
params.addOpt("subscription_id", subscriptionId);
return this;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/chargebee/models/AttachedItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ public Integer billingCycles() {
}

public ChargeOnEvent chargeOnEvent() {
return reqEnum("charge_on_event", ChargeOnEvent.class);
return optEnum("charge_on_event", ChargeOnEvent.class);
}

public Boolean chargeOnce() {
return reqBoolean("charge_once");
return optBoolean("charge_once");
}

public Timestamp createdAt() {
Expand Down
201 changes: 201 additions & 0 deletions src/main/java/com/chargebee/models/CreditUnit.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
package com.chargebee.models;

import com.chargebee.*;
import com.chargebee.internal.*;
import com.chargebee.filters.*;
import com.chargebee.filters.enums.SortOrder;
import com.chargebee.internal.HttpUtil.Method;
import com.chargebee.models.enums.*;
import org.json.*;
import java.io.*;
import java.sql.Timestamp;
import java.util.*;

public class CreditUnit extends Resource<CreditUnit> {

public enum Status {
ACTIVE,
ARCHIVED,
_UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a
java-client version incompatibility. We suggest you to upgrade to the latest version */
}

//Constructors
//============

public CreditUnit(String jsonStr) {
super(jsonStr);
}

public CreditUnit(JSONObject jsonObj) {
super(jsonObj);
}

// Fields
//=======

public String id() {
return reqString("id");
}

public String name() {
return reqString("name");
}

public String externalName() {
return reqString("external_name");
}

public Status status() {
return optEnum("status", Status.class);
}

public Long resourceVersion() {
return optLong("resource_version");
}

public Timestamp updatedAt() {
return optTimestamp("updated_at");
}

public Timestamp createdAt() {
return reqTimestamp("created_at");
}

public String createdBy() {
return optString("created_by");
}

public String updatedBy() {
return optString("updated_by");
}

public Boolean isUnlimited() {
return reqBoolean("is_unlimited");
}

public String overdraftAmount() {
return optString("overdraft_amount");
}

// Operations
//===========

public static CreditUnitListRequest list() {
String uri = uri("credit_units");
return new CreditUnitListRequest(uri);
}

public static CreateRequest create() {
String uri = uri("credit_units");
return new CreateRequest(Method.POST, uri);
}

public static UpdateRequest update(String id) {
String uri = uri("credit_units", nullCheck(id));
return new UpdateRequest(Method.POST, uri);
}

public static Request archive(String id) {
String uri = uri("credit_units", nullCheck(id), "archive_command");
return new Request(Method.POST, uri);
}

public static Request reactivate(String id) {
String uri = uri("credit_units", nullCheck(id), "reactivate_command");
return new Request(Method.POST, uri);
}


// Operation Request Classes
//==========================

public static class CreditUnitListRequest extends ListRequest<CreditUnitListRequest> {

private CreditUnitListRequest(String uri) {
super(uri);
}

public EnumFilter<CreditUnit.Status, CreditUnitListRequest> status() {
return new EnumFilter<CreditUnit.Status, CreditUnitListRequest>("status",this);
}


public StringFilter<CreditUnitListRequest> id() {
return new StringFilter<CreditUnitListRequest>("id",this).supportsMultiOperators(true);
}


@Override
public Params params() {
return params;
}
}

public static class CreateRequest extends Request<CreateRequest> {

private CreateRequest(Method httpMeth, String uri) {
super(httpMeth, uri);
}

public CreateRequest id(String id) {
params.add("id", id);
return this;
}


public CreateRequest name(String name) {
params.add("name", name);
return this;
}


public CreateRequest isUnlimited(Boolean isUnlimited) {
params.add("is_unlimited", isUnlimited);
return this;
}


public CreateRequest overdraftAmount(String overdraftAmount) {
params.addOpt("overdraft_amount", overdraftAmount);
return this;
}


public CreateRequest externalName(String externalName) {
params.addOpt("external_name", externalName);
return this;
}


@Override
public Params params() {
return params;
}
}

public static class UpdateRequest extends Request<UpdateRequest> {

private UpdateRequest(Method httpMeth, String uri) {
super(httpMeth, uri);
}

public UpdateRequest name(String name) {
params.addOpt("name", name);
return this;
}


public UpdateRequest externalName(String externalName) {
params.addOpt("external_name", externalName);
return this;
}


@Override
public Params params() {
return params;
}
}

}
2 changes: 1 addition & 1 deletion src/main/java/com/chargebee/models/Customer.java
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public Boolean sendBillingEmail() {

public static class PaymentMethod extends Resource<PaymentMethod> {
public enum Type {
CARD,PAYPAL_EXPRESS_CHECKOUT,AMAZON_PAYMENTS,DIRECT_DEBIT,GENERIC,ALIPAY,UNIONPAY,APPLE_PAY,WECHAT_PAY,IDEAL,GOOGLE_PAY,SOFORT,BANCONTACT,GIROPAY,DOTPAY,UPI,NETBANKING_EMANDATES,VENMO,PAY_TO,FASTER_PAYMENTS,SEPA_INSTANT_TRANSFER,AUTOMATED_BANK_TRANSFER,KLARNA_PAY_NOW,ONLINE_BANKING_POLAND,PAYCONIQ_BY_BANCONTACT,ELECTRONIC_PAYMENT_STANDARD,KBC_PAYMENT_BUTTON,PAY_BY_BANK,TRUSTLY,STABLECOIN,KAKAO_PAY,NAVER_PAY,REVOLUT_PAY,CASH_APP_PAY,TWINT,GO_PAY,GRAB_PAY,PAY_CO,AFTER_PAY,SWISH,PAYME,PIX,KLARNA,ALIPAY_HK,PAYPAY,GCASH,SOUTH_KOREAN_CARDS,PAYNOW,BIZUM,PROMPTPAY,
CARD,PAYPAL_EXPRESS_CHECKOUT,AMAZON_PAYMENTS,DIRECT_DEBIT,GENERIC,ALIPAY,UNIONPAY,APPLE_PAY,WECHAT_PAY,IDEAL,GOOGLE_PAY,SOFORT,BANCONTACT,GIROPAY,DOTPAY,UPI,NETBANKING_EMANDATES,VENMO,PAY_TO,FASTER_PAYMENTS,SEPA_INSTANT_TRANSFER,AUTOMATED_BANK_TRANSFER,KLARNA_PAY_NOW,ONLINE_BANKING_POLAND,PAYCONIQ_BY_BANCONTACT,ELECTRONIC_PAYMENT_STANDARD,KBC_PAYMENT_BUTTON,PAY_BY_BANK,TRUSTLY,STABLECOIN,KAKAO_PAY,NAVER_PAY,REVOLUT_PAY,CASH_APP_PAY,TWINT,GO_PAY,GRAB_PAY,PAY_CO,AFTER_PAY,SWISH,PAYME,PIX,KLARNA,ALIPAY_HK,PAYPAY,GCASH,SOUTH_KOREAN_CARDS,PAYNOW,BIZUM,PROMPTPAY,DANA,TOUCH_N_GO,TAMARA,QPAY,
_UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a
java-client version incompatibility. We suggest you to upgrade to the latest version */
}
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/com/chargebee/models/Estimate.java
Original file line number Diff line number Diff line change
Expand Up @@ -2637,6 +2637,12 @@ public CancelSubscriptionForItemsRequest invoiceDate(Timestamp invoiceDate) {
}


public CancelSubscriptionForItemsRequest includeCancellationDayInBilling(Boolean includeCancellationDayInBilling) {
params.addOpt("include_cancellation_day_in_billing", includeCancellationDayInBilling);
return this;
}


public CancelSubscriptionForItemsRequest cancelReasonCode(String cancelReasonCode) {
params.addOpt("cancel_reason_code", cancelReasonCode);
return this;
Expand Down
Loading
Loading