Bulk Delete by Filters
Bulk Delete by Filters
Delete all purchases matching filter criteria using an optimistic concurrency guard
POST
Bulk Delete by Filters
Bulk Delete by Filters
Delete all purchases that match the given filter criteria. Uses the same filter parameters as the list endpoint, plus afilter_hash for optimistic concurrency — ensuring you delete exactly what the user saw.
How filter_hash works
- Call the list endpoint with your filters — the response includes a
filter_hash - Pass that
filter_hashin the body of this request along with the same filters - If the filters changed between the two calls, the server returns
409 Conflict
Request
Headers
string
required
Your API key for authenticationExample:
sk_live_1234567890abcdefstring
required
Your organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51faQuery Parameters
At least one filter parameter is required. Supports all the same filters as the list endpoint:string
Filter purchases on or after this date (
YYYY-MM-DD)string
Filter purchases on or before this date (
YYYY-MM-DD)string
Search by description or supplier name
string[]
Filter by status. Values:
active, error, in_progress, in_review, inactive, pendingstring[]
Filter by calculation methodology. Values:
spend_based, supplier_specificstring[]
Filter by expense classification. Values:
capex, opexstring[]
Filter by file UUID
string[]
Filter by supplier UUID
string[]
Filter by currency unit UUID
string
Filter records created on or after this date
string
Filter records created on or before this date
string
Filter by CO2e calculation status
Body Parameters
string
required
Hash from the list endpoint response. Must match the current filter set.
Response
string[]
UUIDs of successfully deleted purchases
object[]
Failed deletions with reason
Example
Successful Response
Common Errors
401 Unauthorized
Cause: Missing or invalid API key403 Forbidden
Cause: The authenticated user is not a member of the organization409 Conflict
Cause: Thefilter_hash doesn’t match the current filters — they changed since the list was loaded
422 Unprocessable Entity
Cause: No filter parameters provided (at least one is required to prevent accidental mass deletion)Related Endpoints
Bulk Delete
Delete specific purchases by ID
List Purchases
Browse purchases and get filter_hash