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

# Update Product

> Update an existing product's details, pricing, or inventory settings

<Note>
  This endpoint supports partial updates. Only include the fields you want to change.
</Note>

### Path Parameters

<ParamField path="id" type="string" required>
  The unique identifier of the product to update
</ParamField>

### Request Body

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

<ParamField body="description" type="string">
  Detailed product description
</ParamField>

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

<ParamField body="brand" type="string">
  Brand or manufacturer name
</ParamField>

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

  <Expandable title="Price object properties">
    <ParamField body="amount" type="integer">
      Price in cents
    </ParamField>

    <ParamField body="currency" type="string">
      ISO 4217 currency code
    </ParamField>

    <ParamField body="compare_at" type="integer">
      Original price for displaying discounts
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="cost" type="object">
  Updated cost information

  <Expandable title="Cost object properties">
    <ParamField body="amount" type="integer">
      Cost in cents
    </ParamField>

    <ParamField body="currency" type="string">
      ISO 4217 currency code
    </ParamField>
  </Expandable>
</ParamField>

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

  <Expandable title="Inventory object properties">
    <ParamField body="track_inventory" type="boolean">
      Whether to track inventory levels
    </ParamField>

    <ParamField body="low_stock_threshold" type="integer">
      Threshold for low stock alerts
    </ParamField>

    <ParamField body="allow_backorder" type="boolean">
      Whether to allow orders when out of stock
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="dimensions" type="object">
  Updated product dimensions

  <Expandable title="Dimensions object properties">
    <ParamField body="weight" type="number">
      Weight in pounds
    </ParamField>

    <ParamField body="length" type="number">
      Length in inches
    </ParamField>

    <ParamField body="width" type="number">
      Width in inches
    </ParamField>

    <ParamField body="height" type="number">
      Height in inches
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="status" type="string">
  Product status: "active", "draft", or "archived"
</ParamField>

<ParamField body="metadata" type="object">
  Additional custom fields as key-value pairs
</ParamField>

<ParamField body="tags" type="array">
  Array of string tags for categorization
</ParamField>

### Response

Returns the updated product object with all fields.

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request PUT 'https://api.stateset.com/v1/products/prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --data-raw '{
      "price": {
          "amount": 12999,
          "compare_at": 14999
      },
      "inventory": {
          "low_stock_threshold": 15
      },
      "tags": ["electronics", "audio", "wireless", "bluetooth", "sale"]
  }'
  ```

  ```graphQL GraphQL theme={null}
  mutation UpdateProduct($id: ID!, $input: UpdateProductInput!) {
    updateProduct(id: $id, input: $input) {
      id
      name
      sku
      price {
        amount
        currency
        compare_at
      }
      inventory {
        low_stock_threshold
        allow_backorder
      }
      tags
      updated_at
    }
  }
  ```

  ```javascript Node.js theme={null}
  const product = await stateset.products.update(
    'prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
    {
      price: {
        amount: 12999,
        compare_at: 14999
      },
      inventory: {
        low_stock_threshold: 15
      },
      tags: ["electronics", "audio", "wireless", "bluetooth", "sale"]
    }
  );
  ```

  ```python Python theme={null}
  product = stateset.products.update(
      'prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30',
      price={
          "amount": 12999,
          "compare_at": 14999
      },
      inventory={
          "low_stock_threshold": 15
      },
      tags=["electronics", "audio", "wireless", "bluetooth", "sale"]
  )
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "id": "prod_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
    "object": "product",
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-15T16:45:00Z",
    "name": "Wireless Bluetooth Headphones",
    "sku": "WBH-001",
    "description": "Premium noise-cancelling wireless headphones with 30-hour battery life",
    "category": "Electronics",
    "brand": "AudioTech",
    "status": "active",
    "price": {
      "amount": 12999,
      "currency": "USD",
      "compare_at": 14999
    },
    "cost": {
      "amount": 7500,
      "currency": "USD"
    },
    "inventory": {
      "track_inventory": true,
      "low_stock_threshold": 15,
      "allow_backorder": false
    },
    "inventory_summary": {
      "total_quantity": 150,
      "available_quantity": 145,
      "reserved_quantity": 5
    },
    "dimensions": {
      "weight": 0.5,
      "length": 8,
      "width": 7,
      "height": 3
    },
    "tags": ["electronics", "audio", "wireless", "bluetooth", "sale"],
    "metadata": {}
  }
  ```
</ResponseExample>
