Check Product Deletability
POST/api/products/is-deletable
Check whether one or more products can be safely deleted. Returns deletability status with reasons and usage record samples for each product.
products:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Authentication: Requires Bearer token.
Fields:
- ids (required): array of product IDs (integers, must exist in DB)
For each product, returns:
- deletable: true if safe to delete
- reason: human-readable reason if not deletable
- usages: array of blocking usage types, each with: relation, label, count, message, and sample records
Usage relations include: salesOrderLines, bundleSalesOrderLines, purchaseOrderLines, inventoryMovements, fifoLayers, inventoryAdjustments, inventoryAssemblyLines, warehouseTransferLines, returnReceiptLines, rmaLines, salesCreditLines, blemishedProducts, inboundShipmentLines, and subscriptionEditions (each is a RESTRICT foreign key, so any referencing row blocks deletion; product variations are checked too, so a matrix parent is reported not deletable when any of its variants is referenced). bundleSalesOrderLines appears when the product was sold as a bundle parent (referenced via sales_order_lines.bundle_id, a RESTRICT foreign key); such bundles are reported as not deletable so they can be archived instead.
Request
Responses
- 200
- 401
- 403
- 422
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Validation failed — the body is a field → messages map (Laravel shape) or the platform envelope with a stable machine-readable code. Fix the payload and resubmit.
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.