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
Steps
Create a new POST Request in Bruno.
Enter the URL: https://eu10.revenue.cloud.sap/api/subscription/v1/subscriptions/ID/cancellation.
Go to the Auth tab and enter the bearer token from the Exercise Generate a Bearer Token to Get Authorization for the APIs.
Replace the ID in the URL with the subscription ID from the Exercise Get Customer ID and Create a Subscription Using the POST Subscription API.
Go to the Body tab.
Select JSON.
Enter JSON.
123456789
{
"metaData": {
"version": 1
},
"requestedCancellationDate": "2024-08-01",
"cancellationReason": "Not Paid",
"cancellationNoticeDate": "2024-07-24T05:00:00.000Z"
}