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
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,43 @@
### v3.14.0 (2025-11-26)
* * *

### New Resources:
* Einvoice has been added.
* QuotedDeltaRamp has been added.

### New Attributes:
* line_items_next_offset has been added to CreditNote.
* line_items_next_offset has been added to Invoice.
* credit_lines has been added to SalesOrder.
* billable_unit_price has been added to SalesOrder#LineItem.
* billable_quantity has been added to SalesOrder#LineItem.
* billable_amount has been added to SalesOrder#LineItem.

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

### New Parameters:
* line_items_limit has been added to CreditNote#RetrieveRequest.
* line_items_offset has been added to CreditNote#RetrieveRequest.
* line_items_limit has been added to Invoice#RetrieveRequest.
* line_items_offset has been added to Invoice#RetrieveRequest.
* item_tiers has been added to Estimate#GiftSubscriptionForItemsRequest.
* unit_price has been added to Estimate#SubscriptionItems#GiftSubscriptionForItemsRequest.
* unit_price_in_decimal has been added to Estimate#SubscriptionItems#GiftSubscriptionForItemsRequest.
* item_tiers has been added to Gift#CreateForItemsRequest.
* meta_data has been added to Gift#CreateForItemsRequest.
* unit_price has been added to Gift#SubscriptionItems#CreateForItemsRequest.
* unit_price_in_decimal has been added to Gift#SubscriptionItems#CreateForItemsRequest.
* item_tiers has been added to HostedPage#CheckoutGiftForItemsRequest.
* unit_price has been added to HostedPage#SubscriptionItems#CheckoutGiftForItemsRequest.
* unit_price_in_decimal has been added to HostedPage#SubscriptionItems#CheckoutGiftForItemsRequest.
* auto_select_local_currency has been added to PricingPageSession#CreateForNewSubscriptionRequest.

### New Enums:
* EZIDEBIT has been added to GatewayEnum.
* BUSINESS_RULE has been added to EntityTypeEnum.
* RULESET has been added to EntityTypeEnum.

### v3.13.0 (2025-10-28)
* * *

Expand Down
2 changes: 2 additions & 0 deletions chargebee/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def __init__(
self.DifferentialPrice = chargebee.DifferentialPrice(self.env)
self.Discount = chargebee.Discount(self.env)
self.Download = chargebee.Download(self.env)
self.Einvoice = chargebee.Einvoice(self.env)
self.Entitlement = chargebee.Entitlement(self.env)
self.EntitlementOverride = chargebee.EntitlementOverride(self.env)
self.Estimate = chargebee.Estimate(self.env)
Expand Down Expand Up @@ -118,6 +119,7 @@ def __init__(
self.Quote = chargebee.Quote(self.env)
self.QuoteLineGroup = chargebee.QuoteLineGroup(self.env)
self.QuotedCharge = chargebee.QuotedCharge(self.env)
self.QuotedDeltaRamp = chargebee.QuotedDeltaRamp(self.env)
self.QuotedRamp = chargebee.QuotedRamp(self.env)
self.QuotedSubscription = chargebee.QuotedSubscription(self.env)
self.Ramp = chargebee.Ramp(self.env)
Expand Down
4 changes: 4 additions & 0 deletions chargebee/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@

from chargebee.models.download.operations import Download

from chargebee.models.einvoice.operations import Einvoice

from chargebee.models.entitlement.operations import Entitlement

from chargebee.models.entitlement_override.operations import EntitlementOverride
Expand Down Expand Up @@ -246,6 +248,8 @@

from chargebee.models.quoted_charge.operations import QuotedCharge

from chargebee.models.quoted_delta_ramp.operations import QuotedDeltaRamp

from chargebee.models.quoted_ramp.operations import QuotedRamp

from chargebee.models.quoted_subscription.operations import QuotedSubscription
Expand Down
2 changes: 2 additions & 0 deletions chargebee/models/credit_note/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,8 @@ class CreateParams(TypedDict):

class RetrieveParams(TypedDict):
line_item: NotRequired["CreditNote.RetrieveLineItemParams"]
line_items_limit: NotRequired[int]
line_items_offset: NotRequired[str]

class PdfParams(TypedDict):
disposition_type: NotRequired[enums.DispositionType]
Expand Down
3 changes: 2 additions & 1 deletion chargebee/models/credit_note/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from chargebee.model import Model
from typing import Dict, List, Any
from chargebee.response import Response
from chargebee.models import invoice, transaction, transaction, invoice, download
from chargebee.models import invoice, transaction, transaction, download, invoice


@dataclass
Expand Down Expand Up @@ -229,6 +229,7 @@ class CreditNoteResponse(Model):
resource_version: int = None
updated_at: int = None
channel: str = None
line_items_next_offset: str = None
sub_total: int = None
sub_total_in_local_currency: int = None
total_in_local_currency: int = None
Expand Down
2 changes: 2 additions & 0 deletions chargebee/models/einvoice/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from .operations import Einvoice
from .responses import EinvoiceResponse
22 changes: 22 additions & 0 deletions chargebee/models/einvoice/operations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from .responses import *
from chargebee import request, environment
from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast
from enum import Enum


@dataclass
class Einvoice:
env: environment.Environment

class Status(Enum):
SCHEDULED = "scheduled"
SKIPPED = "skipped"
IN_PROGRESS = "in_progress"
SUCCESS = "success"
FAILED = "failed"
REGISTERED = "registered"

def __str__(self):
return self.value

pass
12 changes: 12 additions & 0 deletions chargebee/models/einvoice/responses.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from dataclasses import dataclass
from chargebee.model import Model
from typing import Dict, List, Any


@dataclass
class EinvoiceResponse(Model):
raw_data: Dict[Any, Any] = None
id: str = None
reference_number: str = None
status: str = None
message: str = None
3 changes: 3 additions & 0 deletions chargebee/models/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,8 @@ class EntityType(Enum):
OMNICHANNEL_ONE_TIME_ORDER = "omnichannel_one_time_order"
OMNICHANNEL_ONE_TIME_ORDER_ITEM = "omnichannel_one_time_order_item"
USAGE_FILE = "usage_file"
BUSINESS_RULE = "business_rule"
RULESET = "ruleset"

def __str__(self):
return self.value
Expand Down Expand Up @@ -743,6 +745,7 @@ class Gateway(Enum):
PAYSTACK = "paystack"
JP_MORGAN = "jp_morgan"
DEUTSCHE_BANK = "deutsche_bank"
EZIDEBIT = "ezidebit"
GOCARDLESS = "gocardless"
NOT_APPLICABLE = "not_applicable"

Expand Down
12 changes: 12 additions & 0 deletions chargebee/models/estimate/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,17 @@ class GiftSubscriptionForItemsSubscriptionItemParams(TypedDict):
item_price_id: NotRequired[str]
quantity: NotRequired[int]
quantity_in_decimal: NotRequired[str]
unit_price: NotRequired[int]
unit_price_in_decimal: NotRequired[str]

class GiftSubscriptionForItemsItemTierParams(TypedDict):
item_price_id: NotRequired[str]
starting_unit: NotRequired[int]
ending_unit: NotRequired[int]
price: NotRequired[int]
starting_unit_in_decimal: NotRequired[str]
ending_unit_in_decimal: NotRequired[str]
price_in_decimal: NotRequired[str]

class CreateInvoiceInvoiceParams(TypedDict):
customer_id: NotRequired[str]
Expand Down Expand Up @@ -1017,6 +1028,7 @@ class GiftSubscriptionForItemsParams(TypedDict):
subscription_items: NotRequired[
List["Estimate.GiftSubscriptionForItemsSubscriptionItemParams"]
]
item_tiers: NotRequired[List["Estimate.GiftSubscriptionForItemsItemTierParams"]]

class CreateInvoiceParams(TypedDict):
invoice: NotRequired["Estimate.CreateInvoiceInvoiceParams"]
Expand Down
14 changes: 14 additions & 0 deletions chargebee/models/gift/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,17 @@ class CreateForItemsSubscriptionItemParams(TypedDict):
item_price_id: NotRequired[str]
quantity: NotRequired[int]
quantity_in_decimal: NotRequired[str]
unit_price: NotRequired[int]
unit_price_in_decimal: NotRequired[str]

class CreateForItemsItemTierParams(TypedDict):
item_price_id: NotRequired[str]
starting_unit: NotRequired[int]
ending_unit: NotRequired[int]
price: NotRequired[int]
starting_unit_in_decimal: NotRequired[str]
ending_unit_in_decimal: NotRequired[str]
price_in_decimal: NotRequired[str]

class ListGiftReceiverParams(TypedDict):
email: NotRequired[Filters.StringFilter]
Expand Down Expand Up @@ -163,6 +174,8 @@ class CreateForItemsParams(TypedDict):
subscription_items: NotRequired[
List["Gift.CreateForItemsSubscriptionItemParams"]
]
meta_data: NotRequired[Dict[Any, Any]]
item_tiers: NotRequired[List["Gift.CreateForItemsItemTierParams"]]

class ListParams(TypedDict):
limit: NotRequired[int]
Expand Down Expand Up @@ -199,6 +212,7 @@ def create_for_items(
self, params: CreateForItemsParams, headers=None
) -> CreateForItemsResponse:
jsonKeys = {
"meta_data": 0,
"additional_information": 1,
}
options = {
Expand Down
12 changes: 12 additions & 0 deletions chargebee/models/hosted_page/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,17 @@ class CheckoutGiftForItemsSubscriptionItemParams(TypedDict):
item_price_id: NotRequired[str]
quantity: NotRequired[int]
quantity_in_decimal: NotRequired[str]
unit_price: NotRequired[int]
unit_price_in_decimal: NotRequired[str]

class CheckoutGiftForItemsItemTierParams(TypedDict):
item_price_id: NotRequired[str]
starting_unit: NotRequired[int]
ending_unit: NotRequired[int]
price: NotRequired[int]
starting_unit_in_decimal: NotRequired[str]
ending_unit_in_decimal: NotRequired[str]
price_in_decimal: NotRequired[str]

class ClaimGiftGiftParams(TypedDict):
id: Required[str]
Expand Down Expand Up @@ -837,6 +848,7 @@ class CheckoutGiftForItemsParams(TypedDict):
subscription_items: NotRequired[
List["HostedPage.CheckoutGiftForItemsSubscriptionItemParams"]
]
item_tiers: NotRequired[List["HostedPage.CheckoutGiftForItemsItemTierParams"]]
coupon_ids: NotRequired[List[str]]

class ClaimGiftParams(TypedDict):
Expand Down
2 changes: 2 additions & 0 deletions chargebee/models/invoice/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -1104,6 +1104,8 @@ class InvoicesForSubscriptionParams(TypedDict):

class RetrieveParams(TypedDict):
line_item: NotRequired["Invoice.RetrieveLineItemParams"]
line_items_limit: NotRequired[int]
line_items_offset: NotRequired[str]

class PdfParams(TypedDict):
disposition_type: NotRequired[enums.DispositionType]
Expand Down
1 change: 1 addition & 0 deletions chargebee/models/invoice/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ class InvoiceResponse(Model):
voided_at: int = None
resource_version: int = None
updated_at: int = None
line_items_next_offset: str = None
first_invoice: bool = None
new_sales_amount: int = None
has_advance_charges: bool = None
Expand Down
23 changes: 23 additions & 0 deletions chargebee/models/item_price/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,9 @@ class FindApplicableItemPricesParams(TypedDict):
item_id: NotRequired[str]
sort_by: NotRequired[Filters.SortFilter]

class MoveItemPriceParams(TypedDict):
destination_item_id: Required[str]

def create(self, params: CreateParams, headers=None) -> CreateResponse:
jsonKeys = {
"metadata": 0,
Expand Down Expand Up @@ -383,3 +386,23 @@ def find_applicable_item_prices(
jsonKeys,
options,
)

def move_item_price(
self, id, params: MoveItemPriceParams, headers=None
) -> MoveItemPriceResponse:
jsonKeys = {}
options = {
"isIdempotent": True,
}
return request.send(
"post",
request.uri_path("item_prices", id, "move"),
self.env,
cast(Dict[Any, Any], params),
headers,
MoveItemPriceResponse,
None,
False,
jsonKeys,
options,
)
6 changes: 6 additions & 0 deletions chargebee/models/item_price/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,9 @@ class FindApplicableItemPricesItemPriceResponse:
class FindApplicableItemPricesResponse(Response):
list: List[FindApplicableItemPricesItemPriceResponse]
next_offset: str = None


@dataclass
class MoveItemPriceResponse(Response):
is_idempotency_replayed: bool
item_price: ItemPriceResponse
1 change: 1 addition & 0 deletions chargebee/models/pricing_page_session/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ class CreateForNewSubscriptionParams(TypedDict):
"PricingPageSession.CreateForNewSubscriptionSubscriptionParams"
]
business_entity_id: NotRequired[str]
auto_select_local_currency: NotRequired[bool]
customer: NotRequired[
"PricingPageSession.CreateForNewSubscriptionCustomerParams"
]
Expand Down
2 changes: 2 additions & 0 deletions chargebee/models/quoted_delta_ramp/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from .operations import QuotedDeltaRamp
from .responses import QuotedDeltaRampResponse
13 changes: 13 additions & 0 deletions chargebee/models/quoted_delta_ramp/operations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from .responses import *
from chargebee import request, environment
from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast


@dataclass
class QuotedDeltaRamp:
env: environment.Environment

class LineItem(TypedDict):
item_level_discount_per_billing_cycle_in_decimal: NotRequired[str]

pass
15 changes: 15 additions & 0 deletions chargebee/models/quoted_delta_ramp/responses.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from dataclasses import dataclass
from chargebee.model import Model
from typing import Dict, List, Any


@dataclass
class LineItemResponse(Model):
raw_data: Dict[Any, Any] = None
item_level_discount_per_billing_cycle_in_decimal: str = None


@dataclass
class QuotedDeltaRampResponse(Model):
raw_data: Dict[Any, Any] = None
line_items: List[LineItemResponse] = None
2 changes: 1 addition & 1 deletion chargebee/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = "3.13.0"
VERSION = "3.14.0"