When no longer needed, an object in the catalog can be deleted. A deleted catalog object remains in the catalog and can be queried for auditing purposes, but is otherwise inoperable.
Using the Catalog API, you can delete a catalog object by calling the DeleteCatalogObject endpoint to handle a single object or calling the BatchDeleteCatalogObjects endpoint to handle one or more objects.
The following example shows how to delete a single catalog object as identified by its ID (
ZFJKJAQSFYULGXU6JBC6LDVL). The object is of the
ITEM type and has one variation (
XXHPAGFTJOZLMSMYWOSFGCTD) associated with it.
Delete catalog object
If successful, the request returns a response similar to the following:
The operation deletes the item (
G5I2JPKMXSTHRIXIFORI53YX) and the contained item variation (
XXHPAGFTJOZLMSMYWOSFGCTD), making them inoperable except for being searchable for auditing purposes.
To query deleted catalog objects, call SearchCatalogObjects while setting
"include_deleted_objects":true and other applicable query expressions.
The result contains both active and deleted objects. You need to parse the returned response to filter out deleted objects that have the
is_deleted property set to
The following example request shows how to call
SearchCatalogObjects to query deleted items:
Search catalog objects
The successful response is similar to the following:
The returned result contains both the deleted (with
"is_deleted":true) and active (with
"is_deleted":false) catalog objects of the specified types.
SearchCatalogObjects is the only operation that can be applied on deleted catalog objects. Any other operation attempted on a deleted object results in an error.
Calling RetrieveCatalogObject against a deleted object ID returns a
404 Not found response.
Other than querying by
SearchCatalogObjects, you cannot perform any operations on deleted catalog objects. In particular, you cannot undelete or otherwise modify a deleted
CatalogObject instance. Any attempt to do so returns a
400 response indicating an invalid operation to update a non-existent object.