Using the Bill API to Retrieve Bill Information

Objective

After completing this lesson, you will be able to access the Bill API to obtain bill information.

Accessing the Bill API

As part of SAP Subscription Billing, it is important to retrieve bill information to gain insight into the charges and costs associated with individual subscriptions. By accessing bill information, you can effectively manage billing processes, track expenses, ensure accurate and timely billing, and provide transparent and detailed billing statements to customers.

Retrieving bill information requires the use of a REST client such as Bruno. The "Get Bill for Single Subscription" is a request made using a REST client to retrieve the billing information for a specific subscription. This request returns the details of the bill associated with the specified subscription, including the billing period, charges, and any other relevant information. By making this request, you can effectively manage and track the billing for individual subscriptions within the SAP Subscription Billing system.

Let’s access a bill using an API to retrieve billing information. Watch the following video to see how this is done.

Summary

REST APIs play a key role in performing many functions in SAP Subscription Billing. Now that you have seen how an API provides access to billing information, in the next lesson you’ll see how an API closes a bill, another important task that gives us control over the subscription billing process.

Send a GET Bill Request to Retrieve Bill Information on Your Subscription

Now that you are familiar with using the Get Bill API to retrieve information on a specific subscription ID, let's explore how to add query parameters to enhance your request. If you skip this step, you will retrieve a list with of the bills available in the Subscription Billing system. Additionally, the SAP Business Accelerator Hub offers numerous other bill APIs. For example, there is an API Get Bills {ID} which only shows information on a specific Bill. In the Bill Transfer section, you will find the APIs that are also used by the standard integration content to send the bill data to a back-end system for invoicing.

First, the API GET bills/transferable is used to retrieve a list with all bill IDs that are closed. Next, the list is processed one by one with the API "Get Bill {id}". After that, the bills are processed in the back-end system, and billing documents are created. The back-end system will use the API "/bills/{identifier}/successorDocuments" to send back a confirmation that the bills were processed. Finally, the Bill Status will change to transferred.

After uploading usage data to SAP Subscription Billing, you as a developer have the task to check the customer's bill. Your task is to implement a system that retrieves bill information for a specific customer's subscription using the Subscription Billing API.

Steps

  1. Create a new Request in Bruno.

    Use the following data:

    FieldValue
    Name<of your choice>
    MethodGet
    AuthBearerToken

    Bill ID: _______________________________

    Document Number: ___________________________

    1. Choose + in the tab.

    2. Give it a name of your choice, like Get Bill for Single Subscription.

    3. For the URL, change the method to GET and enter the URL: https://eu10.revenue.cloud.sap/api/bill/v2/bills?billItems.subscription.documentNumber=6

    4. Choose Create.

    5. Replace the document number in the end of the URL with the subscription document number from exercise 2.

    6. Open the Auth tab and select BearerToken.

    7. Enter the Bearer Token from exercise 1.

    8. Choose Send to receive information on the bill for the specific subscription.

    9. Note down the Bill ID and Document Number.

Log in to track your progress & complete quizzes