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
56 changes: 56 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,59 @@
### v2.57.0 ( 2025-09-23)
* * *

### 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.

### v2.56.0 (2025-08-25)
* * *

Expand Down
2 changes: 1 addition & 1 deletion chargebee/http_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def request(method, url, env, params=None, headers=None, subDomain=None, isJsonR

def process_response(url,response, http_code, response_headers):
try:
resp_json = compat.json.loads(response)
resp_json = response if http_code == 204 else compat.json.loads(response)
except Exception as ex:
if "503" in response:
raise Exception("Sorry, the server is currently unable to handle the request due to a temporary overload or scheduled maintenance. Please retry after sometime. \n type: internal_temporary_error, \n http_status_code: 503, \n error_code: internal_temporary_error,\n content:" + response)
Expand Down
4 changes: 4 additions & 0 deletions chargebee/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,13 @@
from chargebee.models.item_price import ItemPrice
from chargebee.models.metadata import Metadata
from chargebee.models.non_subscription import NonSubscription
from chargebee.models.offer_event import OfferEvent
from chargebee.models.offer_fulfillment import OfferFulfillment
from chargebee.models.omnichannel_one_time_order import OmnichannelOneTimeOrder
from chargebee.models.omnichannel_one_time_order_item import OmnichannelOneTimeOrderItem
from chargebee.models.omnichannel_subscription import OmnichannelSubscription
from chargebee.models.omnichannel_subscription_item import OmnichannelSubscriptionItem
from chargebee.models.omnichannel_subscription_item_offer import OmnichannelSubscriptionItemOffer
from chargebee.models.omnichannel_subscription_item_scheduled_change import OmnichannelSubscriptionItemScheduledChange
from chargebee.models.omnichannel_transaction import OmnichannelTransaction
from chargebee.models.order import Order
Expand All @@ -60,6 +63,7 @@
from chargebee.models.payment_schedule_scheme import PaymentScheduleScheme
from chargebee.models.payment_source import PaymentSource
from chargebee.models.payment_voucher import PaymentVoucher
from chargebee.models.personalized_offer import PersonalizedOffer
from chargebee.models.plan import Plan
from chargebee.models.portal_session import PortalSession
from chargebee.models.price_variant import PriceVariant
Expand Down
2 changes: 1 addition & 1 deletion chargebee/models/credit_note.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Allocation(Model):
fields = ["invoice_id", "allocated_amount", "allocated_at", "invoice_date", "invoice_status", "tax_application"]
pass
class ShippingAddress(Model):
fields = ["first_name", "last_name", "email", "company", "phone", "line1", "line2", "line3", "city", "state_code", "state", "country", "zip", "validation_status", "index"]
fields = ["first_name", "last_name", "email", "company", "phone", "line1", "line2", "line3", "city", "state_code", "state", "country", "zip", "validation_status"]
pass
class BillingAddress(Model):
fields = ["first_name", "last_name", "email", "company", "phone", "line1", "line2", "line3", "city", "state_code", "state", "country", "zip", "validation_status"]
Expand Down
20 changes: 10 additions & 10 deletions chargebee/models/credit_note_estimate.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ class CreditNoteEstimate(Model):
class LineItem(Model):
fields = ["id", "subscription_id", "date_from", "date_to", "unit_amount", "quantity", "amount", "pricing_model", "is_taxed", "tax_amount", "tax_rate", "unit_amount_in_decimal", "quantity_in_decimal", "amount_in_decimal", "discount_amount", "item_level_discount_amount", "metered", "is_percentage_pricing", "reference_line_item_id", "description", "entity_description", "entity_type", "tax_exempt_reason", "entity_id", "customer_id"]
pass
class Discount(Model):
fields = ["amount", "description", "entity_type", "discount_type", "entity_id", "coupon_set_code"]
class LineItemTier(Model):
fields = ["line_item_id", "starting_unit", "ending_unit", "quantity_used", "unit_amount", "starting_unit_in_decimal", "ending_unit_in_decimal", "quantity_used_in_decimal", "unit_amount_in_decimal", "pricing_type", "package_size"]
pass
class Tax(Model):
fields = ["name", "amount", "description"]
class LineItemDiscount(Model):
fields = ["line_item_id", "discount_type", "coupon_id", "entity_id", "discount_amount"]
pass
class LineItemTax(Model):
fields = ["line_item_id", "tax_name", "tax_rate", "date_to", "date_from", "prorated_taxable_amount", "is_partial_tax_applied", "is_non_compliance_tax", "taxable_amount", "tax_amount", "tax_juris_type", "tax_juris_name", "tax_juris_code", "tax_amount_in_local_currency", "local_currency_code"]
pass
class LineItemDiscount(Model):
fields = ["line_item_id", "discount_type", "coupon_id", "entity_id", "discount_amount"]
class Discount(Model):
fields = ["amount", "description", "entity_type", "discount_type", "entity_id", "coupon_set_code"]
pass
class LineItemTier(Model):
fields = ["line_item_id", "starting_unit", "ending_unit", "quantity_used", "unit_amount", "starting_unit_in_decimal", "ending_unit_in_decimal", "quantity_used_in_decimal", "unit_amount_in_decimal", "pricing_type", "package_size"]
class Tax(Model):
fields = ["name", "amount", "description"]
pass

fields = ["reference_invoice_id", "type", "price_type", "currency_code", "sub_total", "total", \
"amount_allocated", "amount_available", "line_items", "discounts", "taxes", "line_item_taxes", \
"line_item_discounts", "line_item_tiers", "round_off_amount", "customer_id"]
"amount_allocated", "amount_available", "line_items", "line_item_tiers", "line_item_discounts", \
"line_item_taxes", "discounts", "taxes", "round_off_amount", "customer_id"]

4 changes: 2 additions & 2 deletions chargebee/models/currency.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ class Currency(Model):


@staticmethod
def list(env=None, headers=None):
def list(params=None, env=None, headers=None):
json_keys = {
}
return request.send_list_request('get', request.uri_path("currencies","list"), None, env, headers, None, False,json_keys)
return request.send_list_request('get', request.uri_path("currencies","list"), params, env, headers, None, False,json_keys)

@staticmethod
def retrieve(id, env=None, headers=None):
Expand Down
2 changes: 1 addition & 1 deletion chargebee/models/customer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class PaymentMethod(Model):
fields = ["type", "gateway", "gateway_account_id", "status", "reference_id"]
pass
class Balance(Model):
fields = ["promotional_credits", "excess_payments", "refundable_credits", "unbilled_charges", "currency_code", "balance_currency_code"]
fields = ["promotional_credits", "excess_payments", "refundable_credits", "unbilled_charges", "currency_code", "balance_currency_code", "business_entity_id"]
pass
class EntityIdentifier(Model):
fields = ["id", "value", "scheme", "standard"]
Expand Down
3 changes: 2 additions & 1 deletion chargebee/models/gateway_error_detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ class GatewayErrorDetail(Model):

fields = ["request_id", "error_category", "error_code", "error_message", "decline_code", \
"decline_message", "network_error_code", "network_error_message", "error_field", "recommendation_code", \
"recommendation_message", "processor_error_code", "processor_error_message", "error_cause_id"]
"recommendation_message", "processor_error_code", "processor_error_message", "error_cause_id", \
"processor_advice_code"]

2 changes: 1 addition & 1 deletion chargebee/models/invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class Note(Model):
fields = ["note", "entity_id", "entity_type"]
pass
class ShippingAddress(Model):
fields = ["first_name", "last_name", "email", "company", "phone", "line1", "line2", "line3", "city", "state_code", "state", "country", "zip", "validation_status", "index"]
fields = ["first_name", "last_name", "email", "company", "phone", "line1", "line2", "line3", "city", "state_code", "state", "country", "zip", "validation_status"]
pass
class BillingAddress(Model):
fields = ["first_name", "last_name", "email", "company", "phone", "line1", "line2", "line3", "city", "state_code", "state", "country", "zip", "validation_status"]
Expand Down
24 changes: 12 additions & 12 deletions chargebee/models/invoice_estimate.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,29 @@ class InvoiceEstimate(Model):
class LineItem(Model):
fields = ["id", "subscription_id", "date_from", "date_to", "unit_amount", "quantity", "amount", "pricing_model", "is_taxed", "tax_amount", "tax_rate", "unit_amount_in_decimal", "quantity_in_decimal", "amount_in_decimal", "discount_amount", "item_level_discount_amount", "metered", "is_percentage_pricing", "reference_line_item_id", "description", "entity_description", "entity_type", "tax_exempt_reason", "entity_id", "customer_id"]
pass
class Discount(Model):
fields = ["amount", "description", "entity_type", "discount_type", "entity_id", "coupon_set_code"]
class LineItemTier(Model):
fields = ["line_item_id", "starting_unit", "ending_unit", "quantity_used", "unit_amount", "starting_unit_in_decimal", "ending_unit_in_decimal", "quantity_used_in_decimal", "unit_amount_in_decimal", "pricing_type", "package_size"]
pass
class Tax(Model):
fields = ["name", "amount", "description"]
class LineItemDiscount(Model):
fields = ["line_item_id", "discount_type", "coupon_id", "entity_id", "discount_amount"]
pass
class LineItemTax(Model):
fields = ["line_item_id", "tax_name", "tax_rate", "date_to", "date_from", "prorated_taxable_amount", "is_partial_tax_applied", "is_non_compliance_tax", "taxable_amount", "tax_amount", "tax_juris_type", "tax_juris_name", "tax_juris_code", "tax_amount_in_local_currency", "local_currency_code"]
pass
class LineItemTier(Model):
fields = ["line_item_id", "starting_unit", "ending_unit", "quantity_used", "unit_amount", "starting_unit_in_decimal", "ending_unit_in_decimal", "quantity_used_in_decimal", "unit_amount_in_decimal", "pricing_type", "package_size"]
pass
class LineItemCredit(Model):
fields = ["cn_id", "applied_amount", "line_item_id"]
pass
class LineItemDiscount(Model):
fields = ["line_item_id", "discount_type", "coupon_id", "entity_id", "discount_amount"]
pass
class LineItemAddress(Model):
fields = ["line_item_id", "first_name", "last_name", "email", "company", "phone", "line1", "line2", "line3", "city", "state_code", "state", "country", "zip", "validation_status"]
pass
class Discount(Model):
fields = ["amount", "description", "entity_type", "discount_type", "entity_id", "coupon_set_code"]
pass
class Tax(Model):
fields = ["name", "amount", "description"]
pass

fields = ["recurring", "price_type", "currency_code", "sub_total", "total", "credits_applied", \
"amount_paid", "amount_due", "line_items", "discounts", "taxes", "line_item_taxes", "line_item_tiers", \
"line_item_credits", "line_item_discounts", "round_off_amount", "customer_id", "line_item_addresses"]
"amount_paid", "amount_due", "line_items", "line_item_tiers", "line_item_discounts", "line_item_taxes", \
"line_item_credits", "line_item_addresses", "discounts", "taxes", "round_off_amount", "customer_id"]

14 changes: 14 additions & 0 deletions chargebee/models/offer_event.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import json
from chargebee.model import Model
from chargebee import request
from chargebee import APIError

class OfferEvent(Model):



@staticmethod
def offer_events(params, env=None, headers=None):
json_keys = {
}
return request.send('post', request.uri_path("offer_events"), params, env, headers, "grow", True,json_keys)
31 changes: 31 additions & 0 deletions chargebee/models/offer_fulfillment.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import json
from chargebee.model import Model
from chargebee import request
from chargebee import APIError

class OfferFulfillment(Model):
class Error(Model):
fields = ["code", "message"]
pass

fields = ["id", "personalized_offer_id", "option_id", "processing_type", "status", "redirect_url", \
"failed_at", "created_at", "completed_at", "error"]


@staticmethod
def offer_fulfillments(params, env=None, headers=None):
json_keys = {
}
return request.send('post', request.uri_path("offer_fulfillments"), params, env, headers, "grow", True,json_keys)

@staticmethod
def offer_fulfillments_get(id, env=None, headers=None):
json_keys = {
}
return request.send('get', request.uri_path("offer_fulfillments",id), None, env, headers, "grow", True,json_keys)

@staticmethod
def offer_fulfillments_update(id, params, env=None, headers=None):
json_keys = {
}
return request.send('post', request.uri_path("offer_fulfillments",id), params, env, headers, "grow", True,json_keys)
3 changes: 0 additions & 3 deletions chargebee/models/omnichannel_one_time_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
from chargebee import APIError

class OmnichannelOneTimeOrder(Model):
class OmnichannelTransaction(Model):
fields = ["id", "id_at_source", "app_id", "price_currency", "price_units", "price_nanos", "type", "transacted_at", "created_at", "resource_version"]
pass

fields = ["id", "app_id", "customer_id", "id_at_source", "origin", "source", "created_at", \
"resource_version", "omnichannel_one_time_order_items", "purchase_transaction"]
Expand Down
9 changes: 6 additions & 3 deletions chargebee/models/omnichannel_subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
from chargebee import APIError

class OmnichannelSubscription(Model):
class OmnichannelTransaction(Model):
fields = ["id", "id_at_source", "app_id", "price_currency", "price_units", "price_nanos", "type", "transacted_at", "created_at", "resource_version"]
pass

fields = ["id", "id_at_source", "app_id", "source", "customer_id", "created_at", "resource_version", \
"omnichannel_subscription_items", "initial_purchase_transaction"]
Expand All @@ -29,3 +26,9 @@ def omnichannel_transactions_for_omnichannel_subscription(id, params=None, env=N
json_keys = {
}
return request.send('get', request.uri_path("omnichannel_subscriptions",id,"omnichannel_transactions"), params, env, headers, None, False,json_keys)

@staticmethod
def move(id, params, env=None, headers=None):
json_keys = {
}
return request.send('post', request.uri_path("omnichannel_subscriptions",id,"move"), params, env, headers, None, False,json_keys)
2 changes: 1 addition & 1 deletion chargebee/models/omnichannel_subscription_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class LinkedItem(Model):
fields = ["id", "item_id_at_source", "item_parent_id_at_source", "status", "auto_renew_status", \
"current_term_start", "current_term_end", "expired_at", "expiration_reason", "cancelled_at", \
"cancellation_reason", "grace_period_expires_at", "resumes_at", "has_scheduled_changes", "resource_version", \
"upcoming_renewal", "linked_item"]
"omnichannel_subscription_item_offers", "upcoming_renewal", "linked_item"]


@staticmethod
Expand Down
11 changes: 11 additions & 0 deletions chargebee/models/omnichannel_subscription_item_offer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import json
from chargebee.model import Model
from chargebee import request
from chargebee import APIError

class OmnichannelSubscriptionItemOffer(Model):

fields = ["id", "offer_id_at_source", "category", "category_at_source", "type", "type_at_source", \
"discount_type", "duration", "percentage", "price_currency", "price_units", "price_nanos", "offer_term_start", \
"offer_term_end", "resource_version"]

9 changes: 8 additions & 1 deletion chargebee/models/omnichannel_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@
from chargebee import APIError

class OmnichannelTransaction(Model):
class LinkedOmnichannelSubscription(Model):
fields = ["omnichannel_subscription_id"]
pass
class LinkedOmnichannelOneTimeOrder(Model):
fields = ["omnichannel_one_time_order_id"]
pass

fields = ["id", "id_at_source", "app_id", "price_currency", "price_units", "price_nanos", \
"type", "transacted_at", "created_at", "resource_version"]
"type", "transacted_at", "created_at", "resource_version", "linked_omnichannel_subscriptions", \
"linked_omnichannel_one_time_orders"]

2 changes: 1 addition & 1 deletion chargebee/models/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class OrderLineItem(Model):
fields = ["id", "invoice_id", "invoice_line_item_id", "unit_price", "description", "amount", "fulfillment_quantity", "fulfillment_amount", "tax_amount", "amount_paid", "amount_adjusted", "refundable_credits_issued", "refundable_credits", "is_shippable", "sku", "status", "entity_type", "item_level_discount_amount", "discount_amount", "entity_id"]
pass
class ShippingAddress(Model):
fields = ["first_name", "last_name", "email", "company", "phone", "line1", "line2", "line3", "city", "state_code", "state", "country", "zip", "validation_status", "index"]
fields = ["first_name", "last_name", "email", "company", "phone", "line1", "line2", "line3", "city", "state_code", "state", "country", "zip", "validation_status"]
pass
class BillingAddress(Model):
fields = ["first_name", "last_name", "email", "company", "phone", "line1", "line2", "line3", "city", "state_code", "state", "country", "zip", "validation_status"]
Expand Down
22 changes: 22 additions & 0 deletions chargebee/models/personalized_offer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import json
from chargebee.model import Model
from chargebee import request
from chargebee import APIError

class PersonalizedOffer(Model):
class Content(Model):
fields = ["title", "description"]
pass
class Option(Model):
fields = ["id", "label", "processing_type", "processing_layout", "redirect_url"]
pass

fields = ["id", "offer_id", "content", "options"]


@staticmethod
def personalized_offers(params, env=None, headers=None):
json_keys = {
"custom": 0,
}
return request.send('post', request.uri_path("personalized_offers"), params, env, headers, "grow", True,json_keys)
Loading