Before adding or importing new data, we recommend that you clear out the sample data. This page describes the steps to remove this sample data by using both the Merchant Center and the HTTP API.
Delete data in the Merchant Center
- Cart Discounts
- Categories
- Customers
- Business Units
- Discount Codes
- Product Discounts
- Products
- Project settings:
- Languages, currencies, countries, Zones
- Product Types and Attributes
- Shipping Methods
- Stores
- Tax Categories
- Channels
- Associate Roles and Permissions
Bulk delete items
For quick removal, the Merchant Center provides a bulk delete feature for Products, Product Discounts, Cart Discounts, and Discount Codes. The following example walks you through the bulk delete process for Products:
- Go to Products > Product list.
- Select the Products you want to bulk delete. You can rely on the filter functionality to narrow down the list.
- Select the checkbox in the Product list's header row to select all the Products on the page.
- You can change the number of Products displayed on the page from the Items per page drop-down at the bottom of the Product list table.
- Select Delete from the Actions drop-down list.
Delete an item manually
To delete items manually in the Merchant Center, follow these steps using Categories as an example:
- Go to Category > Category list and select the Category you want to delete.
- On the Manage Category page, click the delete icon.
Repeat this process for all items you want to delete. The steps might vary slightly depending on the type of item, but the general process is the same.
Delete data using the HTTP API
The following items can be deleted only via the API:
- Carts
- Quotes and Quote Requests
- Orders
- Payments
id or key. You also need to provide the latest version of a resource to delete it. For example, to delete Carts:- Open the commercetools Postman collection and go to Authorization > Obtain access token. Click Send to generate a new access token.
- Go to Project > Carts > Query carts to obtain the
idandversionof the Cart you want to delete. - Go to Project > Carts > Delete Cart by id.
- In the URL bar, replace placeholders
{{cart-id}}and{{cart-version}}with the details of the Cart you want to delete. - Click Send.
Make sure that you delete the correct items. This is because sending a request with Postman is final and does not produce any additional confirmation prompts.
200 HTTP status code along with the data of the deleted Cart.Repeat the above for each Cart or item that you intend to remove.
Delete Products and Categories
In the process of deleting your data, there are some specific points to keep in mind for Products and Categories.
- Before deleting Products, you must first unpublish them. To speed up the process, you can rely on bulk actions.
- If you delete a Category that contains subcategories, the subcategories are also removed. In addition, these subcategories are also removed from Products.