Managing SAP Subscription Billing REST APIs

Objectives

After completing this lesson, you will be able to:
  • Use a REST Client to test APIs for SAP Subscription Billing.
  • Create a subscription with an API.

REST Client for Testing APIs for SAP Subscription Billing

Testing SAP Subscription Billing APIs with a REST Client is an important step in the development and implementation process. A REST Client simulates API requests and responses, allowing developers and testers to validate the functionality, performance, and security of the APIs. There are several REST Clients available. For our testing purposes, Bruno is used as a REST Client, the same tool used when a bearer token is created. You will use this bearer token for authentication.

Use the Bruno REST Client to create a subscription, make a POST request to an SAP Subscription Billing API endpoint.

This API endpoint is found in the API Hub. An SAP Subscription Billing API endpoint is a URL that allows users to access and interact with the SAP Subscription Billing API. This endpoint allows developers to make requests to the API to manage and automate subscription billing processes within their SAP systems. Users can use the endpoint to perform actions such as creating, updating, and canceling subscriptions, as well as retrieving subscription and billing information.

The REST Client provides a user-friendly interface for building and sending requests, specify the API endpoint and any necessary headers or authentication credentials. Once the POST request is sent, the SAP Subscription Billing API processes the request and create the subscription according to the provided parameters. If the request is successful, the API returns a response indicating that the subscription has been created, along with any relevant details or confirmation information.

Next, let’s continue with a video to see first-hand how to create a subscription with an API.

Subscription with an API

Summary

Now that you have had a chance to create a subscription using a REST API. In the next lesson you will explore managing rights for an API in SAP Subscription Billing.

Get Customer ID and Create a Subscription Using the POST Subscription API

Business Scenario

You work as a developer and you are implementing SAP Subscription Billing to manage customer's subscription-based learning packages. Your task is to set up the process for enrolling new customers and creating subscriptions for their chosen learning plans using APIs.

Steps

  1. Create a new GET Request in Bruno.

    Use the following data:

    FieldValue
    CustomerJohn Doe
    URLhttps://eu10.revenue.cloud.sap/api/business-partner/v3/customers
    MarketA01
    ProductBR469

    1. Enter the URL: https://eu10.revenue.cloud.sap/api/business-partner/v3/customers

    2. Go to the Auth tab and enter the bearer token from the Exercise Generate a Bearer Token to Get Authorization for the APIs.

    3. Choose Send (Arrow on the top right).

    4. Copy the Customer Number for John Doe.

  2. Create a new POST Request.

    Subscription level: _________________________________

    Document ID ______________________________________

    Use the following data:

    FieldValue
    URLhttps://eu10.revenue.cloud.sap/api/subscription/v1/subscriptions
    Auththe Bearer Token from the exercise: Generate a Bearer Token to Get Authorization for the APIs
    1. Enter the URL: https://eu10.revenue.cloud.sap/api/subscription/v1/subscriptions.

    2. Go to the Auth tab and enter the bearer token from the Exercise Generate a Bearer Token to Get Authorization for the APIs.

    3. Go to the Body tab.

    4. Select JSON on the right side.

    5. Enter the JSON.

      Code Snippet
      1234567891011121314151617181920212223
      { "customer": { "id": "3228312141" }, "market": { "id": "A01" }, "validFrom": "2024-07-01T05:00:00.000Z", "snapshots": [ { "effectiveDate": "2024-07-01T05:00:00.000Z", "items": [ { "itemId": "10", "product": { "code": "BR469" } } ] } ] }
    6. Note down the subscription ID and document number into the line on the step level.

Log in to track your progress & complete quizzes