Closing a Bill Using an API

Objective

After completing this lesson, you will be able to close a bill using an API.

Closing a Bill Using an API

Subscription bills are routinely closed each month after a billing cycle. Sometimes a bill it’s necessary to close a bill manually when, for example, an immediate closure is required for testing an integration.

Manually closing a bill is sometimes necessary when managing subscriptions. Normally, a bill is automatically closed at the end of a monthly billing cycle. However, a bill may require closing at different times for any number of reasons, including when testing an integration. Instead of waiting for a bill to automatically close, use an API to manually manage the closing process.

Let’s look at how to manually close a bill with an API. Watch the following video to manually close a bill!

Note

Remember to follow proper handling and security practices when using a bearer token in a REST client.

Summary

Using APIs and events to coordinate the integration of systems simplifies the entire subscription billing process to retrieve bill information, set access rights, cancel subscriptions, generate usage data, update bills, close bills, and many other SAP Subscription Billing-related activities.

Learning Journey Summary

Figure summarizing the content of this lesson: APIs and Events, Systems, and Bills.

SAP Subscription Billing APIs and events can be likened to the orchestration of a symphony, as they play complementary roles in coordinating the integration of systems and managing subscription billing processes. The musical composition represents the underlying business logic and rules governing the performance. In SAP Subscription Billing, the orchestration of events and APIs aligns with the overall business logic, ensuring that the timing, sequence, and collaboration of systems adhere to predefined rules and operational requirements. This synchronizes the interactions between systems, much like the intricate harmony and synchronization found in musical compositions.

Now that you’ve had a chance to explore a few of the many capabilities of APIs and events and how they integrate systems with SAP Subscription Billing, it’s time to put your knowledge to action.

Close the Bill Manually Using the REST API

Business Scenario

After checking the bill, your next task is to close the bill manually to trigger the replication process towards the SAP S/4HANA system to generate invoices. Usually the bills are closed automatically, but your task as a developer is to test the integration and therefore you close the bill manually via API to accelerate the process.

Steps

  1. Create a new Request in Bruno.

    Use the following data:

    FieldValue
    Name<of your choice>
    MethodPost
    AuthBearer Token

    1. Create a new Request in Bruno by choosing + in the tab.

    2. Give it a name of your choice, for example, Close Bill Manually.

    3. For the URL, change the method to POST and enter the URL: https://eu10.revenue.cloud.sap/api/bill/v2/bills/ID/closing.

    4. Choose Create.

    5. Replace the ID in the URL with the Bill ID from exercise 6.

    6. Open the Auth tab and select BearerToken.

    7. Enter the Bearer Token from exercise 1.

    8. Choose Send to close the bill.

Log in to track your progress & complete quizzes