# Bulk create vendors

Creates multiple vendors in 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. Only domain_name and company_name are accepted per row; use UpdateVendor for the richer fields. 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-create
Version: Beta

## Request body:

  - `application/json` (unknown)
    Batch of vendors to create in the caller's directory in one call.
Organization scope is derived from the access token, not from this message.

## Request fields (application/json):

  - `vendors` (array, required)
    Rows to create, 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 row is processed.

  - `vendors.domainName` (string, required)
    Primary domain name of the vendor (e.g. "acme.com"). Required; normalized and
validated server-side.

  - `vendors.companyName` (string)
    Display name of the vendor company. Optional; resolved server-side when omitted.

  - `vendors.dataRegion` (string)
    Data region where a vendor operates, as exposed on the public API.
- DATA_REGION_UNSPECIFIED: Default zero value; data region was not set.
- DATA_REGION_US: United States.
- DATA_REGION_EU: European Union.
- DATA_REGION_UK: United Kingdom.
- DATA_REGION_CA: Canada.
- DATA_REGION_AU: Australia.
- DATA_REGION_APAC: Asia-Pacific.
    Enum: "DATA_REGION_UNSPECIFIED", "DATA_REGION_US", "DATA_REGION_EU", "DATA_REGION_UK", "DATA_REGION_CA", "DATA_REGION_AU", "DATA_REGION_APAC"

## Response 200:

  - `200` (unknown)
    A successful response.

## Response 200 fields (application/json):

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

  - `results.index` (integer, required)
    Position of this row in the request's vendors list (0-based), so callers can
pair a result back to its input without relying on domain_name uniqueness.

  - `results.domainName` (string, required)
    domain_name as submitted (normalized), 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.vendorId` (string)
    Id of the vendor, set when status is SUCCESS or ALREADY_EXISTS.

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

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

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

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

  - `summary.alreadyExists` (integer, required)
    Rows with status ALREADY_EXISTS.

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

## Response 400:

  - `400` (unknown)
    INVALID_ARGUMENT: the batch is empty, exceeds the maximum batch size, or every row is structurally invalid.

## 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, or the organization is not entitled to add vendors.

## 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.

