Overview of DELETEs

Within the context of APIs that are fully REST-compliant, a DELETE is an endpoint operation that deletes a resource. This typically involves removing the resource from the underlying database.

Within the context of Cloud API, a DELETE is a Cloud API method that "removes" an existing resource from BillingCenter. What it means to "remove" the resource depends on the resource type. The DELETE operation federates to the BillingCenter code that matches the functionality most closely tied to deletion. That code could theoretically:

  • Delete the corresponding data model instance from the operational database.
  • Mark the corresponding data model instance as retired.
  • Modify the corresponding data model instance and other related instances to indicate the data is no longer active or available.

Unlike GET, POST, and PATCH, there are only a small number of endpoints in the base configuration that support DELETE. This is because, in most cases, BillingCenter does not support the removal of data. Several business objects can be approved, canceled, completed, closed, declined, rejected, retired, skipped, or withdrawn. But only a few can be deleted.

A DELETE call consists of the DELETE method and the endpoint, such as DELETE /notes/{noteId}. Similar to GETs, DELETEs are not permitted to have a request payload.

The response to a DELETE includes an HTTP code indicating success or failure. DELETE responses do not have a response payload.

Tutorial: DELETE an account contact

In this tutorial, you will delete the primary contact on the Standard Account.

Tutorial steps

  1. In Postman, start a new request by clicking the + to the right of the Launchpad tab.
    1. On the Authorization tab, select Basic Auth using user su and password gw.
  2. Enter the following call and click Send:

    GET http://localhost:8580/bc/rest/billing/v1/accounts?filter=accountNumber:eq:Standard%20Account

  3. Identify the id of the account that is returned. This value is referenced below as <accountId>.
  4. Open a second request tab and right-clicking the first tab and selecting Duplicate Tab.
    1. On the Authorization tab, select Basic Auth using user su and password gw.
  5. Enter the following URL:
    1. GET http://localhost:8580/bc/rest/billing/v1/accounts/<accountId>/contacts
  6. Click Send. In the response payload, there is one contact: Bill Baker. Identify the contact's id, referenced below as <contactId>.
  7. Open a third request tab by right-clicking the second tab and selecting Duplicate Tab.
  8. Change the operation to DELETE and enter the following URL:
    1. DELETE http://localhost:8080/bc/rest/billing/v1/accounts/<accountId>/contacts/<contactId>
  9. Click Send. (The response to a successful DELETE is "204 - No content".)

Checking your work

Resend the request on the third tab. This request returns a "No resource was found" error because it is attempting to DELETE a note that has already been DELETEd.

This removes the contact from the account. The contact still exists in the database, but the contact is no longer associated with the account.