Skip to content

10.0.0

Latest

Choose a tag to compare

@imlukedewitt imlukedewitt released this 14 Aug 14:33
38ef301

ab-python-sdk 10.0.0 Changelog

Breaking Changes

  • unit_balance values are now int | str. This affects SubscriptionComponent, CreateSubscriptionComponent, MeteredUsage, and PrepaidUsage. Components that support fractional quantities return a string.
  • GetOneTimeTokenRequest.payment_profile is now a union. The endpoint can return GetOneTimeTokenPaymentProfile or GetOneTimeTokenBankAccountPaymentProfile. 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_type can now be None. The API can now return None on a profile that previously always carried a value.
  • ListSubcriptionGroupPrepaymentItem is renamed to ListSubscriptionGroupPrepaymentItem. 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_invoice and delete_invoice to the invoices controller. Both act only on ad hoc invoices in draft status.
  • Added support for the subscription_product_change_scheduled webhook event, as EventKey.SUBSCRIPTION_PRODUCT_CHANGE_SCHEDULED and WebhookSubscription.SUBSCRIPTION_PRODUCT_CHANGE_SCHEDULED. The payload deserializes into the existing SubscriptionProductChange model.
  • Added nine filters to list_subscriptions: q, q_scope, customer_id, collection_method, group_status, dunning_exemption, payment_gateways, currencies, and branding_theme_id.
  • The product filter on list_subscriptions now 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 SubscriptionListInclude values: CURRENT_ACCOUNT_BALANCE_IN_CENTS, CURRENT_BILLING_AMOUNT, and COUPONS.
  • Added five SubscriptionStateFilter values: ENUM_EXPIRED_CARDS_LIVE_SUBSCRIPTIONS, ENUM_EXPIRED_CARDS_ALL_SUBSCRIPTIONS, AWAITING_SIGNUP, AWAITING_SIGNUP_DATE, and PREPAID_DUNNING.

Because list_subscriptions takes keyword options, the reordered query parameters in the spec do not change any call site.

New Models

  • UpdateInvoice
  • UpdateInvoiceItem
  • UpdateInvoiceRequest
  • GetOneTimeTokenBankAccountPaymentProfile
  • QScope (enum)
  • GroupStatus (enum)
  • CollectionMethod1 (enum). The 1 suffix avoids a collision with the existing CollectionMethod.

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.
  • Customer
    • Added surcharging (Optional[bool]).
    • Added branding_theme_id (Optional[int], nullable).
  • CustomerAttributes
    • Added surcharging (Optional[bool]).
  • CreateCustomer
    • Added surcharging (Optional[bool]).
    • Added branding_theme_id (Optional[int], nullable).
  • UpdateCustomer
    • Added surcharging (Optional[bool]).
    • Added branding_theme_id (Optional[int], nullable).
  • ProductFamily
    • Added surcharging (Optional[bool]).
  • CreateProductFamily
    • Added surcharging (Optional[bool]).
  • CreateSubscription
    • Added branding_theme_id (Optional[int], nullable). Write-only. The subscription response does not return it.
  • UpdateSubscription
    • Added branding_theme_id (Optional[int], nullable). Write-only. The subscription response does not return it.
  • Invoice
    • Added branding_theme_id (Optional[int], nullable).
  • 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_scheduled event populates these three fields.
  • GetOneTimeTokenPaymentProfile
    • Added a validate() classmethod so the model can take part in the new payment_profile union.

Bug Fixes

  • subscription_product_change_scheduled events no longer fail to deserialize. The payload carries previous_product_price_point_id, new_product_price_point_id, and effective_at. SubscriptionProductChange did not model these fields. It now does, so Event.event_specific_data resolves 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