Cotizar Servicio
Función para cotizar el valor del servicio
Cotizar valor servicio
POST https://www.rapigo.co/api/v1/estimate/
Función para cotizar el valor del servicio
Headers
Name
Type
Description
Authentication
string
Token Basic Auth
Request Body
Name
Type
Description
city_id
string
points
array
array formato json, de las direcciones de recogida y entrega.
{
    "status": "ok",
    "distance": 2000,
    "price": 24000,
    "estimate": 301
}Ejemplo en php
<?php
$request = new HttpRequest();
$request->setUrl('https://www.rapigo.co/api/bogota/estimate/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
  'postman-token' => '62e4553c-9ff8-a703-3571-1b1752d6ea2e',
  'cache-control' => 'no-cache',
  'content-type' => 'application/json',
  'authorization' => 'Basic anVsaWFuQHJhcGlnby5jbzpjb2xvbWJpYTEyMjQ='
));
$request->setBody('{
  "points": [
    {
        "address" : "Carrera 18 #148-69",
        "type" :"point",
        "description" : "Recoger 2 paquetes",
        "phone" : "3147445189"
    },
    {
        "address" : "Av 9 #104",
        "type" :"point",
        "description" : "Recoger 2 paquetes",
        "phone" : "3147445189"
    }
]
}');
try {
  $response = $request->send();
  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}Última actualización