Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Neste exemplo, temos uma requisição para Planning API com integração a Trip API para resolver um problema logístico de 2 veículos e 10 operações, partindo do centro de distribuição.


Parâmetros utilizados

Planning:

"optimizationProfile": "BRAZIL46". Para essa simulação, foi usado o perfil de otimização BRAZIL46. Para os tipos disponíveis, verifique em optimizationProfile.

...

"freight": Foram definidos os parâmetros que retornam os cálculos referente ao Piso Mínimo do Frete.

Request

Code Block
languagejson
{
    "optimizationProfile": "BRAZIL46",
    "tripsProfile": "MAPLINK",
    "startDate": 1620298800000,
    "legislationProfiles": [
        {
            "name": "DEFAULT"
        }
    ],
    "logisticConstraints": [
        {
            "name": "P1Pickup",
            "siteLoadingFixedTime": 1800
        },
        {
            "name": "P1Delivery",
            "siteUnloadingFixedTime": 300
        }
    ],
    "products": [
        {
            "name": "DEFAULT"
        }
    ],
    "sites": [
        {
            "name": "Cliente1",
            "coordinates": {
                "latitude": -23.507608,
                "longitude": -46.587145
            },
            "logisticConstraints": "P1Delivery"
        },
        {
            "name": "Cliente2",
            "coordinates": {
                "latitude": -23.621059,
                "longitude": -46.756193
            },
            "logisticConstraints": "P1Delivery"
        },
        {
            "name": "Cliente3",
            "coordinates": {
                "latitude": -23.44935,
                "longitude": -46.588822
            },
            "logisticConstraints": "P1Delivery"
        },
        {
            "name": "Cliente4",
            "coordinates": {
                "latitude": -23.751801,
                "longitude": -46.698468
            },
            "logisticConstraints": "P1Delivery"
        },
        {
            "name": "Cliente5",
            "coordinates": {
                "latitude": -23.520565,
                "longitude": -46.508478
            },
            "logisticConstraints": "P1Delivery"
        },
        {
            "name": "Cliente6",
            "coordinates": {
                "latitude": -23.506592,
                "longitude": -46.524707
            },
            "logisticConstraints": "P1Delivery"
        },
        {
            "name": "Cliente7",
            "coordinates": {
                "latitude": -23.646993,
                "longitude": -46.779077
            },
            "logisticConstraints": "P1Delivery"
        },
        {
            "name": "Cliente8",
            "coordinates": {
                "latitude": -23.373816,
                "longitude": -46.57777
            },
            "logisticConstraints": "P1Delivery"
        },
        {
            "name": "Cliente9",
            "coordinates": {
                "latitude": -23.476158,
                "longitude": -46.640241
            },
            "logisticConstraints": "P1Delivery"
        },
        {
            "name": "Cliente10",
            "coordinates": {
                "latitude": -23.761565,
                "longitude": -46.655746
            },
            "logisticConstraints": "P1Delivery"
        }
    ],
    "depots": [
        {
            "name": "CD",
            "coordinates": {
                "latitude": -23.503939,
                "longitude": -46.498419
            },
            "logisticConstraints": "P1Pickup"
        }
    ],
    "vehicleTypes": [
        {
            "name": "3/4",
            "maxWeight": 15000,
            "maxVolume": 30,
            "size": 1
        }
    ],
    "vehicles": [
        {
            "name": "3/4_1",
            "vehicleType": "3/4",
            "legislationProfile": "DEFAULT",
            "availablePeriods": [
                {
                    "departureSite": "CD",
                    "arrivalSite": "CD",
                    "maxRoutesNumber": 1,
                    "timeWindow": {
                        "start": 1620298800000,
                        "end": 1620334800000
                    }
                }
            ]
        },
        {
            "name": "3/4_2",
            "vehicleType": "3/4",
            "legislationProfile": "DEFAULT",
            "availablePeriods": [
                {
                    "departureSite": "CD",
                    "arrivalSite": "CD",
                    "maxRoutesNumber": 1,
                    "timeWindow": {
                        "start": 1620298800000,
                        "end": 1620334800000
                    }
                }
            ]
        }
    ],
    "operations": [
        {
            "id": "P1",
            "weight": 2,
            "volume": 2,
            "product": "DEFAULT",
            "type": "DELIVERY",
            "depotSite": "CD",
            "customerSite": "Cliente1",
            "customerTimeWindows": [
                {
                    "start": 1620302400000,
                    "end": 1620309600000
                }
            ]
        },
        {
            "id": "P2",
            "weight": 2,
            "volume": 2,
            "product": "DEFAULT",
            "type": "DELIVERY",
            "depotSite": "CD",
            "customerSite": "Cliente2",
            "customerTimeWindows": [
                {
                    "start": 1620302400000,
                    "end": 1620309600000
                }
            ]
        },
        {
            "id": "P3",
            "weight": 2,
            "volume": 2,
            "product": "DEFAULT",
            "type": "DELIVERY",
            "depotSite": "CD",
            "customerSite": "Cliente3",
            "customerTimeWindows": [
                {
                    "start": 1620302400000,
                    "end": 1620309600000
                }
            ]
        },
        {
            "id": "P4",
            "weight": 2,
            "volume": 2,
            "product": "DEFAULT",
            "type": "DELIVERY",
            "depotSite": "CD",
            "customerSite": "Cliente4",
            "customerTimeWindows": [
                {
                    "start": 1620302400000,
                    "end": 1620309600000
                }
            ]
        },
        {
            "id": "P5",
            "weight": 2,
            "volume": 2,
            "product": "DEFAULT",
            "type": "DELIVERY",
            "depotSite": "CD",
            "customerSite": "Cliente4",
            "customerTimeWindows": [
                {
                    "start": 1620302400000,
                    "end": 1620309600000
                }
            ]
        },
        {
            "id": "P6",
            "weight": 2,
            "volume": 2,
            "product": "DEFAULT",
            "type": "DELIVERY",
            "depotSite": "CD",
            "customerSite": "Cliente6",
            "customerTimeWindows": [
                {
                    "start": 1620302400000,
                    "end": 1620309600000
                }
            ]
        },
        {
            "id": "P7",
            "weight": 2,
            "volume": 2,
            "product": "DEFAULT",
            "type": "DELIVERY",
            "depotSite": "CD",
            "customerSite": "Cliente7",
            "customerTimeWindows": [
                {
                    "start": 1620302400000,
                    "end": 1620309600000
                }
            ]
        },
        {
            "id": "P8",
            "weight": 2,
            "volume": 2,
            "product": "DEFAULT",
            "type": "DELIVERY",
            "depotSite": "CD",
            "customerSite": "Cliente8",
            "customerTimeWindows": [
                {
                    "start": 1620302400000,
                    "end": 1620309600000
                }
            ]
        },
        {
            "id": "P9",
            "weight": 2,
            "volume": 2,
            "product": "DEFAULT",
            "type": "DELIVERY",
            "depotSite": "CD",
            "customerSite": "Cliente9",
            "customerTimeWindows": [
                {
                    "start": 1620302400000,
                    "end": 1620309600000
                }
            ]
        },
        {
            "id": "P10",
            "weight": 2,
            "volume": 2,
            "product": "DEFAULT",
            "type": "DELIVERY",
            "depotSite": "CD",
            "customerSite": "Cliente10",
            "customerTimeWindows": [
                {
                    "start": 1620302400000,
                    "end": 1620309600000
                }
            ]
        }
    ],
    "trip": {
        "calculationMode": "THE_FASTEST",
        "crossedBorders": {
            "level": "CITY"
        },
        "toll": {
            "vehicleType": "TRUCK_WITH_TWO_DOUBLE_AXLES"
        },
        "freight": {
            "operationType": [
                "A",
                "D"
            ],
            "goodsType": [
                "GRANEL_LIQUIDO",
                "GRANEL_SOLIDO"
            ],
            "axis": [
                "2",
                "4"
            ],
            "roundTrip": false,
            "backEmpty": false,
            "otherCosts": [
                {
                    "name": "ICMS",
                    "type": "PERCENT",
                    "value": "5"
                },
                {
                    "name": "Lucro",
                    "type": "PERCENT",
                    "value": "20"
                },
                {
                    "name": "TaxaFixa",
                    "type": "FIXED",
                    "value": "500"
                }
            ],
            "date": "2021-10-02"
        }
    }
}


Response

Na resposta da API, em cada rota irá constar o tripId, que poderá ser consultada através do endpoint https://api.maplink.global/trip/v1/solutions/{{tripjobid}}.

A resposta abaixo encontra-se truncada para facilitar a leitura.

...