The subscription.updated event plays a pivotal role in the subscription lifecycle within our system. Triggered whenever there is a modification to any aspect of a subscriber's account—from renewal price, renewal quantity, renewal product, renewal type, expiration date, and immediate mid-term changes like immediately reducing the quantity and increasing the quantity—this event helps you stay informed about significant changes. Changes initiated through all channels, including Global Commerce, the High Availability Subscription API, integration jobs such as SSN/UM, and the Global Commerce-hosted storefront self-service page, will trigger this event
The previousAttributes object in this event provides invaluable insight into the specifics of these changes, highlighting the altered attributes and their state before the update. This level of detail is essential for maintaining accurate records, ensuring the continuity of services, and delivering exceptional customer service.
Previous attributes
When a subscription undergoes any modifications, such as changes in billing details, subscription period adjustments, or service type transitions, a subscription.updated event is generated. This event is crucial for tracking changes accurately to ensure the continuity of a seamless service experience for your customers.
A key component of this event is the previousAttributes object. This object encapsulates the details of what exactly changed during the update. It lists the attributes that were modified and provides the previous values of these attributes before the update took place.
For example, when a subscription's renewal type changes, the previousAttributes could look like this:
For a change from manual to auto-renewal:
"previousAttributes": {"autoRenewal":true}
For a change from auto-renewal to manual:
"previousAttributes": {"autoRenewal":false}
Handling a change to the renewal price
When the renewal price of a subscription changes, a subscription.updated event is fired. This event notifies stakeholders of any adjustments to the subscription cost for the upcoming renewal period. Understanding this event is crucial for maintaining transparency with subscribers and ensuring smooth subscription management practices.
Understanding the event structure
Upon a renewal price change, you will receive a subscription.updated event with the following structure:
type: Identifies the event type as subscription.updated.
data:
object: Contains details about the subscription, including ID, state, renewal quantity, and more.
renewalPrice: Details the new renewal price, including unitPrice and currency.
previousAttributes: Captures the state of the subscription before the update.
renewalPrice: Indicates the previous renewal price to allow for a clear comparison.
The previousAttributes section is especially important as it provides the old values before the update, enabling clear visibility into what has changed. Here's an example snippet indicating a price change:
Transparency: Subscribers are informed about the price change before their renewal date, maintaining trust.
Compliance: Ensures adherence to policies or regulations requiring pricing change notification.
Analytics: Helps in analyzing the impact of price adjustments on retention and revenue.
Any change in the renewal price is a critical event that requires attention to manage subscriber expectations effectively and comply with service agreements.
Handling a change to the subscription renewal date
In the lifecycle of managing subscriptions, adjusting the renewal date is a common and necessary action to accommodate various scenarios, such as extending a trial period, aligning billing cycles, or responding to customer requests. The subscription.updated event is crucial as it notifies when there's a modification to the subscription's renewal date. This section offers a comprehensive guide on handling such updates efficiently, ensuring smooth subscription management while maintaining transparency with subscribers.
Handling a change to the subscription renewal product
The subscription.updated event is triggered whenever a product is modified associated with a subscriber's renewal period. This can include changes such as updating to a new product version, switching to a different product that better suits the subscriber's needs, or modifying the product's components, including add-ons. This event ensures that subscribers and service providers are informed about the upcoming changes to the subscribed product before the current subscription term renews.
Key information provided in the event's payload includes:
id: The subscription identifier.
renewalProduct: Details of the new product for renewal, including product id, displayName, and sku.
previousAttributes: Shows the renewalProduct details before the update, allowing an easy comparison between the old and new renewal products.
Understanding and handling this event is crucial for maintaining transparency with subscribers and ensuring a seamless transition to the new product.
Handling a change to the subscription renewal type
When the renewal type of a subscription changes, a subscription.updated event is triggered. This event signifies a modification in how the subscription will be renewed – switching between manual and automatic renewals. It's a critical update that reflects either a change in customer preference or an adjustment in business strategy regarding the subscription.
Key details in the event payload:
id: Subscription identifier.
autoRenewal: Boolean value indicating if the renewal is set to automatic (true) or manual (false).
previousAttributes: Contains the subscription attributes before the update, allowing for a comparison. For the renewal type change, it will typically show "autoRenewal": true or "autoRenewal": false depending on the initial setup.
Handling a change to the subscription renewal quantity
When the renewal quantity of a subscription changes, a subscription.updated event is triggered. This event is a crucial indication for subscribers and service providers that there has been an adjustment in the number of subscribed units or services before the next renewal period. The event payload provides detailed information, including:
Subscription ID ("subscriptionId")
Previous and Current Quantity Values: It includes both the previous and current values of currentQuantity and renewalQuantity to maintain transparency.
Renewal Product Details: Information about the renewal product, including ID, displayName, and SKU.
AutoRenewal Status: Indicates whether the subscription is set to renew automatically.
Example of subscription.updated event data with a focus on renewal quantity change:
This event signals an important update in the subscription's lifecycle and aids in maintaining effective communication and satisfaction between the service provider and the customer.
When a subscription is updated midterm, it's fundamental to accurately track and manage these changes to ensure a seamless customer experience. The subscription.updated event is critical for identifying and responding to these modifications, which can range from billing details changes, adjustments in subscription periods, or updates to the service types.
Key Steps:
Identify the Change: Review the subscription.updated event data to understand exactly what was altered in the subscription. This could involve changes in quantity, pricing, product details, payment methods, or other attributes.
Update Records: Promptly update your internal records to reflect the changes identified. This ensures that all systems are in sync and reduces the risk of service interruptions or billing inaccuracies.
Notify the Subscriber: Depending on the nature of the change (e.g., pricing or product alterations), it may be pertinent to notify the subscriber. This can be done via email, SMS, or in-app notifications, ensuring transparency and maintaining trust.
Adjust Billing if Necessary: If the change affects the billing amount or cycle, make the necessary adjustments to the billing system. This may include issuing a new invoice, refunding overcharges, or updating the billing schedule.
Monitor for Issues: After processing the change, monitor the subscription for any issues that might arise. This can include payment failures, access problems, or further changes requested by the customer.
By following these steps, companies can effectively manage midterm subscription changes, keeping customer satisfaction high and operational issues to a minimum.
Handling a change to the subscription expiration date
The subscription.changed event related to expiration date changes indicates a significant modification in the end date of a subscription. Several actions, such as extending or reducing the subscription term, adjusting the renewal settings, or altering the subscription package, can trigger this event.
Key attributes affected:
expirationDate: The updated expiration date of the subscription.
nextRenewalDate: Possibly adjusted along with the expiration date, especially for auto-renewing subscriptions.
duration and frequency: These may change to reflect adjustments in the subscription period due to the update.
Example scenarios:
Extension of subscription term: A subscriber opts to extend their existing subscription term, pushing the expiration date further into the future.
Early termination: Either the subscriber or provider decides to terminate the subscription ahead of its original expiry date, setting a new, earlier expiration date.
Using subscription.action.processed and subscription.updated
The subscription.action.processed and subscription.updated events are crucial in keeping subscribers and service providers informed about subscription changes. While they may cover similar updates, such as expiration_date, renewal_type, and renewal_price, they are triggered under different circumstances and serve distinctive purposes:
subscription.action.processed: This event is triggered when specific actions, such as updating the renewal_type, are processed through various channels like the high-availability (HA) subscription API. It signifies that the requested action on the subscription has been successfully processed, ensuring that changes are accurately reflected and communicated.
subscription.updated: Occurs when a subscription is updated, either through integration jobs, the -availability (HA) subscription API, or self-service options on the storefront. This event is broader, encompassing updates to billing cycles, subscription plans, and subscriber information. Unique to this event is its coverage of changes made through certain channels that do not trigger the subscription.action.processed event. For instance, a change in renewal_price via SSN (Self Service Network) leads to the emission of only the subscription.updated event.
Understanding the distinction and overlap between these events allows for better integration and event handling strategy, ensuring that applications or services subscribing to these events can accurately process and react to changes in subscription details.