> For the complete documentation index, see [llms.txt](https://docs.partner.aboutyou.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.partner.aboutyou.com/api/getting-started/how-to-create-a-product.md).

# How to create a product

This guide will walk you through the process of creating and publishing a product, from gathering required metadata to submitting it via the "Upsert Product" endpoint.

## Determine available countries and locales

Use the `List countries` endpoint to get the countries and locales your merchant account has been linked to.&#x20;

* **Countries** determine:
  * Where the product will be published.
  * Which prices must be defined.
* **Locales** determine:
  * Which languages are available for product descriptions.

## Determine product metadata

Before creating a product, gather the necessary information and identifiers from the API.

### Find the product category

Use the `List Categories` endpoint to search available product categories and retrieve the category ID.

### Get the required attributes

Once the category is selected:

* Call `List Attribute Groups` with the `category_id` to get:
  * Required **attributes**
  * Suggested default attributes via `is_default`
  * Available **colors**
  * **Sizes**
  * **Brands**
  * **Material groups** (e.g. "Lining", "Shell") and **materials**

Some attribute groups (currently `material_group_name` in the material composition flow) return `is_default: true` on attributes that we suggest as defaults for the category. The field is omitted when false.

## Creating the product

### Drafting the product

Now that you've gathered all the necessary metadata, you're ready to draft your product.

#### Material compositions

Depending on the product category, you'll need to provide either a **textile** or **non-textile** material composition.

* The composition is a mapping of:
  * **Cluster** (e.g., `Lining`, `Shell`) from `material_group`
  * → to **Materials** (e.g., `Cotton`, `Leather`) from `material`
* **Textile materials** require a `fraction` field for each component.

**Example: Lining made of Cotton, Material made of Leather**

```json
[
    {
        "cluster_id": 164593, // Lining
        "components": [
            {
                "material_id": 293177, // Cotton
                "fraction": 100
            }
        ]
    },
    {
        "cluster_id": 164588, // Material
        "components": [
            {
                "material_id": 186717, // Leather
                "fraction": 100
            }
        ]
    },
]
```

#### Putting everything together

Use the `Upsert Product` endpoint to create or update your product.

**Example Payload**

```json
{
  "items": [
    {
      "style_key": "<your_style_key>",
      "sku": "<your_sku>",
      "ean": "<your_ean>",
      "hs_code": "<your_hs_code>",
      "name": "<your_product_name>",
      "descriptions": {
        "<locale_1>": "<description_in_locale_1>",
        "<locale_2>": "<description_in_locale_2>"
      },
      "color": <color_id>,
      "size": <size_id>,
      "second_size": <second_size_id>|null,
      "brand": <brand_id>,
      "category": <category_id>,
      "quantity": <your_product_quantity>,
      "weight": <product_weight>,
      "countries": [
        "<country_code_1>", "<country_code_2>"
      ],
      "country_of_origin": "<country_of_origin_code>",
      "attributes": [
        <attribute_ids>
      ],
      "material_composition_textile": [
        {
          "cluster_id": <material_group_1_id>,
          "components": [
            {
              "material_id": <material_1_id>,
              "fraction": <material_1_fraction>
            }
          ]
        }
      ],
      "prices": [
        {
          "country_code": "<country_code_1>",
          "retail_price": <your_retail_price>,
          "sale_price": <your_sale_price>
        },
        {
          "country_code": "<country_code_2>",
          "retail_price": <your_retail_price>,
          "sale_price": <your_sale_price>
        }
      ],
      "images": ["<your_product_image_urls>"]
    }
  ]
}
```

### Publishing the draft product

After creation and updates of the draft product, it can be published using the `Update Product Status` .

**Example Payload**

```json
{
  "items": [
    {
      "style_key": "<product_style_key>",
      "status": "published"
    }
  ]
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.partner.aboutyou.com/api/getting-started/how-to-create-a-product.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
