Skip to main content

Bulk Operation (Synchronous)

POST 

/api/faire/instances/:integrationInstance/products/bulk

Run a bulk action on Faire product options synchronously and return the result inline. Best for Selected Only requests where the count is small and the operation completes in well under HTTP timeout. For All Filtered requests that may exceed timeout, use the tracked variant instead.

Path Parameters:

  • integrationInstance (required) - The ID of the Faire integration instance.

Body:

  • action (required) - One of archive, unarchive, delete, map, unmap, create, remap. Currently only archive, unarchive, and delete are wired up; mapping actions surface as skipped.
  • selection (required) - object describing which records to act on:
    • selection.type (required) - One of selected (use the explicit ids list), visible (use the current page's filters), filtered (use the active filter set across all matching records).
    • selection.ids (required when type=selected) - Array of faire_product_options.id values.
    • selection.filters (optional) - Spatie QueryBuilder filter map. The same filter shape accepted by GET /api/faire/instances/:integrationInstance/products. Resolved via BulkFilterResolver.
  • options (optional) - object reserved for action-specific options (currently unused on Faire — placeholder for future mapping options).

Response (200):

  • data.processed - Count of records the action successfully ran against.
  • data.failed - Count of records that errored during the action.
  • data.skipped - Count of records that were skipped (e.g., already in the target state, or unsupported action).
  • message - Human-readable status string.

Errors:

  • 422 when no records resolve from the selection (empty ids for type=selected, or filters returning zero rows).
  • 422 when validation fails on the body shape.

Request

Responses

Successful response