# Creates a booking sheet

`POST /api/booking-sheets`

- **Products:** Operator (`FOH`)
- **Features:** Front of House Generic Access (`FOHGENERIC`)

HTML version: [Creates a booking sheet](https://support.gladstonesoftware.cloud/reference/bookings/creates-a-booking-sheet)

## Overview

Creates a booking sheet: a named group of products, held at one site, that the other
booking-sheet endpoints then report bookings and exceptions against.

You may supply your own `id` or have one allocated. When `id` is omitted the
next sequential identifier with the `PRCP` prefix is generated. Either way the sheet's
identifier is returned in the `Location` header of the `201 Created` response, and it is
the value you pass as `{id}` to the other booking-sheet endpoints.

The sheet is filed against a site group as well as a site: the site group that contains
`siteId` is used, and created if none exists.

**Use this endpoint to:**

- Define a new group of resources to be managed together on a booking sheet
- Register a booking sheet under an identifier your own system controls

## Endpoint

`POST {base_url}/api/booking-sheets`

`{base_url}` is the environment URL issued to your integration. See [Authenticating with Gladstone APIs](../../guides/authenticating-with-gladstone-apis.md).

## Request body

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `id` | string | No | Your own identifier for the new booking sheet, maximum 15 characters. It must be unique and must not contain any of `!£$%^&*()_+=[]{};:@~#?.,<>\|` — either fault returns `400`. Omit it and the next free identifier prefixed `PRCP` is generated. |
| `description` | string | Yes | The sheet's display description. Must not be blank and cannot exceed 255 characters. |
| `siteId` | string | Yes | The site the booking sheet belongs to. Must not be blank and cannot exceed 15 characters. The sheet is also filed under the site group covering this site, which is created if none exists. |
| `products` | array of string | Yes | The IDs of the products that make up the sheet — the resources whose bookings this sheet groups together. At least one is required; an empty array or an omitted field is rejected with `One or more Products must be specified`. Each product is added to the sheet with a quantity of `0`. Product IDs are not checked individually, so an unknown product returns the `400` "A database error occurred" response rather than a specific message. |

## Sample request

```bash title="cURL"
curl -X POST '{base_url}/api/booking-sheets' \
  -H 'Authorization: Bearer {accessToken}' \
  -H 'X-Use-SSO: true' \
  -H 'Content-Type: application/json' \
  -d '{
  "id": "string",
  "description": "string",
  "siteId": "string",
  "products": [
    "string"
  ]
}'
```

## Errors

| Status | Meaning | When |
|--------|---------|------|
| `400` | Bad request | The ID supplied contains one or more invalid characters. An ID cannot contain any of the characters !£$%^&*()_+=[]{};:@~#?.,<>\|. A database error occurred. Please ensure that the ID supplied is unique. |
| `500` | Internal server error | |
