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

# Update Product

> Update an existing product

# Update Product

Updates an existing product. Only include the fields you want to update.

## Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT "https://api.launchmystore.io/api/v1/products/8a1f3c2e-6b4d-4e8a-9c1f-2d3e4f5a6b7c.json" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "title": "Classic T-Shirt - Updated",
      "status": "active",
      "tags": ["cotton", "casual", "bestseller"]
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://api.launchmystore.io/api/v1/products/8a1f3c2e-6b4d-4e8a-9c1f-2d3e4f5a6b7c.json', {
    method: 'PUT',
    headers: {
      'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      title: 'Classic T-Shirt - Updated',
      status: 'active',
      tags: ['cotton', 'casual', 'bestseller']
    })
  });
  ```
</CodeGroup>

## Path Parameters

<ParamField path="id" type="string" required>
  The product ID. Accepts either the product UUID or the numeric product id.
</ParamField>

## Body Parameters

All body parameters are optional. Only include the fields you want to update.
Any field not listed below is ignored.

<ParamField body="title" type="string">
  The product title.
</ParamField>

<ParamField body="body_html" type="string">
  Product description (supports HTML).
</ParamField>

<ParamField body="handle" type="string">
  URL-safe handle.
</ParamField>

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

<ParamField body="tags" type="array">
  Array of tags (replaces existing tags).
</ParamField>

<ParamField body="variants" type="array">
  Array of variants. On update, only the **first** entry's pricing and stock
  are applied — they are mirrored onto the product-level price/stock columns.
  Existing variant rows are not modified, and additional entries are ignored.

  <Expandable title="Variant Object">
    <ParamField body="price" type="number">
      Price. Mirrored onto the product's sale price.
    </ParamField>

    <ParamField body="compare_at_price" type="number">
      Compare-at price. Mirrored onto the product's compare-at price.
    </ParamField>

    <ParamField body="inventory_quantity" type="number">
      Inventory quantity. Mirrored onto the product's stock.
    </ParamField>
  </Expandable>
</ParamField>

## Response

Returns the updated product as a bare `product` object (standard commerce
shape). Money values are returned as decimal strings, `id` is the numeric
product id, and `product_id` is the product UUID. The `vendor` and
`product_type` fields are derived from the product's category, not from the
request body.

## Example Response

```json theme={null}
{
  "product": {
    "id": 481023,
    "product_id": "8a1f3c2e-6b4d-4e8a-9c1f-2d3e4f5a6b7c",
    "title": "Classic T-Shirt - Updated",
    "handle": "classic-t-shirt",
    "body_html": "<p>A comfortable cotton t-shirt.</p>",
    "vendor": "Apparel",
    "product_type": "Apparel",
    "published_scope": "global",
    "tags": ["cotton", "casual", "bestseller"],
    "price": "25.00",
    "compare_at_price": null,
    "variants": [
      {
        "id": 902145,
        "product_id": "8a1f3c2e-6b4d-4e8a-9c1f-2d3e4f5a6b7c",
        "title": "Small / Black",
        "price": "25.00",
        "compare_at_price": null,
        "sku": "TSHIRT-S-BLK",
        "inventory_quantity": 50,
        "available": true
      }
    ],
    "images": [
      {
        "id": 1,
        "product_id": "8a1f3c2e-6b4d-4e8a-9c1f-2d3e4f5a6b7c",
        "src": "https://cdn.launchmystore.io/images/tshirt.jpg",
        "position": 1
      }
    ],
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-25T15:00:00Z"
  }
}
```

## Error Response

Errors are returned as a standard `errors` object:

```json theme={null}
{
  "errors": {
    "base": ["Product not found"]
  }
}
```

## Error Codes

| Status | Description                                  |
| ------ | -------------------------------------------- |
| `401`  | Invalid or missing access token              |
| `403`  | App doesn't have the `write_products` scope  |
| `404`  | Product with the specified ID does not exist |
| `400`  | Invalid request body                         |
