> For the complete documentation index, see [llms.txt](https://docs.cottoncast.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cottoncast.com/api-reference/webhooks/products.md).

# Products

## Product updates

<mark style="color:green;">`POST`</mark> `https://your.store.com/cottoncast/product`

Each time you create or edit a product in PODrocket we will make a request to this webhook. You can configure the URL in your sales channel settings.\ <br>

#### Query Parameters

| Name   | Type    | Description                                                           |
| ------ | ------- | --------------------------------------------------------------------- |
| recipe | string  | The API will do its best to find a cake matching the provided recipe. |
| gluten | boolean | Whether the cake should be gluten-free or not.                        |

{% tabs %}
{% tab title="202 Product successfully received for processing." %}

```javascript
{
    "status": "ok"
}
```

{% endtab %}

{% tab title="404 Could not find a cake matching this query." %}

```javascript
{
    "status": "error",
    "message": "Page not found"
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Your webhook should respond with code 202: Accepted. Processing of the product data must be done asynchronously.
{% endhint %}

### Example request body

```javascript
{
  "name": "BigBrand T-shirt Black",
  "description": "Lorem ipsum",
  "status": {
    "code": "P",
    "description": "Published"
  },
  "sku": "34RX",
  "brand": "BigBrand",
  "category": {
    "code": "S",
    "description": "T-Shirt"
  },
  "agegroups": [
    {
      "code": "M",
      "description": "Men"
    }
  ],
  "price": 29.95,
  "config": {
    "type": "predesign",
    "code": "color-size",
    "labels": [
      {
        "code": "color",
        "label": "Color"
      },
      {
        "code": "size",
        "label": "Size"
      }
    ]
  },
  "variants": [
    {
      "sku": "34RX-BLA-S",
      "hexcolor": "#dedede",
      "status": {
        "code": "A",
        "name": "Active"
      },
      "config": {
        "options": [
          {
            "code": "color",
            "type": "color",
            "value": "BLA",
            "label": "Black"
          },
          {
            "code": "size",
            "type": "size",
            "value": "S",
            "label": "S"
          }
        ]
      },
      "images": [
        {
          "code": "F",
          "description": "Front",
          "url": "https://texo.cottoncast.com/EFG763.png"
        }
      ]
    }
  ],
  "images": [
    {
      "code": "F",
      "description": "Front",
      "url": "https://texo.cottoncast.com/EFG763.png"
    }
  ],
  "tags": [
    "men",
    "hello",
    "world"
  ],
  "meta": {
    "saleschannelID": "5d963a94b9e99e4ce0468ff2",
    "language": "en"
  }
}
```
