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 |
---|---|---|---|---|
token | string | "abcdefghijklmnqrstuvwxyz" | Yes | API token Make sure that market roles are available for the token. |
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
- JSON
- XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"custom_fields": [
{
"external_id": "test_field_string",
"name": "String field",
"entity_type": "sku",
"required": false,
"value_type": "unicode",
"default_value": "Default value of the sku test field"
}
],
"categories": [
{
"external_id": "test_category_2",
"name": "Test category 2"
}
],
"data": [
{
"name": "Apple iPhone 13 256GB",
"external_id": "sku_test_1",
"price": "1000",
"old_price": "1100",
"currency": "USD",
"description": "SKU description",
"product_external_id": "iphone_test_1",
"categories": ["test_category_2"],
"tags": ["phone", "Apple"],
"manufacturer_name": "Apple",
"url": "https://example.com",
"pictures": ["https://example.com", "https://example.com"],
"count": 10,
"expiration_time": "730",
"is_available": true,
"delivery": true,
"barcode": [23346346, 23546362, 76834566],
"manufacturer_warranty": true,
"custom_fields": {
"test_field_string": "Test field"
},
"regional_data": [
{
"external_id": "region_YnCrJj8Y1",
"price": "75000",
"old_price": "80000",
"currency": "RUB",
"custom_fields": {
"test_field_string": "Test field"
},
"count": 8,
"is_available": true,
"delivery": true
}
]
}
]
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<custom_fields>
<external_id>test_field_string</external_id>
<name>String 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>
<categories>
<external_id>test_category_2</external_id>
<name>Test category 2</name>
</categories>
<data>
<name>Apple iPhone 13 256GB</name>
<external_id>sku_test_1</external_id>
<price>1000</price>
<old_price>1100</old_price>
<currency>USD</currency>
<description>SKU description</description>
<product_external_id>iphone_test_1</product_external_id>
<categories>test_category_2</categories>
<tags>phone</tags>
<tags>Apple</tags>
<manufacturer_name>Apple</manufacturer_name>
<url>https://example.com</url>
<pictures>https://example.com</pictures>
<pictures>https://example.com</pictures>
<count>10</count>
<expiration_time>730</expiration_time>
<is_available>true</is_available>
<delivery>true</delivery>
<barcode>23346346</barcode>
<barcode>23546362</barcode>
<barcode>76834566</barcode>
<manufacturer_warranty>true</manufacturer_warranty>
<custom_fields>
<test_field_string>Test field</test_field_string>
</custom_fields>
<regional_data>
<external_id>region_YnCrJj8Y1</external_id>
<price>75000</price>
<old_price>80000</old_price>
<currency>RUB</currency>
<custom_fields>
<test_field_string>Test field</test_field_string>
</custom_fields>
<count>8</count>
<is_available>true</is_available>
<delivery>true</delivery>
</regional_data>
</data>
</xml>
Response example
- JSON
- XML
{
"error": 0,
"error_text": "",
"result": [
{
"error": 0,
"external_id": "sku_test_1"
}
]
}
<xml>
<error>0</error>
<error_text></error_text>
<result>
<error>0</error>
<external_id>sku_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 |