ab-python-sdk 10.0.0 Changelog
Breaking Changes
unit_balancevalues are nowint | str. This affectsSubscriptionComponent,CreateSubscriptionComponent,MeteredUsage, andPrepaidUsage. Components that support fractional quantities return a string.GetOneTimeTokenRequest.payment_profileis now a union. The endpoint can returnGetOneTimeTokenPaymentProfileorGetOneTimeTokenBankAccountPaymentProfile. The concrete class identifies which variant came back. The credit card class keeps its old name, because the spec file was renamed but the schema title was not.CreditCardPaymentProfile.card_typecan now beNone. The API can now returnNoneon a profile that previously always carried a value.ListSubcriptionGroupPrepaymentItemis renamed toListSubscriptionGroupPrepaymentItem. We corrected a typo in the schema title, and the generated class name follows the title. The properties of the model are unchanged.
New Features
- Added
update_invoiceanddelete_invoiceto the invoices controller. Both act only on ad hoc invoices indraftstatus. - Added support for the
subscription_product_change_scheduledwebhook event, asEventKey.SUBSCRIPTION_PRODUCT_CHANGE_SCHEDULEDandWebhookSubscription.SUBSCRIPTION_PRODUCT_CHANGE_SCHEDULED. The payload deserializes into the existingSubscriptionProductChangemodel. - Added nine filters to
list_subscriptions:q,q_scope,customer_id,collection_method,group_status,dunning_exemption,payment_gateways,currencies, andbranding_theme_id. - The
productfilter onlist_subscriptionsnow also accepts a string. It takes a product ID or an exact product name, but not a handle. Existing integer values keep working, so this is not a breaking change in Python. - Added three
SubscriptionListIncludevalues:CURRENT_ACCOUNT_BALANCE_IN_CENTS,CURRENT_BILLING_AMOUNT, andCOUPONS. - Added five
SubscriptionStateFiltervalues:ENUM_EXPIRED_CARDS_LIVE_SUBSCRIPTIONS,ENUM_EXPIRED_CARDS_ALL_SUBSCRIPTIONS,AWAITING_SIGNUP,AWAITING_SIGNUP_DATE, andPREPAID_DUNNING.
Because list_subscriptions takes keyword options, the reordered query parameters in the spec do not change any call site.
New Models
UpdateInvoiceUpdateInvoiceItemUpdateInvoiceRequestGetOneTimeTokenBankAccountPaymentProfileQScope(enum)GroupStatus(enum)CollectionMethod1(enum). The1suffix avoids a collision with the existingCollectionMethod.
CollectionMethod1, GroupStatus, and QScope are registered in advancedbilling/models/__init__.py and are importable from the models package. The new unions are registered in advancedbilling/utilities/union_type_lookup.py rather than generated as standalone classes.
Model Enhancements
Component,CreateOrUpdateProduct,Product,EBBComponent,MeteredComponent,OnOffComponent,PrepaidUsageComponent,QuantityBasedComponent,UpdateComponent- Added
unspsc_code(Optional[str], nullable). This holds a custom UNSPSC commodity code.
- Added
Customer- Added
surcharging(Optional[bool]). - Added
branding_theme_id(Optional[int], nullable).
- Added
CustomerAttributes- Added
surcharging(Optional[bool]).
- Added
CreateCustomer- Added
surcharging(Optional[bool]). - Added
branding_theme_id(Optional[int], nullable).
- Added
UpdateCustomer- Added
surcharging(Optional[bool]). - Added
branding_theme_id(Optional[int], nullable).
- Added
ProductFamily- Added
surcharging(Optional[bool]).
- Added
CreateProductFamily- Added
surcharging(Optional[bool]).
- Added
CreateSubscription- Added
branding_theme_id(Optional[int], nullable). Write-only. The subscription response does not return it.
- Added
UpdateSubscription- Added
branding_theme_id(Optional[int], nullable). Write-only. The subscription response does not return it.
- Added
Invoice- Added
branding_theme_id(Optional[int], nullable).
- Added
SubscriptionProductChange- Added
previous_product_price_point_id(Optional[int], nullable). - Added
new_product_price_point_id(Optional[int], nullable). - Added
effective_at(Optional[datetime], nullable). - Only the
subscription_product_change_scheduledevent populates these three fields.
- Added
GetOneTimeTokenPaymentProfile- Added a
validate()classmethod so the model can take part in the newpayment_profileunion.
- Added a
Bug Fixes
subscription_product_change_scheduledevents no longer fail to deserialize. The payload carriesprevious_product_price_point_id,new_product_price_point_id, andeffective_at.SubscriptionProductChangedid not model these fields. It now does, soEvent.event_specific_dataresolves the payload.
Internal / Non-functional Changes
- Doc comments reworded across models and controllers after a wording and punctuation pass in the spec (no behavioral impact).
- Version and user agent bumped to
10.0.0.
Full Changelog: 9.1.0...10.0.0