Home > Cloud Cruiser 4 > REST API reference > Customers > Delete a customer by account ID

Delete a customer by account ID

Deletes a customer specified by its account ID.

Resource URL

In version 4.0: DELETE http://<ccServerURL>/rest/v2/customers/accountId/<accountId>

In version 4.1 and later: DELETE http://<ccServerURL>/rest/v2/customers?accountId=<accountId>

Request

Parameters
Version 4.0
Version 4.1 and later

For Cloud Cruiser 4.1 and later, use the following parameters:

  Name Type Description
URL query parameters accountId integer

(required) The account ID of the customer to delete. Use a pipe (|) to separate the levels of your account structure.

deleteAssociates boolean Whether to delete the customer's associated transactions and discount/surcharge instances. The default is false.
Body

None

Response

Content-Type

text/plain

Body

A statement of whether the deletion is successful.​

Examples

URL invocation (basic)

DELETE http://localhost:8080/rest/v2/customers?accountId=T|A1​

URL invocation (delete associated transactions and discounts)

DELETE http://localhost:8080/rest/v2/customers?accountId=T|A1&deleteAssociates=true​

Java invocation

String msg = customerServiceProxy.deleteCustomerByAccountId("T|A1");

Response body (success)

Successfully deleted the customer with accountId T|A1

Response body (nonexistent customer)

<message>Failed to delete the customer Cause: com.cloudcruiser.common.exceptions.NoSuchRecordException: Unable to find the customer with accountId T|A1</message>

Response body (customer has transactions or discounts)

<message>Failed to delete the customer Cause: com.cloudcruiser.common.exceptions.CannotDeleteCustomerWithTransactionsException: This customer has associated transactions and/or discount revisions.<br/>Are you sure you want to delete?</message>

Last modified

Tags

Classifications

This page has no classifications.
© Copyright 2018 Hewlett Packard Enterprise Development LP