Import SKUs and categories
Description
Imports 2 types of entities at the same time: SKUs and categories.
Request URL
Method: POST
https://example.com/api/v1.1/market/sku/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:
|
categories | array of objects | [ | No | Creating categories and subcategories Learn more |
data | array of objects | [ | Yes | SKU data Learn more |
Request example
{
"token": "abcdefghijklmnqrstuvwxyz",
"custom_fields": [
{
"external_id": "test_field_string",
"name": "Custom field for SKU",
"entity_type": "sku",
"required": false,
"value_type": "unicode",
"default_value": "Default value of the SKU custom field"
}
],
"categories": [
{
"external_id": "test_category_2",
"name": "Electronics"
}
],
"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 value",
},
"regional_data": [
{
"external_id": "region_YnCrJj8Y1",
"price": "75000",
"old_price": "80000",
"currency": "RUB",
"custom_fields": {
"test_field_string": "Test field value for this region",
},
"count": 8,
"is_available": true,
"delivery": true
}
]
}
]
}
Response example
{
"error": 0,
"error_text": "",
"result": [
{
"error": 0,
"external_id": "sku_test_1"
}
]
}
Response parameters
Parameter | Type | Description |
---|---|---|
error | int | Error code |
error_text | string | Error text |
result | array | IDs of SKUs that were successfully imported |