Variações

Criar Variação

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

Body
{
    "product_id": 1,
    "color_id": "",
    "color_secondary_id": "",
    "attribute_value_id": "",
    "external_id": "",
    "reference": "referencia",
    "sku": "",
    "gtin": "",
    "mpn": "",
    "price": "",
    "price_compare": "",
    "additional_shipping_time": "",
    "position": "",
    "active": true,
    "balance": ""
}
Status: 201

Editar Variação

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

Parâmetro: O ID da Variação.

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

{
    "color_id": "",
    "color_secondary_id": "",
    "attribute_value_id": "",
    "external_id": "",
    "reference": "referencia",
    "sku": "",
    "gtin": "",
    "mpn": "",
    "price": "",
    "price_compare": "",
    "additional_shipping_time": "",
    "position": "",
    "active": true,
    "balance": ""
}
Status: 200

Deletar Variação

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

Parâmetro: O ID da Variação.

Response: 204

Consultar Variação

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

Parâmetro: O ID da Variação

HTTP STATUS: 200 OK
{
  "id_variation": "1",
  "id_product": "1",
  "id_color": null,
  "id_color_secondary": null,
  "id_attribute": null,
  "external_id": "id externo",
  "reference": null,
  "sku": null,
  "gtin": null,
  "mpn": null,
  "price": "20.00",
  "price_compare": "30.00",
  "active": "1",
  "additional_shipping_time": null,
  "position": "999",
  "image": null,
  "images": [],
  "deleted_at": null,
  "created_at": "2018-11-14 16:13:48",
  "updated_at": "2018-11-14 16:13:48",
  "balance": "10",
  "name": "Nome do produto",
  "color": null,
  "attribute": null
}

Listar Variações 

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

HTTP STATUS: 200 OK
{
  "total": 99,
  "pages": 4,
  "current_page": 1,
  "limit": 25,
  "offset": 0,
  "data": [
    {
      "id_variation": "1",
      "id_product": "1",
      "id_color": null,
      "id_color_secondary": null,
      "id_attribute": null,
      "external_id": null,
      "reference": "VIN90921",
      "sku": "07898950108289",
      "gtin": "07898950108289",
      "mpn": "07898950108289",
      "price": "93.58",
      "price_compare": null,
      "active": "1",
      "additional_shipping_time": "0",
      "position": null,
      "image": null,
      "images": [],
      "deleted_at": null,
      "balance": "200",
      "name": "Nome do produto",
      "color": null,
      "attribute": null,
      "created_at": "1955-02-24 12:00:00",
      "updated_at": "2011-10-05 12:00:00"
    }
  ]
}