Overview

When your customers cancel their subscriptions, new cancel fulfillment requests are generated on the CloudBlue Connect platform. In case this request is approved, its corresponding subscription is terminated by the platform.

The initial status of a cancel fulfillment request is Pending. It remains in this state until it is processed via the Connect platform or via your deployed middleware. In case a cancel request is successfully processed, its status is changed to Approved. Thus, the status of its corresponding subscription will be also switched to Terminated.

Vendors can deploy the Processor to approve pending cancel fulfillment request by calling the Vendor API. Therefore, Vendors can terminate active subscriptions via their systems.

Prerequisites

Before following the provided use case, make sure that all of these prerequisites are met:

Creating Cancel Requests

Cancel fulfillment requests for active subscriptions are created by customers. However, Vendors can also create this request by accessing an active preview subscription. The following steps showcase how to create a cancel request for your generated preview subscription.

1. Access active subscription details

Click on your active preview subscription from the Subscriptions module of the Connect platform.

Your subscriptions are displayed within the Directory tab. Make sure that a subscription that you want to cancel is in the Active state and it is marked with the Preview tag.

2. Launch a Cancel Request Wizard

Open the Actions menu from the subscription details screen and click the Cancel button.

Follow the wizard steps to successfully create a cancel request.

3. Confirm your Cancel Request creation

Click the Create Cancel Request button to confirm your decision.

Therefore, the Connect platform generates a fulfillment request to cancel a subscription.

Code Snippets

Create a script that triggers specific API requests to approve the aforementioned cancel requests. Thus, subscriptions can be cancelled by approving these requests via your configured Processor SDK Template.

Warning

Make sure to copy the right ID of a subscription that should be cancelled.

from connect_processor.app.utils.utils import Utils
from cnct import ConnectClient
from typing import Dict
class Cancel:
# This class is used to manage cancel  request in Connect.
@staticmethod
def process_request(request, client):
# type: (Dict, ConnectClient) -> Dict
# This method approves or rejects pending cancel requests
# Get the fulfillment parameter values from the subscription that needs to be cancelled
# Note that subscription_id serves as an example of fulfillment parameter ID.
# The external_subscription_id is used to call the Vendor API and cancel the subscription
external_subscription_id = Utils.get_param_value(request, 'fulfillment', 'subscription_id')
# Add your code to Cancel the subscription in vendor system by calling the Vendor API
# api_client = APIClient(api_url='',
#                        api_key='')
# cancel_payload = {}
# api_client.cancel_subscription(cancel_payload, external_subscription_id)
# Approve the cancel request with the following code:
return Utils.approve_fulfillment_request(request, client)
# If the cancel request is processed successfully, the subscription status is switched to Terminated.
# In case the cancel request can not be processed, reject the request by using 
# the Utils.reject_fulfillment_request method.

Summary

Once a fulfillment request to cancel a subscription is processed and approved via your deployed middleware, the Connect platform assigns the Terminated status to this subscription.

Is this page helpful?
Translate with Google
Copied to clipboard