Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

Function catalog/export (http://<DOMAIN>/api/catalog/export/)

Parameters:

  • token - authorization key obtained through the auth function
  • expr - condition of goods selection
    • parent - path to the section (Toys for Kids) OR
    • parent.id - section id for selection (or parent.id: {"id": [1,2,3,4]})
    • display_in_showcase - 0 or 1 for selection of products that are included
    • article - selection of products by article (string or array, for example: ['SKU-1-BLACK', 'MF-2010']). Not a mandatory parameter
  • offset - offset relative to the beginning of the goods selection
  • limit - number of exported items (by default 500 records, more than 500 records cannot be exported to avoid server overload). It works together with the offset parameter. For example: offset=20&limit=10 - will output goods from the 20th to the 30th.
  • includedParams - list of fields to be selected (only the fields specified by you will be selected: parent_article, article, parent). see example below.
  • excludedParams - list of fields that should be excluded from export (also excluded are the fields specified in includedParams, if this parameter is filled). see example below.


Response:

  • status - status of function execution
    • OK - export was successful
    • EXCEPTION - an error occurred
  • products - exported goods
    • products[i].title.ru - value in Russian language
    • products[i].title.ua - value in Ukrainian language
    • products[i].article - product article
    • products[i].parent_article - article of the parent product
    • products[i].article_for_display - model article
    • products[i].creation_time - date of product addition
    • products[i].title - product name
    • products[i].display_in_showcase - display item (1|0)
    • products[i].price - Price of the product
    • products[i].price_old - Old price of the product
    • products[i].discount - relative discount for the product
    • products[i].parent - path to the \ section (Developmental Toys\ Toys for Kids) (mandatory parameter).
    • products[i].brand - brand name
    • products[i].description - product description
      • products[i].description.ru - value in Russian language
      • products[i].description.ua - value in Ukrainian language
    • products[i].we_recommended - we recommend (1|0)
    • products[i].icons - Icons (["Sale", "Novelty", "Hit"])
    • products[i].seo_title - SEO title for the product
      • products[i].seo_title.ru - value in Russian language
      • products[i].seo_title.ua - value in Ukrainian language
    • products[i].seo_keywords - SEO keywords for the product
      • products[i].seo_keywords.ru - Russian language value
      • products[i].seo_keywords.ua - value in Ukrainian language
    • products[i].seo_description - SEO description for the product
      • products[i].seo_description.ru - value in Russian language
      • products[i].seo_description.ua - value in Ukrainian language
    • products[i].characteristics[] - product characteristics
    • 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 (specify values with ;)
    • products[i].characteristics.brain - Mental development (specify values with ;)
    • products[i].characteristics.social - Social development (specify values with ;)
    • products[i].images - links to images of the modification
    • products[i].gallery_common - links to images common for all modifications
    • products[i].gallery_360 - links to 360 gallery images
    • products[i].slug - product alias or null if it is not specified
    • products[i].link - absolute link with domain to the product or null if it is not specifie
    • products[i].accessories - accessories for the product (array). Overwrite existing accessoriesproducts[i].accessories[n] - product article in a simple string
      • products[i].accessories[n].article - explicit product article
      • products[i].accessories[n].page - the path to the \ section (Toys for Kids).
      • products[i].accessories[n].page.id - section identifier
    • products[i].gifts - gifts for the product (array). Will work only if gifts are enabled on the site. Overwrite existing gifts
      • products[i].gifts[n] - product article in a simple string
      • products[i].gifts[n].article - explicit product article
      • products[i].gifts[n].page - the path to the \ section (Toys for Kids).
      • products[i].gifts[n].page.id - section id
    • products[i].residues - product residues in warehouses. It works only if the site has enabled the accounting of residues in warehouses.
    • products[i].residues[n].warehouse - Name for warehouse synchronization (value of "Name for synchronization" property in warehouse)
    • products[i].residues[n].quantity - quantity of goods in the warehouse
    • products[i].unit_of_measurement - unit value
      • products[i].unit_of_measurement.id - unit value identifier in the reference book
      • products[i].unit_of_measurement.value - unit value


Important note:

If a parameter has a value translation - it will be output in the format
"param": { "id":1, "value": { "lang_abbr_1" : "value_1", "lang_abbr_2" : "value_2"}}

The exported parameters may vary depending on the parameters of the product-specific data template


Query example http://<DOMAIN>/api/catalog/export/


{
       "expr" : {
           "parent":"Mac",
           "article": ["sdgasdgsa", "asfasgasdg"]
       },
       "limit" : 5,
       "token":"7189d5c9f5f469e8dbfdea1c2c33698c"
}

Response example

{
    "status": "OK",
    "response": {
        "products": [
            {
                "parent_article": "sdgasdgsa",
                "article": "sdgasdgsa",
                "mod_title": {
                    "ru": "dgasdgasdg",
                    "ua": "dgasdgasdg"
                },
                "price": 150,
                "price_old": 0,
                "presence": {
                    "id": 2,
                    "value": {
                        "ru": "Нет в наличии",
                        "ua": "Немає в наявності"
                    }
                },
                "display_in_showcase": 1,
                "discount": 0,
                "quantity": 0,
                "short_description": {
                    "ru": "",
                    "ua": ""
                },
                "color": {
                    "id": 22,
                    "value": {
                        "ru": "Золотистый",
                        "ua": "Золотистий"
                    }
                },
                "title": {
                    "ru": "MacBook Air 11.6\" 128 ГБ",
                    "ua": "MacBook Air 11.6\" 128 ГБ"
                },
                "currency": {
                    "id": 2,
                    "value": ""
                },
                "parent": {
                    "id": 1124,
                    "value": "Mac"
                },
                "brand": {
                    "id": 0,
                    "value": null
                },
                "popularity": 0,
                "description": {
                    "ru": "",
                    "ua": ""
                },
                "g_size": {
                    "id": 0,
                    "value": null
                },
                "seo_title": {
                    "ru": "",
                    "ua": ""
                },
                "seo_keywords": {
                    "ru": "",
                    "ua": ""
                },
                "seo_description": {
                    "ru": "",
                    "ua": ""
                },
                "h1_title": {
                    "ru": "",
                    "ua": ""
                },
                "alt_parent": [
                    {
                        "id": 1681,
                        "value": "development colossus cluster 86070119 \/ boob bang builder 83177342 \/ portal cake 57566500"
                    }
                ],
                "icons": [
                    {
                        "id": 4,
                        "value": {
                            "ru": "Распродажа",
                            "ua": "Распродажа"
                        }
                    },
                    {
                        "id": 3,
                        "value": {
                            "ru": "Новинка",
                            "ua": "Новинка"
                        }
                    }
                ],
                "characteristics": {
                    "mod1": {
                        "id": 0,
                        "value": null
                    },
                    "mod2": {
                        "id": 0,
                        "value": null
                    },
                    "mod3": {
                        "id": 0,
                        "value": null
                    },
                    "mod4": {
                        "id": 0,
                        "value": null
                    },
                    "mod5": {
                        "id": 0,
                        "value": null
                    },
                    "mod6": {
                        "id": 0,
                        "value": null
                    },
                    "mod7": []
                },
                "images": [],
                "gallery_common": [],
                "gallery_360": []
            },
            {
                "parent_article": "asfasgasdg",
                "article": "asfasgasdg",
                "mod_title": {
                    "ru": "efhsdfh",
                    "ua": "efhsdfh"
                },
                "price": 12000,
                "price_old": 0,
                "presence": {
                    "id": 2,
                    "value": {
                        "ru": "Нет в наличии",
                        "ua": "Немає в наявності"
                    }
                },
                "display_in_showcase": 1,
                "discount": 0,
                "quantity": 0,
                "short_description": {
                    "ru": "",
                    "ua": ""
                },
                "color": {
                    "id": 0,
                    "value": null
                },
                "title": {
                    "ru": "MacBook Air 13.3\" 128 ГБ",
                    "ua": ""
                },
                "currency": {
                    "id": 1,
                    "value": ""
                },
                "parent": {
                    "id": 1124,
                    "value": "Mac"
                },
                "brand": {
                    "id": 0,
                    "value": null
                },
                "popularity": 0,
                "description": {
                    "ru": "",
                    "ua": ""
                },
                "g_size": {
                    "id": 0,
                    "value": null
                },
                "seo_title": {
                    "ru": "",
                    "ua": ""
                },
                "seo_keywords": {
                    "ru": "",
                    "ua": ""
                },
                "seo_description": {
                    "ru": "",
                    "ua": ""
                },
                "h1_title": {
                    "ru": "",
                    "ua": ""
                },
                "alt_parent": [
                    {
                        "id": 1681,
                        "value": "development colossus cluster 86070119 \/ boob bang builder 83177342 \/ portal cake 57566500"
                    }
                ],
                "icons": [],
                "characteristics": {
                    "mod1": {
                        "id": 0,
                        "value": null
                    },
                    "mod2": {
                        "id": 0,
                        "value": null
                    },
                    "mod3": {
                        "id": 0,
                        "value": null
                    },
                    "mod4": {
                        "id": 0,
                        "value": null
                    },
                    "mod5": {
                        "id": 0,
                        "value": null
                    },
                    "mod6": {
                        "id": 0,
                        "value": null
                    },
                    "mod7": []
                },
                "images": [],
                "gallery_common": [],
                "gallery_360": []
            }
        ]
    }
}

An example of a request for an address (http://<DOMAIN>/api/catalog/export/) using the includedParams parameter


{
       "limit" : 5,
       "token":"7189d5c9f5f469e8dbfdea1c2c33698c",
	   "includedParams": ["price", "price_old", "title"]
}

Respionse example

{
    "status": "OK",
    "response": {
        "products": [
            {
                "parent_article": "2318262",
                "article": "2318262",
                "price": 649,
                "price_old": 0,
                "title": {
                    "ru": "Stainless Steel Case with Milanese Loop",
                    "ua": "Stainless Steel Case with Milanese Loop"
                },
                "parent": {
                    "id": 1006,
                    "value": "Watch"
                }
            },
            {
                "parent_article": "2317217",
                "article": "2317217",
                "price": 550,
                "price_old": 650,
                "title": {
                    "ru": "Stainless Steel Case with Black Sport Band",
                    "ua": "Stainless Steel Case with Black Sport Band"
                },
                "parent": {
                    "id": 1006,
                    "value": "Watch"
                }
            },
            {
                "parent_article": "MD827",
                "article": "MD827",
                "price": 599,
                "price_old": 0,
                "title": {
                    "ru": "Apple EarPods with Remote and Mic",
                    "ua": "Apple EarPods with Remote and Mic"
                },
                "parent": {
                    "id": 1008,
                    "value": "Аксессуары"
                }
            },
            {
                "parent_article": "MD564",
                "article": "MD564",
                "price": 79,
                "price_old": 0,
                "title": {
                    "ru": "Дисковод USB SuperDrive",
                    "ua": "Дисковод USB SuperDrive"
                },
                "parent": {
                    "id": 1008,
                    "value": "Аксессуары"
                }
            },
            {
                "parent_article": "MB829",
                "article": "MB829",
                "price": 69,
                "price_old": 0,
                "title": {
                    "ru": "Magic Mouse",
                    "ua": "Magic Mouse"
                },
                "parent": {
                    "id": 1032,
                    "value": "Аксессуары \/ Клавиатуры и мыши"
                }
            }
        ]
    }
}


An example of a request for an address (http://<DOMAIN>/api/catalog/export/) using the excludedParams parameter:

{
	"token": "7189d5c9f5f469e8dbfdea1c2c33698c"
    "limit": 1,
    "excludedParams": ["price", "price_old", "description"]
}

Response example

{
    "status": "OK",
    "response": {
        "products": [
            {
                "parent_article": "2318262",
                "article": "2318262",
                "mod_title": {
                    "ru": "",
                    "ua": ""
                },
                "presence": {
                    "id": 1,
                    "value": {
                        "ru": "В наличии",
                        "ua": "В наявності"
                    }
                },
                "display_in_showcase": 1,
                "discount": 0,
                "quantity": 3,
                "short_description": {
                    "ru": "jfhblagfue",
                    "ua": ""
                },
                "color": {
                    "id": 20,
                    "value": {
                        "ru": "Зелёный",
                        "ua": "Зелений"
                    }
                },
                "currency": {
                    "id": 4,
                    "value": "грн"
                },
                "title": {
                    "ru": "Stainless Steel Case with Milanese Loop",
                    "ua": "Stainless Steel Case with Milanese Loop"
                },
                "parent": {
                    "id": 1006,
                    "value": "Watch"
                },
                "brand": {
                    "id": 88,
                    "value": {
                        "ru": "Air Jordan",
                        "ua": "Air Jordan"
                    }
                },
                "popularity": 0,
                "seo_title": {
                    "ru": "",
                    "ua": ""
                },
                "seo_keywords": {
                    "ru": "",
                    "ua": ""
                },
                "seo_description": {
                    "ru": "",
                    "ua": ""
                },
                "h1_title": {
                    "ru": "",
                    "ua": ""
                },
                "alt_parent": [],
                "icons": [
                    {
                        "id": 3,
                        "value": {
                            "ru": "Новинка",
                            "ua": "Новинка"
                        }
                    }
                ],
                "select": [],
                "characteristics": {
                    "country": {
                        "ru": "",
                        "ua": ""
                    },
                    "sezon": 0,
                    "iq": {
                        "id": 0,
                        "value": null
                    }
                },
                "images": [
                    "http:\/\/my.horoshop.dev\/content\/images\/36\/58113884470528.jpg",
                    "http:\/\/my.horoshop.dev\/content\/images\/36\/22344377057419.jpg",
                    "http:\/\/my.horoshop.dev\/content\/images\/36\/96673477606640.jpg",
                    "http:\/\/my.horoshop.dev\/content\/images\/36\/92563395698865.jpg"
                ],
                "gallery_common": [],
                "gallery_360": [],
                "slug": "stainless-steel-case-with-milanese-loop\/69",
                "link": "http:\/\/my.horoshop.dev\/stainless-steel-case-with-milanese-loop\/69\/"
            }
        ]
    }
}


Example of a request for an address (http://<DOMAIN>/api/catalog/export/) using the includedParams and excludedParams parameters:

{
    "limit" : 1,
    "includedParams": ["price", "title", "color"],
    "excludedParams": ["price", "price_old", "description"]
}

Response example

{
    "status": "OK",
    "response": {
        "products": [
            {
                "parent_article": "2318262",
                "article": "2318262",
                "color": {
                    "id": 20,
                    "value": {
                        "ru": "Зелёный",
                        "ua": "Зелений"
                    }
                },
                "title": {
                    "ru": "Stainless Steel Case with Milanese Loop",
                    "ua": "Stainless Steel Case with Milanese Loop"
                },
                "parent": {
                    "id": 1006,
                    "value": "Watch"
                }
            }
        ]
    }
}


  • No labels