---
search:
  tags:
    - Products
    - POST
seo:
  description: >-
    Each item is either a create or an update: Reference for the POST
    /api/v1/products endpoint in the Bloomcount Public API API.
sidebar:
  label: Bulk create or update products + variants
  badge: POST
title: Bulk create or update products + variants
type: openapi-operation
---
Each item is either a create or an update:

- **Create**: omit `productId`. `name`, `category`, and `variant.name` are required.
- **Update product**: pass `productId`. Only the supplied fields are patched.
- **Update variant**: pass both `productId` and `variantId`. Variant fields (under `variant.*`) are patched; supplying any without `variantId` errors with `variantId_required_for_variant_patch`.

Returns 201 if any row was created, 200 if every row was an update or errored. Per-row failures are listed in `errors`; successful rows in `results`.

A row that fails does not roll back the rows around it, so a batch of 500 with two bad references still writes
498. Match `errors[].index` back to the row you sent. Send the batch again with `Idempotency-Key` to retry
safely: a replay returns the first response rather than writing twice.

**Errors** (per row, in `errors`)

- `missing_required_fields_on_create` — a create row without `name`, `category` or `variant.name`.
- `product_not_found` — `productId` is unknown or belongs to another tenant.
- `variant_not_found` — `variantId` isn't on the product named by `productId`.
- `supplier_not_found` / `supplier_archived` — a `supplierIds` entry that can't be used.
- `supplier_default_not_allowed` — the hidden Default supplier can't be assigned explicitly.
- `supplierMinPacks_supplier_mismatch` — a minimum names a supplier that isn't on the variant after the patch.
- `hireable_requires_material_product` — `hireable: true` on a flower.

Whole-request failures: `422 too_many_items` above 500 rows, and `422 wrong_id_type:…` or
`422 invalid_id_format` when a prefixed ID in the batch doesn't decode.

<Operation source="reference" id="post-api-v1-products" />
