# Book all the rooms of a group for the same nights, all or none

`POST /lodging/groups/{id}/rooms` · Rivier · bookings

Book all the rooms of a group for the same nights, all or none; each room is checked before the first is made.

- Scope: bookings:write
- Mcp: rivier_lodging_group_book
- Sdk: bookings.group.book
- Cli: bookings group book
- Events: bookings.reservation.created

## Parameters

- `id` (path, required), string

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "arrival": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "departure": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "rooms": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "roomTypeId": {
            "type": "string",
            "format": "uuid"
          },
          "ratePlanId": {
            "type": "string",
            "format": "uuid"
          },
          "adults": {
            "type": "integer",
            "minimum": 1,
            "maximum": 20,
            "default": 2
          },
          "children": {
            "type": "integer",
            "minimum": 0,
            "maximum": 20,
            "default": 0
          },
          "count": {
            "type": "integer",
            "minimum": 1,
            "maximum": 50,
            "default": 1
          },
          "extras": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "extraId": {
                  "type": "string",
                  "format": "uuid"
                },
                "quantity": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 50,
                  "default": 1
                }
              },
              "required": [
                "extraId"
              ],
              "additionalProperties": false
            },
            "maxItems": 20,
            "default": []
          }
        },
        "required": [
          "roomTypeId",
          "ratePlanId"
        ],
        "additionalProperties": false
      },
      "minItems": 1,
      "maxItems": 30
    },
    "promoCode": {
      "type": "string",
      "maxLength": 24
    },
    "idempotencyKey": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    }
  },
  "required": [
    "arrival",
    "departure",
    "rooms",
    "idempotencyKey"
  ],
  "additionalProperties": false
}
```

## Responses

- `201`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X POST 'https://api.rivier.ai/lodging/groups/{id}/rooms' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "arrival": "string",
  "departure": "string",
  "rooms": [
    {
      "roomTypeId": "string",
      "ratePlanId": "string"
    }
  ],
  "idempotencyKey": "string"
}'
```
