Criar e importar Planograma

Criar

Cria uma novo planograma em determinada máquina e instalação.

Este novo planograma trás todos os itens ativos do planograma atual.

O planograma criado fica pendente e pode ser atualizado. O mesmo só entra em atividade no próximo reabastecimento da máquina.

Uma instalação pode ter somente um planograma pendente. Se houver uma tentativa de cadastro de um outro planograma, será retornado um erro de validação, código HTTP 422.

POST /api/v1/machines/[machine_id]/installations/[installation_id]/create_from_current_planogram

Parâmetros de URL:

parâmetro

descrição

obrigatório

machine_id

id da máquina

sim

installation_id

id da instalação

sim

Retorno

status

descrição

201

Criado com sucesso

Exemplo:

{
  "id": 7110,
  "created_at": "2024-04-23T15:37:24.000Z",
  "updated_at": "2024-04-23T15:37:24.000Z",
  "due": "due_next_restock",
  "started_at": null,
  "ended_at": null,
  "items": [
    {
      "id": 273609,
      "created_at": "2024-04-23T15:37:24.000Z",
      "updated_at": "2024-04-23T15:37:24.000Z",
      "planogram_id": 7110,
      "type": "Coil",
      "good_id": 251172,
      "name": "abc123",
      "capacity": 10.0,
      "par_level": 8.0,
      "alert_level": 1.0,
      "desired_price": 5.0,
      "undefined": false,
      "logical_locator": "44",
      "physical_locators": [
        "abc123"
      ],
      "children": null,
      "display_message": null,
      "alternate_message": null,
      "status": "active",
      "use_default_price_product": false,
      "promotional_price": null,
      "benefits_club_price": null,
      "alternative_only": false,
      "good": {
        "id": 251172,
        "category_id": 2335,
        "name": "BALA HALLS MENTA 28G",
        "upc_code": "78938878",
        "upc_code_name": "78938878 - BALA HALLS MENTA 28G",
        "barcode": "78938878",
        "unit": {
          "id": 1,
          "fractionable": false,
          "name": "unit",
          "conversion_factor": 1
        },
        "default_price": null,
        "unit_description": "Unidade",
        "unit_symbol": "un",
        "price_symbol": "un",
        "default_promotional_price": null,
        "default_benefits_club_price": null
      },
      "default_desired_price": null,
      "default_promotional_price": null,
      "default_benefits_club_price": null,
      "typed_desired_price": 5.0,
      "typed_promotional_price": null,
      "typed_benefits_club_price": null
    },
    {
      "id": 273610,
      "created_at": "2024-04-23T15:37:24.000Z",
      "updated_at": "2024-04-23T15:37:24.000Z",
      "planogram_id": 7110,
      "type": "Coil",
      "good_id": 251056,
      "name": "aggg1",
      "capacity": 10.0,
      "par_level": 10.0,
      "alert_level": 1.0,
      "desired_price": 1.0,
      "undefined": false,
      "logical_locator": "45",
      "physical_locators": [
        "aggg1"
      ],
      "children": null,
      "display_message": null,
      "alternate_message": null,
      "status": "active",
      "use_default_price_product": false,
      "promotional_price": null,
      "benefits_club_price": null,
      "alternative_only": false,
      "good": {
        "id": 251056,
        "category_id": 2335,
        "name": "BALA  ARCOR  BUT CHOKKO 100G",
        "upc_code": "7891118015306",
        "upc_code_name": "7891118015306 - BALA  ARCOR  BUT CHOKKO 100G",
        "barcode": "7891118015306",
        "unit": {
          "id": 1,
          "fractionable": false,
          "name": "unit",
          "conversion_factor": 1
        },
        "default_price": 1.05,
        "unit_description": "Unidade",
        "unit_symbol": "un",
        "price_symbol": "un",
        "default_promotional_price": null,
        "default_benefits_club_price": null
      },
      "default_desired_price": 1.05,
      "default_promotional_price": null,
      "default_benefits_club_price": null,
      "typed_desired_price": 1.0,
      "typed_promotional_price": null,
      "typed_benefits_club_price": null
    },
    {
      "id": 273611,
      "created_at": "2024-04-23T15:37:24.000Z",
      "updated_at": "2024-04-23T15:37:24.000Z",
      "planogram_id": 7110,
      "type": "Coil",
      "good_id": 251210,
      "name": "TESTEEE",
      "capacity": 100.0,
      "par_level": 100.0,
      "alert_level": 10.0,
      "desired_price": 10.0,
      "undefined": false,
      "logical_locator": "46",
      "physical_locators": [
        "TESTEEE"
      ],
      "children": null,
      "display_message": null,
      "alternate_message": null,
      "status": "active",
      "use_default_price_product": false,
      "promotional_price": null,
      "benefits_club_price": null,
      "alternative_only": false,
      "good": {
        "id": 251210,
        "category_id": 3716,
        "name": "Coca Cola Zero 350ml",
        "upc_code": "7894900700015",
        "upc_code_name": "7894900700015 - Coca Cola Zero 350ml",
        "barcode": "7894900700015",
        "unit": {
          "id": 1,
          "fractionable": false,
          "name": "unit",
          "conversion_factor": 1
        },
        "default_price": null,
        "unit_description": "Unidade",
        "unit_symbol": "un",
        "price_symbol": "un",
        "default_promotional_price": null,
        "default_benefits_club_price": null
      },
      "default_desired_price": null,
      "default_promotional_price": null,
      "default_benefits_club_price": null,
      "typed_desired_price": 10.0,
      "typed_promotional_price": null,
      "typed_benefits_club_price": null
    }
  ]
}

Erros

status

descrição

response body

400

parâmetros faltando

{ “status”: “400”, “error”: “Bad Request” }

401

não autorizado

(vazio)

404

máquina/instalação não encontrada

{ “status”: “404”, “error”: “Not Found” }

422

erro ao criar

ver exemplo abaixo

422 - erro ao criar

{
  "errors": [
    "Já existe um planograma cadastrado para o próximo reabastecimento"
  ]
}