Categorías

En esta sección se encuentran las API's referentes a creación, edición y eliminación de Categorías. Esta información solamente actualizará la información base dentro de Ventiapp.

Create Category

POST https://ventiapi.azurewebsites.net/api/Category/CreateCategory

Este endpoint será utilizado para crear nuevas categorias en Ventiapp, se podrá hacer un mapeo automático en caso de especificar la información de origen (source)

Headers

NameTypeDescription

Authorization

string

Bearer + Token

Content-Type

string

application/json

{
    "title": "Kitchen",
    "categoryId": 59869
}

Body:

{
    "Title": "Kitchen",
    "CategorySource": "magento",
    "CategorySourceId": 19,
    "CategorySourceParent": null,
    "CategorySourceParentId": null
}

Parámetros del body:

Title: Título que llevará la categoría creada en Ventiapp CategorySource: Canal de origen donde estamos obteniendo la categoría, ej: "magento" CategorySourceId: Id de origen donde la estamos obteniendo la categoría, ej: 19 CategorySourceParent: Nombre del canal Padre, en donde obtiene la integración destino, en caso de no existir una categoría destino CategorySourceParentId: Id de Ventiapp de la categoría Padre, en caso de querer insertar a la categoría como nodo hijo

Update Category

POST https://ventiapi.azurewebsites.net/api/Category/UpdateCategory

Este endpoint será utilizado para actualizar una categoría existente en Ventiapp

Headers

NameTypeDescription

Authorization

string

Bearer + token

Content-Type

string

application/json

{
    "title": "Bathroom",
    "categoryId": 59869
}

Body:

{
    "Title": "Bathroom",
    "CategorySource": "tiendanube",
    "CategorySourceId": 3
}

Parámetros del body:

Title: Título que llevará la categoría actualizada en Ventiapp CategorySource: Canal de origen donde estamos obteniendo la categoría, ej: "tiendanube" CategorySourceId: Id de origen donde la estamos obteniendo la categoría, ej: 3

Search Category

GET https://ventiapi.azurewebsites.net/api/Category/SearchCategory

Este método será utilizado para buscar una categoría específica en un canal

Query Parameters

NameTypeDescription

Keyword

string

Palabras para busquéda de categoría

Channel

string

Canal donde se desa buscar ej: meli

Headers

NameTypeDescription

Authorization

string

Bearer + Token

Content-Type

string

application/json

{
    "title": "Postes de Asiento",
    "categoryId": "MLM189777"
}

Ejemplo de Query: https://ventiapi.azurewebsites.net/api/Category/SearchCategory?Keyword=zapatos&channel=meli

Map Category

POST https://ventiapi.azurewebsites.net/api/Category/MapCategory

Este método es utilizado para mapear una categoría de un canal hacia otro

Headers

NameTypeDescription

Authorization

string

Bearer + token

Content-Type

string

application/json

{
    "title": "Postes de asiento",
    "categoryId": 63699
}

Body

{
   "channelSource" : "magento",
   "categorySourceId" : 50,
   "channelTarget" : "meli",
   "categoryTargetId" : "MLM189777"
}

GetCategories

GET https://ventiapi.azurewebsites.net/api/Category/GetCategories

Este método es utilizado para buscar alguna categoría de un canal dentro de Ventiapp.

Canales disponibles:

Mercado Libre - "meli"

Magento - "magento"

Query Parameters

NameTypeDescription

channel*

String

// Ejemplo "magento"
{
    "items": [
        {
            "id": 2,
            "parent_id": 1,
            "name": "MensFashion",
            "is_active": true,
            "position": 1,
            "level": 1,
            "children": "4,5,6,7,8,9,10,19,44,112,125,147,297,318,335,338,353,372,376,377,382,391,412,433,447,450,454,470,471,479,503,527,528,529,533,584,612,627,697",
            "created_at": "2018-04-12 16:43:08",
            "updated_at": "2022-04-19 15:35:55",
            "path": "1/2",
            "available_sort_by": [],
            "include_in_menu": false,
            "custom_attributes": [
                {
                    "attribute_code": "description",
                    "value": "<div data-content-type=\"row\" data-appearance=\"contained\" data-element=\"main\"><div data-enable-parallax=\"0\" data-parallax-speed=\"0.5\" data-background-images=\"{}\" data-element=\"inner\" data-pb-style=\"60E2FED03F516\"><div class=\"pagebuilder-column-group\" data-content-type=\"column-group\" data-grid-size=\"12\" data-element=\"main\" data-pb-style=\"60E2FED03F52D\"><div class=\"pagebuilder-column\" data-content-type=\"column\" data-appearance=\"full-height\" data-background-images=\"{}\" data-element=\"main\" data-pb-style=\"60E2FED03F53E\"><figure data-content-type=\"image\" data-appearance=\"full-width\" data-element=\"main\" data-pb-style=\"60E2FED03F54E\"><img class=\"pagebuilder-mobile-hidden\" src=\"{{media url=wysiwyg/test-categoria2_1.jpg}}\" alt=\"\" title=\"\" data-element=\"desktop_image\" data-pb-style=\"60E2FED03F55D\"><img class=\"pagebuilder-mobile-only\" src=\"{{media url=wysiwyg/test-categoria2_1.jpg}}\" alt=\"\" title=\"\" data-element=\"mobile_image\" data-pb-style=\"60E2FED03F56C\"></figure></div><div class=\"pagebuilder-column\" data-content-type=\"column\" data-appearance=\"full-height\" data-background-images=\"{}\" data-element=\"main\" data-pb-style=\"60E2FED03F57B\"><figure data-content-type=\"image\" data-appearance=\"full-width\" data-element=\"main\" data-pb-style=\"60E2FED03F58A\"><img class=\"pagebuilder-mobile-hidden\" src=\"{{media url=wysiwyg/test-categoria1_2.jpg}}\" alt=\"\" title=\"\" data-element=\"desktop_image\" data-pb-style=\"60E2FED03F599\"><img class=\"pagebuilder-mobile-only\" src=\"{{media url=wysiwyg/test-categoria1_2.jpg}}\" alt=\"\" title=\"\" data-element=\"mobile_image\" data-pb-style=\"60E2FED03F5A8\"></figure></div></div></div></div><style>#html-body [data-pb-style=\"60E2FED03F516\"]{justify-content: flex-start; display: flex; flex-direction: column; background-position: left top; background-size: cover; background-repeat: no-repeat; background-attachment: scroll; border-style: none; border-width: 1px; border-radius: 0px; margin: 0px 0px 10px; padding: 10px;}#html-body [data-pb-style=\"60E2FED03F52D\"]{display: flex;}#html-body [data-pb-style=\"60E2FED03F53E\"]{justify-content: flex-start; display: flex; flex-direction: column; background-position: left top; background-size: cover; background-repeat: no-repeat; background-attachment: scroll; border-style: none; border-width: 1px; border-radius: 0px; width: 50%; margin: 0px; padding: 10px; align-self: stretch;}#html-body [data-pb-style=\"60E2FED03F54E\"]{margin: 0px; padding: 0px; border-style: none;}#html-body [data-pb-style=\"60E2FED03F55D\"]{border-style: none; border-width: 1px; border-radius: 0px; max-width: 100%; height: auto;}#html-body [data-pb-style=\"60E2FED03F56C\"]{border-style: none; border-width: 1px; border-radius: 0px; max-width: 100%; height: auto;}#html-body [data-pb-style=\"60E2FED03F57B\"]{justify-content: flex-start; display: flex; flex-direction: column; background-position: left top; background-size: cover; background-repeat: no-repeat; background-attachment: scroll; border-style: none; border-width: 1px; border-radius: 0px; width: 50%; margin: 0px; padding: 10px; align-self: stretch;}#html-body [data-pb-style=\"60E2FED03F58A\"]{margin: 0px; padding: 0px; border-style: none;}#html-body [data-pb-style=\"60E2FED03F599\"]{border-style: none; border-width: 1px; border-radius: 0px; max-width: 100%; height: auto;}#html-body [data-pb-style=\"60E2FED03F5A8\"]{border-style: none; border-width: 1px; border-radius: 0px; max-width: 100%; height: auto;}</style>"
                },
                {
                    "attribute_code": "image",
                    "value": "categoria.jpg"
                },
                {
                    "attribute_code": "meta_title",
                    "value": "Trajes para Caballero en Men's Fashion | Trajes para Hombres"
                },
                {
                    "attribute_code": "meta_keywords",
                    "value": "ropa, para, 2019, moda, sport, hombre, mejor, precios, mejores, calidad, vestir"
                },
                {
                    "attribute_code": "meta_description",
                    "value": "Trajes Formales para Hombre, Camisas de Vestir, Pantalones para Caballeros y Sacos en Men's Fashion. Trajes para Hombre de las Mejores Marcas - Trajes para Caballero"
                },
                {
                    "attribute_code": "display_mode",
                    "value": "PRODUCTS"
                },
                {
                    "attribute_code": "is_anchor",
                    "value": "1"
                },
                {
                    "attribute_code": "path",
                    "value": "1/2"
                },
                {
                    "attribute_code": "page_layout",
                    "value": "category-full-width"
                },
                {
                    "attribute_code": "children_count",
                    "value": "192"
                },
                {
                    "attribute_code": "custom_use_parent_settings",
                    "value": "0"
                },
                {
                    "attribute_code": "custom_apply_to_products",
                    "value": "0"
                },
                {
                    "attribute_code": "url_key",
                    "value": "mensfashion"
                },
                {
                    "attribute_code": "automatic_sorting",
                    "value": "0"
                },
                {
                    "attribute_code": "is_new",
                    "value": "0"
                },
                {
                    "attribute_code": "is_sale",
                    "value": "0"
                },
                {
                    "attribute_code": "use_name_in_product_search",
                    "value": "1"
                },
                {
                    "attribute_code": "virtual_rule",
                    "value": {
                        "condition": {
                            "condition_type": "Smile\\ElasticsuiteVirtualCategory\\Model\\Rule\\Condition\\Combine",
                            "aggregator_type": "all",
                            "operator": null,
                            "value": "1"
                        }
                    }
                },
                {
                    "attribute_code": "use_store_positions",
                    "value": "0"
                },
                {
                    "attribute_code": "sync_to_facebook_catalog",
                    "value": "1"
                },
                {
                    "attribute_code": "googleshopping_cat_exlude",
                    "value": "0"
                }
            ]
        },
        {
            "id": 3,
            "parent_id": 1,
            "name": "Roberts",
            "is_active": true,
            "position": 2,
            "level": 1,
            "children": "186,187,190,192,272,400,405,406,407,411,418,424,438,449,472,473,474,475,477,478,501,502,585,586,587,588,589,600,628,629,630,631,653,661,664,665,666,667,668,669,690",
            "created_at": "2018-05-03 15:15:18",
            "updated_at": "2021-11-23 21:36:30",
            "path": "1/3",
            "available_sort_by": [],
            "include_in_menu": true,
            "custom_attributes": [
                {
                    "attribute_code": "display_mode",
                    "value": "PRODUCTS"
                },
                {
                    "attribute_code": "is_anchor",
                    "value": "1"
                },
                {
                    "attribute_code": "path",
                    "value": "1/3"
                },
                {
                    "attribute_code": "children_count",
                    "value": "106"
                },
                {
                    "attribute_code": "custom_use_parent_settings",
                    "value": "0"
                },
                {
                    "attribute_code": "custom_apply_to_products",
                    "value": "0"
                },
                {
                    "attribute_code": "url_key",
                    "value": "roberts"
                },
                {
                    "attribute_code": "is_new",
                    "value": "1"
                },
                {
                    "attribute_code": "is_sale",
                    "value": "1"
                },
                {
                    "attribute_code": "use_name_in_product_search",
                    "value": "1"
                },
                {
                    "attribute_code": "virtual_rule",
                    "value": {
                        "condition": {
                            "condition_type": "Smile\\ElasticsuiteVirtualCategory\\Model\\Rule\\Condition\\Combine",
                            "aggregator_type": "all",
                            "operator": null,
                            "value": true
                        }
                    }
                }
            ]
        }
   ]
}

Delete Category

DELETE https://ventiapi.azurewebsites.net/api/Category/DeleteCategory

Este método es utilizado para borrar alguna categoría dentro de Ventiapp.

Query Parameters

NameTypeDescription

internalId*

int

ID categoría de VentiApp

"Category {internalId} has been deleted successfully."

Última actualización