Skip to content

Instantly share code, notes, and snippets.

@matheusoliveira-luizalabs
Last active February 3, 2017 19:58
Show Gist options
  • Save matheusoliveira-luizalabs/91dc678b6812178dc60d94d9a4edde28 to your computer and use it in GitHub Desktop.
Save matheusoliveira-luizalabs/91dc678b6812178dc60d94d9a4edde28 to your computer and use it in GitHub Desktop.
Timeline events

Timeline API

All orders events and more.

List all events

Parâmetros de entrada

Parâmetro Descrição Tipo do Parâmetro Tipo do Dados Obrigatório
orderid Código pedido principal do GEMCO (numpedprinc) query numérico Sim - se não passar ecommerceid, customerid ou orderid
suborderid Código pedido de venda do GEMCO (numpedven ou numpedvenorig) query numérico Sim - se não passar ecommerceid, customerid ou orderid
ecommerceid Código pedido admsite query numérico Sim - se não passar ecommerceid, customerid ou orderid
customerid Código pedido cliente query alfanumérico Sim - se não passar ecommerceid, customerid ou orderid
stauts.id Código de status do pedido query Não
GET /v1/orders/timelines

{
    "id": "27665bf3-eb67-47ab-9160-5f95bfe99ea3",
    "orderId": 12323235, // NUMPEDPRINC
    "subOrderId": 12323235, // NUMPEDVEN
    "ecommerceId": 28258915,
    "customerId": "4603500212490095", // tabPedido.strPedido_cli
    "salesChannel": {
        "id": "B2B"
    },
    "createdAt": "2016-08-20T16:42:29.801Z",
    "timeline": [
        {
            "status": {
                "id": 100,
                "description": "NOTA FISCAL EMITIDA"
            },
            "platform": {
                "id": "TRACKING"
            },
            "createdAt": "2016-08-20T16:42:29.801Z",
            "createdBy": "MAHE_OLIVEIRA",
            "current": false,
            "note": "STP:106391  -  03/06/2015 18:00:00 PLACA VEICULO: BWP4251\n MOTORISTA: EVARISTO VIANA -  - "
        }
    ],
    "complementOrders": [
        {
            "id": 1231236,
            "timeline": [
                {
                    "status": {
                        "id": 100,
                        "description": "NOTA FISCAL EMITIDA"
                    },
                    "platform": {
                        "id": "TRACKING"
                    },
                    "createdAt": "2016-08-20T16:42:29.801Z",
                    "createdBy": "MAHE_OLIVEIRA",
                    "current": false,
                    "note": "STP:106391  -  03/06/2015 18:00:00 PLACA VEICULO: BWP4251\n MOTORISTA: EVARISTO VIANA -  - "
                }
            ]
        }
    ]
}

Create events

POST /v1/orders/timelines
{
    "orderId": 12323235, // nao
    "ecommerceId": 28258915, // nao por canal
    "customerId": "4603500212490095", // nao por canal
    "salesChannel": { // sim
        "id": "B2B"
    },
    "timeline": [
        {
            "status": {
                "id": 100,
                "description": "NOTA FISCAL EMITIDA"
            },
            "platform": {
                "id": "TRACKING"
            },
            "createdAt": "2016-08-20T16:42:29.801Z",
            "createdBy": "MAHE_OLIVEIRA",
            "current": false,
            "note": "STP:106391  -  03/06/2015 18:00:00 PLACA VEICULO: BWP4251\n MOTORISTA: EVARISTO VIANA -  - "
        }
    ]
}

Append new events

PATCH /v1/orders/timelines/{uuid}
PATCH /v1/orders/timelines?orderid=12312&suborderid=15236751&ecommerceid=28258915&customerid=4603500212490095&salesChannel.id=B2B
{
    "id": 12323235, // mov_juncao.numpedven
    "createdAt": "2016-08-20T16:42:29.801Z",
    "timeline": [ // nao
        {
            "status": {
                "id": 100,
                "description": "NOTA FISCAL EMITIDA"
            },
            "platform": {
                "id": "TRACKING"
            },
            "createdAt": "2016-08-20T16:42:29.801Z",
            "createdBy": "MAHE_OLIVEIRA",
            "current": false,
            "note": "STP:106391  -  03/06/2015 18:00:00 PLACA VEICULO: BWP4251\n MOTORISTA: EVARISTO VIANA -  - "
        }
    ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment