> For the complete documentation index, see [llms.txt](https://docs.podplay.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.podplay.app/api/use-cases/use-case-create-a-1-hour-open-play-event/step-3-create-the-booking-event.md).

# Step 3 — Create the Booking (Event)

Now that you have selected the correct sessions and extracted:

* `sessionId`
* `sessionTableId`

You can create the actual event booking.

This request links one or more consecutive sessions to the selected court and publishes the event.

### Create the Booking Request

To create the event, send a `POST` request to:

```
POST /bookings
```

Full URL:

```
https://sandbox1.podplay.app/apis/v2/bookings
```

You must include:

* The event configuration (type, subtype, status, etc.)
* An `items[]` array
* One object per session being booked

### Example — 1-Hour Open Play Event

```
curl -sS -X POST \
  -H "x-api-key: <your-api-key>" \
  -H "Content-Type: application/json" \
  "https://sandbox1.podplay.app/apis/v2/bookings" \
  -d '{
    "type": "ORDER",
    "eventSubtype": "OPEN_PLAY",
    "bookingMode": "FREE_OF_CHARGE",
    "eventName": "Open Play Session",
    "eventStatus": "PUBLISHED",
    "admission": "OPEN",
    "admissionRate": {
      "regular": 0,
      "membersDefault": 0,
      "chargingStrategy": "SPOT"
    },
    "totalTeams": 0,
    "teamSize": 0,
    "termsAgreed": true,
    "liabilityWaiverAgreed": true,
    "eventFeatures": [],
    "items": [
      {
        "session": {
          "id": "b066d668-e64f-480a-ad31-110b3433c080@1772643600000"
        },
        "sessionTable": {
          "id": "b066d668-e64f-480a-ad31-110b3433c080@61e3f1c2-d23b-4eb3-bebb-77c4eeda6d03@1772643600000"
        }
      },
      {
        "session": {
          "id": "b066d668-e64f-480a-ad31-110b3433c080@1772645400000"
        },
        "sessionTable": {
          "id": "b066d668-e64f-480a-ad31-110b3433c080@61e3f1c2-d23b-4eb3-bebb-77c4eeda6d03@1772645400000"
        }
      }
    ]
  }'
```

#### Understanding the Payload

The booking request contains two main parts:

1. **Event configuration**
2. **Session allocation (`items[]`)**

#### Event Configuration Fields

<table><thead><tr><th width="171.0390625">Field</th><th width="234.34375">Value</th><th>Notes</th></tr></thead><tbody><tr><td><code>type</code></td><td><code>"ORDER"</code></td><td><strong>Required.</strong> Use <code>"ORDER"</code> when creating an event booking.</td></tr><tr><td><code>eventSubtype</code></td><td><code>"OPEN_PLAY"</code></td><td>Defines the event category (e.g. <code>"OPEN_PLAY"</code>, <code>"ADULT_CLASS"</code>).</td></tr><tr><td><code>bookingMode</code></td><td><code>"FREE_OF_CHARGE"</code></td><td><strong>Required for events.</strong> Indicates no payment is collected.</td></tr><tr><td><code>eventStatus</code></td><td><code>"PUBLISHED"</code> or <code>"DRAFT"</code></td><td><code>"PUBLISHED"</code> makes the event visible to users. <code>"DRAFT"</code> keeps it hidden.</td></tr><tr><td><code>admission</code></td><td><code>"OPEN"</code> or <code>"MEMBERS_ONLY"</code></td><td><code>"OPEN"</code> allows all players to join. <code>"MEMBERS_ONLY"</code> restricts participation.</td></tr></tbody></table>

#### Session Allocation (`items[]`)

The `items[]` array defines **which sessions are being booked**.

Each object inside `items[]` represents:

* One session
* One specific court allocation for that session

Each item must contain:

* A `session.id`
* The corresponding `sessionTable.id`

These values are **not generated here** — they come directly from **Step 2**, when you retrieved available sessions and matched them to your selected `tableId`.

**Structure**

```
{
  "items": [
    {
      "session": { "id": "<sessionId_from_step_2>" },
      "sessionTable": { "id": "<sessionTableId_from_step_2>" }
    }
  ]
}
```

In this example, the two session objects used in the booking request are exactly the ones retrieved in Step 2 for:

```
17:00 → 17:30 UTC
17:30 → 18:00 UTC
```

### How This Looks in the Admin Dashboard (EST Time)

After the booking is successfully created, the event becomes visible in the Admin calendar view.

Below is the Open Play event created for:

* **March 4th**
* **17:00 → 18:00 UTC**
* Which corresponds to:
  * **12:00 → 13:00 EST (New York)**

<figure><img src="https://storage.googleapis.com/podplay-gitbook/assets/api-create-event-case-step3-event-in-calender.png" alt=""><figcaption></figcaption></figure>

<figure><img src="https://storage.googleapis.com/podplay-gitbook/assets/api-create-event-case-step3-event-drawer.png" alt=""><figcaption></figcaption></figure>

### Step 3 Completed — Event Successfully Created

At this point:

* The booking request has been accepted (`201 Created`)
* The Open Play event is visible in the Admin dashboard
* The two 30-minute sessions are combined into one 1-hour event
* The event is scheduled on:
  * **March 4th**
  * **12:00 → 13:00 EST**
  * **Court 1 (C1)**

The API and the Admin UI now reflect the same state.

In the next step, we will verify the event programmatically using the Events endpoint.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.podplay.app/api/use-cases/use-case-create-a-1-hour-open-play-event/step-3-create-the-booking-event.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
