In case your customer resumes a subscription, a corresponding resume request is created on the CloudBlue Connect platform. Once this request is approved, its corresponding subscription is reactivated by the platform.

The initial status of a resume 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 suspend request is successfully processed, its status is changed to Approved. Furthermore, the status of its associated subscription switches to Active on the Connect platform.

Vendors can deploy the Processor SDK to approve pending resume request and consequently reactivate subscriptions via their systems.

Prerequisites

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

Creating Resume Requests

Cancel fulfillment requests for active subscriptions are created by customers. However, Vendors can also create this request by accessing a suspended preview subscription.

Before creating a resume request, make sure that the Administrative Hold capability from your product profile page is enabled.

The following steps showcase how to create a resume 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 Suspended 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 Resume button.

Follow the wizard steps to successfully create a resume request.

3. Confirm your Resume Request creation

Click the Create Resume Request button to confirm your decision.

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

Code Snippets

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

from connect_processor.app.utils.utils import Utils
from cnct import ConnectClient
from typing import Dict


class Resume:
    # This class is used to manage requests to resume suspended subscriptions.

    @staticmethod
    def process_request(request, client):
        # type: (Dict, ConnectClient) -> Dict
        # This method processes pending resume requests.

        # Get the ID of the suspended subscription that should be active again.
        # The Subscription ID can be saved as a fulfillment parameter.
        # The external_subscription_id is used to call the Vendor API and resume the suspended subscription
        external_subscription_id = Utils.get_param_value(request, 'fulfillment', 'subscription_id')

        # Add the code to resume the subscription by calling the Vendor API:
        # api_client = APIClient(api_url='',
        #                        api_key='')
        # resume_payload = {}
        # api_client.resume_subscription(resume_payload, external_subscription_id)

        # In case the resume operation is successful, approve the request with the following code:
        return Utils.approve_fulfillment_request(request, client)
        # Therefore, the suspended subscription will be activated again.
        # If the resume operation is not successful, the request can be rejected by using 
        # the Utils.reject_fulfillment_request method.

Summary

Once a resume request to reactivate a subscription is processed and approved via your deployed middleware, the Connect platform assigns the Active status to this subscription.

Is this page helpful?
Translate with Google
Copied to clipboard