Import products, SKUs and categories
Description
Allows you to import 3 types of entities at the same time: products, SKUs and categories.
Request URL
Method: POST
https://example.com/api/v1.1/market/products/import
Request parameters
| Parameter | Type | Example | Required | Description |
|---|---|---|---|---|
| custom_fields | array of objects | [ | No | Creating custom fields for the following entities:
Learn more |
| categories | array of objects | [ | No | Creating categories and subcategories Learn more |
| data | array of objects | [ | Yes | Data about products and their SKUs |
Request example
Three examples of increasing complexity are provided below: a minimal request with required fields only, a request with additional fields, and a request with custom fields.
Required fields
- JSON
- XML
{
"data": [
{
"name": "Apple iPhone 13",
"external_id": "iphone_test_1"
}
]
}
<xml>
<data>
<name>Apple iPhone 13</name>
<external_id>iphone_test_1</external_id>
</data>
</xml>
With additional fields
- JSON
- XML
{
"categories": [
{
"external_id": "test_category_1",
"name": "Test category"
}
],
"data": [
{
"name": "Apple iPhone 13",
"external_id": "iphone_test_1",
"price": "900",
"old_price": "950",
"currency": "USD",
"tags": ["phone", "Apple"],
"manufacturer_name": "Apple",
"description": "Product description",
"url": "https://example.com",
"pictures": ["https://example.com", "https://example.com"],
"count": 20,
"expiration_time": "730",
"is_available": true,
"delivery": true,
"barcode": [5235235, 347347, 335578769],
"manufacturer_warranty": true,
"regional_data": [
{
"external_id": "region_YnCrJj8Y1",
"price": "65000",
"old_price": "70000",
"currency": "RUB",
"count": 5,
"is_available": true,
"delivery": false
}
],
"categories": ["test_category_1"],
"sku": [
{
"name": "Apple iPhone 13 256GB",
"external_id": "sku_test_1",
"price": "1000",
"old_price": "1100",
"currency": "USD",
"tags": ["phone", "Apple"],
"manufacturer_name": "Apple",
"description": "SKU description",
"url": "https://example.com",
"count": 10,
"expiration_time": "730",
"is_available": true,
"delivery": true,
"barcode": [5235235, 347347, 335578769],
"manufacturer_warranty": true,
"regional_data": [
{
"external_id": "region_Un7rdJoBT",
"price": "75000",
"old_price": "80000",
"currency": "RUB",
"count": 5,
"is_available": true,
"delivery": true
}
]
}
]
}
]
}
<xml>
<categories>
<external_id>test_category_1</external_id>
<name>Test category</name>
</categories>
<data>
<name>Apple iPhone 13</name>
<external_id>iphone_test_1</external_id>
<price>900</price>
<old_price>950</old_price>
<currency>USD</currency>
<tags>phone</tags>
<tags>Apple</tags>
<manufacturer_name>Apple</manufacturer_name>
<description>Product description</description>
<url>https://example.com</url>
<pictures>https://example.com</pictures>
<pictures>https://example.com</pictures>
<count>20</count>
<expiration_time>730</expiration_time>
<is_available>true</is_available>
<delivery>true</delivery>
<barcode>5235235</barcode>
<barcode>347347</barcode>
<barcode>335578769</barcode>
<manufacturer_warranty>true</manufacturer_warranty>
<regional_data>
<external_id>region_YnCrJj8Y1</external_id>
<price>65000</price>
<old_price>70000</old_price>
<currency>RUB</currency>
<count>5</count>
<is_available>true</is_available>
<delivery>false</delivery>
</regional_data>
<categories>test_category_1</categories>
<sku>
<name>Apple iPhone 13 256GB</name>
<external_id>sku_test_1</external_id>
<price>1000</price>
<old_price>1100</old_price>
<currency>USD</currency>
<tags>phone</tags>
<tags>Apple</tags>
<manufacturer_name>Apple</manufacturer_name>
<description>SKU description</description>
<url>https://example.com</url>
<count>10</count>
<expiration_time>730</expiration_time>
<is_available>true</is_available>
<delivery>true</delivery>
<barcode>5235235</barcode>
<barcode>347347</barcode>
<barcode>335578769</barcode>
<manufacturer_warranty>true</manufacturer_warranty>
<regional_data>
<external_id>region_Un7rdJoBT</external_id>
<price>75000</price>
<old_price>80000</old_price>
<currency>RUB</currency>
<count>5</count>
<is_available>true</is_available>
<delivery>true</delivery>
</regional_data>
</sku>
</data>
</xml>
With custom fields
An example of creating custom fields (the custom_fields array at the root of the request) and filling their values in the product and the SKU:
- JSON
- XML
{
"custom_fields": [
{
"external_id": "test_field_1",
"name": "Product test field",
"entity_type": "product",
"required": false,
"value_type": "unicode",
"default_value": "Default value of the product test field"
},
{
"external_id": "test_field_2",
"name": "SKU test field",
"entity_type": "sku",
"required": false,
"value_type": "unicode",
"default_value": "Default value of the sku test field"
}
],
"data": [
{
"name": "Apple iPhone 13",
"external_id": "iphone_test_1",
"price": "900",
"old_price": "950",
"currency": "USD",
"custom_fields": {
"test_field_1": "test field"
},
"sku": [
{
"name": "Apple iPhone 13 256GB",
"external_id": "sku_test_1",
"price": "1000",
"old_price": "1100",
"currency": "USD",
"custom_fields": {
"test_field_2": "test field"
}
}
]
}
]
}
<xml>
<custom_fields>
<external_id>test_field_1</external_id>
<name>Product test field</name>
<entity_type>product</entity_type>
<required>false</required>
<value_type>unicode</value_type>
<default_value>Default value of the product test field</default_value>
</custom_fields>
<custom_fields>
<external_id>test_field_2</external_id>
<name>SKU test field</name>
<entity_type>sku</entity_type>
<required>false</required>
<value_type>unicode</value_type>
<default_value>Default value of the sku test field</default_value>
</custom_fields>
<data>
<name>Apple iPhone 13</name>
<external_id>iphone_test_1</external_id>
<price>900</price>
<old_price>950</old_price>
<currency>USD</currency>
<custom_fields>
<test_field_1>test field</test_field_1>
</custom_fields>
<sku>
<name>Apple iPhone 13 256GB</name>
<external_id>sku_test_1</external_id>
<price>1000</price>
<old_price>1100</old_price>
<currency>USD</currency>
<custom_fields>
<test_field_2>test field</test_field_2>
</custom_fields>
</sku>
</data>
</xml>
info
The custom_fields array at the root of the request creates new custom fields, while in a product or SKU object it fills them with values (an object in the format "field_external_id": "value").
Response example
- JSON
- XML
{
"error": 0,
"error_text": "",
"result": [
{
"error": 0,
"external_id": "iphone_test_1"
}
]
}
<xml>
<error>0</error>
<error_text></error_text>
<result>
<error>0</error>
<external_id>iphone_test_1</external_id>
</result>
</xml>
Response parameters
| Parameter | Type | Description |
|---|---|---|
| error | int | Error code |
| error_text | string | Error text |
| result | array | Product IDs that were successfully imported |