> For the complete documentation index, see [llms.txt](https://docs.api.beefast.eu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.api.beefast.eu/endpoints/price-estimation.md). Agents can also search and read this documentation through its [MCP server](https://docs.api.beefast.eu/~gitbook/mcp).

# Delivery Price Estimation

<mark style="color:green;">`POST`</mark> `https://api.beefast.eu/v2/delivery/estimate`

Returns the estimated amount the client will be charged for a delivery, computed with the same pricing logic used when the delivery is completed.

**Headers**

| Name                                            | Type   | Description                                              |
| ----------------------------------------------- | ------ | -------------------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | <p>The authorization header.<br>Format: Bearer TOKEN</p> |

**Request Body**

The body is a single `delivery` object.

| Name                                       | Type   | Description                                                       |
| ------------------------------------------ | ------ | ----------------------------------------------------------------- |
| delivery<mark style="color:red;">\*</mark> | Object | The delivery to estimate. Same shape as the Create Delivery body. |

**Place object** (`pickupPlace` / `dropoffPlace`)

| Name                                                 | Type   | Description                                                                                     |
| ---------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------- |
| streetAddress<mark style="color:red;">\*</mark>      | String | Full street address. Geocoded server-side when `geolocation` is omitted.                        |
| name<mark style="color:red;">\*</mark>               | String | Contact/location name.                                                                          |
| contactPhoneNumber<mark style="color:red;">\*</mark> | String | Contact phone number.                                                                           |
| addressDetails                                       | String | Extra details (floor, apartment, notes).                                                        |
| geolocation                                          | Object | `{ latitude: Float, longitude: Float }`. When provided, it is used as-is and no geocoding runs. |

{% tabs %}
{% tab title="200 The estimate" %}

```javascript
{
  "estimatedAmount": 34.5
}
```

{% endtab %}

{% tab title="400 Bad Request" %}
The request body could not be parsed (e.g. a field has the wrong type). Returned as an array of error objects.

```javascript
[
  {
    "message": "Variable \"$delivery\" got invalid value \"10\" at \"delivery.cashOnDeliveryAmount\"; Float cannot represent non numeric value: \"10\""
  }
]
```

{% endtab %}

{% tab title="500 Request failed" %}
The estimate could not be produced. The body is an array of error objects; read `message` for the reason.

```javascript
[
  {
    "message": "Client has no tariff configured."
  }
]
```

Other messages you may receive:

* `"A client is required!"`
* `"Request unauthorized!"`
* `"The requesting client is disabled!"`
* `"Either pickupAddressID or pickupPlace must be provided!"`
* `"Either dropoffAddressID or dropoffPlace must be provided!"`
* `"Pickup streetAddress required!"`
* `"Dropoff streetAddress required!"`
* `"Address could not be geocoded: <address>"`
  {% endtab %}
  {% endtabs %}

#### Example

```bash
curl -X POST 'https://api.beefast.eu/v2/delivery/estimate' \
  -H 'Authorization: Bearer TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
        "delivery": {
          "cashOnDeliveryAmount": 0,
          "weightKg": 2,
          "deliveryType": "NOW",
          "pickupPlace": {
            "name": "Warehouse",
            "contactPhoneNumber": "+40700000000",
            "streetAddress": "Strada Exemplu 1, Bucuresti"
          },
          "dropoffPlace": {
            "name": "Ana Popa",
            "contactPhoneNumber": "+40711111111",
            "streetAddress": "Bulevardul Exemplu 25, Bucuresti"
          }
        }
      }'
```

Response:

```javascript
{
  "estimatedAmount": 34.5
}
```
