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

# Horaires d’ouverture

> Lisez et remplacez les plannings hebdomadaires de livraison et de retrait d’un établissement.

Les horaires contiennent des plannings hebdomadaires distincts pour `delivery` et `pickup`.

| Action    | Endpoint                                        | Permission                   |
| --------- | ----------------------------------------------- | ---------------------------- |
| Lire      | `GET /v1/locations/{location_id}/opening_hours` | `openingHoursSettings.read`  |
| Remplacer | `PUT /v1/locations/{location_id}/opening_hours` | `openingHoursSettings.write` |

Chaque planning possède une clé par jour de la semaine. Un jour contient une liste de plages `{ "from": "HH:MM", "to": "HH:MM" }` ; une liste vide signifie que l’établissement est fermé. Les heures sont exprimées en heure locale, dans le fuseau configuré pour l’établissement.

<Note>
  Une plage ne peut pas dépasser minuit. Pour une ouverture le lundi de 11:00 jusqu’à 02:00 le mardi matin, configurez `monday` avec `{ "from": "11:00", "to": "23:59" }` et `tuesday` avec `{ "from": "00:00", "to": "02:00" }`.
</Note>

## Lire le planning actuel

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

## Remplacer le planning

<Warning>
  `PUT` remplace le planning. Envoyez chaque jour pour la livraison et le retrait, avec une liste vide pour les jours fermés. N’envoyez pas uniquement les jours modifiés.
</Warning>

```bash theme={null}
curl https://server.chataigne.ai/v1/locations/loc_r8v4n2c6tz/opening_hours \
  -X PUT \
  -H "x-api-key: $CHATAIGNE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "delivery": {
      "monday": [{"from":"11:30","to":"14:00"},{"from":"18:00","to":"22:30"}],
      "tuesday": [{"from":"11:30","to":"14:00"},{"from":"18:00","to":"22:30"}],
      "wednesday": [{"from":"11:30","to":"14:00"},{"from":"18:00","to":"22:30"}],
      "thursday": [{"from":"11:30","to":"14:00"},{"from":"18:00","to":"22:30"}],
      "friday": [{"from":"11:30","to":"14:00"},{"from":"18:00","to":"23:00"}],
      "saturday": [{"from":"18:00","to":"23:00"}],
      "sunday": []
    },
    "pickup": {
      "monday": [{"from":"11:00","to":"22:30"}],
      "tuesday": [{"from":"11:00","to":"22:30"}],
      "wednesday": [{"from":"11:00","to":"22:30"}],
      "thursday": [{"from":"11:00","to":"22:30"}],
      "friday": [{"from":"11:00","to":"23:00"}],
      "saturday": [{"from":"11:00","to":"23:00"}],
      "sunday": []
    }
  }'
```

Utilisez les [Fermetures exceptionnelles](/fr/location-organization-management/special-closings) pour les fermetures ponctuelles sans modifier le planning hebdomadaire récurrent.
