Preparing the YML file
Products in the Market are represented by two entities: products and SKU.
A product is a good or service for sale. SKU is a product modifier, i.e. a group of goods that stands out in one product according to certain parameters (color, size, weight, model, equipment, etc.).
To upload product data to the platform, a file in yml format or a .zip/.tar.gz archive containing yml files is used. If you are setting up import on a schedule, you must provide a link to the yml file.
The YML (Yandex Market Language) format is a data format for product platforms developed by Yandex. You can view its full structure at this link.
The structure of such files looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<yml_catalog date="2017-02-05 17:22">
<shop>
...
<offers>
...
</offers>
<gifts>
...
</gifts>
<promos>
...
</promos>
</shop>
</yml_catalog>
If you want to upload product data to the platform, use yml files or .zip/.tar.gz archives containing yml files.
A list of all products and SKUs to import is passed in the offers
element. More information you will find here.
Each product and SKU is described in a separate offer
element. In this element you need to specify an id
attribute that is unique for each item:
<offer id="9012">
Importing a SKU is similar to importing a product. The only difference is the structure of a yml file.
When importing a SKU, you'll have to specify not only id
, but also group_id
(the product identifier) for the offer
element. This is because the SKU is always tied to a specific product.
<offer id="1234" group_id="9012">
Please note that SKUs are different variations of the same product, so the value of the group_id
attribute must be the same for all SKUs of the same product.
Examples
Product
<?xml version="1.0" encoding="UTF-8"?>
<yml_catalog date="2020-11-22T14:37:38+03:00">
<shop>
<name>BestSeller</name>
<company>Tne Best inc.</company>
<url>http://best.seller.ru</url>
<currencies>
<currency id="RUB" rate="1"/>
</currencies>
<categories>
<category id="1">Appliances</category>
<category id="10" parentId="1">Small kitchen appliances</category>
</categories>
<delivery-options>
<option cost="200" days="1"/>
</delivery-options>
<offers>
<offer id="9012">
<name>Cream freezer Brand 3811</name>
<url>http://best.seller.ru/product_page.asp?pid=12345</url>
<price>200</price>
<currencyId>USD</currencyId>
<categoryId>10</categoryId>
<delivery>true</delivery>
<delivery-options>
<option cost="300" days="1" order-before="18"/>
</delivery-options>
<param name="Color">white</param>
<weight>3.6</weight>
<dimensions>20.1/20.551/22.5</dimensions>
</offer>
</offers>
<gifts>
<!-- gifts not from the price list -->
</gifts>
<promos>
<!-- promotions -->
</promos>
</shop>
</yml_catalog>
SKU
<?xml version="1.0" encoding="UTF-8"?>
<yml_catalog date="2020-11-22T14:37:38+03:00">
<shop>
<name>BestSeller</name>
<company>Tne Best inc.</company>
<url>http://best.seller.ru</url>
<currencies>
<currency id="RUB" rate="1"/>
</currencies>
<categories>
<category id="1">Appliances</category>
<category id="10" parentId="1">Small kitchen appliances</category>
</categories>
<delivery-options>
<option cost="200" days="1"/>
</delivery-options>
<offers>
<offer id="1234" group_id="9012">
<name>Cream freezer Brand 3811 v.2</name>
<url>http://best.seller.ru/product_page.asp?pid=12345</url>
<price>200</price>
<currencyId>USD</currencyId>
<categoryId>10</categoryId>
<delivery>true</delivery>
<delivery-options>
<option cost="300" days="1" order-before="18"/>
</delivery-options>
<param name="Color">white</param>
<weight>3.6</weight>
<dimensions>20.1/20.551/22.5</dimensions>
</offer>
</offers>
<gifts>
<!-- gifts not from the price list -->
</gifts>
<promos>
<!-- promotions -->
</promos>
</shop>
</yml_catalog>