Categorias

Criar Categoria

POST  https://api.dooca.store/categories

Body
{
    "external_id": "",
    "parent_id": "206",
    "name": "teste",
    "description": "",
    "banner": "",
    "image": "",
    "meta_title": "",
    "meta_description": "",
    "meta_keywords": "",
    "google_taxonomy_id": "",
    "position": "",
    "is_visable": "",
    "active": true
}
Status: 201

Editar Categoria

PUT  https://api.dooca.store/categories/:id

Parâmetro: O ID da categoria.

A edição do registro pode ser parcial ou total.

{
  "name": "Novo nome Categoria",
  "active": 0
}
Status: 200

Deletar Categoria

DELETE  https://api.dooca.store/categories/:id

Parâmetro: O ID da categoria.

Response: 204

Consultar Categoria

GET https://api.dooca.store/categories/:id

Parâmetro: O ID da categoria.

HTTP STATUS: 200 OK
{
  "id_category": "1",
  "id_parent": null,
  "name": "Nome da categoria",
  "active": 1,
  "position": "4",
  "banner": null,
  "google_taxonomy_id": "413",
  "is_visible": "1",
  "slug": "nome-da-categoria",
  "meta_title": null,
  "meta_keywords": null,
  "meta_description": "Descrição da categoria",
  "description": "<p>Descrição da categoria<p>",
  "image": null,
  "depth": "1",
  "breadcrumb": "",
  "breadcrumbs": [
    {
      "id_category": "1",
      "name": "Nome da categoria",
      "slug": "nome-da-categoria"
    }
  ],
  "external_id": null,
  "created_at": "1955-02-24 12:00:00",
  "updated_at": "2011-10-05 12:00:00"
}

Listar Categorias

GET https://api.dooca.store/categories 

HTTP STATUS: 200 OK
{
  "total": 99,
  "pages": 4,
  "current_page": 1,
  "limit": 25,
  "offset": 0,
  "data": [
    {
      "id_category": "1",
      "id_parent": null,
      "name": "Nome da categoria",
      "slug": "nome-categoria",
      "active": 1,
      "position": "1",
      "banner": null,
      "google_taxonomy_id": "413",
      "is_visible": "1",
      "meta_title": null,
      "meta_keywords": null,
      "meta_description": "Descrição da categoria",
      "description": "<p>Descrição da categoria<p>",
      "image": null,
      "depth": "1",
      "breadcrumb": "",
      "external_id": null,
      "created_at": "1955-02-24 12:00:00",
      "updated_at": "2011-10-05 12:00:00"
    }
  ]
}

Consultar Breadcrumb

GET https://api.dooca.store/categories/:category_id/breadcrumb

Parâmetro: O ID da Categoria.

Editar Árvore de Categorias

PUT https://api.dooca.store/categories/tree

A edição do registro pode ser parcial ou total

{
        "id": 120,
        "external_id": 120,
        "parent_id": null,
        "name": "FERRAMENTAS",
        "slug": "ferramentas",
        "description": null,
        "banner": null,
        "image": null,
        "position": null,
        "depth": 1,
        "breadcrumb": "FERRAMENTAS",
        "google_taxonomy_id": null,
        "meta_title": null,
        "meta_keywords": null,
        "meta_description": null,
        "active": true,
        "created_at": "2019-06-17 13:41:35",
        "updated_at": "2019-06-17 13:41:35",
        "children": [
            {
                "id": 121,
                "external_id": 121,
                "parent_id": 120,
                "name": "TRANSBIKE / RACK",
                "slug": "transbike-rack",
                "description": null,
                "banner": null,
                "image": null,
                "position": null,
                "depth": "2",
                "breadcrumb": "FERRAMENTAS > TRANSBIKE / RACK",
                "google_taxonomy_id": null,
                "meta_title": null,
                "meta_keywords": null,
                "meta_description": null,
                "active": true,
                "created_at": "2019-06-17 13:41:36",
                "updated_at": "2019-06-17 13:41:36",
                "children": []
            },
            {
                "id": 128,
                "external_id": 128,
                "parent_id": 120,
                "name": "LUBRIFICANTE",
                "slug": "lubrificante",
                "description": null,
                "banner": null,
                "image": null,
                "position": null,
                "depth": "2",
                "breadcrumb": "FERRAMENTAS > LUBRIFICANTE",
                "google_taxonomy_id": null,
                "meta_title": null,
                "meta_keywords": null,
                "meta_description": null,
                "active": true,
                "created_at": "2019-06-17 13:41:44",
                "updated_at": "2019-06-17 13:41:44",
                "children": []
            }]
}

Listar Árvores de Categorias

GET https://api.dooca.store/categories/tree

HTTP STATUS: 200 OK
{
        "id": 120,
        "external_id": 120,
        "parent_id": null,
        "name": "FERRAMENTAS",
        "slug": "ferramentas",
        "description": null,
        "banner": null,
        "image": null,
        "position": null,
        "depth": 1,
        "breadcrumb": "FERRAMENTAS",
        "google_taxonomy_id": null,
        "meta_title": null,
        "meta_keywords": null,
        "meta_description": null,
        "active": true,
        "created_at": "2019-06-17 13:41:35",
        "updated_at": "2019-06-17 13:41:35",
        "children": [
            {
                "id": 121,
                "external_id": 121,
                "parent_id": 120,
                "name": "TRANSBIKE / RACK",
                "slug": "transbike-rack",
                "description": null,
                "banner": null,
                "image": null,
                "position": null,
                "depth": "2",
                "breadcrumb": "FERRAMENTAS > TRANSBIKE / RACK",
                "google_taxonomy_id": null,
                "meta_title": null,
                "meta_keywords": null,
                "meta_description": null,
                "active": true,
                "created_at": "2019-06-17 13:41:36",
                "updated_at": "2019-06-17 13:41:36",
                "children": []
            },
            {
                "id": 128,
                "external_id": 128,
                "parent_id": 120,
                "name": "LUBRIFICANTE",
                "slug": "lubrificante",
                "description": null,
                "banner": null,
                "image": null,
                "position": null,
                "depth": "2",
                "breadcrumb": "FERRAMENTAS > LUBRIFICANTE",
                "google_taxonomy_id": null,
                "meta_title": null,
                "meta_keywords": null,
                "meta_description": null,
                "active": true,
                "created_at": "2019-06-17 13:41:44",
                "updated_at": "2019-06-17 13:41:44",
                "children": []
            }]
}