Skip to main content
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 a filter_hash for optimistic concurrency — ensuring you delete exactly what the user saw.

How filter_hash works

  1. Call the list endpoint with your filters — the response includes a filter_hash
  2. Pass that filter_hash in the body of this request along with the same filters
  3. If the filters changed between the two calls, the server returns 409 Conflict
This prevents accidental mass deletions when filters have been modified.

Request

Headers

string
required
Your API key for authenticationExample: sk_live_1234567890abcdef
string
required
Your organization UUIDExample: a8315ef3-dd50-43f8-b7ce-d839e68d51fa

Query 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)
Search by description or supplier name
string[]
Filter by status. Values: active, error, in_progress, in_review, inactive, pending
string[]
Filter by calculation methodology. Values: spend_based, supplier_specific
string[]
Filter by expense classification. Values: capex, opex
string[]
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 key

403 Forbidden

Cause: The authenticated user is not a member of the organization

409 Conflict

Cause: The filter_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)

Bulk Delete

Delete specific purchases by ID

List Purchases

Browse purchases and get filter_hash