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
57 changes: 57 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,60 @@
### v3.12.0 (2025-09-24)
* * *

### New Resources:
* PersonalizedOffer has been added.
* OfferFulfillment has been added.
* OfferEvent has been added.
* OmnichannelSubscriptionItemOffer has been added.

### New Attributes:
* business_entity_id has been added to Customer#Balance.
* processor_advice_code has been added to GatewayErrorDetail.
* processor_advice_code has been added to Transaction#GatewayErrorDetail.
* omnichannel_subscription_item_offers has been added to OmnichannelSubscriptionItem.
* linked_omnichannel_subscriptions has been added to OmnichannelTransaction.
* linked_omnichannel_one_time_orders has been added to OmnichannelTransaction.
* contract_term has been added to Ramp.
* charge_once has been added to Ramp#ItemsToAdd.
* charge_on_option has been added to Ramp#ItemsToAdd.
* charge_on_event has been added to Ramp#ItemsToAdd.
* charge_once has been added to Ramp#ItemsToUpdate.
* charge_on_option has been added to Ramp#ItemsToUpdate.
* charge_on_event has been added to Ramp#ItemsToUpdate.
* error_file_path has been added to UsageFile.
* error_file_url has been added to UsageFile.

### New Endpoint:
* move has been added to OmnichannelSubscription.

### New Parameters:
* offline_payment_method has been added to Estimate#CreateSubItemEstimateRequest.
* offline_payment_method has been added to Estimate#CreateSubItemForCustomerEstimateRequest.
* offline_payment_method has been added to HostedPage#CheckoutNewForItemsRequest.
* offline_payment_method has been added to Quote#SubscriptionCreateSubItemsForCustomerQuoteRequest.
* offline_payment_method has been added to Quote#SubscriptionEditCreateSubCustomerQuoteForItemsRequest.
* contract_term has been added to Ramp#CreateForSubscriptionRequest.
* items_to_add has been added to Ramp#CreateForSubscriptionRequest.
* items_to_update has been added to Ramp#CreateForSubscriptionRequest.
* contract_term has been added to Ramp#UpdateRequest.
* items_to_add has been added to Ramp#UpdateRequest.
* items_to_update has been added to Ramp#UpdateRequest.

### New Enums:
* DUNNING_UPDATED has been added EventType.
* OMNICHANNEL_SUBSCRIPTION_MOVED_IN has been added to EventType.


### Bug Fixes:
* currency list action has been marked as ListRequest.
* index has been removed from CreditNote#ShippingAddress.
* index has been removed from Invoice#ShippingAddress
* index has been removed from Order#ShippingAddress.
* index has been removed from Quote#ShippingAddress.
* index has been removed from SubscriptionEstimate#ShippingAddress.
* index has been removed from Subscription#ShippingAddress.


### v3.11.0b1 (2025-08-27)
* * *

Expand Down
1 change: 0 additions & 1 deletion chargebee/api_error.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
class APIError(Exception):

def __init__(self, http_code, json_obj, headers=None):
Exception.__init__(self, json_obj.get("message"))
self.json_obj = json_obj
Expand Down
6 changes: 6 additions & 0 deletions chargebee/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ def __init__(
self.ItemFamily = chargebee.ItemFamily(self.env)
self.ItemPrice = chargebee.ItemPrice(self.env)
self.Metadata = chargebee.Metadata(self.env)
self.OfferEvent = chargebee.OfferEvent(self.env)
self.OfferFulfillment = chargebee.OfferFulfillment(self.env)
self.OmnichannelOneTimeOrder = chargebee.OmnichannelOneTimeOrder(self.env)
self.OmnichannelOneTimeOrderItem = chargebee.OmnichannelOneTimeOrderItem(
self.env
Expand All @@ -91,6 +93,9 @@ def __init__(
self.OmnichannelSubscriptionItem = chargebee.OmnichannelSubscriptionItem(
self.env
)
self.OmnichannelSubscriptionItemOffer = (
chargebee.OmnichannelSubscriptionItemOffer(self.env)
)
self.OmnichannelSubscriptionItemScheduledChange = (
chargebee.OmnichannelSubscriptionItemScheduledChange(self.env)
)
Expand All @@ -103,6 +108,7 @@ def __init__(
self.PaymentScheduleScheme = chargebee.PaymentScheduleScheme(self.env)
self.PaymentSource = chargebee.PaymentSource(self.env)
self.PaymentVoucher = chargebee.PaymentVoucher(self.env)
self.PersonalizedOffer = chargebee.PersonalizedOffer(self.env)
self.Plan = chargebee.Plan(self.env)
self.PortalSession = chargebee.PortalSession(self.env)
self.PriceVariant = chargebee.PriceVariant(self.env)
Expand Down
12 changes: 12 additions & 0 deletions chargebee/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
BillingPeriodUnit,
BillingStartOption,
CancelOption,
Category,
ChangeOption,
Channel,
ChargeModel,
Expand All @@ -26,6 +27,7 @@
CustomerType,
DedupeOption,
DirectDebitScheme,
DiscountType,
DispositionType,
DunningType,
DurationType,
Expand Down Expand Up @@ -178,6 +180,10 @@

from chargebee.models.metadata.operations import Metadata

from chargebee.models.offer_event.operations import OfferEvent

from chargebee.models.offer_fulfillment.operations import OfferFulfillment

from chargebee.models.omnichannel_one_time_order.operations import (
OmnichannelOneTimeOrder,
)
Expand All @@ -192,6 +198,10 @@
OmnichannelSubscriptionItem,
)

from chargebee.models.omnichannel_subscription_item_offer.operations import (
OmnichannelSubscriptionItemOffer,
)

from chargebee.models.omnichannel_subscription_item_scheduled_change.operations import (
OmnichannelSubscriptionItemScheduledChange,
)
Expand All @@ -216,6 +226,8 @@

from chargebee.models.payment_voucher.operations import PaymentVoucher

from chargebee.models.personalized_offer.operations import PersonalizedOffer

from chargebee.models.plan.operations import Plan

from chargebee.models.portal_session.operations import PortalSession
Expand Down
1 change: 0 additions & 1 deletion chargebee/models/credit_note/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ class ShippingAddress(TypedDict):
country: NotRequired[str]
zip: NotRequired[str]
validation_status: NotRequired[enums.ValidationStatus]
index: Required[int]

class BillingAddress(TypedDict):
first_name: NotRequired[str]
Expand Down
1 change: 0 additions & 1 deletion chargebee/models/credit_note/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ class ShippingAddressResponse(Model):
country: str = None
zip: str = None
validation_status: str = None
index: int = None


@dataclass
Expand Down
74 changes: 37 additions & 37 deletions chargebee/models/credit_note_estimate/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class LineItemEntityType(Enum):
def __str__(self):
return self.value

class DiscountEntityType(Enum):
class LineItemDiscountDiscountType(Enum):
ITEM_LEVEL_COUPON = "item_level_coupon"
DOCUMENT_LEVEL_COUPON = "document_level_coupon"
PROMOTIONAL_CREDITS = "promotional_credits"
Expand All @@ -40,14 +40,7 @@ class DiscountEntityType(Enum):
def __str__(self):
return self.value

class DiscountDiscountType(Enum):
FIXED_AMOUNT = "fixed_amount"
PERCENTAGE = "percentage"

def __str__(self):
return self.value

class LineItemDiscountDiscountType(Enum):
class DiscountEntityType(Enum):
ITEM_LEVEL_COUPON = "item_level_coupon"
DOCUMENT_LEVEL_COUPON = "document_level_coupon"
PROMOTIONAL_CREDITS = "promotional_credits"
Expand All @@ -58,6 +51,13 @@ class LineItemDiscountDiscountType(Enum):
def __str__(self):
return self.value

class DiscountDiscountType(Enum):
FIXED_AMOUNT = "fixed_amount"
PERCENTAGE = "percentage"

def __str__(self):
return self.value

class LineItem(TypedDict):
id: NotRequired[str]
subscription_id: NotRequired[str]
Expand Down Expand Up @@ -85,18 +85,25 @@ class LineItem(TypedDict):
entity_id: NotRequired[str]
customer_id: NotRequired[str]

class Discount(TypedDict):
amount: Required[int]
description: NotRequired[str]
entity_type: Required["CreditNoteEstimate.DiscountEntityType"]
discount_type: NotRequired["CreditNoteEstimate.DiscountDiscountType"]
entity_id: NotRequired[str]
coupon_set_code: NotRequired[str]
class LineItemTier(TypedDict):
line_item_id: NotRequired[str]
starting_unit: Required[int]
ending_unit: NotRequired[int]
quantity_used: Required[int]
unit_amount: Required[int]
starting_unit_in_decimal: NotRequired[str]
ending_unit_in_decimal: NotRequired[str]
quantity_used_in_decimal: NotRequired[str]
unit_amount_in_decimal: NotRequired[str]
pricing_type: NotRequired[enums.PricingType]
package_size: NotRequired[int]

class Tax(TypedDict):
name: Required[str]
amount: Required[int]
description: NotRequired[str]
class LineItemDiscount(TypedDict):
line_item_id: Required[str]
discount_type: Required["CreditNoteEstimate.LineItemDiscountDiscountType"]
coupon_id: NotRequired[str]
entity_id: NotRequired[str]
discount_amount: Required[int]

class LineItemTax(TypedDict):
line_item_id: NotRequired[str]
Expand All @@ -115,24 +122,17 @@ class LineItemTax(TypedDict):
tax_amount_in_local_currency: NotRequired[int]
local_currency_code: NotRequired[str]

class LineItemDiscount(TypedDict):
line_item_id: Required[str]
discount_type: Required["CreditNoteEstimate.LineItemDiscountDiscountType"]
coupon_id: NotRequired[str]
class Discount(TypedDict):
amount: Required[int]
description: NotRequired[str]
entity_type: Required["CreditNoteEstimate.DiscountEntityType"]
discount_type: NotRequired["CreditNoteEstimate.DiscountDiscountType"]
entity_id: NotRequired[str]
discount_amount: Required[int]
coupon_set_code: NotRequired[str]

class LineItemTier(TypedDict):
line_item_id: NotRequired[str]
starting_unit: Required[int]
ending_unit: NotRequired[int]
quantity_used: Required[int]
unit_amount: Required[int]
starting_unit_in_decimal: NotRequired[str]
ending_unit_in_decimal: NotRequired[str]
quantity_used_in_decimal: NotRequired[str]
unit_amount_in_decimal: NotRequired[str]
pricing_type: NotRequired[enums.PricingType]
package_size: NotRequired[int]
class Tax(TypedDict):
name: Required[str]
amount: Required[int]
description: NotRequired[str]

pass
60 changes: 30 additions & 30 deletions chargebee/models/credit_note_estimate/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,29 @@ class LineItemResponse(Model):


@dataclass
class DiscountResponse(Model):
class LineItemTierResponse(Model):
raw_data: Dict[Any, Any] = None
amount: int = None
description: str = None
entity_type: str = None
discount_type: str = None
entity_id: str = None
coupon_set_code: str = None
line_item_id: str = None
starting_unit: int = None
ending_unit: int = None
quantity_used: int = None
unit_amount: int = None
starting_unit_in_decimal: str = None
ending_unit_in_decimal: str = None
quantity_used_in_decimal: str = None
unit_amount_in_decimal: str = None
pricing_type: str = None
package_size: int = None


@dataclass
class TaxResponse(Model):
class LineItemDiscountResponse(Model):
raw_data: Dict[Any, Any] = None
name: str = None
amount: int = None
description: str = None
line_item_id: str = None
discount_type: str = None
coupon_id: str = None
entity_id: str = None
discount_amount: int = None


@dataclass
Expand All @@ -73,29 +80,22 @@ class LineItemTaxResponse(Model):


@dataclass
class LineItemDiscountResponse(Model):
class DiscountResponse(Model):
raw_data: Dict[Any, Any] = None
line_item_id: str = None
amount: int = None
description: str = None
entity_type: str = None
discount_type: str = None
coupon_id: str = None
entity_id: str = None
discount_amount: int = None
coupon_set_code: str = None


@dataclass
class LineItemTierResponse(Model):
class TaxResponse(Model):
raw_data: Dict[Any, Any] = None
line_item_id: str = None
starting_unit: int = None
ending_unit: int = None
quantity_used: int = None
unit_amount: int = None
starting_unit_in_decimal: str = None
ending_unit_in_decimal: str = None
quantity_used_in_decimal: str = None
unit_amount_in_decimal: str = None
pricing_type: str = None
package_size: int = None
name: str = None
amount: int = None
description: str = None


@dataclass
Expand All @@ -110,10 +110,10 @@ class CreditNoteEstimateResponse(Model):
amount_allocated: int = None
amount_available: int = None
line_items: List[LineItemResponse] = None
line_item_tiers: List[LineItemTierResponse] = None
line_item_discounts: List[LineItemDiscountResponse] = None
line_item_taxes: List[LineItemTaxResponse] = None
discounts: List[DiscountResponse] = None
taxes: List[TaxResponse] = None
line_item_taxes: List[LineItemTaxResponse] = None
line_item_discounts: List[LineItemDiscountResponse] = None
line_item_tiers: List[LineItemTierResponse] = None
round_off_amount: int = None
customer_id: str = None
8 changes: 6 additions & 2 deletions chargebee/models/currency/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ class ForexType(Enum):
def __str__(self):
return self.value

class ListParams(TypedDict):
limit: NotRequired[int]
offset: NotRequired[str]

class CreateParams(TypedDict):
currency_code: Required[str]
forex_type: Required["Currency.ForexType"]
Expand All @@ -28,14 +32,14 @@ class AddScheduleParams(TypedDict):
manual_exchange_rate: Required[str]
schedule_at: Required[int]

def list(self, headers=None) -> ListResponse:
def list(self, params: ListParams = None, headers=None) -> ListResponse:
jsonKeys = {}
options = {}
return request.send_list_request(
"get",
request.uri_path("currencies", "list"),
self.env,
None,
cast(Dict[Any, Any], params),
headers,
ListResponse,
None,
Expand Down
Loading