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 @@
### v3.49.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.48.0 (2026-06-08)
* * *
### New Attributes:
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.48.0
3.49.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.48.0</version>
<version>3.49.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.48.0";
public static final String LIBRARY_VERSION = "3.49.0";

private final String apiBaseUrl;

Expand Down
24 changes: 24 additions & 0 deletions src/main/java/com/chargebee/internal/ResultBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,22 @@ public AlertStatus alertStatus() {
return (AlertStatus)get("alert_status");
}

public LedgerAccountBalance ledgerAccountBalance() {
return (LedgerAccountBalance)get("ledger_account_balance");
}

public LedgerOperation ledgerOperation() {
return (LedgerOperation)get("ledger_operation");
}

public GrantBlock grantBlock() {
return (GrantBlock)get("grant_block");
}

public PromotionalGrant promotionalGrant() {
return (PromotionalGrant)get("promotional_grant");
}

public ImpactedCustomer impactedCustomer() {
return (ImpactedCustomer)get("impacted_customer");
}
Expand Down Expand Up @@ -456,6 +472,14 @@ public List<PersonalizedOffer> personalizedOffers() {
return (List<PersonalizedOffer>) getList("personalized_offers", "personalized_offer");
}

public List<LedgerOperation> ledgerOperations() {
return (List<LedgerOperation>) getList("ledger_operations", "ledger_operation");
}

public List<GrantBlock> grantBlocks() {
return (List<GrantBlock>) getList("grant_blocks", "grant_block");
}


private List<? extends Resource> getList(String pluralName, String singularName) {
JSONArray listModels = jsonObj.optJSONArray(pluralName);
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/chargebee/models/CreditNote.java
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,10 @@ public Long fractionalCorrection() {
return optLong("fractional_correction");
}

public List<String> notes() {
return optList("notes", String.class);
}

public List<CreditNote.LineItem> lineItems() {
return optList("line_items", CreditNote.LineItem.class);
}
Expand Down
189 changes: 189 additions & 0 deletions src/main/java/com/chargebee/models/GrantBlock.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
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 GrantBlock extends Resource<GrantBlock> {

public enum GrantSource {
SUBSCRIPTION_CREATED,
SUBSCRIPTION_CHANGED,
TOP_UP,
PROMOTIONAL_GRANTS,
ROLLOVER,
_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 */
}

public enum AccountType {
PROVISIONED,
OVERDRAFT,
_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 */
}

public enum UnitType {
CREDIT_UNIT,
_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 GrantBlock(String jsonStr) {
super(jsonStr);
}

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

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

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

public String grantedAmount() {
return reqString("granted_amount");
}

public Timestamp effectiveFrom() {
return reqTimestamp("effective_from");
}

public Timestamp expiresAt() {
return reqTimestamp("expires_at");
}

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

public String holdAmount() {
return reqString("hold_amount");
}

public String usedAmount() {
return reqString("used_amount");
}

public String expiredAmount() {
return reqString("expired_amount");
}

public String rolledOverAmount() {
return reqString("rolled_over_amount");
}

public String voidedAmount() {
return reqString("voided_amount");
}

public String originGrantBlockId() {
return optString("origin_grant_block_id");
}

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

public String metadata() {
return optString("metadata");
}

public GrantSource grantSource() {
return reqEnum("grant_source", GrantSource.class);
}

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

public AccountType accountType() {
return optEnum("account_type", AccountType.class);
}

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

public UnitType unitType() {
return optEnum("unit_type", UnitType.class);
}

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

public static GrantBlockListGrantBlocksRequest listGrantBlocks() {
String uri = uri("grant_blocks");
return new GrantBlockListGrantBlocksRequest(uri);
}


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

public static class GrantBlockListGrantBlocksRequest extends ListRequest<GrantBlockListGrantBlocksRequest> {

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

public StringFilter<GrantBlockListGrantBlocksRequest> subscriptionId() {
return new StringFilter<GrantBlockListGrantBlocksRequest>("subscription_id",this);
}


public StringFilter<GrantBlockListGrantBlocksRequest> unitId() {
return new StringFilter<GrantBlockListGrantBlocksRequest>("unit_id",this);
}


public TimestampFilter<GrantBlockListGrantBlocksRequest> effectiveFrom() {
return new TimestampFilter<GrantBlockListGrantBlocksRequest>("effective_from",this);
}


public TimestampFilter<GrantBlockListGrantBlocksRequest> expiresAt() {
return new TimestampFilter<GrantBlockListGrantBlocksRequest>("expires_at",this);
}


public TimestampFilter<GrantBlockListGrantBlocksRequest> createdAt() {
return new TimestampFilter<GrantBlockListGrantBlocksRequest>("created_at",this);
}


public GrantBlockListGrantBlocksRequest sortByEffectiveFrom(SortOrder order) {
params.addOpt("sort_by["+order.name().toLowerCase()+"]","effective_from");
return this;
}
public GrantBlockListGrantBlocksRequest sortByExpiresAt(SortOrder order) {
params.addOpt("sort_by["+order.name().toLowerCase()+"]","expires_at");
return this;
}
public GrantBlockListGrantBlocksRequest sortByCreatedAt(SortOrder order) {
params.addOpt("sort_by["+order.name().toLowerCase()+"]","created_at");
return this;
}



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

}
6 changes: 6 additions & 0 deletions src/main/java/com/chargebee/models/HostedPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public enum Type {
CHECKOUT_EXISTING,
@Deprecated
UPDATE_CARD,
@Deprecated
UPDATE_PAYMENT_METHOD,
MANAGE_PAYMENT_SOURCES,
COLLECT_NOW,
Expand Down Expand Up @@ -103,6 +104,10 @@ public Timestamp expiresAt() {
return optTimestamp("expires_at");
}

public Layout layout() {
return optEnum("layout", Layout.class);
}

public Timestamp updatedAt() {
return optTimestamp("updated_at");
}
Expand Down Expand Up @@ -158,6 +163,7 @@ public static UpdateCardRequest updateCard() {
return new UpdateCardRequest(Method.POST, uri);
}

@Deprecated
public static UpdatePaymentMethodRequest updatePaymentMethod() {
String uri = uri("hosted_pages", "update_payment_method");
return new UpdatePaymentMethodRequest(Method.POST, uri);
Expand Down
Loading
Loading