API Playground

Delete one or more entities by id. This playground calls the live API and will remove data from your catalogue. The filters scope is documented below but deliberately not offered here — a filter tree can match your whole catalogue.

Authentication Required

You need to Login to test the API playground

Bulk delete entities

Delete every entity in a scope — an explicit list of ids, or everything matching a filter tree.

Each id is resolved as an entity first (brand-scoped), then falls back to a legacy inventory id — in which case the inventory and all of its entities go. Inventories left with no entity at all are removed too, and the matching search-index documents are dropped by the Change Stream shortly after the MongoDB delete. Carrying the scope in the request body removes the URL-length limit of the legacy delete endpoint.

A filters scope with an empty condition list means the whole catalogue, and one call deletes up to 5.000 entities with no further confirmation. Deletion is soft — an operator can undo it with php artisan entities:restore for 30 days — but the API offers no way back, so treat every call as final.
Endpoint URL
POST https://api.commerceclarity.com/api/2026-05/entities/delete

Body parameters

Send either ids or filters. If both are present, ids wins and filters is ignored.

ParameterTypeRequiredDescription
idsarrayRequiredNon-empty array of entity (or legacy inventory) _id strings. Required unless filters is sent.
filtersobjectRequiredFilter tree — the same one List / Query entities takes. Deletes everything it matches. Required unless ids is sent.
filters.operatorstringRequiredand or or. Mandatory whenever filters is present.
filters.conditionsarrayOptionalAn empty or omitted condition list is the deliberate whole catalogue scope.
brand_idstringOptionalOverride the active brand.
A filters scope may resolve at most 5 000 entities. The count is checked before anything is deleted; above the cap the request is refused with 422 and nothing is written. An ids scope is not capped.

Request Examples

By ids
curl -X POST "https://api.commerceclarity.com/api/2026-05/entities/delete" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "ids": ["507f1f77bcf86cd799439011", "507f1f77bcf86cd799439012"] }'
By filters — a whole family, except two entities
curl -X POST "https://api.commerceclarity.com/api/2026-05/entities/delete" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "filters": {
      "operator": "and",
      "conditions": [
        { "field": "family_id",  "op": "is",     "value": "507f1f77bcf86cd7994390f0" },
        { "field": "product_id", "op": "not in", "value": ["507f1f77bcf86cd799439011", "507f1f77bcf86cd799439012"] }
      ]
    }
  }'

product_id is the entity's own id: a not in condition is how you subtract entities from an otherwise broad scope.

Response Example

Success Response
{
  "status": "success",
  "message": "Entities deleted"
}
Error Response - Validation — validation
{
  "status": "error",
  "message": "The ids field is required when filters is not present."
}
Error Response - Validation — scope over the cap (422)
{
  "status": "error",
  "message": "The selection matches 12480 entities, more than the 5000 allowed for a single bulk action. Narrow the filters and try again.",
  "total": 12480,
  "limit": 5000
}
Error Response - Validation — scope could not be resolved (503)
{
  "status": "error",
  "message": "Unable to resolve the selected products: <reason>"
}

The 503 is only reachable on the filters form: when the search index is unavailable the scope is unknown, so the request is refused rather than applied to a partially resolved set.