Cotizar Servicio

Función para cotizar el valor del servicio

post
Cotizar valor servicio

https://www.rapigo.co/api/v1/estimate/
Función para cotizar el valor del servicio
Request
Response
Request
Headers
Authentication
required
string
Token Basic Auth
Body Parameters
city_id
optional
string
points
required
array
array formato json, de las direcciones de recogida y entrega.
Response
200: OK
Cake successfully retrieved.
{
"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;
}