> ## 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 settings

> Configure fulfillment availability, delivery providers, fees, zones, and order limits.

Delivery settings control whether a location offers delivery and pickup and how delivery requests are priced and fulfilled.

| Action | Endpoint                                              | Permission               |
| ------ | ----------------------------------------------------- | ------------------------ |
| Read   | `GET /v1/locations/{location_id}/delivery_settings`   | `deliverySettings.read`  |
| Update | `PATCH /v1/locations/{location_id}/delivery_settings` | `deliverySettings.write` |

## Read the current settings

```bash theme={null}
curl https://server.chataigne.ai/v1/locations/loc_r8v4n2c6tz/delivery_settings \
  -H "x-api-key: $CHATAIGNE_API_KEY"
```

The response describes availability, the selected provider and fee strategy, geographic eligibility, order limits, and provider-specific options. Read it before changing a related group of fields.

`provider` is `null` when fulfillment is managed by a provider that is not configurable through the public API. In that case, leave `provider` out of `PATCH` requests; the other public delivery settings remain readable and writable.

## Fee strategies

`fee_strategy` determines the delivery fee displayed and charged to the customer:

| Value               | Behavior                                                                                                                                  | Related fields      |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ------------------- |
| `postalCode`        | Applies the fixed fee configured for the delivery address's postal code.                                                                  | `postal_codes`      |
| `deliveryZone`      | Applies the fixed fee of the geographic zone containing the delivery address.                                                             | `delivery_zones`    |
| `percentage`        | The customer pays the configured share of the provider's real fee and the location covers the remainder. For example, `0.7` means 70%.    | `fee_percentage`    |
| `customerPaysAll`   | The customer pays the provider's full real delivery fee.                                                                                  | No additional field |
| `restaurantPaysAll` | The customer is charged no delivery fee; the location covers the full cost.                                                               | No additional field |
| `smart`             | Automatically calculates the customer fee from distance and applies the smart pricing configuration.                                      | `smart_parameters`  |
| `distanceRange`     | Uses the first bracket whose `up_to_km` includes the distance; each bracket defines its displayed fee and can set a minimum order amount. | `distance_ranges`   |

## Update selected fields

`PATCH` preserves omitted fields. The following request enables delivery and pickup, uses restaurant-managed delivery, limits the delivery radius, and sets minimum and maximum subtotals:

```bash theme={null}
curl https://server.chataigne.ai/v1/locations/loc_r8v4n2c6tz/delivery_settings \
  -X PATCH \
  -H "x-api-key: $CHATAIGNE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "delivery_enabled": true,
    "pickup_enabled": true,
    "provider": "handledByStore",
    "fee_strategy": "distanceRange",
    "max_delivery_radius_in_km": 8,
    "min_order_amount": 15,
    "max_order_amount": 120,
    "collection_max_order_amount": 200,
    "max_items_number": 30
  }'
```

## Clearing values

Nullable fields can be set to `null` to clear or reset them. For example, this removes the location-level delivery subtotal cap while preserving all other fields:

```json theme={null}
{
  "max_order_amount": null
}
```

Provider-specific limits can still apply after a location-level limit is cleared. Consult the API reference for every supported fee strategy and its corresponding fields.
