Inventory Batch Delete
Delete inventory records via row-based targeting or filter criteria
The Inventory Batch Delete API enables external integrations to programmatically delete inventory data from Claret. This API complements the Inventory Import API to support complete inventory refresh workflows.
The API supports two deletion modes:
Row-based deletion - Delete specific inventory rows by unique identifiers (recommended for UI-driven deletions)
Filter-based deletion - Delete by broad criteria (items, locations, bins, etc.)
As with all Claret API endpoints, the Inventory Batch Delete API requires token authentication. For instructions on how to retrieve and pass through the authentication token, please refer to the Authentication documentation.
POST Inventory Batch Delete
POST https://plan.claret.app/{tenant}/api/v1/inventory/batch-delete
Delete inventory records matching the specified criteria.
Headers
Content-Type
application/json
Authorization
Bearer {token}
Deletion Modes
The API accepts one of two deletion modes. If both are provided, row-based deletion takes precedence.
Mode 1: Row-Based Deletion
Use this mode to delete specific inventory rows by providing an array of row objects. Each row uniquely identifies allocation(s) using any combination of fields.
Request Body (Row-Based)
rows*
array
Array of row objects to delete
(rows) item*
string
Item name (required for each row)
(rows) location
string
Location name
(rows) location_area
string
Location area name
(rows) bin
string
Bin name
(rows) lot
string
Lot name
(rows) date_filled
string
Date filled. Format: YYYY-MM-DD
Example: Row-Based Request
Mode 2: Filter-Based Deletion
Use this mode for bulk deletions matching broad criteria.
Request Body (Filter-Based)
items
array
Array of item names
locations
array
Array of location names
location_areas
array
Array of location area names
bins
array
Array of bin names
lots
array
Array of lot names
date_filled_from
string
Start date (inclusive). Format: YYYY-MM-DD
date_filled_to
string
End date (inclusive). Format: YYYY-MM-DD
At least one filter must be provided. If all provided filters are empty arrays, a 422 validation error is returned.
Example: Filter-Based Request
Response
Examples
Delete by Item Only
Delete all allocations for specific items:
Delete by Location
Delete all inventory at a specific location:
Delete by Date Range
Delete inventory within a date range:
Delete with Combined Filters (AND Logic)
Delete inventory matching multiple criteria:
Row-Based: Delete Specific Rows
Delete exact rows (e.g., user-selected rows from UI):
Row-Based: Delete by Item Name Only
Delete all allocations for specific items using row mode:
Behavior Notes
Idempotency
The delete operation is idempotent. Re-running the same request returns success with records_deleted: 0 if the records were already deleted.
Data Integrity
Only transactional inventory data is deleted (allocations and empty containers)
Master data (Items, Locations, Bins, Lots) is not deleted
All operations are scoped to the authenticated tenant only
Performance
Large deletions are processed in chunks of 1000 records
The operation is synchronous and returns when complete
Name Matching
All filters match by the name field of each entity, not by ID or description. Matching is case-sensitive.
Related Documentation
Inventory Import - Import inventory records
Job Status - Monitor import job progress
Authentication - API authentication guide
Last updated
Was this helpful?