> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zenflow.com.ar/llms.txt
> Use this file to discover all available pages before exploring further.

# Bulk Upsert Products

> Create or update multiple products at once

# Bulk Upsert Products

Create new products or update existing ones in a single request. Products are matched by barcode.

<Note>Requires `write:products` scope.</Note>

## Request

```bash theme={null}
POST /api/v1/products/bulk
```

### Body Parameters

<ParamField body="products" type="array" required>
  Array of products to create or update

  <Expandable title="product properties">
    <ParamField body="barcode" type="string" required>
      Product barcode (used for matching)
    </ParamField>

    <ParamField body="name" type="string">
      Product name
    </ParamField>

    <ParamField body="sku" type="string">
      SKU / external ID
    </ParamField>

    <ParamField body="category" type="string">
      Product category
    </ParamField>

    <ParamField body="price" type="number">
      Unit price
    </ParamField>

    <ParamField body="weight" type="number">
      Weight in kg
    </ParamField>
  </Expandable>
</ParamField>

## Example

```bash theme={null}
curl -X POST "https://api.zenflow.com.ar/api/v1/products/bulk" \
  -H "X-API-Key: zenflow_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "products": [
      {
        "barcode": "7891234567890",
        "name": "Widget A",
        "sku": "SKU-001",
        "price": 29.99
      },
      {
        "barcode": "7891234567891",
        "name": "Widget B",
        "sku": "SKU-002",
        "price": 49.99
      },
      {
        "barcode": "7891234567892",
        "name": "Widget C",
        "sku": "SKU-003",
        "price": 19.99
      }
    ]
  }'
```

### Response

```json theme={null}
{
  "success": true,
  "data": {
    "created": 2,
    "updated": 1,
    "errors": []
  }
}
```

### Response with Errors

```json theme={null}
{
  "success": true,
  "data": {
    "created": 2,
    "updated": 0,
    "errors": [
      {
        "barcode": "INVALID",
        "error": "Barcode is required"
      }
    ]
  }
}
```

## Best Practices

* Use this endpoint for initial catalog sync
* Batch products in groups of 100 for optimal performance
* The endpoint is idempotent - safe to retry on failure
