Skip to content

Catalog Products — Mass Delete

Deletes a batch of catalog products in a single call. Mirrors Catalog → Products → Mass Delete in the Bagisto admin panel.

Endpoint

EndpointMethod
/api/admin/catalog/products/mass-deletePOST

Request body

FieldTypeRequiredNotes
indicesint[]yesNon-empty array of product IDs. Non-existent IDs are silently skipped.

Response

200 OK

FieldTypeNotes
idintegerAlways 1. This is an action result, not a record — ignore it.
deletedint[]The ids that were actually removed.
messagestringTranslated confirmation.

deleted is not an echo of indices. Ids that do not exist are dropped silently, so sending [1403, 999999] returns deleted: [1403]. Compare the two lists to find out what was skipped — nothing else reports it.

Behaviour

  • Best effort, no transaction. The batch does not roll back if one id fails partway through; ids processed before the failure stay deleted.
  • Configurable variants cascade with their parent, so a parent id can remove more rows than you listed.
  • Order history is unaffected — order items keep their product snapshot.

Errors

HTTPDetail
400The indices field is required and must be a non-empty array.
401Unauthenticated.
403You do not have permission to manage products. — token lacks catalog.products.delete

Note the validation failures here are 400, not the 422 used by the single-product create and update endpoints.

Released under the MIT License.