> Fetch the complete documentation index at: https://padeldeskapp.com/llms.txt
> HTML version: https://padeldeskapp.com/docs/integrations/bookings
> Türkçe: https://padeldeskapp.com/docs/integrations/bookings/tr.md

# Booking Source API

Version 0.2.1 · 13 October 2026

This document defines the API a booking source must offer so that a venue can connect it to its front desk system, Padel Desk.

- Every booking of the venue at the booking source reaches the front desk.
- Bookings made at the front desk reach the booking source; the same court is not sold twice.
- The venue's setup comes from one place: Padel Desk sends the profile, opening hours, courts, booking rules and prices. The venue does not enter them again at the booking source.

This page is a summary. The exact definition is the OpenAPI 3.1 file; it has every endpoint, field and error code.

[OpenAPI file (YAML)](https://padeldeskapp.com/docs/integrations/bookings.openapi.yaml)

Contact: More Padel, [info@morepadel.co](mailto:info@morepadel.co)

Base URL: `https://BOOKING_SOURCE_API_BASE_URL`

## Definitions

- A venue is a padel club.
- Padel Desk is the venue's front desk system: reservation board, checks, payments and end-of-day reconciliation.
- A booking source is the platform where players or staff reserve the venue's courts.
- A block is an interval in which a court is closed. A block is not a booking.
- A slot is an interval that comes from the setup: the opening hours, and the court's booking lengths and start step. A slot can be taken or free.

This document is open to comment. Field names and shapes are a proposal; the data and the operations are the requirement.

## Connection

The booking source gives the venue two values: the base URL of this API and the venue's token. The venue enters them in Padel Desk. No one signs in to the booking source to finish the connection, and no setting is typed in there.

Padel Desk then:

1. Reads `GET /venue` to confirm the token and the venue.
2. Sends its webhook URL and a signing secret with `PUT /webhook`.
3. Reads `GET /courts`. The venue matches each court that already exists at the booking source to a court in Padel Desk, once, in Padel Desk.
4. Sends the venue's setup with `PUT /setup`.
5. Reads the slots the booking source builds from the setup with `GET /slots` and compares them with its own.
6. Reads the bookings and blocks, and follows changes through events.

When the venue disconnects in Padel Desk, Padel Desk calls `DELETE /webhook`. The booking source then sends no more events. The applied setup stays as it is, and the venue may change it at the booking source again. Bookings and blocks that Padel Desk created stay. When the venue connects again, Padel Desk repeats the steps above. It raises `version` on every connection, so the booking source applies the setup again and replaces any value the venue changed there meanwhile.

The `GET /events` feed does not depend on the webhook: the booking source records events also while no webhook is set.

**Authentication**

```
Authorization: Bearer <venue token>
```

## Setup

Padel Desk is the single source of the venue's setup. The setup is one document: the venue's profile, opening hours, courts with their booking rules, and prices. The booking source applies the whole document or none of it, and shows its players what the document says.

- Venue: name, timezone, currency, address, location, phone, logo and icon.
- Opening hours: open and close for each weekday.
- Courts: Padel Desk's id, number, name, type (indoor or outdoor; double or single), state, booking lengths and start step.
- Prices: rules by court, weekdays, time range and booking length.

While a venue is connected, the booking source does not change these values on its own side. When the venue changes one in Padel Desk, Padel Desk sends the whole document again with a higher `version`.

The connection works only while the slots agree. If the slots of the booking source differ from those of Padel Desk, Padel Desk shows the venue the difference and exchanges no bookings until they agree. Because the slots agree, a booking that Padel Desk creates always fits them.

The booking source keeps its own rules for players: how far ahead they book, and its cancellation and refund policy.

## Rules

- Each venue has one token.
- The token gives access to every booking and every block of that venue.
- The venue is the authority over its courts. Padel Desk may move, extend or cancel any booking of the venue and remove any block of the venue, whoever created it. Padel Desk sets the venue's setup. It does not change a booking's customer, players, price or payment.
- All times are UTC, written with `Z` and millisecond precision. An interval includes its start and excludes its end. A queried range is at most 31 days.
- All amounts are in the minor unit of the currency; kuruş for TRY.
- Identifiers are opaque strings and do not change for the life of the record.
- An unknown id in a path returns 404. An unknown or inactive court in the body of a booking or block request returns 422.
- When Padel Desk sends the same reference again, the booking source does not create a second booking. It returns the booking that reference created, in its current state. The booking source compares the repeated request with the first request of that reference, not with the record as it is now. The same court, start and end return that booking even after it was moved or cancelled.
- A taken interval returns `interval_taken`. A reference that was used for another court or time returns `reference_reused`.
- Lists are paged with `limit` and `cursor`. `nextCursor` in the response is `null` on the last page.
- Rate limits apply to the token, not to the IP address. A 429 response carries `Retry-After` in seconds.
- Padel Desk may create a booking that continues after midnight.
- Every booking that Padel Desk creates, moves or extends is one slot of the court: it starts on a start step, its length is one of the court's `durations`, and it ends at or before the close. Any other interval returns 422.
- Padel Desk may book after the end of the booking window that applies to players.
- The booking source may add fields and enum values. Any other change needs a new version.
- A sandbox with a test venue and a test token is required before go-live.

**Error response**

```json
{
  "error": "interval_taken",
  "message": "Court crt_1 is taken for this interval."
}
```

## Booking states

- `PENDING` — Awaiting confirmation at the booking source, for example a payment in progress. It occupies the court. It becomes `CONFIRMED` or `CANCELLED`.
- `CONFIRMED` — The court is reserved. It can become `CANCELLED`.
- `CANCELLED` — Final. It does not occupy the court and cannot be moved; a move returns 409.

A booking created through this API is `CONFIRMED` at once. Cancelling a cancelled booking and removing a removed block both succeed.

## Privacy

Padel Desk sends no customer name, phone number or email address to the booking source. A booking that Padel Desk creates is only an occupied interval at the booking source. It has no customer, players or price.

Padel Desk creates regular and lesson bookings only. Open matches and tournaments start at the booking source; Padel Desk receives them.

The venue needs the customer and player data of its bookings to receive the customer, open their check and reach them. Padel Desk holds that data on the venue's behalf. Padel Desk does not pass it to another booking source.

## Read the venue

`GET /venue`

Returns the venue the token belongs to. Padel Desk uses it to confirm the token.

### Responses

- **200** Venue

### Response example

```json
{
  "id": "ven_more",
  "name": "More Padel",
  "timezone": "Europe/Istanbul",
  "currency": "TRY"
}
```

## List the courts at the booking source

`GET /courts`

Returns the venue's courts that already exist at the booking source. The venue matches them to the courts in Padel Desk. `reference` is `null` until a setup names the court.

### Query parameters

| Field | Type | Description |
| --- | --- | --- |
| `limit` | integer | 1 to 100; default 50. |
| `cursor` | string | The nextCursor value of the previous response. |

### Responses

- **200** Page of courts

### Response example

```json
{
  "items": [
    {
      "id": "crt_1",
      "name": "Kort 1",
      "active": true,
      "reference": "pd_crt_1"
    }
  ],
  "nextCursor": null
}
```

## Set the venue’s setup

`PUT /setup`

Replaces the whole setup. The booking source applies all of it or none of it.

- A court with a `courtId` updates that existing court. A court without one is created, unless a court with the same `reference` exists. A `courtId` that the booking source does not know, or a `reference` that belongs to another court, returns 422.
- A court that is absent from the document becomes inactive. No court is deleted. `GET /setup` returns the document as applied and leaves that court out; `GET /courts` still lists it with `active: false`.
- Bookings that exist outside the new opening hours, or on a court that becomes inactive, stay as they are.
- A closure on one date is a block, not a change of setup.
- Prices apply to bookings made after the call; the price of an existing booking does not change.
- The booking source compares content with the request body it last applied, as Padel Desk sent it. The same `version` with the same content succeeds again. The same `version` with different content, or a lower `version`, returns 409. `version` is compared with the applied setup only: a setup that was refused was never applied, so Padel Desk may send its `version` again with corrected content.
- A booking source that cannot apply a value returns 422, names the field in `message` and applies nothing. Examples: a court with more than one booking length, a close after midnight, or price rules that overlap.
- A price rule covers a booking when the court, the weekday, the start time and the length all match. The weekday is that of the venue day: a booking at 01:00 after Friday's opening is a Friday booking. Two rules never cover the same booking. A slot that no rule covers stays a slot, but the booking source does not offer it to players.

The request body is a [Setup](#model-setup) document; its fields are listed there.

### Responses

- **200** Applied setup, with the booking source’s id on every court
- **409** conflict: a lower version, or the same version with different content
- **422** unprocessable: the booking source cannot apply a value; message names the field

### Request example

```json
{
  "version": 7,
  "venue": {
    "name": "More Padel",
    "timezone": "Europe/Istanbul",
    "currency": "TRY",
    "address": {
      "line": "Örnek Sokak 1",
      "city": "İstanbul",
      "country": "TR"
    },
    "location": {
      "latitude": 41.0082,
      "longitude": 28.9784
    },
    "phone": "+902120000000",
    "logoUrl": "https://padeldeskapp.com/venues/more-padel/logo.png",
    "iconUrl": "https://padeldeskapp.com/venues/more-padel/icon.png"
  },
  "openingHours": [
    {
      "open": "09:00",
      "close": "03:00"
    },
    {
      "open": "09:00",
      "close": "03:00"
    },
    {
      "open": "09:00",
      "close": "03:00"
    },
    {
      "open": "09:00",
      "close": "03:00"
    },
    {
      "open": "09:00",
      "close": "03:00"
    },
    {
      "open": "08:00",
      "close": "03:00"
    },
    null
  ],
  "courts": [
    {
      "reference": "pd_crt_1",
      "courtId": "crt_1",
      "number": 1,
      "name": "Kort 1",
      "environment": "OUTDOOR",
      "format": "DOUBLE",
      "active": true,
      "durations": [
        90
      ],
      "startStep": 90
    }
  ],
  "prices": [
    {
      "courtReference": "pd_crt_1",
      "weekdays": [
        1,
        2,
        3,
        4,
        5,
        6
      ],
      "from": "08:00",
      "to": "18:00",
      "duration": 90,
      "price": {
        "amountMinor": 120000,
        "currency": "TRY"
      }
    },
    {
      "courtReference": "pd_crt_1",
      "weekdays": [
        1,
        2,
        3,
        4,
        5,
        6
      ],
      "from": "18:00",
      "to": "03:00",
      "duration": 90,
      "price": {
        "amountMinor": 180000,
        "currency": "TRY"
      }
    }
  ]
}
```

## Read the applied setup

`GET /setup`

Returns the setup the booking source has applied. Padel Desk uses it to confirm what is applied.

### Responses

- **200** Applied setup
- **404** No setup has been sent yet

## Read the slots of one day

`GET /slots`

Returns every slot of each active court on the venue day that opens on the given date, taken or not. Slots come from the setup only: the opening hours, and each court's `durations` and `startStep`. A slot starts on a start step and ends at or before the close. Prices, the players' booking window, the current time, bookings and blocks do not add or remove slots. A court that accepts more than one booking length returns a slot for each start and length.

Padel Desk compares these with its own slots; the connection works only while they agree. Padel Desk may book any slot, also one that no price rule covers. `GET /availability` tells which are taken. The example response shows only the first two of the day's 12 slots.

### Query parameters

| Field | Type | Description |
| --- | --- | --- |
| `date` (required) | date | Venue-local date; for example 2026-10-13. |
| `courtId` | string | Only this court. |

### Responses

- **200** Slots

### Response example

```json
{
  "items": [
    {
      "courtId": "crt_1",
      "start": "2026-10-13T06:00:00.000Z",
      "end": "2026-10-13T07:30:00.000Z"
    },
    {
      "courtId": "crt_1",
      "start": "2026-10-13T07:30:00.000Z",
      "end": "2026-10-13T09:00:00.000Z"
    }
  ]
}
```

## Read busy intervals

`GET /availability`

Returns everything that prevents a booking in the range: bookings, blocks and temporary holds. An interval that is absent here is only a candidate; the create request does the final check.

### Query parameters

| Field | Type | Description |
| --- | --- | --- |
| `from` (required) | date-time | Start of the range. |
| `to` (required) | date-time | End of the range; this instant is not included. |
| `courtId` | string | Only this court. |

### Responses

- **200** Busy intervals

### Response example

```json
{
  "items": [
    {
      "courtId": "crt_1",
      "start": "2026-10-13T16:30:00.000Z",
      "end": "2026-10-13T18:00:00.000Z"
    }
  ]
}
```

## List all bookings of the venue

`GET /bookings`

Includes bookings made by players, past bookings and cancelled bookings. Supply a range (`from` and `to`) or a `reference`; a request with neither returns 400. A range returns the bookings that overlap it. Used for the first import and for reconciliation; changes arrive as events.

### Query parameters

| Field | Type | Description |
| --- | --- | --- |
| `from` | date-time | Start of the range. |
| `to` | date-time | End of the range; this instant is not included. |
| `courtId` | string | Only this court. |
| `reference` | string | Exact match. Finds a booking whose create response was lost. |
| `limit` | integer | 1 to 100; default 50. |
| `cursor` | string | The nextCursor value of the previous response. |

### Responses

- **200** Page of bookings

### Response example

```json
{
  "items": [
    {
      "id": "bkg_8f2c",
      "courtId": "crt_1",
      "start": "2026-10-13T16:30:00.000Z",
      "end": "2026-10-13T18:00:00.000Z",
      "status": "CONFIRMED",
      "type": "OPEN_MATCH",
      "origin": "PLAYER",
      "reference": null,
      "note": null,
      "customer": {
        "userId": "usr_41",
        "name": "Ada Yılmaz",
        "phone": "+905550000000",
        "email": "ada@example.com"
      },
      "players": [
        {
          "userId": "usr_41",
          "name": "Ada Yılmaz",
          "phone": "+905550000000",
          "email": "ada@example.com",
          "team": 1,
          "position": 1,
          "amountPaid": {
            "amountMinor": 45000,
            "currency": "TRY"
          }
        }
      ],
      "price": {
        "amountMinor": 180000,
        "currency": "TRY"
      },
      "payment": {
        "status": "PARTIALLY_PAID",
        "amountPaid": {
          "amountMinor": 45000,
          "currency": "TRY"
        },
        "amountRefunded": {
          "amountMinor": 0,
          "currency": "TRY"
        },
        "method": "CARD"
      },
      "cancelledAt": null,
      "cancelledBy": null,
      "createdAt": "2026-10-12T09:14:03.120Z",
      "updatedAt": "2026-10-12T09:14:03.120Z"
    }
  ],
  "nextCursor": null
}
```

## Create a confirmed booking

`POST /bookings`

The booking is an occupied interval with no customer, players or price at the booking source. Padel Desk creates regular and lesson bookings only. The interval must be one slot of the court.

### Request body

| Field | Type | Description |
| --- | --- | --- |
| `reference` (required) | string ≤ 191 | Idempotency reference with no meaning to the booking source. |
| `courtId` (required) | string | Court. |
| `start` (required) | date-time | Start time. |
| `end` (required) | date-time | End time. |
| `type` | REGULAR \| LESSON | Type; default REGULAR. |
| `note` | string ≤ 500 \| null | Sent only when the venue has opted in to sharing notes. |

### Responses

- **201** Booking, or the existing booking for an identical retry
- **409** interval_taken or reference_reused
- **422** The interval is not a slot of the court

### Request example

```json
{
  "reference": "pd_7Q2mX4",
  "courtId": "crt_1",
  "start": "2026-10-13T18:00:00.000Z",
  "end": "2026-10-13T19:30:00.000Z",
  "type": "REGULAR"
}
```

### Response example

```json
{
  "id": "bkg_9a10",
  "courtId": "crt_1",
  "start": "2026-10-13T18:00:00.000Z",
  "end": "2026-10-13T19:30:00.000Z",
  "status": "CONFIRMED",
  "type": "REGULAR",
  "origin": "PADEL_DESK",
  "reference": "pd_7Q2mX4",
  "note": null,
  "customer": null,
  "players": [],
  "price": null,
  "payment": null,
  "cancelledAt": null,
  "cancelledBy": null,
  "createdAt": "2026-10-12T09:14:03.120Z",
  "updatedAt": "2026-10-12T09:14:03.120Z"
}
```

## Read one booking

`GET /bookings/{bookingId}`

Returns one booking of the venue.

### Responses

- **200** Booking
- **404** Unknown id

## Move or extend any booking of the venue

`PATCH /bookings/{bookingId}`

The booking keeps its id. Omitted fields are unchanged. The booking's own current interval does not conflict with its new one. A conflict returns 409 and changes nothing. The new interval must be one slot of the booking's court after the change; any other returns 422. For a booking made by a player, the booking source applies its own price and refund rules and tells the players.

### Request body

| Field | Type | Description |
| --- | --- | --- |
| `courtId` | string | New court. |
| `start` | date-time | New start time. |
| `end` | date-time | New end time. |

### Responses

- **200** Updated booking
- **404** Unknown id
- **409** interval_taken or conflict
- **422** The interval is not a slot of the court

### Request example

```json
{
  "start": "2026-10-13T19:30:00.000Z",
  "end": "2026-10-13T21:00:00.000Z"
}
```

## Cancel any booking of the venue

`POST /bookings/{bookingId}/cancel`

The venue may also cancel a booking made by a player, for example when rain closes the court. The booking source applies its own refund rules and tells the players. The booking's `cancelledBy` becomes `PADEL_DESK`. Cancelling an already cancelled booking succeeds and changes nothing.

### Request body

| Field | Type | Description |
| --- | --- | --- |
| `reason` | string ≤ 200 \| null | Short reason from the venue. The booking source may show it to the players. |

### Responses

- **200** Cancelled booking
- **404** Unknown id

### Request example

```json
{
  "reason": "Court closed because of rain"
}
```

## List blocks

`GET /blocks`

Returns the maintenance and closures that overlap the range, whoever created them. Removed blocks are not listed.

### Query parameters

| Field | Type | Description |
| --- | --- | --- |
| `from` (required) | date-time | Start of the range. |
| `to` (required) | date-time | End of the range; this instant is not included. |
| `courtId` | string | Only this court. |
| `limit` | integer | 1 to 100; default 50. |
| `cursor` | string | The nextCursor value of the previous response. |

### Responses

- **200** Page of blocks

### Response example

```json
{
  "items": [
    {
      "id": "blk_52",
      "courtId": "crt_1",
      "start": "2026-10-14T06:00:00.000Z",
      "end": "2026-10-14T09:00:00.000Z",
      "reason": "Yağmur",
      "origin": "PADEL_DESK",
      "reference": "pd_blk_3Hd9",
      "removedAt": null,
      "updatedAt": "2026-10-13T18:02:11.004Z"
    }
  ],
  "nextCursor": null
}
```

## Close a court for an interval

`POST /blocks`

For rain, repair or a private closure. Any length; a block need not be a slot. It does not cancel existing bookings; an overlap with a booking returns 409.

### Request body

| Field | Type | Description |
| --- | --- | --- |
| `reference` (required) | string ≤ 191 | Idempotency reference. Blocks have their own references, separate from bookings. |
| `courtId` (required) | string | Court. |
| `start` (required) | date-time | Start time. |
| `end` (required) | date-time | End time. |
| `reason` | string ≤ 500 \| null | Reason. |

### Responses

- **201** Block, or the existing block for an identical retry
- **409** interval_taken or reference_reused
- **422** The court is unknown or inactive

### Request example

```json
{
  "reference": "pd_blk_3Hd9",
  "courtId": "crt_1",
  "start": "2026-10-14T06:00:00.000Z",
  "end": "2026-10-14T09:00:00.000Z",
  "reason": "Yağmur"
}
```

### Response example

```json
{
  "id": "blk_52",
  "courtId": "crt_1",
  "start": "2026-10-14T06:00:00.000Z",
  "end": "2026-10-14T09:00:00.000Z",
  "reason": "Yağmur",
  "origin": "PADEL_DESK",
  "reference": "pd_blk_3Hd9",
  "removedAt": null,
  "updatedAt": "2026-10-13T18:02:11.004Z"
}
```

## Remove any block of the venue

`DELETE /blocks/{blockId}`

Removing a removed block succeeds.

### Responses

- **204** Removed
- **404** Unknown id

## Set where events are sent

`PUT /webhook`

Replaces the venue's earlier URL and signing secret. From this call on, the booking source sends events to this URL and signs them with the new secret at once. Padel Desk sends no webhooks to the booking source.

### Request body

| Field | Type | Description |
| --- | --- | --- |
| `url` (required) | uri | HTTPS URL of Padel Desk for this venue. |
| `secret` (required) | string ≥ 32 | Signing secret created by Padel Desk. No endpoint returns it. |

### Responses

- **204** Stored

### Request example

```json
{
  "url": "https://padeldeskapp.com/hooks/bookings/ven_more",
  "secret": "f3b1… 32 characters or more"
}
```

## Stop sending events

`DELETE /webhook`

Called when the venue disconnects in Padel Desk.

### Responses

- **204** Removed

## Webhook: event delivery

`POST Padel Desk’s webhook URL`

The booking source sends an event for every booking and every block of the venue, including bookings made by players. It also sends `booking.updated` when players, price or payment change.

Event types: `booking.created`, `booking.updated`, `booking.cancelled`, `block.created`, `block.updated`, `block.removed`. `block.updated` is sent when venue staff change a block in the booking source's own tools.

### Signature

- `X-Event-Timestamp` — Send time. It is part of the signed content.
- `X-Event-Signature` — `v1=` followed by a hex HMAC-SHA256 value. The booking source computes it over the timestamp, a full stop and the raw body of the request.
- Padel Desk refuses a request with a wrong signature.
- Padel Desk refuses a request whose time differs from its clock by more than 5 minutes.

### Delivery

- Padel Desk stores the event. Then it answers with a 2xx response.
- When Padel Desk answers 429 or 5xx, the booking source sends the event again.
- The booking source keeps retrying for at least 24 hours.
- The booking source may send the same event more than once. The event id stays the same.
- Events may arrive out of order. Padel Desk uses the sequence to put them in the right order.

### Responses

- **2xx** Padel Desk stored the event

### Request example

```
X-Event-Timestamp: 2026-10-12T09:14:03.412Z
X-Event-Signature: v1=5f8a…

{
  "id": "evt_c41d",
  "sequence": 1042,
  "type": "booking.created",
  "createdAt": "2026-10-12T09:14:03.200Z",
  "data": {
    "id": "bkg_8f2c",
    "courtId": "crt_1",
    "start": "2026-10-13T16:30:00.000Z",
    "end": "2026-10-13T18:00:00.000Z",
    "status": "CONFIRMED",
    "type": "OPEN_MATCH",
    "origin": "PLAYER",
    "reference": null,
    "note": null,
    "customer": {
      "userId": "usr_41",
      "name": "Ada Yılmaz",
      "phone": "+905550000000",
      "email": "ada@example.com"
    },
    "players": [
      {
        "userId": "usr_41",
        "name": "Ada Yılmaz",
        "phone": "+905550000000",
        "email": "ada@example.com",
        "team": 1,
        "position": 1,
        "amountPaid": {
          "amountMinor": 45000,
          "currency": "TRY"
        }
      }
    ],
    "price": {
      "amountMinor": 180000,
      "currency": "TRY"
    },
    "payment": {
      "status": "PARTIALLY_PAID",
      "amountPaid": {
        "amountMinor": 45000,
        "currency": "TRY"
      },
      "amountRefunded": {
        "amountMinor": 0,
        "currency": "TRY"
      },
      "method": "CARD"
    },
    "cancelledAt": null,
    "cancelledBy": null,
    "createdAt": "2026-10-12T09:14:03.120Z",
    "updatedAt": "2026-10-12T09:14:03.120Z"
  }
}
```

## Read the event feed

`GET /events`

Returns every event of the venue in sequence order, delivered by webhook or not. The booking source keeps each event for at least 7 days. Padel Desk keeps its own place in this feed and reads it on a schedule and after downtime, so an event that no webhook delivered is still found. Sequences only need to increase; they need not be consecutive.

Every response carries `latestSequence`: the sequence of the venue's newest event, or 0 when there is none. When connecting, Padel Desk calls this with `after=0` to learn `latestSequence`; the answer is 200, or 410 when older events are already deleted, and both carry it. Padel Desk then reads bookings and blocks by range and follows the feed from that sequence.

410 `expired` is returned only when the booking source has deleted an event whose sequence is greater than `after`. Padel Desk then reads bookings and blocks by range again and continues from the `latestSequence` in that response.

### Query parameters

| Field | Type | Description |
| --- | --- | --- |
| `after` (required) | integer | Returns events whose sequence is greater than this. |
| `limit` | integer | 1 to 100; default 50. |

### Responses

- **200** Events in sequence order; an empty list when there are none
- **410** expired: a later event is no longer kept; the response carries latestSequence

### Response example

```json
{
  "items": [
    {
      "id": "evt_c41d",
      "sequence": 1042,
      "type": "booking.created",
      "createdAt": "2026-10-12T09:14:03.200Z",
      "data": {
        "id": "bkg_8f2c",
        "courtId": "crt_1",
        "start": "2026-10-13T16:30:00.000Z",
        "end": "2026-10-13T18:00:00.000Z",
        "status": "CONFIRMED",
        "type": "OPEN_MATCH",
        "origin": "PLAYER",
        "reference": null,
        "note": null,
        "customer": {
          "userId": "usr_41",
          "name": "Ada Yılmaz",
          "phone": "+905550000000",
          "email": "ada@example.com"
        },
        "players": [
          {
            "userId": "usr_41",
            "name": "Ada Yılmaz",
            "phone": "+905550000000",
            "email": "ada@example.com",
            "team": 1,
            "position": 1,
            "amountPaid": {
              "amountMinor": 45000,
              "currency": "TRY"
            }
          }
        ],
        "price": {
          "amountMinor": 180000,
          "currency": "TRY"
        },
        "payment": {
          "status": "PARTIALLY_PAID",
          "amountPaid": {
            "amountMinor": 45000,
            "currency": "TRY"
          },
          "amountRefunded": {
            "amountMinor": 0,
            "currency": "TRY"
          },
          "method": "CARD"
        },
        "cancelledAt": null,
        "cancelledBy": null,
        "createdAt": "2026-10-12T09:14:03.120Z",
        "updatedAt": "2026-10-12T09:14:03.120Z"
      }
    }
  ],
  "latestSequence": 1042
}
```

## Setup

The venue's setup document. Padel Desk sends it with `PUT /setup`; the booking source returns it as applied with `GET /setup`.

### Fields

| Field | Type | Description |
| --- | --- | --- |
| `version` (required) | integer | Increases with every change of the setup in Padel Desk. |
| `venue.name` (required) | string | Name of the venue. |
| `venue.timezone` (required) | string | IANA timezone. |
| `venue.currency` (required) | string | ISO 4217 currency. |
| `venue.address` (required) | object \| null | Address: line, city and the ISO country code country. |
| `venue.location` (required) | object \| null | Location: latitude and longitude. |
| `venue.phone` (required) | string \| null | Phone number in E.164 format. |
| `venue.logoUrl` (required) | uri \| null | HTTPS link to the venue’s logo. The booking source copies the image. |
| `venue.iconUrl` (required) | uri \| null | HTTPS link to a square icon. The booking source copies the image. |
| `openingHours` (required) | array[7] | One entry per weekday, Monday first, with open and close (local HH:mm); null on a closed day. A close at or before the open means the next day. |
| `courts[].reference` (required) | string ≤ 191 | Padel Desk’s id of the court. Stable. |
| `courts[].courtId` | string \| null | The booking source’s id of the court. Padel Desk sends it for a court the venue matched to an existing one; always present in responses. |
| `courts[].number` (required) | integer | Order of the court at the venue. |
| `courts[].name` (required) | string | Name of the court. |
| `courts[].environment` (required) | INDOOR \| OUTDOOR | Indoor or outdoor. |
| `courts[].format` (required) | DOUBLE \| SINGLE | Double or single. |
| `courts[].active` (required) | boolean | Whether the court can be booked. |
| `courts[].durations` (required) | integer[] | Booking lengths the court accepts, in minutes. |
| `courts[].startStep` (required) | integer | Minutes between valid start times, counted from opening. A booking ends at or before the close. |
| `prices[].courtReference` (required) | string | The reference of a court in this document. |
| `prices[].weekdays` (required) | integer[] | Weekdays; 1 is Monday. |
| `prices[].from` (required) | HH:mm | Venue-local time. The rule applies to bookings that start at or after this time. |
| `prices[].to` (required) | HH:mm | Venue-local time; not included. At or before from means the next day. |
| `prices[].duration` (required) | integer | Booking length in minutes. |
| `prices[].price` (required) | Money | Price. |

### Example

```json
{
  "version": 7,
  "venue": {
    "name": "More Padel",
    "timezone": "Europe/Istanbul",
    "currency": "TRY",
    "address": {
      "line": "Örnek Sokak 1",
      "city": "İstanbul",
      "country": "TR"
    },
    "location": {
      "latitude": 41.0082,
      "longitude": 28.9784
    },
    "phone": "+902120000000",
    "logoUrl": "https://padeldeskapp.com/venues/more-padel/logo.png",
    "iconUrl": "https://padeldeskapp.com/venues/more-padel/icon.png"
  },
  "openingHours": [
    {
      "open": "09:00",
      "close": "03:00"
    },
    {
      "open": "09:00",
      "close": "03:00"
    },
    {
      "open": "09:00",
      "close": "03:00"
    },
    {
      "open": "09:00",
      "close": "03:00"
    },
    {
      "open": "09:00",
      "close": "03:00"
    },
    {
      "open": "08:00",
      "close": "03:00"
    },
    null
  ],
  "courts": [
    {
      "reference": "pd_crt_1",
      "courtId": "crt_1",
      "number": 1,
      "name": "Kort 1",
      "environment": "OUTDOOR",
      "format": "DOUBLE",
      "active": true,
      "durations": [
        90
      ],
      "startStep": 90
    }
  ],
  "prices": [
    {
      "courtReference": "pd_crt_1",
      "weekdays": [
        1,
        2,
        3,
        4,
        5,
        6
      ],
      "from": "08:00",
      "to": "18:00",
      "duration": 90,
      "price": {
        "amountMinor": 120000,
        "currency": "TRY"
      }
    },
    {
      "courtReference": "pd_crt_1",
      "weekdays": [
        1,
        2,
        3,
        4,
        5,
        6
      ],
      "from": "18:00",
      "to": "03:00",
      "duration": 90,
      "price": {
        "amountMinor": 180000,
        "currency": "TRY"
      }
    }
  ]
}
```

## Court

A court at the booking source.

### Fields

| Field | Type | Description |
| --- | --- | --- |
| `id` (required) | string | The booking source’s id of the court. |
| `name` (required) | string | Name of the court. |
| `active` (required) | boolean | Whether the court can be booked. |
| `reference` (required) | string \| null | Padel Desk’s id of the court; null until a setup names it. |

### Example

```json
{
  "id": "crt_1",
  "name": "Kort 1",
  "active": true,
  "reference": "pd_crt_1"
}
```

## Booking

Padel Desk must receive every booking of the venue. This includes the bookings that players make at the booking source.

### Fields

| Field | Type | Description |
| --- | --- | --- |
| `id` (required) | string | Id of the booking. |
| `courtId` (required) | string | Court. |
| `start` (required) | date-time | Start time. |
| `end` (required) | date-time | End time. |
| `status` (required) | PENDING \| CONFIRMED \| CANCELLED | State. |
| `type` (required) | REGULAR \| OPEN_MATCH \| LESSON \| TOURNAMENT | Type. |
| `origin` (required) | PLAYER \| VENUE \| PADEL_DESK | Origin: a player, venue staff in the booking source’s own tools, or this API. |
| `reference` (required) | string \| null | Set only for bookings created through this API. |
| `note` (required) | string \| null | Note. |
| `customer` (required) | Person \| null | The customer the booking belongs to. For an open match, the player who opened it. Null for bookings created through this API. |
| `players` (required) | Person[] | Everyone on the booking, including the customer when they play. |
| `players[].team` (required) | integer \| null | Side in an open match: 1 or 2. |
| `players[].position` (required) | integer \| null | Place within the team: 1 or 2. |
| `players[].amountPaid` (required) | Money \| null | The amount this player paid. |
| `price` (required) | Money \| null | Total price of the court; null when there is no price. |
| `payment` (required) | object \| null | Money the booking source collected. |
| `payment.status` (required) | UNPAID \| PARTIALLY_PAID \| PAID \| REFUNDED | Payment state. |
| `payment.amountPaid` (required) | Money | Money collected and not returned. The venue collects the rest at the desk. |
| `payment.amountRefunded` (required) | Money | Money returned to the players. |
| `payment.method` (required) | string \| null | Payment method; for example CARD or WALLET. |
| `cancelledAt` (required) | date-time \| null | Time of the cancellation. |
| `cancelledBy` (required) | PLAYER \| VENUE \| PADEL_DESK \| BOOKING_SOURCE \| null | Who cancelled the booking. BOOKING_SOURCE: the booking source itself, for example after a payment that failed. |
| `createdAt` (required) | date-time | Time of creation. |
| `updatedAt` (required) | date-time | Changes whenever any field changes. |

### Example

```json
{
  "id": "bkg_8f2c",
  "courtId": "crt_1",
  "start": "2026-10-13T16:30:00.000Z",
  "end": "2026-10-13T18:00:00.000Z",
  "status": "CONFIRMED",
  "type": "OPEN_MATCH",
  "origin": "PLAYER",
  "reference": null,
  "note": null,
  "customer": {
    "userId": "usr_41",
    "name": "Ada Yılmaz",
    "phone": "+905550000000",
    "email": "ada@example.com"
  },
  "players": [
    {
      "userId": "usr_41",
      "name": "Ada Yılmaz",
      "phone": "+905550000000",
      "email": "ada@example.com",
      "team": 1,
      "position": 1,
      "amountPaid": {
        "amountMinor": 45000,
        "currency": "TRY"
      }
    }
  ],
  "price": {
    "amountMinor": 180000,
    "currency": "TRY"
  },
  "payment": {
    "status": "PARTIALLY_PAID",
    "amountPaid": {
      "amountMinor": 45000,
      "currency": "TRY"
    },
    "amountRefunded": {
      "amountMinor": 0,
      "currency": "TRY"
    },
    "method": "CARD"
  },
  "cancelledAt": null,
  "cancelledBy": null,
  "createdAt": "2026-10-12T09:14:03.120Z",
  "updatedAt": "2026-10-12T09:14:03.120Z"
}
```

## Person

### Fields

| Field | Type | Description |
| --- | --- | --- |
| `userId` (required) | string \| null | User id at the booking source; null for a guest. |
| `name` (required) | string \| null | Name. |
| `phone` (required) | string \| null | Phone number in E.164 format. |
| `email` (required) | string \| null | Email address. |

### Example

```json
{
  "userId": "usr_41",
  "name": "Ada Yılmaz",
  "phone": "+905550000000",
  "email": "ada@example.com"
}
```

## Money

### Fields

| Field | Type | Description |
| --- | --- | --- |
| `amountMinor` (required) | integer | Minor units; kuruş for TRY. |
| `currency` (required) | string | ISO 4217 currency. |

### Example

```json
{
  "amountMinor": 180000,
  "currency": "TRY"
}
```

## Block

### Fields

| Field | Type | Description |
| --- | --- | --- |
| `id` (required) | string | Id of the block. |
| `courtId` (required) | string | Court. |
| `start` (required) | date-time | Start time. |
| `end` (required) | date-time | End time. |
| `reason` (required) | string \| null | Reason. |
| `origin` (required) | VENUE \| PADEL_DESK | Origin: venue staff or Padel Desk. |
| `reference` (required) | string \| null | Set only for blocks created through this API. |
| `removedAt` (required) | date-time \| null | Null unless the block is removed. A removed block does not close the court. |
| `updatedAt` (required) | date-time | Time of the last change. |

### Example

```json
{
  "id": "blk_52",
  "courtId": "crt_1",
  "start": "2026-10-14T06:00:00.000Z",
  "end": "2026-10-14T09:00:00.000Z",
  "reason": "Yağmur",
  "origin": "PADEL_DESK",
  "reference": "pd_blk_3Hd9",
  "removedAt": null,
  "updatedAt": "2026-10-13T18:02:11.004Z"
}
```

## Event

### Fields

| Field | Type | Description |
| --- | --- | --- |
| `id` (required) | string | Unique per event. Repeated deliveries carry the same id. |
| `sequence` (required) | integer | Increases with every event of the venue. A later change always has a higher sequence. |
| `type` (required) | string | Type of the event. |
| `createdAt` (required) | date-time | Time of creation. |
| `data` (required) | Booking \| Block | The complete booking or block as it was when the event was created. |

### Example

```json
{
  "id": "evt_c41d",
  "sequence": 1042,
  "type": "booking.created",
  "createdAt": "2026-10-12T09:14:03.200Z",
  "data": "{ Booking }"
}
```

## Error

Every response that is not 2xx is an Error object.

### Fields

| Field | Type | Description |
| --- | --- | --- |
| `error` (required) | string | bad_request, unauthorized, forbidden, not_found, interval_taken, reference_reused, conflict, expired, unprocessable, rate_limited or unavailable. |
| `message` (required) | string | Human-readable explanation. |

### Example

```json
{
  "error": "reference_reused",
  "message": "Reference pd_7Q2mX4 belongs to another interval."
}
```
