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

# Import relations between objects

> Link imported products to catalogs, categories, and variant options, and prices to products and pricebooks.

## Overview

A CSV import can link the records it creates or updates to records that already exist in your workspace.

**Supported relations:**

* **Product → Catalog** (a product can be in several catalogs)
* **Product → Category** (a product can be in several categories)
* **Product variant → Variant option values** (for example size `m`)
* **Price → Product and Pricebook** (each price belongs to one product in one pricebook)

You don't import product masters separately: each new product row creates the product and its default variant.

## How relations work

### Many-to-many relations

Products and catalogs, and products and categories, are many-to-many. List the API names in one cell, separated by commas, with the cell wrapped in double quotes:

| Relation | CSV column | Example |
| - | - | - |
| Product ↔ Catalogs | `catalog_api_names` | `"france,partner_pricing"` |
| Product ↔ Categories | `category_api_names` | `"hardware,accessories"` |

On creation, a product is also always linked to the workspace's default catalog. On update, catalog links are replaced only when `catalog_api_names` is mapped. Catalog names that match no catalog are skipped.

### Variant options

Use pairs of columns `options[N][name]` (API name of the option, for example `size`) and `options[N][value]` (API name of the value, for example `m`). `N` starts at 1. The option and its values must already exist in **Products & pricing › Product options**: the import doesn't create them.

### Prices

Prices aren't created by import: Qwoty generates one price per product (and per billing frequency for recurring products) in the pricebooks of the product's catalogs. The `id` column targets an existing price by:

* Its UUID, from an export
* Or its key: `product_api_name.pricebook_api_name` for a one-off price, plus `.period_unit.period` for a recurring price (for example `licence_pro.standard_eur.month.1`)

## Linking records during import

**1. Create the referenced records**

Create your **catalogs**, **categories**, **pricebooks**, and **variant options** in the app first. The import fails or skips links to records that don't exist.

**2. Fill in the relation columns**

| Linking | Column | Format |
| - | - | - |
| Product → Catalog(s) | `catalog_api_names` | Comma-separated API names, in quotes if several |
| Product → Category(ies) | `category_api_names` | Comma-separated API names, in quotes if several |
| Variant → Option value | `options[N][name]`, `options[N][value]` | API names |
| Price → Product and Pricebook | `id` | Price UUID or price key |

**3. Map the columns**

At the **Mapping** step, check that each relation column maps to its field (for example `catalog_api_names` → **Catalog API Names (comma-separated)**).

> [!WARNING]
>
> API names must match the referenced record exactly: no extra spaces or characters.

## Import order rule

> [!WARNING]
>
> **The referenced record must exist first.**
>
> 1. **Catalogs, categories, pricebooks, variant options**: create them in the app.
> 2. **Products**: import them. Qwoty generates their prices.
> 3. **Prices**: export them, fill in the values, and import them back.

## Related

> [card] [Uniqueness constraints](https://docs.qwoty.io/user-guide/data-migration/reference/uniqueness-constraints.md)
>
> Which identifiers create or update records.

> [card] [Field mapping](https://docs.qwoty.io/user-guide/data-migration/reference/field-mapping.md)
>
> Format requirements for relation columns.

> [card] [Import products](https://docs.qwoty.io/user-guide/data-migration/how-tos/import-products.md)
>
> Start your migration here.

> [card] [Import prices](https://docs.qwoty.io/user-guide/data-migration/how-tos/import-prices.md)
>
> Final step: fill in the prices.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.