# Bookings



Create a guest booking and read its current state with a booking capability.



## Ask the shop for a booking

`POST /v1/public/booking-requests`

A shop website sends a guest's booking request with its published host or site key; the shop and the guest get an email and nothing is booked. Works whether the shop books online or takes requests.

### Parameters

- `X-Outdoor-Grid-Site-Key` (string): Site key for a shop website server. Optional when the published shop host identifies the shop.

### Body parameters

- `bike_product_ids` (string · uuid[]): Rental products the guest liked; others are dropped
- `email` (string · email, required): 
- `first_day` (string · date, required): 
- `language` (string, required):  Values: `en`, `it`, `de`, `fr`.
- `last_day` (string · date, required): On or after first_day, at most 60 days after it
- `name` (string, required): 
- `note` (string): 
- `phone` (string): E.164, for example +41793106078
- `riders` (integer, required): 
- `tour` (object): 
  - `length` (string):  Values: `full`, `half`.
  - `private` (boolean): 
  - `product_id` (string · uuid): A tour product of the shop; another shop's or an unknown one is dropped
- `wants` (string[], required): At least one, each once
- `website` (string): Leave empty

### Returns

A JSON response with ref.

### Errors

- 404: booking_unavailable: no shop on this host; online_booking_closed: the shop takes nothing online
- 413: too_large: the body is over 16 KB
- 422: invalid_request (context.field)
- 429: too_many_requests: from this guest address (5 a minute, 20 an hour) for this email (5 an hour) or for the shop (60 an hour)

### Request

```bash
API_BASE="https://api.outdoorgrid.ai"
curl -X POST "$API_BASE/v1/public/booking-requests" \
  -H "X-Outdoor-Grid-Site-Key: $SITE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "email": "guest@example.com",
  "first_day": "2026-07-18",
  "language": "en",
  "last_day": "2026-07-18",
  "name": "Trail bike rental",
  "riders": 2,
  "wants": [
    "rent"
  ]
}'
```

```javascript
const url = "https://api.outdoorgrid.ai" +
  "/v1/public/booking-requests";
const response = await fetch(url, {
  method: "POST",
  headers: {
    "X-Outdoor-Grid-Site-Key": process.env.SITE_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "email": "guest@example.com",
    "first_day": "2026-07-18",
    "language": "en",
    "last_day": "2026-07-18",
    "name": "Trail bike rental",
    "riders": 2,
    "wants": [
      "rent"
    ]
  }),
});
const data = await response.json();
```

```python
import os
import requests

url = (
    "https://api.outdoorgrid.ai"
    "/v1/public/booking-requests"
)
response = requests.post(
    url,
    headers={
        "X-Outdoor-Grid-Site-Key": os.environ["SITE_KEY"],
        "Content-Type": "application/json",
    },
    json={
        "email": "guest@example.com",
        "first_day": "2026-07-18",
        "language": "en",
        "last_day": "2026-07-18",
        "name": "Trail bike rental",
        "riders": 2,
        "wants": [
            "rent",
        ],
    },
    timeout=10,
)
response.raise_for_status()
print(response.json())
```

### Response

```json
{
  "ref": "Trail bike rental"
}
```

## Get a booking view

`GET /v1/public/booking-view`

A confirmation page reads booking details with X-Booking-View; a missing or invalid view token returns 404.

### Parameters

- `X-Booking-View` (string): The view token from the confirmation link
- `X-Outdoor-Grid-Site-Key` (string): Site key for a shop website server. Optional when the published shop host identifies the shop.

### Body parameters

None.

### Returns

A JSON response with currency, days, first_day.

### Errors

- 404: The view token or booking was not found.
- 422: A field or parameter failed validation.

### Request

```bash
API_BASE="https://api.outdoorgrid.ai"
curl -X GET "$API_BASE/v1/public/booking-view" \
  -H "X-Booking-View: $BOOKING_VIEW"
```

```javascript
const url = "https://api.outdoorgrid.ai" +
  "/v1/public/booking-view";
const response = await fetch(url, {
  method: "GET",
  headers: {
    "X-Booking-View": process.env.BOOKING_VIEW,
  },
});
const data = await response.json();
```

```python
import os
import requests

url = (
    "https://api.outdoorgrid.ai"
    "/v1/public/booking-view"
)
response = requests.get(
    url,
    headers={
        "X-Booking-View": os.environ["BOOKING_VIEW"],
    },
    timeout=10,
)
response.raise_for_status()
print(response.json())
```

### Response

```json
{
  "currency": "EUR",
  "days": 2,
  "first_day": "2026-07-18",
  "lines": [
    {
      "label": {
        "de": "Trailbike Verleih",
        "en": "Trail bike rental",
        "fr": "Location de vélo trail",
        "it": "Bici da trail"
      },
      "quantity": 2,
      "size": "M",
      "total_minor": 4500
    }
  ],
  "locale": "en",
  "money": {
    "due_minor": 4500,
    "paid_minor": 0,
    "status": "not_paid",
    "total_minor": 4500
  },
  "pickup_at": "2026-07-18T09:00:00Z",
  "reference": "OG-7K2P9",
  "return_by_at": "2026-07-18T09:00:00Z",
  "riders": [
    {
      "height_cm": 2,
      "level": "Trail bike rental",
      "line": 2,
      "name": "Trail bike rental",
      "weight_kg": 2
    }
  ],
  "shop": {
    "address": "Trail bike rental",
    "cancellation_text": {
      "de": "Trailbike Verleih",
      "en": "Trail bike rental",
      "fr": "Location de vélo trail",
      "it": "Bici da trail"
    },
    "email": "guest@example.com",
    "name": "Trail bike rental",
    "phone": "+CC 000 000 0000"
  },
  "stage": "booked"
}
```

## Create a booking

`POST /v1/public/bookings`

A guest books rentals or tour seats with Authorization: Booking and a published shop host; unavailable lines return 409 and unfinished shapes return 501.

### Parameters

- `Authorization` (string, required): Guest booking capability in the Booking authorization scheme.
- `X-Outdoor-Grid-Site-Key` (string): Site key for a shop website server. Optional when the published shop host identifies the shop.

### Body parameters

- `answers` (object[]): Questions the shop asks once per booking for rented products, based on their categories.
  - `item_type_id` (string · uuid, required): 
  - `key` (string, required): height_cm, weight_kg, shoe_eu, level or the shop's own key
  - `value` (any, required): 
- `days` (integer): Number of whole rental days; optional when each line supplies its own dates.
- `first_day` (string · date): First local rental day.
- `guest` (object, required): Contact details for the person making the booking.
  - `email` (string · email, required): Guest or shop email address.
  - `first_name` (string): Guest's given name when the request uses split name fields.
  - `last_name` (string): Guest's family name when the request uses split name fields.
  - `locale` (string, required): Language for this guest's booking and messages: en, it, de or fr. Values: `en`, `it`, `de`, `fr`.
  - `name` (string): Name shown to guests.
  - `phone` (string): Guest or shop telephone number.
- `idempotency_key` (string · uuid, required): Unique UUID for a safe retry of this request.
- `lines` (object[], required): Items in the booking.
  - `asked` (boolean): True to ask the shop for a rental instead of reserving it immediately.
  - `bikes` (object): For each rider on a tour line, own means their bike or line:<key> names a rental line.
  - `days` (object[]): This line's dates and parts of day; omit to use the booking's whole date range.
    - `date` (string · date, required): Local calendar date.
    - `period` (string, required): Part of the day covered by this item. Values: `full`, `morning`, `afternoon`.
  - `departure_id` (string · uuid): Departure ID from the tour departures read for a tour seat.
  - `fit_at_shop` (boolean): True when a kit size will be chosen at the shop instead of by option ID.
  - `group` (string): Tour request type: new_group or private. Values: `new_group`, `private`.
  - `key` (string): Client-assigned line key, stable across edits to the booking.
  - `kind` (string): Line to book: rental, extra, tour_seat, kit, guide_pick or tour_request. Values: `rental`, `extra`, `tour_seat`, `kit`, `guide_pick`, `tour_request`.
  - `kit_item_id` (string · uuid): Identifier of the kit item shown in availability.
  - `note` (string): Optional note for a guide choice or tour request.
  - `option_id` (string · uuid): Public rental option identifier.
  - `or_options` (string · uuid[]): Other rental option IDs the guest would accept if the first is unavailable.
  - `parent_line_key` (string): Key of the rental or tour line this extra or kit item belongs with.
  - `parent_line_no` (integer): One-based number of the rental or tour line this extra follows.
  - `period` (object): Part of the day covered by this item.
    - `ends` (string): Local end time.
    - `kind` (string, required): Rental period: morning, afternoon or custom hours. Values: `morning`, `afternoon`, `custom`.
    - `starts` (string): Local start time.
  - `product_id` (string · uuid): Public product identifier.
  - `quantity` (integer, required): Number of units requested.
  - `riders` (string[]): Person keys assigned to this line; each appears once and the count matches quantity.
- `mode` (string): Choose book to reserve now or request to ask the shop to confirm. Values: `book`, `request`.
- `origin` (object): Where the booking came from: the store product the guest pressed Rent this on. Kept on a new booking of the same shop only; an unknown id books the same and keeps nothing; a replay changes nothing
  - `id` (string · uuid, required): The store product's id
  - `kind` (string, required): 
- `payment_choice` (string): How the guest pays: deposit, full or at_shop. Values: `deposit`, `full`, `at_shop`.
- `promo_code` (string): Guest's promotion code, three to 32 letters, digits, underscores or hyphens; surrounding spaces are removed.
- `riders` (object[]): People taking part in the booked lines.
  - `answers` (object[]): Questions the shop asks about this rider for the category of their booked line.
    - `item_type_id` (string · uuid, required): 
    - `key` (string, required): height_cm, weight_kg, shoe_eu, level or the shop's own key
    - `value` (any, required): 
  - `details` (object): Equipment choices and measurements supplied by the rider.
    - `brakes` (string): The lever that works the front brake Values: `front_left`, `front_right`.
    - `first_visit` (boolean): First time riding with this shop
    - `own_bike` (boolean): The rider brings their own bike
    - `pedals` (string): Pedal choice: flat, clipless or own_pedals; null when not supplied. Values: `flat`, `clipless`, `own_pedals`.
    - `wheel_size` (string): Of the bike the rider brings Values: `20`, `24`, `26`, `27.5`, `29`, `mixed`.
  - `first_time` (boolean): Whether this is the rider's first time riding at this shop's place.
  - `head_cm` (integer): Rider's head circumference in centimetres for a helmet.
  - `height_cm` (integer): Rider height in centimetres, used to choose a suitable size.
  - `key` (string): Client-assigned key that identifies this rider within the booking request.
  - `kit_own` (string · uuid[]): Identifiers of kit items the rider is bringing rather than renting.
  - `level` (string): Rider's skill level as supplied by the guest.
  - `line` (integer): One-based number of the booking line this rider joins.
  - `name` (string): Name shown to guests.
  - `note` (string): Optional note about this rider for the shop.
  - `own_bike` (object): Kind and make of the bike the rider is bringing.
    - `kind` (any, required): One of the shop's kinds of ride (booking.kinds), or other
    - `make` (string): Brand of the bike the rider brings; null when not supplied.
  - `shoe_eu` (any): Rider's European shoe size in half-size steps.
  - `stance` (string): Snowboard lines only: regular, goofy or unsure (dropped on other lines) Values: `regular`, `goofy`, `unsure`.
  - `weight_kg` (integer): Rider weight in kilograms when needed to prepare equipment.

### Returns

A JSON response with asked, at_shop_minor, currency.

### Errors

- 404: The booking page or Booking capability is unavailable.
- 409: Some lines are no longer free (lines_unavailable), the shop's prices or rules refuse a line (quote_refused), a business cannot take online payments yet (payment_account_missing), the promo code does not apply (promo_refused), or a coded conflict: departure_full, departure_closed, payment_choice_unavailable, promo_used_up
- 422: A field or parameter failed validation.
- 429: too_many_codes: too many promo codes were refused from this client or shop
- 501: not_built: this booking shape is not available yet

### Request

```bash
API_BASE="https://api.outdoorgrid.ai"
curl -X POST "$API_BASE/v1/public/bookings" \
  -H "Authorization: Booking $BOOKING_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "idempotency_key":
    "7a6f9780-7d6f-4c6f-8f6f-7e6f9dcc816f",
  "first_day": "2027-07-18",
  "days": 1,
  "lines": [
    {
      "kind": "rental",
      "option_id":
        "98ef4278-9bef-4aef-8def-9cef48c49fef",
      "quantity": 1
    }
  ],
  "guest": {
    "name": "Alex Rivera",
    "email": "alex@example.com",
    "locale": "en"
  }
}'
```

```javascript
const credential = process.env.BOOKING_TOKEN;

const url = "https://api.outdoorgrid.ai" +
  "/v1/public/bookings";
const response = await fetch(url, {
  method: "POST",
  headers: {
    "Authorization": `Booking ${credential}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "idempotency_key":
      "7a6f9780-7d6f-4c6f-8f6f-7e6f9dcc816f",
    "first_day": "2027-07-18",
    "days": 1,
    "lines": [
      {
        "kind": "rental",
        "option_id":
          "98ef4278-9bef-4aef-8def-9cef48c49fef",
        "quantity": 1
      }
    ],
    "guest": {
      "name": "Alex Rivera",
      "email": "alex@example.com",
      "locale": "en"
    }
  }),
});
const data = await response.json();
```

```python
import os
import requests

credential = os.environ["BOOKING_TOKEN"]
authorization = f"Booking {credential}"

url = (
    "https://api.outdoorgrid.ai"
    "/v1/public/bookings"
)
response = requests.post(
    url,
    headers={
        "Authorization": authorization,
        "Content-Type": "application/json",
    },
    json={
        "idempotency_key": (
            "7a6f9780-7d6f-4c6f-8f6f"
            "-7e6f9dcc816f"
        ),
        "first_day": "2027-07-18",
        "days": 1,
        "lines": [
            {
                "kind": "rental",
                "option_id": (
                    "98ef4278-9bef-4aef-8def"
                    "-9cef48c49fef"
                ),
                "quantity": 1,
            },
        ],
        "guest": {
            "name": "Alex Rivera",
            "email": "alex@example.com",
            "locale": "en",
        },
    },
    timeout=10,
)
response.raise_for_status()
print(response.json())
```

### Response

```json
{
  "at_shop_minor": 4500,
  "currency": "EUR",
  "days": 1,
  "deposit_minor": 0,
  "first_day": "2027-07-18",
  "hold_expires_at": null,
  "next": "done",
  "paid_minor": 0,
  "reference": "OG-7K2P9",
  "stage": "booked",
  "total_minor": 4500
}
```

## Get the current booking

`GET /v1/public/bookings/current`

A guest reads the current booking with Authorization: Booking; a missing or invalid booking returns 404.

### Parameters

- `Authorization` (string, required): Guest booking capability in the Booking authorization scheme.
- `X-Outdoor-Grid-Site-Key` (string): Site key for a shop website server. Optional when the published shop host identifies the shop.

### Body parameters

None.

### Returns

A JSON response with asked, at_shop_minor, currency.

### Errors

- 404: The Booking capability or current booking was not found.
- 422: A field or parameter failed validation.

### Request

```bash
API_BASE="https://api.outdoorgrid.ai"
curl -X GET "$API_BASE/v1/public/bookings/current" \
  -H "Authorization: Booking $BOOKING_TOKEN"
```

```javascript
const credential = process.env.BOOKING_TOKEN;

const url = "https://api.outdoorgrid.ai" +
  "/v1/public/bookings/current";
const response = await fetch(url, {
  method: "GET",
  headers: {
    "Authorization": `Booking ${credential}`,
  },
});
const data = await response.json();
```

```python
import os
import requests

credential = os.environ["BOOKING_TOKEN"]
authorization = f"Booking {credential}"

url = (
    "https://api.outdoorgrid.ai"
    "/v1/public/bookings/current"
)
response = requests.get(
    url,
    headers={
        "Authorization": authorization,
    },
    timeout=10,
)
response.raise_for_status()
print(response.json())
```

### Response

```json
{
  "at_shop_minor": 4500,
  "currency": "EUR",
  "days": 2,
  "deposit_minor": 0,
  "first_day": "2026-07-18",
  "hold_expires_at": null,
  "next": "done",
  "paid_minor": 0,
  "reference": "OG-7K2P9",
  "stage": "booked",
  "total_minor": 4500
}
```

## The Booking object



- `asked` (object[]): Lines the guest has asked the shop to supply and each line's current state. They are not charged until assigned.
  - `answer_by` (string · date-time, required): The shop answers by then (the running short settings)
  - `days` (object[], required): Dates and parts of day requested by the guest.
    - `date` (string · date, required): Local calendar date.
    - `period` (string, required): Part of the day covered by this item. Values: `full`, `morning`, `afternoon`.
  - `difference_minor` (integer): offered: what the guest pays more (0: the same)
  - `key` (string, required): Client key of the line the guest asked the shop to supply.
  - `label` (object, required): Guest-visible name of the requested item.
    - `de` (string, required): 
    - `en` (string, required): 
    - `fr` (string, required): 
    - `it` (string, required): 
  - `line` (integer, required): The 1-based line of the request
  - `riders` (string[], required): Person keys
  - `sizes` (string[], required): The size asked first, then the other sizes that would do
  - `status` (string, required): State of the request: asked, offered, assigned, declined, expired or withdrawn. Values: `asked`, `offered`, `assigned`, `declined`, `expired`, `withdrawn`.
- `at_shop_minor` (integer, required): Amount due at the shop, in minor currency units.
- `currency` (string, required): ISO currency code for all money amounts in this answer.
- `days` (integer, required): Number of days covered by the booking.
- `deposit_minor` (integer, required): What is paid online: the deposit, or the total for full; 0 at the shop or for a request
- `first_day` (string · date, required): First local rental day.
- `hold_expires_at` (string · date-time, required): Null once confirmed
- `next` (string, required): Next action: done, pay_deposit, pay_full or requested. Values: `done`, `pay_deposit`, `pay_full`, `requested`.
- `paid_minor` (integer, required): Amount already paid, in minor currency units.
- `payment_choice` (string): Null for a request Values: `deposit`, `full`, `at_shop`.
- `promo` (object): Promotion code applied to the booking, when available.
  - `capped` (boolean, required): The shop's most discount per booking limited the basket
  - `code` (string, required): Promotion code that reduced the booking total.
  - `discount_minor` (integer, required): What the code took off the total, VAT included
- `reference` (string, required): Guest-facing booking reference.
- `stage` (string, required): Current booking stage. Values: `request`, `lapsed`, `waiting_payment`, `not_finished`, `needs_you`, `booked`, `not_collected`, `out`, `late`, `back`, `cancelled`.
- `total_minor` (integer, required): Total price in minor currency units.
- `view_token` (string): Confirmation view token, returned when a booking is confirmed immediately for payment at the shop.



```json

{
  "at_shop_minor": 4500,
  "currency": "EUR",
  "days": 2,
  "deposit_minor": 0,
  "first_day": "2026-07-18",
  "hold_expires_at": null,
  "next": "done",
  "paid_minor": 0,
  "reference": "OG-7K2P9",
  "stage": "booked",
  "total_minor": 4500
}

```