# Bulk delete vendors

Permanently deletes multiple vendors from the caller's vendor directory in one call (max 500 per request) and reports a per-row outcome, scoped server-side to the caller's organization. Unrecoverable — does not retain history; use BulkOffboardVendors for a reversible archive. Requires an Idempotency-Key header (enforced at the gateway); a replay with the same key returns the originally recorded results.

Endpoint: POST /public/v1/vendors/bulk-delete
Version: Beta

## Request body:

  - `application/json` (unknown)
    Batch of vendor ids to permanently delete in one call.
Organization scope is derived from the access token, not from this message.

## Request fields (application/json):

  - `ids` (array, required)
    Ids of the vendors to delete, in the order results are returned. Required and
non-empty; bounded server-side at 500 entries — a larger batch is rejected with
INVALID_ARGUMENT before any id is processed.

## Response 200:

  - `200` (unknown)
    A successful response.

## Response 200 fields (application/json):

  - `results` (array, required)
    Outcome of each id, in request order.

  - `results.id` (string, required)
    Id as submitted, echoed for convenience.

  - `results.status` (string, required)
    Outcome of a single row in a bulk vendor mutation (create, delete, or offboard).
Shared across BulkCreateVendors, BulkDeleteVendors, and BulkOffboardVendors so
callers handle partial failure the same way regardless of which bulk call they made.
- BULK_VENDOR_MUTATION_STATUS_UNSPECIFIED: Default zero value; status was not set.
- BULK_VENDOR_MUTATION_STATUS_SUCCESS: The row was applied successfully.
- BULK_VENDOR_MUTATION_STATUS_ALREADY_EXISTS: BulkCreateVendors only: a vendor with the same domain already exists in the
caller's directory; no new row was created.
- BULK_VENDOR_MUTATION_STATUS_NOT_FOUND: BulkDeleteVendors / BulkOffboardVendors only: no vendor with the given id
exists within the caller's organization.
- BULK_VENDOR_MUTATION_STATUS_ERROR: The row failed for a reason not covered above (e.g. malformed domain_name);
error_message on the row carries detail.
    Enum: "BULK_VENDOR_MUTATION_STATUS_UNSPECIFIED", "BULK_VENDOR_MUTATION_STATUS_SUCCESS", "BULK_VENDOR_MUTATION_STATUS_ALREADY_EXISTS", "BULK_VENDOR_MUTATION_STATUS_NOT_FOUND", "BULK_VENDOR_MUTATION_STATUS_ERROR"

  - `results.errorMessage` (string)
    Human-readable detail, set when status is ERROR.

  - `summary` (object, required)
    Aggregate counts of the batch: total, succeeded, not found, and failed.

  - `summary.total` (integer, required)
    Total ids in the request.

  - `summary.succeeded` (integer, required)
    Ids with status SUCCESS.

  - `summary.notFound` (integer, required)
    Ids with status NOT_FOUND.

  - `summary.failed` (integer, required)
    Ids with status ERROR.

## Response 400:

  - `400` (unknown)
    INVALID_ARGUMENT: the batch is empty or exceeds the maximum batch size.

## Response 401:

  - `401` (unknown)
    UNAUTHENTICATED: access token is absent, malformed, or missing the required organization claim.

## Response 403:

  - `403` (unknown)
    PERMISSION_DENIED: access token does not include the vendor-directory.write scope.

## Response default:

  - `default` (unknown)
    An unexpected error response.

## Response default fields (application/json):

  - `code` (integer, required)
    The status code, which should be an enum value of
[google.rpc.Code][google.rpc.Code].

  - `message` (string, required)
    A developer-facing error message, which should be in English. Any
user-facing error message should be localized and sent in the
[google.rpc.Status.details][google.rpc.Status.details] field, or localized
by the client.

  - `details` (array, required)
    A list of messages that carry the error details.  There is a common set of
message types for APIs to use.

  - `details.@type` (string)
    A URL/resource name that uniquely identifies the type of the serialized
protocol buffer message. This string must contain at least
one "/" character. The last segment of the URL's path must represent
the fully qualified name of the type (as in
`path/google.protobuf.Duration`). The name should be in a canonical form
(e.g., leading "." is not accepted).
In practice, teams usually precompile into the binary all types that they
expect it to use in the context of Any. However, for URLs which use the
scheme `http`, `https`, or no scheme, one can optionally set up a type
server that maps type URLs to message definitions as follows:
* If no scheme is provided, `https` is assumed.
* An HTTP GET on the URL must yield a [google.protobuf.Type][]
value in binary format, or produce an error.
* Applications are allowed to cache lookup results based on the
URL, or have them precompiled into a binary to avoid any
lookup. Therefore, binary compatibility needs to be preserved
on changes to types. (Use versioned type names to manage
breaking changes.)

Note: this functionality is not currently available in the official
protobuf release, and it is not used for type URLs beginning with
type.googleapis.com. As of May 2023, there are no widely used type server
implementations and no plans to implement one.
Schemes other than `http`, `https` (or the empty scheme) might be
used with implementation specific semantics.

