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

# Bulk Update Products

> Update multiple products in a single request

<Note>
  This endpoint allows updating up to 100 products in a single request. Use this for bulk price changes, inventory updates, or status changes.
</Note>

### Request Body

<ParamField body="updates" type="array" required>
  Array of product updates (max 100 items)

  <Expandable title="Update object properties">
    <ParamField body="id" type="string" required>
      Product ID to update
    </ParamField>

    <ParamField body="price" type="object">
      Updated pricing information
    </ParamField>

    <ParamField body="inventory" type="object">
      Updated inventory settings
    </ParamField>

    <ParamField body="status" type="string">
      Updated status
    </ParamField>

    <ParamField body="metadata" type="object">
      Updated metadata
    </ParamField>

    <ParamField body="tags" type="array">
      Updated tags
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="validate_only" type="boolean">
  If true, validates the updates without applying them (default: false)
</ParamField>

### Response

<ResponseField name="updated" type="array">
  Successfully updated products
</ResponseField>

<ResponseField name="errors" type="array">
  Products that failed to update with error details
</ResponseField>

<ResponseField name="summary" type="object">
  Summary of the bulk operation

  <Expandable title="Summary properties">
    <ResponseField name="total" type="integer">
      Total number of products in request
    </ResponseField>

    <ResponseField name="successful" type="integer">
      Number of successfully updated products
    </ResponseField>

    <ResponseField name="failed" type="integer">
      Number of failed updates
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request POST 'https://api.stateset.com/v1/products/bulk-update' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --data-raw '{
      "updates": [
          {
              "id": "prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
              "price": {
                  "amount": 11999
              },
              "tags": ["electronics", "audio", "sale", "clearance"]
          },
          {
              "id": "prod_abc123def456",
              "price": {
                  "amount": 6999
              },
              "inventory": {
                  "low_stock_threshold": 25
              }
          },
          {
              "id": "prod_xyz789ghi012",
              "status": "archived"
          }
      ]
  }'
  ```

  ```graphQL GraphQL theme={null}
  mutation BulkUpdateProducts($updates: [ProductUpdate!]!) {
    bulkUpdateProducts(updates: $updates) {
      updated {
        id
        name
        sku
        updated_at
      }
      errors {
        product_id
        error
      }
      summary {
        total
        successful
        failed
      }
    }
  }
  ```

  ```javascript Node.js theme={null}
  const result = await stateset.products.bulkUpdate({
    updates: [
      {
        id: "prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
        price: { amount: 11999 },
        tags: ["electronics", "audio", "sale", "clearance"]
      },
      {
        id: "prod_abc123def456",
        price: { amount: 6999 },
        inventory: { low_stock_threshold: 25 }
      },
      {
        id: "prod_xyz789ghi012",
        status: "archived"
      }
    ]
  });
  ```

  ```python Python theme={null}
  result = stateset.products.bulk_update({
      "updates": [
          {
              "id": "prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
              "price": {"amount": 11999},
              "tags": ["electronics", "audio", "sale", "clearance"]
          },
          {
              "id": "prod_abc123def456",
              "price": {"amount": 6999},
              "inventory": {"low_stock_threshold": 25}
          },
          {
              "id": "prod_xyz789ghi012",
              "status": "archived"
          }
      ]
  })
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "updated": [
      {
        "id": "prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
        "name": "Wireless Bluetooth Headphones",
        "sku": "WBH-001",
        "updated_at": "2024-01-15T17:30:00Z"
      },
      {
        "id": "prod_abc123def456",
        "name": "Sport Wireless Earbuds",
        "sku": "SWE-001",
        "updated_at": "2024-01-15T17:30:00Z"
      }
    ],
    "errors": [
      {
        "product_id": "prod_xyz789ghi012",
        "error": "Product not found"
      }
    ],
    "summary": {
      "total": 3,
      "successful": 2,
      "failed": 1
    }
  }
  ```
</ResponseExample>
