Viabilidade - API Lojaz Delivery

GET

-

Consultar Viabilidade

PATH

{{BASE_URL}}/availability

Query

token: Bearer Token
originLat: Latitude de origem
originLng: Longitude de origem
destinationLat: Latitude de destino
destinationLng: Longitude de destino
weight: Peso dos carrinho (Opcional em grama)

Exemplo em NodeJS:

const axios = require('axios'); const checkAvailability = async () => { try { const { data } = await axios.get('BASE_URL/availability', { params: { originLat: -22.89812026847072, originLng: -43.3444589826631, destinationLat: -22.885682778258467, destinationLng: -43.352142653561856 } }); return data; } catch (error) { console.error(error); } }; module.exports = checkAvailability;

Response - OK (200)

{
  "status": true,
  "data": {
    "deliveryInRange": 1,
    "acceptRate": 6.5,
    "shortText": "Weslley pode entregar seu pedido em 30 a 60 minutos",
    "banners": {
      "white": {
        "square": "",
        "rounded": "",
        "horizontalSquare": "",
        "horizontalRounded": ""
      },
      "black": {
        "square": "",
        "rounded": "",
        "horizontalSquare": "",
        "horizontalRounded": ""
      }
    }
  }
}

Content-Type: application/json

Response - Padrão de erro (200)

{
  "status": false,
  "message": "Nenhum motoboy encontrado no raio de 9Km"
}

Content-Type: application/json