Function catalog/import (http://<DOMAIN>/api/catalog/import/
)
ParametersParameters:
token - authorization key obtained via the auth function
products[] - product list
products[i].title.en - value in English (optional)
products[i].title.ro - value in Romanian (optional)
products[i].title - common value for all languages
products[i].description.en - value in English (optional)
products[i].description.ro - value in Romanian (optional)
products[i].description - common value for all languages
products[i].seo_title.en - value in English (optional)
products[i].seo_title.ro - value in Romanian (optional)
products[i].seo_title - common value for all languages
products[i].seo_keywords.en - value in English (optional)
products[i].seo_keywords.ro - value in Romanian (optional)
products[i].seo_keywords - common value for all languages
products[i].seo_description.en - value in English (optional)
products[i].seo_description.ro - value in Romanian (optional)
products[i].seo_description - common value for all languages
products[i].marketplace_description - description for marketplaces
products[i].parent_article - article of the parent product. Necessary for creating/merging variants. If the product is a parent, thid field is not necessary (or specify the value of the product article).
If you update an existing item but do not specify this field, the current parent article from the database will be taken as the value
If the product is new and no value is specified, the parent article will be taken from the products[i].article fieldproducts[i].article - product article (mandatory parameter)
products[i].article_for_display - model article (optional). If filled in, it will be displayed on the site instead of the product article
products[i].title - product name (mandatory parameter in case of adding a new product)
products[i].mod_title - product variant name (optional)
products[i].mod_title.en - value in English (optional)
products[i].mod_title.ro - value in Romanian (optional)
products[i].mod_title - common value for all languages
products[i].display_in_showcase - display product (true|false|1|0)
products[i].presence - product availability. Attention: availability statuses can be transferred only if the Stock Accounting function is disabled.
Available values:in stock
out of stock
coming soon
Also any other availability statuses added to your site
products[i].price - product price
products[i].price_old - product old price
products[i].discount - relative discount on the product
products[i].short_description — short description
products[i].color — color
products[i].gtin — barcode (GTIN (EAN, UPC, ISBN))
products[i].mpn — manufacturer part number (MPN)
products[i].popularity — popularity
products[i].guarantee_shop — warranty type
products[i].guarantee_length — warranty period, months.
products[i].countdown_end_time — promotion end date and time
products[i].countdown_description — promotion text
products[i].currency - currency of the product. Available values (by default):
UAH
USD
EUR
PLN
RON
MDL
Note that the currency name may be different on your site, if you have renamed it. Before importing the currency you must check the currency name in the site admin panel
products[i].parent - path / to / section (Educational toys / Toys for babies) (mandatory parameter when adding new products)
products[i].parent.id - catalog section identifier (used instead of products[i].parent, recommended instead of just the section path). Section identifiers can be obtained with the pages/export function
products[i].alt_parent - array of additional sections. Each element is specified in the same way as the products[i].parent field
products[i].alt_parent[n] - path / to / section (Educational toys / Toys for babies)
products[i].alt_parent[n].id - catalog section identifier (used instead of products[i].alt_parent[n])
the above options for additional sections can be combined
products[i].forceAliasUpdate - need to regenerate the product reference (boolean value, true/false)
products[i].slug - product alias. Works only for new item, or if the parameter forceAliasUpdate == true. The alias will be inserted into the product link and converted according to the rules of forming product links
products[i].brand - brand name
products[i].description - product description
products[i].adult - for adults only (Google Merchant Center)
products[i].condition - product condition (e.g. "New", "Used", "Refurbished")
products[i].condition.id - product condition ID (used instead of products[i].condition)
products[i].icons - Icons (["Sale", "New", "Bestseller"]). Also other parameters with the "Multiselect" type or "Selection from list" with the mark "multi" can be passed in the same format
products[i].seo_title - SEO title for product
products[i].seo_keywords - SEO keywords for product
products[i].seo_description - SEO description for product
products[i].h1_title.en - h1 header for the product (English version)
products[i].h1_title.ro - h1 header for the product (Romanian version)
products[i].export_to_marketplace - enable uploading to marketplaces. Specify names of marketplaces with semicolon: "marketplace 1;marketplace2;...".
products[i].characteristics[] - product attributes (optional)
products[i].characteristics.material - Material
products[i].characteristics.weight - Weight
products[i].characteristics.consist - Composition
products[i].characteristics.country - Country
products[i].characteristics.gender - Gender
products[i].characteristics.age - Age
products[i].characteristics.physics - Physical development (enter values with ;)
products[i].characteristics.brain - Mental development (specify values with ;)
products[i].characteristics.social - Social development (enter values with ;)
New parameters since version 3.15.15
products[i].accessories - product accessories (array). Overwrites existing accessories
products[i].accessories[n] - product article (string)
products[i].accessories[n].article - direct indication of the product article
products[i].accessories[n].page - path / to / section (Educational toys / Toys for babies)
products[i].accessories[n].page.id - section ID
products[i].gifts - gifts for the product (array). Will only work if the site has gifts enabled. Overwrites existing gifts
products[i].gifts[n] - product article (string)
products[i].gifts[n].article - явное указание артикула товара
products[i].gifts[n].page - path / to / section (Educational toys / Toys for babies)
products[i].gifts[n].page.id - section ID
products[i].residues - product stock in warehouses. Works only if the site has stock accounting enabled
products[i].residues[n].warehouse - Name for warehouse synchronization (value of the property "Name for synchronization" in the warehouse)
products[i].residues[n].quantity - product stock in the warehouse
products[i].images - product variant images
products[i].images.links - links to the product images to be loaded (array). Photos are imported in the order in which they are in the array.
products[i].images.links[n] - link to the image (image size should not exceed 5MB)
products[i].images.override - need to delete current images before loading new ones (boolean). Default is
true
. Iffalse
is passed, images with the same or new links will be added to the product without overwriting the previously imported ones.products[i].images.removeAll - remove all images. WARNING! If you specify true in the parameter, the other parameters ("links", "override") will be ignored and the gallery will simply be cleaned up.
products[i].gallery_common - common gallery for all variants
products[i].gallery_common.links - links to the product images to be loaded (array). Photos are imported in the order in which they are in the array.
products[i].gallery_common.links[n] - link to the image (image size should not exceed 5MB)
products[i].gallery_common.override - need to delete current images before loading new ones (boolean). Default is
true
.products[i].gallery_common.removeAll - remove all images. WARNING! If you specify true in the parameter, the other parameters ("links", "override") will be ignored and the gallery will simply be cleaned up.
products[i].gallery_360 - 360-degree view
products[i].gallery_360.links - links to the product images to be loaded (array). Photos are imported in the order in which they are in the array.
products[i].gallery_360.links[n] - link to the image (image size should not exceed 5MB)
products[i].gallery_360.override - need to delete current images before loading new ones (boolean). Default is
true
.products[i].gallery_360.removeAll - remove all images. WARNING! If you specify true in the parameter, the other parameters ("links", "override") will be ignored and the gallery will simply be cleaned up.
New parameters since version 4.0
For projects with wholesale functionality (example query)
products[i].price_levels - prices of different types
products[i].price_levels.level_id - number, price type identifier
products[i].price_levels.price - number, price value of this type
For all projects
products[i].multiplicity — multiplicity (step of adding to cart). Integer number.
products[i].minimal_order — minimum order. Integer, must be a multiple of the "Multiplicity" field.
products[i].installments_payment — number of payments for "Payment by installments by PrivatBank".
Available values:"Off" - payment by installments is not available for the product
"Default" - the value is taken from the payment system settings
2-25 - allowable number of payments
products[i].monobank_installments_payment — number of payments for "Purchase by installments from monobank".
Available values:"Off" - payment by installments is not available for the product
"Default" - the value is taken from the payment system settings
3-25 - allowable number of payments
products[i].unit_of_measurement — measurement units.
products[i].wholesale_prices[] — wholesale prices for the number of units in an order.
products[i].wholesale_prices.minimal_threshold — number of units
products[i].wholesale_prices.price — the price valid when adding this number of units to an order
products[i].supplier_id[] — supplier
products[i].supplier_id.id — unique supplier ID
products[i].supplier_id.value — supplier name
ResponseResponse:
status - function execution status
OK - all records updated successfully
WARNING - errors occurred when updating some records
ERROR - critical error has occurred
response.log - function execution log for each record
response.log[i].article - product article
response.log[i][‘info’][n].code - record update status (see the code table below)
response.log[i][‘info’][n].message - code explanation
Product import log codes
Code | Description |
---|---|
Common | |
0 | Product added/updated |
1 | Item with article does not exist (obsolete code, no longer in use) |
2 | Product matching the parent article "parent_article" was not found |
3 | The product is now a separate parent variant |
4 | The product was set as a variant to another product |
5 | Category change error |
For new products only | |
6 | The "title" parameter is mandatory (only for new products) |
7 | One of the required fields is not set |
8 | Obsolete code. No longer used |
9 | The product was moved to another category |
10 | Error transferring a product to another category |
11 | The passed parameter is not found in the "Catalog" template |
12 | It is not possible to set the category of the product variant, because the parent product has a different category. |
Product link | |
13 | An entry with the link provided already exists |
14 | Error when creating/saving a link |
Stock balances | |
15 | Stock balances updated |
16 | Unable to update stock balances because they are disabled on the site |
17 | Data integrity error on stock balances in the warehouse |
18 | The warehouse for the stock balances was not found |
19 | Error when updating stock balances |
Accessories and gifts | |
20 | When adding an accessory/gift, there is no accessory/gift with the specified article |
21 | When adding an accessory/gift section, there is no category with the specified details |
Gallery (for the variant, common and 360-degree view) | |
22 | The gallery image has been uploaded |
23 | The link to the image is incorrect |
24 | Error when writing an image to a file |
25 | Unknown error when loading an image |
26 | Error when loading an image |
27 | MIME type of the uploaded image does not correspond to the following: image/jpeg, image/gif, image/png |
28 | The gallery has been cleared. This code is displayed if you pass the "removeAll":true parameter in the gallery, or if you upload new images and do not specify the "override" parameter or specify explicitly "override": true, which in turn also clears the image gallery. |
Example of a query for the address (http://<DOMAIN>/api/catalog/import/):
{ "products": [ { "parent_article": "AAAA_TEST", "article": "AAAA_TEST", "title": { "en": "Import test", "ro": "Test de import" }, "description": { "en": "Import test", "ro": "Test de import" }, "short_description": { "en": "Short description", "ro": "Scurtă descriere" }, "color": "White", "gtin": "4581649781942", "mpn": "GO12345OOGLE", "popularity": 25, "guarantee_shop": "Shop", "guarantee_length": 12, "countdown_end_time": "2021-12-31 23:59:59", "countdown_description": { "en": "<p>Description for promotion</p>", "ro": "<p>Descriere pentru promovare</p>", }, "parent": "iPhone / iPhone 6", "alt_parent": [ "Other products / Accessories", { "id": 98 }, "Apple / Test" ], "forceAliasUpdate": true, "slug": "aaaa-test", "display_in_showcase": true, "presence": "In stock", "price": 100, "price_old": 150, "wholesale_prices": [ { "minimal_threshold": "4", "price": 8000 } ], "icons": [ "Sale", "New", "Bestseller" ], "export_to_marketplace": "Facebook Feed;Google Feed for Merchant Center", "images": { "override": false, "links": [ "https://cdn.pixabay.com/photo/2013/07/12/12/58/tv-test-pattern-146649_960_720.png", "https://lh4.ggpht.com/wKrDLLmmxjfRG2-E-k5L5BUuHWpCOe4lWRF7oVs1Gzdn5e5yvr8fj-ORTlBF43U47yI=w300", "http://wp.patheos.com.s3.amazonaws.com/blogs/faithwalkers/files/2013/03/bigstock-Test-word-on-white-keyboard-27134336.jpg", "https://i.vimeocdn.com/portrait/58832_300x300", "http://www.testinteligencia.net/image/repository/test1.jpg", "https://i.ytimg.com/vi/yaqe1qesQ8c/maxresdefault.jpg", "http://build.horoshop.com.ua/api/catalog/export", "sdgagadsgsadgsadgsadgsagsadg" ] } }, { "parent_article": "AAAA_TEST", "article": "BBBB_TEST", "title": { "en": "Import test", "ro": "Test de import" }, "description": { "en": "Import test", "ro": "Test de import" }, "marketplace_description": { "en": "Description en", "ro": "Descriere ro", }, "parent": { "id": 1036 }, "display_in_showcase": true, "price": 95, "discount": 3, "accessories": [ "2317217", "4517217", { "page": "Phones / Accessories" }, { "page": { "id": 1032 } }, { "article": "MD827" } ], "residues": [ { "warehouse": "office", "quantity": 15 } ], "gallery_common": { "override": false, "links": [ "https://cdn.pixabay.com/photo/2013/07/12/12/58/tv-test-pattern-146649_960_720.png", "https://lh4.ggpht.com/wKrDLLmmxjfRG2-E-k5L5BUuHWpCOe4lWRF7oVs1Gzdn5e5yvr8fj-ORTlBF43U47yI=w300" ] }, "characteristics": { "gender": "Boy ; Girl", "material": "Polyester", "country": { "en": "United Kingdom", "ro": "Marea Britanie" } "supplier_id": { "id": 4, "value": "Top" } } } ] }
Example of a response to a request:
{ "status": "WARNING", "response": { "log": [ { "article": "AAAA_TEST", "info": [ { "code": 23, "message": "Некорректная ссылка на изображение \"sdgagadsgsadgsadgsadgsagsadg\"" }, { "code": 0, "message": "Товар обновлен" }, { "code": 13, "message": "Запись с ссылкой \/aaaa-test\/ уже существует" }, { "code": 22, "message": "Изображение https:\/\/cdn.pixabay.com\/photo\/2013\/07\/12\/12\/58\/tv-test-pattern-146649_960_720.png успешно загружено" }, { "code": 22, "message": "Изображение https:\/\/lh4.ggpht.com\/wKrDLLmmxjfRG2-E-k5L5BUuHWpCOe4lWRF7oVs1Gzdn5e5yvr8fj-ORTlBF43U47yI=w300 успешно загружено" }, { "code": 22, "message": "Изображение http:\/\/wp.patheos.com.s3.amazonaws.com\/blogs\/faithwalkers\/files\/2013\/03\/bigstock-Test-word-on-white-keyboard-27134336.jpg успешно загружено" }, { "code": 22, "message": "Изображение https:\/\/i.vimeocdn.com\/portrait\/58832_300x300 успешно загружено" }, { "code": 22, "message": "Изображение http:\/\/www.testinteligencia.net\/image\/repository\/test1.jpg успешно загружено" }, { "code": 22, "message": "Изображение https:\/\/i.ytimg.com\/vi\/yaqe1qesQ8c\/maxresdefault.jpg успешно загружено" }, { "code": 25, "message": "Произошла неизвестная ошибка при загрузке изображения. Cannot read from non-readable stream" } ] }, { "article": "BBBB_TEST", "info": [ { "code": 15, "message": "Остатки товара обновлены" }, { "code": 0, "message": "Товар добавлен" }, { "code": 22, "message": "Изображение https:\/\/cdn.pixabay.com\/photo\/2013\/07\/12\/12\/58\/tv-test-pattern-146649_960_720.png успешно загружено" }, { "code": 22, "message": "Изображение https:\/\/lh4.ggpht.com\/wKrDLLmmxjfRG2-E-k5L5BUuHWpCOe4lWRF7oVs1Gzdn5e5yvr8fj-ORTlBF43U47yI=w300 успешно загружено" } ] } ] } }
Add Comment