# Update a product

Updates a product. Works with Meta Ads.

```http
PUT https://api.pozy.ai/v1/ads/catalogs/{catalogId}/products/{productId}
```

- Area: Ads / Product Catalogs
- Auth: Authorization: Bearer pz_live_...

## Path parameters

- `catalogId` (string, required)
- `productId` (string, required)

## Request body

Content type: `application/json`

- `accountId`, string, required
- `catalogAccountId`, string
- `product`, object, required
  - `retailerId`, string: Up to 100 characters
  - `name`, string: Up to 200 characters
  - `description`, string: Up to 9999 characters
  - `url`, string (URL)
  - `imageUrl`, string (URL)
  - `additionalImageUrls`, array of string (URL): Up to 20 items
  - `price`, number
  - `currency`, string
  - `salePrice`, number
  - `salePriceStartDate`, string
  - `salePriceEndDate`, string
  - `availability`, string: One of `in stock`, `out of stock`, `preorder`, `available for order`, `discontinued`, `pending`
  - `condition`, string: One of `new`, `refurbished`, `used`
  - `brand`, string: Up to 100 characters
  - `category`, string: Up to 250 characters
  - `googleProductCategory`, string: Up to 250 characters
  - `productType`, string: Up to 750 characters
  - `gtin`, string: Up to 50 characters
  - `mpn`, string: Up to 100 characters
  - `inventory`, integer: At least 0
  - `visibility`, string: One of `published`, `staging`
  - `color`, string: Up to 200 characters
  - `size`, string: Up to 200 characters
  - `gender`, string: One of `female`, `male`, `unisex`
  - `material`, string: Up to 200 characters
  - `pattern`, string: Up to 100 characters
  - `customLabel0`, string: Up to 100 characters
  - `customLabel1`, string: Up to 100 characters
  - `customLabel2`, string: Up to 100 characters
  - `customLabel3`, string: Up to 100 characters
  - `customLabel4`, string: Up to 100 characters

## Example request

```bash
curl -X PUT "https://api.pozy.ai/v1/ads/catalogs/6f2f2ffcf4ace3659342c4c2/products/659773d34b353e6821202f21" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "accountId": "696e0b682d0a31188e7a2ba9",
  "product": {
    "retailerId": "62ed28b157a658d89f9173aa",
    "name": "Acme",
    "description": "A short description"
  }
}'
```

```ts
const res = await fetch("https://api.pozy.ai/v1/ads/catalogs/6f2f2ffcf4ace3659342c4c2/products/659773d34b353e6821202f21", {
  method: "PUT",
  headers: {
    Authorization: `Bearer ${process.env.POZY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    accountId: "696e0b682d0a31188e7a2ba9",
    product: {
      retailerId: "62ed28b157a658d89f9173aa",
      name: "Acme",
      description: "A short description"
    }
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(data?.error ?? `Request failed with status ${res.status}`);
console.log(data);
```

```python
import os
import requests

resp = requests.put(
    "https://api.pozy.ai/v1/ads/catalogs/6f2f2ffcf4ace3659342c4c2/products/659773d34b353e6821202f21",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    json={
        "accountId": "696e0b682d0a31188e7a2ba9",
        "product": {
            "retailerId": "62ed28b157a658d89f9173aa",
            "name": "Acme",
            "description": "A short description",
        },
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `product`, object
  - `id`, string
  - `retailerId`, string: Can be null
  - `name`, string
  - `description`, string: Can be null
  - `url`, string: Can be null
  - `imageUrl`, string: Can be null
  - `additionalImageUrls`, array of string
  - `price`, string: Can be null
  - `salePrice`, string: Can be null
  - `currency`, string: Can be null
  - `availability`, string: Can be null
  - `condition`, string: Can be null
  - `brand`, string: Can be null
  - `category`, string: Can be null
  - `productType`, string: Can be null
  - `gtin`, string: Can be null
  - `inventory`, integer: Can be null
  - `visibility`, string: Can be null
  - `color`, string: Can be null
  - `size`, string: Can be null
  - `gender`, string: Can be null
  - `material`, string: Can be null
  - `pattern`, string: Can be null
  - `customLabels`, array of string: Each item: can be null
  - `reviewStatus`, string: Can be null
  - `reviewRejectionReasons`, array of string

```json
{
  "product": {
    "id": "6bfebd43ddc270f6d2c56fc5",
    "retailerId": "62ed28b157a658d89f9173aa",
    "name": "Acme",
    "description": "A short description",
    "url": "https://pozy.ai/media/example-1.jpg",
    "imageUrl": "https://pozy.ai/media/example-1.jpg",
    "additionalImageUrls": [
      "https://pozy.ai/media/example-1.jpg"
    ],
    "price": "string",
    "salePrice": "string",
    "currency": "USD",
    "availability": "string",
    "condition": "string",
    "brand": "string",
    "category": "string",
    "productType": "string",
    "gtin": "string",
    "inventory": 1,
    "visibility": "string",
    "color": "string",
    "size": "string",
    "gender": "string",
    "material": "string",
    "pattern": "string",
    "customLabels": [
      "string"
    ],
    "reviewStatus": "active",
    "reviewRejectionReasons": [
      "string"
    ]
  }
}
```
