Skip to content

Commit 815481e

Browse files
Releasing v3.12.0 (#97)
* Releasing v3.12.0 * uvx ruff format --------- Co-authored-by: Srinath Sankar <srinath.sankar@chargebee.com>
1 parent 8915bb8 commit 815481e

57 files changed

Lines changed: 864 additions & 336 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,60 @@
1+
### v3.12.0 (2025-09-24)
2+
* * *
3+
4+
### New Resources:
5+
* PersonalizedOffer has been added.
6+
* OfferFulfillment has been added.
7+
* OfferEvent has been added.
8+
* OmnichannelSubscriptionItemOffer has been added.
9+
10+
### New Attributes:
11+
* business_entity_id has been added to Customer#Balance.
12+
* processor_advice_code has been added to GatewayErrorDetail.
13+
* processor_advice_code has been added to Transaction#GatewayErrorDetail.
14+
* omnichannel_subscription_item_offers has been added to OmnichannelSubscriptionItem.
15+
* linked_omnichannel_subscriptions has been added to OmnichannelTransaction.
16+
* linked_omnichannel_one_time_orders has been added to OmnichannelTransaction.
17+
* contract_term has been added to Ramp.
18+
* charge_once has been added to Ramp#ItemsToAdd.
19+
* charge_on_option has been added to Ramp#ItemsToAdd.
20+
* charge_on_event has been added to Ramp#ItemsToAdd.
21+
* charge_once has been added to Ramp#ItemsToUpdate.
22+
* charge_on_option has been added to Ramp#ItemsToUpdate.
23+
* charge_on_event has been added to Ramp#ItemsToUpdate.
24+
* error_file_path has been added to UsageFile.
25+
* error_file_url has been added to UsageFile.
26+
27+
### New Endpoint:
28+
* move has been added to OmnichannelSubscription.
29+
30+
### New Parameters:
31+
* offline_payment_method has been added to Estimate#CreateSubItemEstimateRequest.
32+
* offline_payment_method has been added to Estimate#CreateSubItemForCustomerEstimateRequest.
33+
* offline_payment_method has been added to HostedPage#CheckoutNewForItemsRequest.
34+
* offline_payment_method has been added to Quote#SubscriptionCreateSubItemsForCustomerQuoteRequest.
35+
* offline_payment_method has been added to Quote#SubscriptionEditCreateSubCustomerQuoteForItemsRequest.
36+
* contract_term has been added to Ramp#CreateForSubscriptionRequest.
37+
* items_to_add has been added to Ramp#CreateForSubscriptionRequest.
38+
* items_to_update has been added to Ramp#CreateForSubscriptionRequest.
39+
* contract_term has been added to Ramp#UpdateRequest.
40+
* items_to_add has been added to Ramp#UpdateRequest.
41+
* items_to_update has been added to Ramp#UpdateRequest.
42+
43+
### New Enums:
44+
* DUNNING_UPDATED has been added EventType.
45+
* OMNICHANNEL_SUBSCRIPTION_MOVED_IN has been added to EventType.
46+
47+
48+
### Bug Fixes:
49+
* currency list action has been marked as ListRequest.
50+
* index has been removed from CreditNote#ShippingAddress.
51+
* index has been removed from Invoice#ShippingAddress
52+
* index has been removed from Order#ShippingAddress.
53+
* index has been removed from Quote#ShippingAddress.
54+
* index has been removed from SubscriptionEstimate#ShippingAddress.
55+
* index has been removed from Subscription#ShippingAddress.
56+
57+
158
### v3.11.0b1 (2025-08-27)
259
* * *
360

chargebee/api_error.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
class APIError(Exception):
2-
32
def __init__(self, http_code, json_obj, headers=None):
43
Exception.__init__(self, json_obj.get("message"))
54
self.json_obj = json_obj

chargebee/main.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ def __init__(
8383
self.ItemFamily = chargebee.ItemFamily(self.env)
8484
self.ItemPrice = chargebee.ItemPrice(self.env)
8585
self.Metadata = chargebee.Metadata(self.env)
86+
self.OfferEvent = chargebee.OfferEvent(self.env)
87+
self.OfferFulfillment = chargebee.OfferFulfillment(self.env)
8688
self.OmnichannelOneTimeOrder = chargebee.OmnichannelOneTimeOrder(self.env)
8789
self.OmnichannelOneTimeOrderItem = chargebee.OmnichannelOneTimeOrderItem(
8890
self.env
@@ -91,6 +93,9 @@ def __init__(
9193
self.OmnichannelSubscriptionItem = chargebee.OmnichannelSubscriptionItem(
9294
self.env
9395
)
96+
self.OmnichannelSubscriptionItemOffer = (
97+
chargebee.OmnichannelSubscriptionItemOffer(self.env)
98+
)
9499
self.OmnichannelSubscriptionItemScheduledChange = (
95100
chargebee.OmnichannelSubscriptionItemScheduledChange(self.env)
96101
)
@@ -103,6 +108,7 @@ def __init__(
103108
self.PaymentScheduleScheme = chargebee.PaymentScheduleScheme(self.env)
104109
self.PaymentSource = chargebee.PaymentSource(self.env)
105110
self.PaymentVoucher = chargebee.PaymentVoucher(self.env)
111+
self.PersonalizedOffer = chargebee.PersonalizedOffer(self.env)
106112
self.Plan = chargebee.Plan(self.env)
107113
self.PortalSession = chargebee.PortalSession(self.env)
108114
self.PriceVariant = chargebee.PriceVariant(self.env)

chargebee/models/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
BillingPeriodUnit,
1414
BillingStartOption,
1515
CancelOption,
16+
Category,
1617
ChangeOption,
1718
Channel,
1819
ChargeModel,
@@ -26,6 +27,7 @@
2627
CustomerType,
2728
DedupeOption,
2829
DirectDebitScheme,
30+
DiscountType,
2931
DispositionType,
3032
DunningType,
3133
DurationType,
@@ -178,6 +180,10 @@
178180

179181
from chargebee.models.metadata.operations import Metadata
180182

183+
from chargebee.models.offer_event.operations import OfferEvent
184+
185+
from chargebee.models.offer_fulfillment.operations import OfferFulfillment
186+
181187
from chargebee.models.omnichannel_one_time_order.operations import (
182188
OmnichannelOneTimeOrder,
183189
)
@@ -192,6 +198,10 @@
192198
OmnichannelSubscriptionItem,
193199
)
194200

201+
from chargebee.models.omnichannel_subscription_item_offer.operations import (
202+
OmnichannelSubscriptionItemOffer,
203+
)
204+
195205
from chargebee.models.omnichannel_subscription_item_scheduled_change.operations import (
196206
OmnichannelSubscriptionItemScheduledChange,
197207
)
@@ -216,6 +226,8 @@
216226

217227
from chargebee.models.payment_voucher.operations import PaymentVoucher
218228

229+
from chargebee.models.personalized_offer.operations import PersonalizedOffer
230+
219231
from chargebee.models.plan.operations import Plan
220232

221233
from chargebee.models.portal_session.operations import PortalSession

chargebee/models/credit_note/operations.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ class ShippingAddress(TypedDict):
233233
country: NotRequired[str]
234234
zip: NotRequired[str]
235235
validation_status: NotRequired[enums.ValidationStatus]
236-
index: Required[int]
237236

238237
class BillingAddress(TypedDict):
239238
first_name: NotRequired[str]

chargebee/models/credit_note/responses.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ class ShippingAddressResponse(Model):
167167
country: str = None
168168
zip: str = None
169169
validation_status: str = None
170-
index: int = None
171170

172171

173172
@dataclass

chargebee/models/credit_note_estimate/operations.py

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class LineItemEntityType(Enum):
2929
def __str__(self):
3030
return self.value
3131

32-
class DiscountEntityType(Enum):
32+
class LineItemDiscountDiscountType(Enum):
3333
ITEM_LEVEL_COUPON = "item_level_coupon"
3434
DOCUMENT_LEVEL_COUPON = "document_level_coupon"
3535
PROMOTIONAL_CREDITS = "promotional_credits"
@@ -40,14 +40,7 @@ class DiscountEntityType(Enum):
4040
def __str__(self):
4141
return self.value
4242

43-
class DiscountDiscountType(Enum):
44-
FIXED_AMOUNT = "fixed_amount"
45-
PERCENTAGE = "percentage"
46-
47-
def __str__(self):
48-
return self.value
49-
50-
class LineItemDiscountDiscountType(Enum):
43+
class DiscountEntityType(Enum):
5144
ITEM_LEVEL_COUPON = "item_level_coupon"
5245
DOCUMENT_LEVEL_COUPON = "document_level_coupon"
5346
PROMOTIONAL_CREDITS = "promotional_credits"
@@ -58,6 +51,13 @@ class LineItemDiscountDiscountType(Enum):
5851
def __str__(self):
5952
return self.value
6053

54+
class DiscountDiscountType(Enum):
55+
FIXED_AMOUNT = "fixed_amount"
56+
PERCENTAGE = "percentage"
57+
58+
def __str__(self):
59+
return self.value
60+
6161
class LineItem(TypedDict):
6262
id: NotRequired[str]
6363
subscription_id: NotRequired[str]
@@ -85,18 +85,25 @@ class LineItem(TypedDict):
8585
entity_id: NotRequired[str]
8686
customer_id: NotRequired[str]
8787

88-
class Discount(TypedDict):
89-
amount: Required[int]
90-
description: NotRequired[str]
91-
entity_type: Required["CreditNoteEstimate.DiscountEntityType"]
92-
discount_type: NotRequired["CreditNoteEstimate.DiscountDiscountType"]
93-
entity_id: NotRequired[str]
94-
coupon_set_code: NotRequired[str]
88+
class LineItemTier(TypedDict):
89+
line_item_id: NotRequired[str]
90+
starting_unit: Required[int]
91+
ending_unit: NotRequired[int]
92+
quantity_used: Required[int]
93+
unit_amount: Required[int]
94+
starting_unit_in_decimal: NotRequired[str]
95+
ending_unit_in_decimal: NotRequired[str]
96+
quantity_used_in_decimal: NotRequired[str]
97+
unit_amount_in_decimal: NotRequired[str]
98+
pricing_type: NotRequired[enums.PricingType]
99+
package_size: NotRequired[int]
95100

96-
class Tax(TypedDict):
97-
name: Required[str]
98-
amount: Required[int]
99-
description: NotRequired[str]
101+
class LineItemDiscount(TypedDict):
102+
line_item_id: Required[str]
103+
discount_type: Required["CreditNoteEstimate.LineItemDiscountDiscountType"]
104+
coupon_id: NotRequired[str]
105+
entity_id: NotRequired[str]
106+
discount_amount: Required[int]
100107

101108
class LineItemTax(TypedDict):
102109
line_item_id: NotRequired[str]
@@ -115,24 +122,17 @@ class LineItemTax(TypedDict):
115122
tax_amount_in_local_currency: NotRequired[int]
116123
local_currency_code: NotRequired[str]
117124

118-
class LineItemDiscount(TypedDict):
119-
line_item_id: Required[str]
120-
discount_type: Required["CreditNoteEstimate.LineItemDiscountDiscountType"]
121-
coupon_id: NotRequired[str]
125+
class Discount(TypedDict):
126+
amount: Required[int]
127+
description: NotRequired[str]
128+
entity_type: Required["CreditNoteEstimate.DiscountEntityType"]
129+
discount_type: NotRequired["CreditNoteEstimate.DiscountDiscountType"]
122130
entity_id: NotRequired[str]
123-
discount_amount: Required[int]
131+
coupon_set_code: NotRequired[str]
124132

125-
class LineItemTier(TypedDict):
126-
line_item_id: NotRequired[str]
127-
starting_unit: Required[int]
128-
ending_unit: NotRequired[int]
129-
quantity_used: Required[int]
130-
unit_amount: Required[int]
131-
starting_unit_in_decimal: NotRequired[str]
132-
ending_unit_in_decimal: NotRequired[str]
133-
quantity_used_in_decimal: NotRequired[str]
134-
unit_amount_in_decimal: NotRequired[str]
135-
pricing_type: NotRequired[enums.PricingType]
136-
package_size: NotRequired[int]
133+
class Tax(TypedDict):
134+
name: Required[str]
135+
amount: Required[int]
136+
description: NotRequired[str]
137137

138138
pass

chargebee/models/credit_note_estimate/responses.py

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,29 @@ class LineItemResponse(Model):
3434

3535

3636
@dataclass
37-
class DiscountResponse(Model):
37+
class LineItemTierResponse(Model):
3838
raw_data: Dict[Any, Any] = None
39-
amount: int = None
40-
description: str = None
41-
entity_type: str = None
42-
discount_type: str = None
43-
entity_id: str = None
44-
coupon_set_code: str = None
39+
line_item_id: str = None
40+
starting_unit: int = None
41+
ending_unit: int = None
42+
quantity_used: int = None
43+
unit_amount: int = None
44+
starting_unit_in_decimal: str = None
45+
ending_unit_in_decimal: str = None
46+
quantity_used_in_decimal: str = None
47+
unit_amount_in_decimal: str = None
48+
pricing_type: str = None
49+
package_size: int = None
4550

4651

4752
@dataclass
48-
class TaxResponse(Model):
53+
class LineItemDiscountResponse(Model):
4954
raw_data: Dict[Any, Any] = None
50-
name: str = None
51-
amount: int = None
52-
description: str = None
55+
line_item_id: str = None
56+
discount_type: str = None
57+
coupon_id: str = None
58+
entity_id: str = None
59+
discount_amount: int = None
5360

5461

5562
@dataclass
@@ -73,29 +80,22 @@ class LineItemTaxResponse(Model):
7380

7481

7582
@dataclass
76-
class LineItemDiscountResponse(Model):
83+
class DiscountResponse(Model):
7784
raw_data: Dict[Any, Any] = None
78-
line_item_id: str = None
85+
amount: int = None
86+
description: str = None
87+
entity_type: str = None
7988
discount_type: str = None
80-
coupon_id: str = None
8189
entity_id: str = None
82-
discount_amount: int = None
90+
coupon_set_code: str = None
8391

8492

8593
@dataclass
86-
class LineItemTierResponse(Model):
94+
class TaxResponse(Model):
8795
raw_data: Dict[Any, Any] = None
88-
line_item_id: str = None
89-
starting_unit: int = None
90-
ending_unit: int = None
91-
quantity_used: int = None
92-
unit_amount: int = None
93-
starting_unit_in_decimal: str = None
94-
ending_unit_in_decimal: str = None
95-
quantity_used_in_decimal: str = None
96-
unit_amount_in_decimal: str = None
97-
pricing_type: str = None
98-
package_size: int = None
96+
name: str = None
97+
amount: int = None
98+
description: str = None
9999

100100

101101
@dataclass
@@ -110,10 +110,10 @@ class CreditNoteEstimateResponse(Model):
110110
amount_allocated: int = None
111111
amount_available: int = None
112112
line_items: List[LineItemResponse] = None
113+
line_item_tiers: List[LineItemTierResponse] = None
114+
line_item_discounts: List[LineItemDiscountResponse] = None
115+
line_item_taxes: List[LineItemTaxResponse] = None
113116
discounts: List[DiscountResponse] = None
114117
taxes: List[TaxResponse] = None
115-
line_item_taxes: List[LineItemTaxResponse] = None
116-
line_item_discounts: List[LineItemDiscountResponse] = None
117-
line_item_tiers: List[LineItemTierResponse] = None
118118
round_off_amount: int = None
119119
customer_id: str = None

chargebee/models/currency/operations.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ class ForexType(Enum):
1515
def __str__(self):
1616
return self.value
1717

18+
class ListParams(TypedDict):
19+
limit: NotRequired[int]
20+
offset: NotRequired[str]
21+
1822
class CreateParams(TypedDict):
1923
currency_code: Required[str]
2024
forex_type: Required["Currency.ForexType"]
@@ -28,14 +32,14 @@ class AddScheduleParams(TypedDict):
2832
manual_exchange_rate: Required[str]
2933
schedule_at: Required[int]
3034

31-
def list(self, headers=None) -> ListResponse:
35+
def list(self, params: ListParams = None, headers=None) -> ListResponse:
3236
jsonKeys = {}
3337
options = {}
3438
return request.send_list_request(
3539
"get",
3640
request.uri_path("currencies", "list"),
3741
self.env,
38-
None,
42+
cast(Dict[Any, Any], params),
3943
headers,
4044
ListResponse,
4145
None,

0 commit comments

Comments
 (0)