# 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"
  }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cottoncast.com/api-reference/webhooks/products.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
