> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chataigne.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Delivery analytics

> Compare failed deliveries, provider costs, customer fees, and delivery destinations.

```text Location theme={null}
GET /v1/locations/{location_id}/analytics/delivery
```

```text Business organization theme={null}
GET /v1/organizations/{organization_id}/analytics/delivery
```

## Statistics

| Field                      | Meaning                                                                                                                     |
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| `failed_delivery_count`    | Delivery orders that ended in a failed or canceled state during the period.                                                 |
| `provider_delivery_cost`   | Delivery fees charged to the restaurant by delivery providers.                                                              |
| `customer_delivery_fee`    | Delivery fees charged by the restaurant to customers.                                                                       |
| `delivery_fee_balance`     | `customer_delivery_fee - provider_delivery_cost`. A negative value means the restaurant absorbed part of the delivery cost. |
| `top_cities[].order_count` | Delivered orders for a destination city; available for a location, with up to ten cities.                                   |

Location amounts use the response's `currency`. Organization totals are grouped in `by_currency`, including `failed_delivery_count` in each currency bucket because the bucket represents the same set of locations.

```json Location response excerpt theme={null}
{
  "currency": "EUR",
  "summary": {
    "failed_delivery_count": 2,
    "provider_delivery_cost": 420.25,
    "customer_delivery_fee": 310,
    "delivery_fee_balance": -110.25
  },
  "top_cities": [{ "city": "Paris", "order_count": 64 }]
}
```

For a delivery report, pass `service_type=delivery`. Passing `collection` intentionally restricts order-backed values to collection orders, for which delivery fees are normally zero.
