Integração frete Omnik

A omnik oferta uma interação para cotação de frete onde é cadastrado o endpoint do parceiro e o mesmo deve receber um payload e responder com o contrato já definido.

Liberar acessos aos IPs da Omnik
SAND (us-west-2): 34.208.201.196/32 35.84.115.152/32 44.237.254.187/32 52.42.89.220/32 54.68.50.205/32 
PROD (us-west-2): 34.208.201.196/32 35.165.35.71/32 44.231.195.225/32 44.240.171.28/32 54.149.219.155/32 
PROD (us-east-1): 3.212.27.23/32 3.228.93.46/32 34.194.89.63/32 34.231.89.224/32 52.203.145.51/32 52.5.19.10/32

Request

curl --location 'https: //seuDominio/freteSeller' \
--header 'Content-Type: application/json' \
--data '{
    "originZipCode": "string", //cep origem
    "destinationZipCode": "string", //cep destino
    "products": [ // produtos
        {
            "skuId": "string", // skuid
            "sellerTenant": "string", //tenant seller
            "category": "string", //categoria
            "weight": null, //peso
            "width": null, //largura
            "height": null, //altura
            "length": null, //comprimento
            "quantity": null, //quntidade
            "cost": null // custo/preço
        }
    ]
}

Response

Para os campos abaixo foi mapeado nos comentários a obrigatoriedade e qual campo do antigo retorno deve ser mapeado para um campo específico.

{
    "statusHttp": 200, //sempre 200
    "status": "string", //sempre ok
    "messages": [ // opcional, informações para o integrador
        //[ { "type": "INFO", "key": "NO_DELIVERY_OPTIONS", "text": "Nenhuma opção de frete disponível para o CEP informado.", "sellerTenant": "string" } ]
        {
            "type": "string",
            "key": "string",
            "text": "string",
            "sellerTenant": "string"
        }
    ],
    "content": {
        "sellerTenant": "string", // o id seller omink
        "destinationZipCode": 1415906, //cep destino
        "platform": "string", //plataforma: mobile
        "quotationId": "string", // opcional
        "deliveryOptions": [
            {
                "deliveryMethodId": "string",//shippingMethodId
                "deliveryMethodName": "string",//shippingMethodDisplayName
                "deliveryTime": 1,//Dias para entregar transit+ expedition
                "deliveryTimeType": "bd", // bd
                "deliveryMode": "ENUM", //optional
                "deliveryEstimateBusinessDays": 1, //optional
                "finalShippingCost": 0,//shippingCost
                "deliveryEstimatedDateExact": 1,//Dias para entregar  transit+ expedition
                "deliveryEstimatedDateExactIso": "2025-09-08",//Dias para entregar  transit+ expedition
                "pickupPointInfo": [ // opcional
                    {
                        "id": "string",
                        "name": "string",
                        "instructions": "string",
                        "description": "string",
                        "address": {
                            "id": "string",
                            "externalId": "string",
                            "zipCode": "string",
                            "city": {
                                "name": "string"
                            },
                            "state": {
                                "name": "string",
                                "initials": "string",
                                "ibgeCode": "string"
                            },
                            "street": "string",
                            "number": "string",
                            "complement": "string",
                            "neighborhood": "string",
                            "country": "string",
                            "latitude": null,
                            "longitude": null
                        },
                        "businessHours": [
                            {
                                "dayOfWeek": "ENUM",
                                "openingTime": "string",
                                "closingTime": "string"
                            }
                        ],
                        "businessHoursExceptions": [
                            {
                                "date": "string",
                                "startTime": "string",
                                "endTime": "string",
                                "name": "string"
                            }
                        ]
                    }
                ],
                "availableDeliveryWindows": [// opcional
                    {
                        "date": "string",
                        "startTime": "string",
                        "endTime": "string"
                    }
                ]
            }
        ],
        "products": [
            {
                "skuId": "string", //skuid
                "sellerTenant": "string", //seu proprio tenant
                "skuIntegration": "string" //opcional
            }
        ]
    },
    "time": "string", //duração de request
    "timezone": "string", //timezone
    "locale": "string" //lingua local
}

Comparação

Request

As Is

{
    "destinationZip": 5711000,
    "volumes": [
        {
            "sku": "PRD9999999999",
            "height": 0.038,
            "length": 0.082,
            "width": 0.016,
            "weight": 0.32,
            "quantity": 2,
            "price": 45.0
        }
    ]
}

To be

{
    "originZipCode": "13555122", //cep origem
    "destinationZipCode": "5711000", //cep destino
    "products": [ // produtos
        {
            "skuId": "PRD9999999999", // skuid
            "sellerTenant": "TALD99999999999", //tenant seller
            "category": "string", //categoria opcional
            "weight": 0.32, //peso
            "width": 0.016, //largura
            "height": 0.038, //altura
            "length": 0.082, //comprimento
            "quantity": 2, //quntidade
            "cost": 50.0 // custo/preço
        }
    ]
}

Response

As Is

{
    "shippingQuotes": [
        {
            "shippingMethodType": "regular",
            "shippingCost": 0.0,
            "shippingMethodId": "jadlog",
            "shippingMethodName": "standard",
            "shippingMethodDisplayName": "Normal",
            "deliveryTime": {
                "transit": 60,
                "expedition": 2
            }
        },
        {
            "shippingMethodType": "express",
            "shippingCost": 0.0,
            "shippingMethodId": "jadlog",
            "shippingMethodName": "express",
            "shippingMethodDisplayName": "Expresso",
            "deliveryTime": {
                "transit": 60,
                "expedition": 2
            }
        }
    ]
}

To be

{
    "content": {
        "additionalInformation": null,
        "cached": false,
        "deliveryOptions": [
            {
                "deliveryEstimatedDateExact": 60,
                "deliveryEstimatedDateExactIso": "60",
                "deliveryEstimatedDateMax": 60,
                "deliveryEstimatedDateMaxIso": "60",
                "deliveryMethodId": "jadlog",
                "deliveryMethodName": "Normal",
                "deliveryTime": 60,
                "deliveryTimeType": "bd",
                "finalShippingCost": 0
            }
        ],
        "destinationZipCode": "04252040",
        "originZipCode": null,
        "identification": null,
        "platform": "mobile",
        "products": [
            {
                "sellerTenant": "TALD99999999999",
                "skuId": "PRD9999999999",
                "skuIntegration": null,
                "weight": 124.75,
                "quantity": 1,
                "cost": 1144.43,
                "height": 0.178,
                "width": 0.625,
                "length": 2.135,
                "stock": null
            }
        ],
        "sellerTenant": "TALD99999999999",
        "volumes": []
    },
    "locale": "en",
    "messages": [],
    "status": "OK", // sempre OK
    "statusHttp": 200, // sempre 200
    "time": "13", //quanto tempo levou  para calcular
    "timezone": "America/Sao_Paulo"
}

Last updated