Cancelling a Subscription With an API

Objective

After completing this lesson, you will be able to cancel a subscription with an API.

Canceling of a Subscription with an API

Canceling a subscription with an API typically involves sending a request to the Subscription Billing API endpoint with the necessary parameters and authentication credentials. With a Subscription ID, you can send a subscription cancellation request using an API. Note that the URL remains the same; you only need to change the endpoint.

Next, let’s continue with a video to see how to cancel a subscription with an API.

Summary

Now that we’ve explored everything from subscription API options and testing with REST Clients to creating and canceling subscriptions with APIs, let’s move to the next unit and learn about APIs that manage usage.

Cancel a Subscription Using the POST Subscription Cancellation API

Business Scenario

You are a developer implementing Subscription Billing for your company. The business scenario is that your company has received a cancellation request from a customer for his running subscription. The exercise requires you to use the Subscriptions API to cancel the subscription.

Steps

  1. Create a new POST Request in Bruno.

    1. Enter the URL: https://eu10.revenue.cloud.sap/api/subscription/v1/subscriptions/ID/cancellation.

    2. Go to the Auth tab and enter the bearer token from Exercise 1.

    3. Replace the ID in the URL with the subscription ID from Exercise 2.

    4. Go to the Body tab.

    5. Select JSON.

    6. Enter JSON.

      Code Snippet
      123456789
      { "metaData": { "version": 1 }, "requestedCancellationDate": "2024-08-01", "cancellationReason": "Not Paid", "cancellationNoticeDate": "2024-07-24T05:00:00.000Z" }

Log in to track your progress & complete quizzes