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
Your API key for authenticationExample:
sk_live_1234567890abcdefYour organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51faQuery Parameters
At least one filter parameter is required. Supports all the same filters as the list endpoint:Filter purchases on or after this date (
YYYY-MM-DD)Filter purchases on or before this date (
YYYY-MM-DD)Search by description or supplier name
Filter by status. Values:
active, error, in_progress, in_review, inactive, pendingFilter by calculation methodology. Values:
spend_based, supplier_specificFilter by expense classification. Values:
capex, opexFilter by file UUID
Filter by supplier UUID
Filter by currency unit UUID
Filter records created on or after this date
Filter records created on or before this date
Filter by CO2e calculation status
Body Parameters
Hash from the list endpoint response. Must match the current filter set.
Response
UUIDs of successfully deleted purchases
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

