Introduction
A common subscription offering is the services subscription model. In this model, a provider offers access to a digital service, such as connecting to the internet or streaming media content.
With SAP Subscription Billing, you can now not only create subscriptions for such services, but also trigger the activation or deactivation of the subscribed service for the user in an integrated system.
Example Use Case: Software-as-a-Service
A provider of different IT and software services offers a flexible subscription model. Users get access to the services from the day on which the subscription begins. On this day, the users enable their first-time access with a license key that they receive per email.
The subscriptions are annual and don’t have an expiration date, but users can cancel them at any time or pause them until further notice. Consequently, access to the services is disabled during a pause.
Configuring Notifications
The provider configures notifications in SAP Subscription Billing so that the enablement and disablement of the software service for the subscriber is triggered automatically. The provider uses then the following notification triggers:
- Product Effective: To activate the service on the day that the subscription to the service starts.
- Pause: To deactivate the service on the day that the subscription is paused.
- Resume: To reactivate the service on the day that the subscription is resumed.
- Expiration: To deactivate the service on the day that the subscription expires.
Note: This trigger is needed if the subscriptions are cancelled, in which case they expire 30 days after the users submit their cancellation notice.
As the provider wants all subscriptions to have the same notification settings, they configure the notifications in the product. Thus, the notification settings are automatically applied to all subscriptions that are created for that product.
Accordingly, the provider creates a product for each software service in the
Products app. Then, in the
Subscription Notifications tab of the product, the provider creates four notifications, one for each trigger. Here you see the settings for the
Product Effective notification:
Once all notifications are configured, the setup looks like this in the product:
With these settings, the system will dispatch a notification every time that a subscription for the product starts, pauses, resumes, or expires. The provider can use these notifications to enable or disable access to their software services in a connected application.
Provisioning Subscriptions with License Keys
The provider adds the license key to a subscription as a technical resource in the item for the product or service. Usually, they already prepare the rest of the subscription data before a subscription starts, provision the license key once available and then let the subscription begin.
The exact steps for this look as follows:
- In SAP Subscription Billing, the provider creates the subscription in status Pending.
As it’s pending, the subscription doesn’t start (in other words, isn’t billed) until the missing data is provisioned.
- In a technical system, the license key is generated.
- In SAP Subscription Billing, the provider enters the license key into the subscription as a technical resource. Then, they complete the subscription.
The completion removes the pending status and activates the subscription as of the start date.
- When the subscription starts, this triggers an email to the subscriber with the license key.
For more information about these processes of SAP Subscription Billing, see
Pending Subscriptions and
Technical Resources on the SAP Help Portal.
Setting Up an Integration Process with Events
We mentioned before that the users need the license key when they access the services for the first time. The provider sends them their license key by email on the day of the service activation, which is the day on which the product becomes effective (usually, this day matches the start date of the subscription).
The provider uses the notification from SAP Subscription Billing with the trigger
Product Effective to automate their activation emails. This automation is possible by enabling the distribution and consumption of the notification in their integration process, which the provider sets up following these steps:
- Registering the notification in SAP Event Mesh.
- Configuring an integration flow in SAP Cloud Integration.
Registering the Notification in SAP Event Mesh
Notifications for events are registered in SAP Event Mesh as queues. Other applications can then subscribe to these queues and trigger follow-up processes derived from the events they receive. In our example, such a process would be dispatching the activation email with the license key.
You register notification events in Event Mesh by creating a queue and assigning the corresponding topics for the events.
- See Manage Queues in the Event Mesh documentation for detailed instructions.
- See the Subscription Events package in the SAP API Business Hub for the topic names of the notifications.
To enable the dispatch of the email, the provider creates a queue for the notification with the trigger
Product Effective and assigns the corresponding topic:
Configuring an Integration Flow in SAP Cloud Integration
To trigger the activation email to the subscriber, the provider sets up an appropriate integration flow. SAP Cloud Integration offers adapters to consume messages from an Event Mesh queue, like the
AMQP adapter.
All the provider needs to do is to enter the connection details, the credentials, and the name of the inbound queue that contains the Product Effective notifications.
Having done that, the provider finishes by configuring the steps that are needed to read the relevant data and trigger the email.
Here you see an example of a simple integration flow that performs these steps:
- Processes the event payload.
- Reads the customer data to get the name and email address of the subscriber.
- Sends the email.
The email contains the license key, which is the technical resource of the subscription item.
Therefore, every time SAP Subscription Billing dispatches a notification for an activation email to Event Mesh, this integration flow processes the notification to send the key to the new subscriber:
Did you like this insight into events and integration flows? The automation of emails is just one possible use case. If you remember the example of provisioning subscriptions with license keys, the license key was generated separately before the subscription was completed. Another integration flow was actually in play for generating the license key, or technical resource. The trigger for that integration flow was also a subscription event: createdAsPending.
If you want to learn more about integration flows, you’ll find all the details in the documentation of SAP Cloud Integration.
This blog post was drafted with the assistance of Annette Klute. The use case and setup screenshots were provided by Frank Lange.