# Cotizar Servicio

## Cotizar valor servicio

<mark style="color:green;">`POST`</mark> `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. |

{% tabs %}
{% tab title="200 Cake successfully retrieved." %}

```javascript
{
    "status": "ok",
    "distance": 2000,
    "price": 24000,
    "estimate": 301
}
```

{% endtab %}
{% endtabs %}

## Ejemplo en php

```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;
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://apidocs.rapigo.co/api/cotizar-servicio.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
