Produtos

Filtros

Pode-se utilizar filtros para restringir o retorno de dados. São utilizados, passando um parâmetro na URL requisitada. Observe a tabela de possíveis filtros abaixo

ParamDescriçãoTipoValoresEx
idsFiltra pedidos pelo idstring
?ids=1,2,3
nameFiltra produto pelo nomestring?name=produto
activeFiltra produto ativostring?active=1
category_idFiltra produto pelo ID da categoriastring?category_id=29

Criar Produto

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

Body
{
  "external_id": "meu id do erp",
  "id_category_default": "1",
  "id_brand": "1",
  "name": "Nome do seu produto",
  "description": "Descrição do seu produto",
  "short_description": "Curta descrição",
  "active": 1,
  "relevance": 5,
  "weight": 1.65,
  "depth": 1.65,
  "width": 1.65,
  "height": 1.65,
  "meta_title": "Meta title",
  "meta_description": "Meta description",
  "meta_keywords": "meta, keywords",
  "tags": "separado, por, virgulas",
  "price": 100,
  "price_compare": 1000,
  "price_out_of_stock": 200,
  "billet_discount": 10,
  "additional_time_out_of_stock": 3,
  "sell_out_of_stock": 1,
  "ncm": "123456789",
  "images": [
    {
      "type": "image",
      "src": "https://url-da-imagem.jpg"
    }
  ],
  "model": "Modelo do produto",
  "gender": "unissex",
  "age_group": "adult",
  "features": [
    1,
    2,
    3,
    4
  ],
  "categories": [
    1,
    2,
    3,
    4
  ],
  "attachments": [
    {
      "name": "Nome do anexo",
      "src": "https://url-do-anexo.pdf"
    }
  ],
  "carrier_exclude": [
    2
  ],
  "variations": [
    {
      "external_id": "12",
      "id_color": null,
      "id_color_secondary": null,
      "id_attribute": null,
      "reference": "1234567890",
      "gtin": "asdfghjkl",
      "mpn": "123456789",
      "sku": "1234567890",
      "price": 50,
      "price_compare": 79.99,
      "balance": 50,
      "active": 1,
      "additional_shipping_time": null,
      "position": 1
    }
  ]
}
Status: 201

Criar Produto (KIT)

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

Body
{
    "name": "Kit teste",
    "kit": 1,
    "active": true,
    "#components": [{
        "grid_id": "1-2"
    },{
        "grid_id": "2-7"
    },{
        "grid_id": "3-7"
    },{
        "grid_id": "4-2"
    }],
    "components": [{
        "grid_id": "1-2",
        "product_component_group_id": "1",
        "quantity": "1"
    },{
        "grid_id": "2-7",
        "product_component_group_id": "1",
        "quantity": "1"
    },{
        "grid_id": "3-7",
        "product_component_group_id": "1",
        "quantity": "1",
        "default": "1"
    },{
        "grid_id": "4-2",
        "product_component_group_id": "1",
        "quantity": "1"
    },{
        "grid_id": "7",
        "product_component_group_id": "1",
        "quantity": "1"
    },{
        "grid_id": "8-11",
        "product_component_group_id": "3",
        "quantity": "1"
    },{
        "grid_id": "10",
        "product_component_group_id": "3",
        "quantity": "1"
    },{
        "grid_id": "13-14",
        "product_component_group_id": "3",
        "quantity": "1"
    },{
        "grid_id": "14-3",
        "product_component_group_id": "3",
        "quantity": "1",
        "default": "1"
    },{
        "grid_id": "17",
        "product_component_group_id": "3",
        "quantity": "1"
    },{
        "grid_id": "18-8",
        "product_component_group_id": "3",
        "quantity": "1"
    },{
        "grid_id": "25-12",
        "product_component_group_id": "7",
        "quantity": "1"
    },{
        "grid_id": "25-12",
        "product_component_group_id": "7",
        "quantity": "2"
    },{
        "grid_id": "25-12",
        "product_component_group_id": "7",
        "quantity": "4",
        "default": "1"
    }]
}
Status: 201

Editar Produto

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

Parâmetro: O ID do produto.

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

{
  "name": "Novo nome do Produto"
}
Status: 200

Deletar Produto

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

Parâmetro: O ID do produto.

Response: 204

Consultar Produto

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

Parâmetro: O ID do produto.

HTTP STATUS: 200 OK
{
  "id_product": "1",
  "name": "Nome do produto",
  "weight": "1.650",
  "depth": "1.65",
  "width": "1.65",
  "height": "1.65",
  "relevance": "5",
  "meta_title": "meta title",
  "meta_description": "meta description",
  "meta_keywords": "meta, keywords",
  "tags": "tags, separadas, por, virgula",
  "description": "Descrição do produto",
  "short_description": "Descrição curta do produto",
  "slug": "nome-do-produto",
  "ncm": "123456789",
  "ipi": null,
  "st": "0",
  "billet_discount": "10.00",
  "images": [
    {
      "src": "https://dooca.com.br/files/product/nome-do-produto-15422001706124.jpg",
      "type": "image"
    }
  ],
  "image": "https://dooca.com.br/files/product/nome-do-produto-15422001706124.jpg",
  "created_at": "1955-02-24 12:00:00",
  "video": null,
  "price": "100.00",
  "price_compare": "1000.00",
  "updated_at": "2011-10-05 12:00:00",
  "external_id": "meu id do erp",
  "active": "1",
  "available_date": null,
  "sell_out_of_stock": "1",
  "price_out_of_stock": "200.00",
  "additional_time_out_of_stock": "3",
  "min_quantity": "1",
  "sell_in_kit_only": "0",
  "kit": "0",
  "kit_markup": "1.00000000",
  "kit_custom": "0",
  "id_category_default": "82",
  "id_brand": "4",
  "id_hotsite": null,
  "brand": {
    "id_brand": "1",
    "slug": "nome-da-marca",
    "image": "https://dooca.com.br/files/brand/nome-da-marca-1536585608388.jpg",
    "name": "Nome da marca"
  },
  "category": {
    "id_category": "1",
    "id_parent": null,
    "slug": "nome-da-categoria",
    "image": null,
    "name": "Nome da categoria"
  },
  "categories": [
    {
      "id_category": "1",
      "id_parent": null,
      "name": "Nome da categoria",
      "slug": "nome-da-categoria",
      "image": null,
      "breadcrumb": ""
    }
  ],
  "attachments": [
    {
      "id_product_attachment": "1",
      "id_product": "1",
      "name": "Nome do anexo",
      "src": "https://dooca.com.br/files/product/nome-do-anexo-15422001701408.pdf"
    }
  ],
  "features": [
    {
      "id_feature_group": "1",
      "name": "Nome da feature group",
      "image": "https://dooca.com.br/files/feature-group/nome-da-feature-group-15376795086210.png",
      "slug": "nome-da-feature-group",
      "values": [
        {
          "id_feature": "1",
          "id_feature_group": "1",
          "external_id": null,
          "name": "Nome da feature",
          "slug": "nome-da-feature",
          "image": null,
          "created_at": "1955-02-24 12:00:00",
          "updated_at": "2011-10-05 12:00:00",
          "position": "1",
          "active": "1"
        }
      ]
    }
  ],
  "carrier_exclude": [
    {
      "id_carrier": "1",
      "id_product": "1"
    }
  ],
  "variations": [
    {
      "id_variation": "2157",
      "id_product": "1606",
      "id_color": null,
      "id_color_secondary": null,
      "id_attribute": null,
      "external_id": "12",
      "reference": "1234567890",
      "sku": "1234567890",
      "gtin": "asdfghjkl",
      "mpn": "123456789",
      "price": "50.00",
      "price_compare": "79.99",
      "active": "1",
      "additional_shipping_time": null,
      "position": "1",
      "image": "https://dooca.com.br/files/product/produto-da-dooca-15422020467029.jpg",
      "images": [],
      "deleted_at": null,
      "created_at": "2018-11-14 11:27:27",
      "updated_at": "2018-11-14 11:27:27",
      "balance": "50",
      "name": "Produto da Dooca",
      "color": null,
      "attribute": null
    }
  ],
  "components": []
}

Listar Produtos

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

HTTP STATUS: 200 OK  
{
  "total": 99,
  "pages": 4,
  "current_page": 1,
  "limit": 25,
  "offset": 0,
  "data": [
    {
      "id_product": "1",
      "name": "Nome do produto",
      "weight": "0.700",
      "depth": "23.00",
      "width": "22.00",
      "height": "23.00",
      "relevance": "1",
      "meta_title": null,
      "meta_description": "Meta description",
      "meta_keywords": null,
      "tags": null,
      "description": "<p>Descrição</p>",
      "short_description": null,
      "slug": "nome-do-produto",
      "ncm": null,
      "ipi": null,
      "st": "0",
      "billet_discount": null,
      "images": [
        {
          "src": "https://dooca.com.br/files/product/nome-do-produto-14725831647586.jpg",
          "type": "image"
        }
      ],
      "image": "https://dooca.com.br/files/product/nome-do-produto-14725831647586.jpg",
      "created_at": "2015-08-07 16:34:27",
      "video": null,
      "price": "93.58",
      "price_compare": "117.90",
      "updated_at": "2018-10-18 16:03:20",
      "external_id": "1",
      "active": "1",
      "available_date": null,
      "sell_out_of_stock": "0",
      "price_out_of_stock": "0.00",
      "additional_time_out_of_stock": "0",
      "min_quantity": "1",
      "sell_in_kit_only": "0",
      "kit": "0",
      "kit_markup": "1.00000000",
      "kit_custom": "0",
      "id_category_default": "87",
      "id_brand": "1",
      "id_hotsite": null,
      "brand": {
        "id_brand": "1",
        "slug": "nome-da-marca",
        "image": "https://dooca.com.br/files/brand/nome-da-marca-1536589677690.jpg",
        "name": "Nome da marca"
      },
      "category": {
        "id_category": "1",
        "id_parent": "2",
        "slug": "nome-da-categoria",
        "image": null,
        "name": "Nome da categoria"
      }
    }
  ]
}